deduplicated some print character routines

This commit is contained in:
FeralChild64 committed 2019-10-03 22:21:44 +02:00
1 parent c173540fac
commit 2608e1b153
18 files changed
+68 -45

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
//
// Print the hex value in .A as two digits
//
print_hex_byte:
#if HAS_BCD_SAFE_INTERRUPTS
// Idea by Haubitze
sed
pha
lsr
lsr
lsr
lsr
cmp #$0A
adc #$30
jsr JCHROUT
pla
and #$0F
cmp #$0A
adc #$30
cld
jmp JCHROUT
#else
pha
lsr
lsr
lsr
lsr
ora #$30
cmp #$3A
bcc !+
adc #6
!: jsr JCHROUT
pla
and #$0f
ora #$30
cmp #$3A
bcc !+
adc #6
!: jmp JCHROUT
#endif