From c3a99ba5e0c0cba49f9719aaef0e9dcb0622759c Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Thu, 3 Oct 2019 23:11:57 +0200 Subject: [PATCH] routine at $E422 is now implemented --- STATUS.md | 2 +- c64/basic/basic_cold_start.s | 29 ++--------------------------- c64/basic/e422.initmsg.s | 20 ++++++++++++++++++-- c64/basic/startup_banner.s | 7 +++++++ 4 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 c64/basic/startup_banner.s diff --git a/STATUS.md b/STATUS.md index 2b7915dc..01af1e7c 100644 --- a/STATUS.md +++ b/STATUS.md @@ -81,7 +81,7 @@ Not all of them - only these we want to have implemented. | `$AB1E` | STROUT | DONE | | | `$BDCD` | LINPRT | NOT DONE | | | `$E3BF` | INIT | NOT DONE | | -| `$E422` | INITMSG | PARTIAL | banner printed outside | +| `$E422` | INITMSG | DONE | | | `$E453` | RVECT | NOT DONE | |
diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 9863ea5b..5f8d27e3 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -27,33 +27,8 @@ basic_cold_start: lda #>do_ILLEGAL_QUANTITY_error sta USRADD+1 - // Print startup banner - jsr printf // XXX don't use printf, keep it for debug purposes only - TARGET_HOOK_BANNER() - - // Print PAL/NTSC - ldx #30 // NTSC - lda TVSFLG - beq !+ - ldx #31 // PAL -!: - jsr print_packed_message - - // Work out free bytes, display them - jsr basic_do_new - lda MEMSIZ+0 - sec - sbc TXTTAB+0 - tax - lda MEMSIZ+1 - sbc TXTTAB+1 - - jsr print_integer - jsr print_space - - // Print the rest of the start up message - ldx #34 - jsr print_packed_message + // Print startup messages + jsr INITMSG // jump into warm start loop jmp basic_warm_start diff --git a/c64/basic/e422.initmsg.s b/c64/basic/e422.initmsg.s index 739de6ce..261ce40b 100644 --- a/c64/basic/e422.initmsg.s +++ b/c64/basic/e422.initmsg.s @@ -1,8 +1,24 @@ -// XXX provide documentation and finish the implementation +// +// Well-known BASIC routine, described in: +// +// - [CM64] Compute's Mapping the Commodore 64 - page 212 +// +// Prints the start-up messages +// INITMSG: + // Print startup banner, up to 255 characters + ldx #$00 +!: + lda startup_banner, x + beq !+ // 0 means end of banner + jsr JCHROUT + inx + bne !- + +!: // Print PAL/NTSC ldx #30 // NTSC lda TVSFLG @@ -23,6 +39,6 @@ INITMSG: jsr print_integer jsr print_space - // Print the rest of the start up message + // Print rest of the start up message ldx #34 jmp print_packed_message diff --git a/c64/basic/startup_banner.s b/c64/basic/startup_banner.s new file mode 100644 index 00000000..957ab11d --- /dev/null +++ b/c64/basic/startup_banner.s @@ -0,0 +1,7 @@ + +// +// Startup banner, to be displayed durin cold start +// + +startup_banner: + TARGET_HOOK_BANNER()