'printf' routine is now optional

This commit is contained in:
FeralChild64 committed 2019-10-03 23:59:43 +02:00
1 parent c3a99ba5e0
commit 4be1f222a9
7 files changed
+85 -28

No files matched your search

+8 -2
View File
@@ -94,8 +94,14 @@ On the most widespread CPUs the D flag is not cleared upon entering interrupts.
Feature needs 2 bytes in KERNAL segmment (for CPUs needing the patch), but at the same time allows optimizations allowing to gain some more bytes. If unsure - enable.
## Debug options
Options in this section are for debug purposes only. If unsure - disable.
### `CONFIG_DBG_STUBS_BRK`
Option just for debugging purposes - replaces `RTS` stubbed routines implementation with one causing a break.
Replaces `RTS` stubbed routines implementation with one causing a break.
If unsure - disable.
### `CONFIG_DBG_PRINTF`
Makes 'printf' routine available.
+1 -1
View File
@@ -24,4 +24,4 @@
#define CONFIG_BCD_SAFE_INTERRUPTS
// #define CONFIG_DBG_STUBS_BRK
#define CONFIG_DBG_PRINTF
// #define CONFIG_DBG_PRINTF
+1 -1
View File
@@ -24,4 +24,4 @@
#define CONFIG_BCD_SAFE_INTERRUPTS
// #define CONFIG_DBG_STUBS_BRK
#define CONFIG_DBG_PRINTF
// #define CONFIG_DBG_PRINTF
+1 -1
View File
@@ -24,4 +24,4 @@
#define CONFIG_BCD_SAFE_INTERRUPTS
// #define CONFIG_DBG_STUBS_BRK
#define CONFIG_DBG_PRINTF
// #define CONFIG_DBG_PRINTF
+44
View File
@@ -0,0 +1,44 @@
//
// Messages to be prined out by Kernal
//
// Double underscore prevents labels from being passed to VICE (would confuse monitor)
.label __MSG_KERNAL_SEARCHING_FOR = __kernal_message_searching_for - __kernal_messages_start
.label __MSG_KERNAL_LOADING = __kernal_message_loading - __kernal_messages_start
.label __MSG_KERNAL_VERIFYING = __kernal_message_verifying - __kernal_messages_start
.label __MSG_KERNAL_SAVING = __kernal_message_saving - __kernal_messages_start
.label __MSG_KERNAL_FROM_HEX = __kernal_message_from_hex - __kernal_messages_start
.label __MSG_KERNAL_TO_HEX = __kernal_message_to_hex - __kernal_messages_start
__kernal_messages_start:
__kernal_message_searching_for:
.byte $0D
.text "SEARCHING FOR "
.byte 0
__kernal_message_loading:
.byte $0D
.text "LOADING"
.byte 0
__kernal_message_verifying:
.byte $0D
.text "VERIFYING"
.byte 0
__kernal_message_saving:
.byte $0D
.text "SAVING"
.byte 0
__kernal_message_from_hex:
.text " FROM $"
.byte 0
__kernal_message_to_hex:
.text " TO $"
.byte 0
+16 -23
View File
@@ -71,10 +71,10 @@ lvs_advance_pointer:
lvs_display_searching_for:
lda MSGFLG
bpl lvs_display_end
jsr printf // XXX don't use printf, use packed message
.byte $0D
.text "SEARCHING FOR "
.byte 0
ldx #__MSG_KERNAL_SEARCHING_FOR
jsr print_kernal_message
ldy #$00
!:
cpy FNLEN
@@ -98,24 +98,21 @@ lvs_display_loading_verifying:
// Display LOADING / VERIFYING and start address
lda MSGFLG
bpl lvs_display_end
ldx #__MSG_KERNAL_LOADING
lda VERCKK
beq !+
jsr printf // XXX don't use printf, use packed message
.byte $0D
.text "VERIFYING"
.byte 0
jmp lvs_display_start_addr
ldx #__MSG_KERNAL_VERIFYING
!:
jsr printf // XXX don't use printf, use packed message
.byte $0D
.text "LOADING"
.byte 0
jsr print_kernal_message
// FALLTHROUGH
lvs_display_start_addr:
jsr printf // XXX don't use printf, use packed message
.text " FROM $"
.byte 0
ldx #__MSG_KERNAL_FROM_HEX
!:
jsr print_kernal_message
lda STAL+1
jsr print_hex_byte
lda STAL+0
@@ -125,13 +122,9 @@ lvs_display_done:
// Display end address
lda MSGFLG
bpl lvs_display_end
jsr printf // XXX don't use printf, use packed message
.text " TO $"
.byte 0
lda STAL+1
jsr print_hex_byte
lda STAL+0
jsr print_hex_byte
ldx #__MSG_KERNAL_TO_HEX
jsr !-
jmp print_return
lvs_wrap_around_error:
+14
View File
@@ -0,0 +1,14 @@
//
// Print one of the standard Kernal messages, index in .X
//
!:
jsr JCHROUT
inx
print_kernal_message:
lda __kernal_messages_start, x
bne !- // 0 marks end of string
rts