started separating 'printf' as debug-only routine

This commit is contained in:
FeralChild64 committed 2019-10-03 21:21:34 +02:00
1 parent c3cbfcebfb
commit c173540fac
13 files changed
+86 -74

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