diff --git a/STATUS.md b/STATUS.md index a93e8233..e11de2dd 100644 --- a/STATUS.md +++ b/STATUS.md @@ -70,7 +70,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | Address | Name | Status | Remarks | | --------- | :------- | :------: | :------------------------------------------------: | -| `$FF81` | `CINT` | PARTIAL | at least PAL/NTSC detection is missing | +| `$FF81` | `CINT` | DONE | | | `$FF84` | `IOINIT` | PARTIAL | at least SID volume handling is missing | | `$FF87` | `RAMTAS` | DONE | | | `$FF8A` | `RESTOR` | DONE | | diff --git a/c64/basic/basic_cold_start.s b/c64/basic/basic_cold_start.s index 341e0909..b57145c8 100644 --- a/c64/basic/basic_cold_start.s +++ b/c64/basic/basic_cold_start.s @@ -17,6 +17,14 @@ startup_banner: `TARGET_HOOK_BANNER + ;; Print PAL/NTSC + ldx #30 ; NTSC + lda PALNTSC + beq + + ldx #31 ; PAL +* + jsr print_packed_message + ;; Work out free bytes, and display jsr basic_do_new lda basic_top_of_memory_ptr+0 @@ -26,7 +34,7 @@ startup_banner: lda basic_top_of_memory_ptr+1 sbc basic_end_of_text_ptr+1 - jsr print_integer + jsr print_integer lda #$20 jsr JCHROUT @@ -37,8 +45,8 @@ startup_banner: ;; jump into warm start loop jmp basic_warm_start - - + + startup_message: ;; Clear the screen .byte $93 diff --git a/c64/kernal/cint.s b/c64/kernal/cint.s index 243ba5ff..142005c0 100644 --- a/c64/kernal/cint.s +++ b/c64/kernal/cint.s @@ -14,7 +14,32 @@ cint: cint_brk: ; entry for BRK and STOP+RESTORE - XXX, where should it start? jsr setup_vicii - + + ;; Detect video system (PAL/NTSC), use Graham's method, as it's short and reliable + ;; see here: https://codebase64.org/doku.php?id=base:detect_pal_ntsc + +cint_w0: + lda VIC_RASTER +cint_w1: + cmp VIC_RASTER + beq cint_w1 + bmi cint_w0 + + ;; Result in A, if no interrupt happened during the test: + ;; #$37 -> 312 rasterlines, PAL, VIC 6569 + ;; #$06 -> 263 rasterlines, NTSC, VIC 6567R8 + ;; #$05 -> 262 rasterlines, NTSC, VIC 6567R56A + + cmp #$07 + bcs cint_pal +cint_ntsc: + lda #$00 + beq + +cint_pal: + lda #$01 +* + sta PALNTSC + ;; Initialise cursor blink flags (Compute's Mapping the 64 p215) lda #$00 sta cursor_blink_disable @@ -51,4 +76,3 @@ cint_brk: ; entry for BRK and STOP+RESTORE - XXX, where should it start? ;; Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215) jmp clear_screen - diff --git a/src/compress_text.c b/src/compress_text.c index fd156b19..57c02f19 100644 --- a/src/compress_text.c +++ b/src/compress_text.c @@ -159,15 +159,20 @@ char *error_list[]={ "LOAD", // https://www.discogs.com/Gimmik-Load-Error/release/482462 // Non-error messages "READY.\r", // #29 // https://www.ibm.com/support/knowledgecenter/zosbasics/com.ibm.zos.zconcepts/zconc_whatistsonative.htm https://github.com/stefanhaustein/expressionparser - "LOADING", // #30 // https://community.tibco.com/wiki/how-show-loading-prompt-when-reloading-external-data - "VERIFYING", // https://discussions.apple.com/thread/8087203 - "SAVING", + "NTSC, ", // #30 + "PAL, ", // #31 + "", // unused for now "ERROR", // #33 // Simply the word error that is attached to the other parts of messages https://fjkraan.home.xs4all.nl/comp/apple2faq/app2asoftfaq.html - "BYTES FREE.\r\r", // #34 // https://github.com/stefanhaustein/expressionparser + "BYTES FREE\r\r", // #34 // https://github.com/stefanhaustein/expressionparser "MEMORY CORRUPT", // #35 "NOT IMPLEMENTED", // #36 NULL}; +// XXX: create separate list for Kernal +// "LOADING", // #30 // https://community.tibco.com/wiki/how-show-loading-prompt-when-reloading-external-data +// "VERIFYING", // https://discussions.apple.com/thread/8087203 +// "SAVING", + // Token $FF is end of message, so we can have only 255 unique words #define MAX_WORDS 255 char *words[MAX_WORDS];