Controlling the credits display

From NeoGeo Development Wiki
Jump to navigation Jump to search

To display the credits on-screen, see displaying credits.

You should let the system ROM be in charge of controlling the credits displays. But if you want to try things, here's how it goes:

See the bit definitions of the REG_LEDDATA and REG_LEDLATCHES registers for more details.

The system ROM uses ~35us delays done with fall-through calls to NOPs.

Credits for P1 are in D0, for P2 in D1.

move.b #$FF, REG_LEDLATCHES  ; Set clock high
jsr    wait
not.b  d0                    ; The digits are sent inverted
move.b d0, REG_LEDDATA       ; Set digits
move.b #$EF, REG_LEDLATCHES  ; Set clock low (latch P1 digits)
jsr    wait
move.b #$FF, REG_LEDLATCHES  ; Set clock back high
jsr    wait
not.b  d1                    ; The digits are sent inverted
move.b d1, REG_LEDDATA       ; Set digits
move.b #$DF, REG_LEDLATCHES  ; Set clock low (latch P2 digits)
jsr    wait
move.b #$FF, REG_LEDLATCHES  ; Set clock back high
wait:
movem.l d0-d7/a0-a5,-(a7)    ; 120 cycles
movem.l (a7)+,d0-d7/a0-a5    ; 124 cycles
movem.l d0-d7/a0-a5,-(a7)    ; 120 cycles
movem.l (a7)+,d0-d7/a0-a5    ; 124 cycles, total = 488 cycles = 40.7us
rts