Palette changing only every two lines
Posted: Sun Mar 23, 2014 2:12 am
While trying to use the horizontal interrupts to change a palette every line, the palette actually changes every two lines. The same happens with different codes I have tried. What may be wrong?
Here is one of those codes:
Here is one of those codes:
Code: Select all
HBL:
add.w #1,cur_scanline
tst.b color_change_enabled
jeq endHBL
moveq #0, %d0
moveq #0, %d1
move.w cur_scanline,%d0
and.w #1,%d0
tst.w %d0
jeq otherColor
move.w #0x888,%d0
move.w #0x0C0,%d1
jmp afterColor
otherColor:
move.w #0xFFF,%d0
move.w #0x0E0,%d1
afterColor:
move.l #0xC0020000,0xC00004
move.w %d0,0xC00000
move.l #0xC00A0000,0xC00004
move.w %d1,0xC00000
endHBL:
rte