Controlling the marquee: Difference between revisions
Jump to navigation
Jump to search
(Created page with "You should let the system ROM be in charge of controlling the marquee. But if you want to try things, here's how it goes: See the bit definitions of the {{Reg|REG_LED...") |
m (Forgot RTS in subroutine) |
||
(One intermediate revision by the same user not shown) | |||
Line 5: | Line 5: | ||
The system ROM uses ~35us delays done with fall-through calls to NOPs. | The system ROM uses ~35us delays done with fall-through calls to NOPs. | ||
< | <syntaxhighlight> | ||
move.b #$FF, REG_LEDLATCHES ; Set clock high | move.b #$FF, REG_LEDLATCHES ; Set clock high | ||
jsr wait | jsr wait | ||
Line 15: | Line 15: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
< | <syntaxhighlight> | ||
wait: | wait: | ||
movem.l d0-d7/a0-a5,-(a7) ; 120 cycles | movem.l d0-d7/a0-a5,-(a7) ; 120 cycles | ||
Line 21: | Line 21: | ||
movem.l d0-d7/a0-a5,-(a7) ; 120 cycles | movem.l d0-d7/a0-a5,-(a7) ; 120 cycles | ||
movem.l (a7)+,d0-d7/a0-a5 ; 124 cycles, total = 488 cycles = 40.7us | movem.l (a7)+,d0-d7/a0-a5 ; 124 cycles, total = 488 cycles = 40.7us | ||
rts | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Code]] | [[Category:Code]] |
Latest revision as of 06:11, 14 November 2017
You should let the system ROM be in charge of controlling the marquee. 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.
move.b #$FF, REG_LEDLATCHES ; Set clock high
jsr wait
not.b d0 ; The panel # is sent inverted
move.b d0, REG_LEDDATA ; Set panel #
move.b #$F7, REG_LEDLATCHES ; Set clock low (latch panel #)
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