HomeForumsWhat's newResources 
 
 
Two-way cache in yabause
mic - Jun 16, 2009
 mic Jun 16, 2009
I was using 0.9.7 when testing this, so you can ignore my comment if the problem has already been fixed..

What I was trying to do was this:

Set up a two-way cache by writing 0x19 to the cache control register (0xFFFFFE92).

Copy some code/data to the explicitly cached region at 0xC0000000-0xC00007FF.

Run some code from that region.

When I ran my program in yabause it didn't work. I looked in the debugger and saw that the main SH2 was stuck on the stack somewhere (PC had some weird value like 0x06000952). But I thought my code was correct so I decided to try it out on my Saturn. Sure enough; it works just fine.

So it seems like yabause has a problem with executing explicitly cached code.

JSYK..

 mic Jun 17, 2009
Here's a small test that demonstrates this problem: http://jiggawatt.org/satcache.zip...

Upload the binary to 0x06004000. The result should be a green screen (and it is on a real Saturn). In yabause I get a red screen which indicates that the code in cache wasn't executed properly.

 Guillaume Jun 29, 2009
I've just spent some time this evening to get it working.

The problem is Yabause only allow execution of code in some specific areas of the memory and that wasn't one of them

Anyways, I commited a fix for it. You can download the latest SVN and compile with

"./configure --enable-exec-from-cache && make"

to test it. The fix is not enabled by default, as I'm still not sure of the best way to handle it.

 Chilly Willy Jun 29, 2009
Do you only support 2K+2K mode? You can actually use all 4K of the cache when the cache is off. I don't know that anyone actually does that, but it would be best if you supported it.

 Runik Jun 30, 2009

Chilly Willy said:
Do you only support 2K+2K mode? You can actually use all 4K of the cache when the cache is off. I don't know that anyone actually does that, but it would be best if you supported it.


I had to add the 4K of RAM in Saturnin to have the sprites in 3 Dirty Dwarves displayed, and after testing the game on Yabause, it has the feature too

 Chilly Willy Jun 30, 2009

Runik said:
I had to add the 4K of RAM in Saturnin to have the sprites in 3 Dirty Dwarves displayed, and after testing the game on Yabause, it has the feature too


So someone DOES use that mode... cool. Thanks for the info.