- Joined
- Apr 9, 2009
- Posts
- 540
I've been messing around writing some code the cps1, but getting some weird behavior related to asking the cpsa/b chips to copy the palette data from gfxram to the real palette chips. From what I've read/seen this should get triggered by writing to the your palette address to $80010a. Doing this works in mame, but on real hardware there seems to be some additional condition that is needed for it to happen.
After setting up the necessary registers and print some text on screen (bad colors). I have a simple while loop such that
if player 1 A button is pressed, it will write the palette address to $80010a
if player 1 B button is pressed, it will enable interrupts. The interrupt handler for vblank will write to the palette address to $80010a, then interrupts are disabled.
If I hit A button a bunch of times it will eventually trigger the palette copy and fix the colors of the on screen text
If I hit B button it instantly does the palette copy
It almost seems like the copy request is ignored unless its done while a vblank is happening? Curious if anyone has run into this before and/or knows how to trigger a the copy without using the interrupt handler method.
After setting up the necessary registers and print some text on screen (bad colors). I have a simple while loop such that
if player 1 A button is pressed, it will write the palette address to $80010a
if player 1 B button is pressed, it will enable interrupts. The interrupt handler for vblank will write to the palette address to $80010a, then interrupts are disabled.
If I hit A button a bunch of times it will eventually trigger the palette copy and fix the colors of the on screen text
If I hit B button it instantly does the palette copy
It almost seems like the copy request is ignored unless its done while a vblank is happening? Curious if anyone has run into this before and/or knows how to trigger a the copy without using the interrupt handler method.