From ee540678e6cc99aecf05912fec7c7ec21e66d27e Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Thu, 13 Mar 2025 22:03:37 +0100
Subject: [PATCH] Improved consistency of notation for return value promotion.
---
libsrc/apple2/curdevice.s | 2 +-
libsrc/apple2/diocommon.s | 2 +-
libsrc/apple2/get_iigs_speed.s | 2 +-
libsrc/apple2/getdevice.s | 2 +-
libsrc/apple2/joy/a2.stdjoy.s | 4 ++--
libsrc/apple2/mou/a2.stdmou.s | 2 +-
libsrc/apple2/open.s | 2 +-
libsrc/apple2/oserror.s | 2 +-
libsrc/apple2/revers.s | 2 +-
libsrc/apple2/ser/a2.gs.s | 14 +++++++-------
libsrc/apple2/ser/a2.ssc.s | 8 ++++----
libsrc/apple2/set_iigs_speed.s | 2 +-
libsrc/apple2/stat.s | 2 +-
libsrc/apple2/tgi/a2.hi.s | 2 +-
libsrc/apple2/tgi/a2.lo.s | 2 +-
libsrc/apple2/wherey.s | 2 +-
16 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/libsrc/apple2/curdevice.s b/libsrc/apple2/curdevice.s
index 9781b8ad0..a450c605f 100644
--- a/libsrc/apple2/curdevice.s
+++ b/libsrc/apple2/curdevice.s
@@ -23,5 +23,5 @@ _getcurrentdevice:
bne :+
lda #$FF ; INVALID_DEVICE
-: ldx #$00
+: ldx #>$0000
rts
diff --git a/libsrc/apple2/diocommon.s b/libsrc/apple2/diocommon.s
index b18f0e6ef..6870ebb51 100644
--- a/libsrc/apple2/diocommon.s
+++ b/libsrc/apple2/diocommon.s
@@ -31,5 +31,5 @@ diocommon:
dioepilog:
; Return success or error
sta ___oserror
- ldx #$00
+ ldx #>$0000
rts
diff --git a/libsrc/apple2/get_iigs_speed.s b/libsrc/apple2/get_iigs_speed.s
index 1915d7773..b960516fa 100644
--- a/libsrc/apple2/get_iigs_speed.s
+++ b/libsrc/apple2/get_iigs_speed.s
@@ -16,7 +16,7 @@ _get_iigs_speed:
lda CYAREG ; Check current setting
bpl :+
lda #SPEED_FAST
- ldx #$00
+ ldx #>$0000
rts
.assert SPEED_SLOW = 0, error
: jmp return0 ; SPEED_SLOW
diff --git a/libsrc/apple2/getdevice.s b/libsrc/apple2/getdevice.s
index 0c674cad0..f3b0d5a86 100644
--- a/libsrc/apple2/getdevice.s
+++ b/libsrc/apple2/getdevice.s
@@ -30,5 +30,5 @@ next: inx
bne next
done: txa
- ldx #$00
+ ldx #>$0000
rts
diff --git a/libsrc/apple2/joy/a2.stdjoy.s b/libsrc/apple2/joy/a2.stdjoy.s
index 11be52eb4..b5e7a311b 100644
--- a/libsrc/apple2/joy/a2.stdjoy.s
+++ b/libsrc/apple2/joy/a2.stdjoy.s
@@ -92,7 +92,7 @@ COUNT:
bvc noiic ; Not $4x
dex ; Only one joystick for the //c
noiic: txa ; Number of joysticks we support
- ldx #$00
+ ldx #>$0000
rts
; READ routine. Read a particular joystick passed in A.
@@ -170,5 +170,5 @@ nogs2: lda #$00 ; 0 0 0 0 0 0 0 0
; Finalize
eor #%00010100 ; BTN_2 BTN_1 DOWN UP RIGHT LEFT 0 0
- ldx #$00
+ ldx #>$0000
rts
diff --git a/libsrc/apple2/mou/a2.stdmou.s b/libsrc/apple2/mou/a2.stdmou.s
index 9b84c2f53..e48abbb41 100644
--- a/libsrc/apple2/mou/a2.stdmou.s
+++ b/libsrc/apple2/mou/a2.stdmou.s
@@ -353,7 +353,7 @@ SHOW:
; BUTTONS: Return the button mask in A/X.
BUTTONS:
lda info + MOUSE_INFO::BUTTONS
- ldx #$00
+ ldx #>$0000
rts
; POS: Return the mouse position in the MOUSE_POS struct pointed to by ptr1.
diff --git a/libsrc/apple2/open.s b/libsrc/apple2/open.s
index 38793a13e..7ece7f18d 100644
--- a/libsrc/apple2/open.s
+++ b/libsrc/apple2/open.s
@@ -209,7 +209,7 @@ done: lda tmp1 ; Restore fd
jsr popname ; Preserves A
; Return success
- ldx #$00
+ ldx #>$0000
stx ___oserror
rts
diff --git a/libsrc/apple2/oserror.s b/libsrc/apple2/oserror.s
index 5f523340f..db4f146cd 100644
--- a/libsrc/apple2/oserror.s
+++ b/libsrc/apple2/oserror.s
@@ -23,7 +23,7 @@ ___osmaperrno:
; Found the code
: lda ErrTab-1,x
- ldx #$00 ; High byte always zero
+ ldx #>$0000
rts
.rodata
diff --git a/libsrc/apple2/revers.s b/libsrc/apple2/revers.s
index 83fcb2ae7..86dfd0d19 100644
--- a/libsrc/apple2/revers.s
+++ b/libsrc/apple2/revers.s
@@ -18,5 +18,5 @@ normal: dex ; $00->$FF, $40->$3F
stx INVFLG ; Save new flag value
bmi :+ ; Jump if current value is $FF (normal)
lda #$01 ; Return "inverse"
-: ldx #$00
+: ldx #>$0000
rts
diff --git a/libsrc/apple2/ser/a2.gs.s b/libsrc/apple2/ser/a2.gs.s
index ea3e54cc1..3ad899fc2 100644
--- a/libsrc/apple2/ser/a2.gs.s
+++ b/libsrc/apple2/ser/a2.gs.s
@@ -295,7 +295,7 @@ SER_CLOSE:
bcc IIgs
lda #SER_ERR_NO_DEVICE ; Not a IIgs
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
IIgs:
@@ -500,7 +500,7 @@ BaudOK:
SetupOut:
plp ; Reenable interrupts if needed
- ldx #$00 ; Promote char return value
+ ldx #>$0000
sty Opened
rts
@@ -539,7 +539,7 @@ SER_GET:
rts
NoData:
lda #SER_ERR_NO_DATA
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
;----------------------------------------------------------------------------
@@ -560,7 +560,7 @@ SER_PUT:
: ldy SendFreeCnt ; Do we have room to store byte?
bne :+
lda #SER_ERR_OVERFLOW
- ldx #$00
+ ldx #>$0000
rts
: ldy SendTail ; Put byte into send buffer & send
@@ -571,7 +571,7 @@ SER_PUT:
jsr TryToSend
lda #SER_ERR_OK
.assert SER_ERR_OK = 0, error
- tax
+ tax ; Promote char return value
rts
;----------------------------------------------------------------------------
@@ -608,11 +608,11 @@ SER_IOCTL:
stx Channel
.assert SER_ERR_OK = 0, error
- tax
+ tax ; Promote char return value
rts
: lda #SER_ERR_INV_IOCTL
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
;----------------------------------------------------------------------------
diff --git a/libsrc/apple2/ser/a2.ssc.s b/libsrc/apple2/ser/a2.ssc.s
index 88dc4572c..488a32540 100644
--- a/libsrc/apple2/ser/a2.ssc.s
+++ b/libsrc/apple2/ser/a2.ssc.s
@@ -345,7 +345,7 @@ BaudOK: sta tmp1
stx Index ; Mark port as open
lda #SER_ERR_OK
Out:
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
;----------------------------------------------------------------------------
@@ -360,7 +360,7 @@ SER_GET:
cmp #$FF
bne :+
lda #SER_ERR_NO_DATA
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
: ldy Stopped ; Check for flow stopped
@@ -408,7 +408,7 @@ SER_PUT:
ldy SendFreeCnt ; Reload SendFreeCnt after TryToSend
bne :+
lda #SER_ERR_OVERFLOW
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
: ldy SendTail ; Put byte into send buffer
@@ -456,7 +456,7 @@ SER_IOCTL:
rts
: lda #SER_ERR_INV_IOCTL
- ldx #$00 ; Promote char return value
+ ldx #>$0000
rts
;----------------------------------------------------------------------------
diff --git a/libsrc/apple2/set_iigs_speed.s b/libsrc/apple2/set_iigs_speed.s
index 5e2f2f722..f13e8ab6a 100644
--- a/libsrc/apple2/set_iigs_speed.s
+++ b/libsrc/apple2/set_iigs_speed.s
@@ -25,5 +25,5 @@ _set_iigs_speed:
set_speed:
sta CYAREG
txa
- ldx #$00
+ ldx #>$0000
rts
diff --git a/libsrc/apple2/stat.s b/libsrc/apple2/stat.s
index f655b3e3f..e0564ae0c 100644
--- a/libsrc/apple2/stat.s
+++ b/libsrc/apple2/stat.s
@@ -121,7 +121,7 @@ eoferr:
beq done
lda #$FF
done:
- tax
+ tax ; Promote char return value
rts
.bss
diff --git a/libsrc/apple2/tgi/a2.hi.s b/libsrc/apple2/tgi/a2.hi.s
index aeb24f6be..1d5bdb68b 100644
--- a/libsrc/apple2/tgi/a2.hi.s
+++ b/libsrc/apple2/tgi/a2.hi.s
@@ -342,7 +342,7 @@ GETPIXEL:
lda #$03 ; 3 (white)
: bcc :+
adc #$03 ; += 4 (black -> black2, white -> white2)
-: ldx #$00
+: ldx #>$0000
bit $C080 ; Switch in LC bank 2 for R/O
rts
diff --git a/libsrc/apple2/tgi/a2.lo.s b/libsrc/apple2/tgi/a2.lo.s
index 6d1c6aa4a..8b00c5d20 100644
--- a/libsrc/apple2/tgi/a2.lo.s
+++ b/libsrc/apple2/tgi/a2.lo.s
@@ -321,7 +321,7 @@ GETPIXEL:
jsr SCRN
tax
lda COL2TGI,x
- ldx #$00
+ ldx #>$0000
bit $C080 ; Switch in LC bank 2 for R/O
rts
diff --git a/libsrc/apple2/wherey.s b/libsrc/apple2/wherey.s
index daacaaba7..a3843f606 100644
--- a/libsrc/apple2/wherey.s
+++ b/libsrc/apple2/wherey.s
@@ -12,5 +12,5 @@ _wherey:
lda CV
sec
sbc WNDTOP
- ldx #$00
+ ldx #>$0000
rts