https://wiki.neogeodev.org/index.php?title=Controlling_the_credits_display&feed=atom&action=historyControlling the credits display - Revision history2024-03-28T10:06:51ZRevision history for this page on the wikiMediaWiki 1.40.0https://wiki.neogeodev.org/index.php?title=Controlling_the_credits_display&diff=5871&oldid=prevFurrtek: Created page with "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 t..."2017-11-14T06:10:43Z<p>Created page with "To display the credits on-screen, see <a href="/index.php?title=Displaying_credits" title="Displaying credits">displaying credits</a>. You should let the <a href="/index.php?title=System_ROM" title="System ROM">system ROM</a> be in charge of controlling the <a href="/index.php?title=MV-LED" title="MV-LED">credits displays</a>. But if you want t..."</p>
<p><b>New page</b></p><div>To display the credits on-screen, see [[displaying credits]].<br />
<br />
You should let the [[system ROM]] be in charge of controlling the [[MV-LED|credits displays]]. But if you want to try things, here's how it goes:<br />
<br />
See the bit definitions of the {{Reg|REG_LEDDATA}} and {{Reg|REG_LEDLATCHES}} registers for more details.<br />
<br />
The system ROM uses ~35us delays done with fall-through calls to NOPs.<br />
<br />
Credits for P1 are in D0, for P2 in D1.<br />
<br />
<syntaxhighlight><br />
move.b #$FF, REG_LEDLATCHES ; Set clock high<br />
jsr wait<br />
not.b d0 ; The digits are sent inverted<br />
move.b d0, REG_LEDDATA ; Set digits<br />
move.b #$EF, REG_LEDLATCHES ; Set clock low (latch P1 digits)<br />
jsr wait<br />
move.b #$FF, REG_LEDLATCHES ; Set clock back high<br />
jsr wait<br />
not.b d1 ; The digits are sent inverted<br />
move.b d1, REG_LEDDATA ; Set digits<br />
move.b #$DF, REG_LEDLATCHES ; Set clock low (latch P2 digits)<br />
jsr wait<br />
move.b #$FF, REG_LEDLATCHES ; Set clock back high<br />
<br />
</syntaxhighlight><br />
<br />
<syntaxhighlight><br />
wait:<br />
movem.l d0-d7/a0-a5,-(a7) ; 120 cycles<br />
movem.l (a7)+,d0-d7/a0-a5 ; 124 cycles<br />
movem.l d0-d7/a0-a5,-(a7) ; 120 cycles<br />
movem.l (a7)+,d0-d7/a0-a5 ; 124 cycles, total = 488 cycles = 40.7us<br />
rts<br />
</syntaxhighlight><br />
<br />
[[Category:Code]]</div>Furrtek