Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit ec27ae3

Browse files
committed
Deduplicate code for byte savings
Saves a whole whopping 6 bytes!
1 parent 4f43515 commit ec27ae3

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

roms/boot.s

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -474,30 +474,27 @@ fschk:
474474
dec $03
475475
bra @loop
476476

477-
hex2val:
478-
; Converts two hexadecimal characters to a value
479-
lda $00,X
480-
clc
481-
sbc #$2f
482-
cmp #$11
483-
bcc :+
484-
clc
485-
sbc #$06
486-
: sta good
487-
dex
477+
_hex2val:
478+
; Converts one hexadecimal characters to a value
488479
lda $00,X
489480
clc
490481
sbc #$2f
491482
cmp #$11
492483
bcc :+
493-
clc
494-
sbc #$06
495-
: asl
484+
sbc #$07
485+
: dex
486+
rts
487+
488+
hex2val:
489+
; Converts two hexadecimal characters to a value
490+
jsr _hex2val
491+
sta good
492+
jsr _hex2val
493+
asl
496494
asl
497495
asl
498496
asl
499497
eor good
500-
dex
501498
sta (curlow),Y
502499
iny
503500
rts

0 commit comments

Comments
 (0)