From 1a74e6a1856673072a61abd0861759901bc2d939 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 10 Mar 2025 22:52:15 +0100 Subject: Bring code style to better standards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Be more careful on everything and try to follow along style.nes from my repository. This might change in the future, but it's in a much better state now. Signed-off-by: Miquel Sabaté Solà --- basics/unrom.s | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'basics/unrom.s') diff --git a/basics/unrom.s b/basics/unrom.s index b6deb4d..eb49b17 100644 --- a/basics/unrom.s +++ b/basics/unrom.s @@ -101,32 +101,37 @@ banktable: ;; Variable containing the bank we are currently in. It's useful to keep track ;; of the bank so the NMI handler can restore it if it does some bank switching ;; of its own. -m_current_bank = $00 +zp_current_bank = $00 ;; Perform a bankswitch by using the value on the `y` register. Note that you ;; can use the `bankswitch_nosave` variant, which is useful if you just want to ;; perform a temporary bankswitch (e.g. on NMI code). bankswitch: - sty m_current_bank + sty zp_current_bank bankswitch_nosave: tya sta banktable, y rts ;; Unused -nmi: -irq: +.proc nmi rti +.endproc + +;; Unused +.proc irq + rti +.endproc ;; Check `basics/sprite.s` for a deeper look on the logic below. I have only ;; added code after configuration/reset is done. -reset: +.proc reset sei cld ldx #$40 stx $4017 - ldx #$ff + ldx #$FF txs inx @@ -178,3 +183,4 @@ reset: ;; Loop forever, there's nothing to be done here. @loop: jmp @loop +.endproc -- cgit v1.2.3