
Does the GB do a lot of line oriented effects? It might be worth it to make an option for syncing once a frame as opposed to every line for games that don't need per line synchronization.
Moderator: Mask of Destiny
Code: Select all
loop:
fetch byte
get vector
jsr
cmp/pz r13
bf do_event
cmp/pz r12
bf loop
I just tried that and it wasn't pretty. Anything that moves looks like it's been run through a noise filter. One problem might be that the slave gets the scanline number from the main SH2, so if it the main keeps adding draw-commands without waiting for the slave to be ready some scanlines might be skipped. I could try it with the slave keeping track of the scanline number internally later..and the sync each vblank
Well, I did that. And then I split the command longword into two words so that the main SH2 can add a new command while the slave SH2 is executing another one (actually it can add two, because I also changed the command passing a bit). But already with amount of out of sync-ness it started getting a bit unstable (it looks bad in games that change the horizontal scrolling during HBLANK to get different amounts of scrolling for different parts of the screen).I could try it with the slave keeping track of the scanline number internally later..
What we did for the Atari emu was make an array for parameters that could be changed on a line basis. The "default" value would be set at the start of each line, and the CPU could override it by setting it directly. Then when the screen was drawn (once at the end of an entire frame), the drawing routine would simply pull the value from the array. It was a huge time-saver while still allowing on-the-fly effects.mic_ wrote:Well, I did that. And then I split the command longword into two words so that the main SH2 can add a new command while the slave SH2 is executing another one (actually it can add two, because I also changed the command passing a bit). But already with amount of out of sync-ness it started getting a bit unstable (it looks bad in games that change the horizontal scrolling during HBLANK to get different amounts of scrolling for different parts of the screen).I could try it with the slave keeping track of the scanline number internally later..
The slave doesn't use cache-through when reading from the GB VRAM, so I'm making sure that before it starts drawing a scanline it'll get the most current VRAM data. Of course, I probably don't need to purge all lines, but I haven't looked into which ones would be needed.I noticed you are doing some sort of cache purge every scanline. Is this really needed? That's probably going to be slow.
The palette could've changed since the previous scanline, so yes. And I hardly think this has much of an impact, since it's just setting up a 12-byte array that I've explicitly put in cache.Also, you're doing something with the palette every scanline too. Again, is this needed?