From 0f80941eac262f958a82d2e301599eaf02ba92b1 Mon Sep 17 00:00:00 2001 From: FeralChild64 Date: Sun, 20 Oct 2019 12:29:29 +0200 Subject: [PATCH] CINT adjustments for 'Operacja Proboszcz' game --- STATUS.md | 45 ++++++++++--------- ...int_real.s => cint_screen_keyboard_real.s} | 13 +++--- c64/kernal/init/e51b.cint_screen_keyboard.s | 6 +++ c64/kernal/init/e51b.interop | 2 + c64/kernal/init/ff5b.cint.jmp.s | 6 --- c64/kernal/init/ff5b.cint.s | 16 +++++++ .../interrupts/fe66.default_brk_handler.s | 1 + 7 files changed, 53 insertions(+), 36 deletions(-) rename c64/kernal/init/{cint_real.s => cint_screen_keyboard_real.s} (90%) create mode 100644 c64/kernal/init/e51b.cint_screen_keyboard.s create mode 100644 c64/kernal/init/e51b.interop delete mode 100644 c64/kernal/init/ff5b.cint.jmp.s create mode 100644 c64/kernal/init/ff5b.cint.s diff --git a/STATUS.md b/STATUS.md index fb33b47a..42c2197d 100644 --- a/STATUS.md +++ b/STATUS.md @@ -137,7 +137,7 @@ NOTE: Even the 'DONE' routines won't support features described as missing in on | `$FFDB` | | `SETTIM` | DONE | | | `$FFDE` | | `RDTIM` | DONE | | | `$FFE1` | `$F6ED` | `STOP` | DONE | | -| `$FFE4` | `$F13E` | `GETIN` | PARTIAL | only keyaboard supported | +| `$FFE4` | `$F13E` | `GETIN` | PARTIAL | only keyboard supported | | `$FFE7` | `$F32F` | `CLALL` | DONE | | | `$FFEA` | | `UDTIM` | DONE | | | `$FFED` | | `SCREEN` | DONE | | @@ -155,26 +155,27 @@ Not all of them - only these we want to have implemented.
-| Address | Name | Status | Remarks | -| :-------: | :------------------ | :------: | :------------------------------------------------: | -| `$E544` | clear screen | DONE | | -| `$E50C` | set cursor position | PARTIAL | | -| `$E566` | home cursor | NOT DONE | | -| `$E5A0` | setup VIC II & IO | DONE | | -| `$E6B6` | advance cursor | NOT DONE | | -| `$E701` | previous line | NOT DONE | | -| `$E8EA` | scroll line | NOT DONE | | -| `$E9FF` | clear line | NOT DONE | | -| `$EA31` | default IRQ | PARTIAL | | -| `$EA7E` | ack CIA1 + below | DONE | | -| `$EA81` | ret from IRQ/NMI | DONE | | -| `$F142` | get key from buffer | DONE | | -| `$FD30` | default vectors | DONE | | -| `$FD90` | (unknown) | NOT DONE | | -| `$FD90` | (unknown) | NOT DONE | | -| `$FE2D` | memtop set part | DONE | | -| `$FE47` | default NMI | PARTIAL | | -| `$FE66` | default BRK | DONE | | -| `$FF80` | revision byte | DONE | | +| Address | Name | Status | Remarks | +| :-------: | :--------------------------- | :------: | :------------------------------------------------: | +| `$E51B` | init screen keyboard, no VIC | PARTIAL | not sure if correct | +| `$E544` | clear screen | DONE | | +| `$E50C` | set cursor position | PARTIAL | | +| `$E566` | home cursor | NOT DONE | | +| `$E5A0` | setup VIC II & IO | DONE | | +| `$E6B6` | advance cursor | NOT DONE | | +| `$E701` | previous line | NOT DONE | | +| `$E8EA` | scroll line | NOT DONE | | +| `$E9FF` | clear line | NOT DONE | | +| `$EA31` | default IRQ | PARTIAL | | +| `$EA7E` | ack CIA1 + below | DONE | | +| `$EA81` | ret from IRQ/NMI | DONE | | +| `$F142` | get key from buffer | DONE | | +| `$FD30` | default vectors | DONE | | +| `$FD90` | (unknown) | NOT DONE | | +| `$FD90` | (unknown) | NOT DONE | | +| `$FE2D` | memtop set part | DONE | | +| `$FE47` | default NMI | PARTIAL | | +| `$FE66` | default BRK | DONE | | +| `$FF80` | revision byte | DONE | |
diff --git a/c64/kernal/init/cint_real.s b/c64/kernal/init/cint_screen_keyboard_real.s similarity index 90% rename from c64/kernal/init/cint_real.s rename to c64/kernal/init/cint_screen_keyboard_real.s index 2c4722a4..453320f4 100644 --- a/c64/kernal/init/cint_real.s +++ b/c64/kernal/init/cint_screen_keyboard_real.s @@ -1,15 +1,15 @@ // -// Official Kernal routine, described in: +// It seems this is a part CINT which initializes screen and keyboard, but does not +// reset VIC-II. See here: https://csdb.dk/forums/index.php?roomid=11&topicid=17048&firstpost=22 // +// For more details see: // - [RG64] C64 Programmer's Reference Guide - page 280 // - [CM64] Compute's Mapping the Commodore 64 - page 242 -// -// CPU registers that has to be preserved (see [RG64]): none -// +cint_screen_keyboard_real: -cint_real: + // XXX check what really is performed here // According to [CM64], this routine checks for PAL/NTSC. It's definitely not done // within the 'BRK' part, this can be easily checked - POKE something @@ -116,9 +116,6 @@ cint_brk: // entry for BRK and STOP+RESTORE - XXX, where should it start? ldx #$00 stx MODE - // Setup video and I/O - jsr setup_vicii - // Fallthrough/jump to screen clear routine (Compute's Mapping the 64 p215) jmp clear_screen diff --git a/c64/kernal/init/e51b.cint_screen_keyboard.s b/c64/kernal/init/e51b.cint_screen_keyboard.s new file mode 100644 index 00000000..5ed66544 --- /dev/null +++ b/c64/kernal/init/e51b.cint_screen_keyboard.s @@ -0,0 +1,6 @@ + +// Routine too long to fit here + +cint_screen_keyboard: + + jmp cint_screen_keyboard_real diff --git a/c64/kernal/init/e51b.interop b/c64/kernal/init/e51b.interop new file mode 100644 index 00000000..5b2be0e9 --- /dev/null +++ b/c64/kernal/init/e51b.interop @@ -0,0 +1,2 @@ + +Game 'Operacja Proboszcz' explicitly calls this location. diff --git a/c64/kernal/init/ff5b.cint.jmp.s b/c64/kernal/init/ff5b.cint.jmp.s deleted file mode 100644 index d692928f..00000000 --- a/c64/kernal/init/ff5b.cint.jmp.s +++ /dev/null @@ -1,6 +0,0 @@ - -// Our implementation is longer than the original one, -// placing it here would cause a collision with OPEN - -CINT: - jmp cint_real diff --git a/c64/kernal/init/ff5b.cint.s b/c64/kernal/init/ff5b.cint.s new file mode 100644 index 00000000..bb3b91b0 --- /dev/null +++ b/c64/kernal/init/ff5b.cint.s @@ -0,0 +1,16 @@ + +// +// Official Kernal routine, described in: +// +// - [RG64] C64 Programmer's Reference Guide - page 280 +// - [CM64] Compute's Mapping the Commodore 64 - page 242 +// +// CPU registers that has to be preserved (see [RG64]): none +// + +CINT: + + // Setup video and I/O + jsr setup_vicii + + jmp cint_screen_keyboard diff --git a/c64/kernal/interrupts/fe66.default_brk_handler.s b/c64/kernal/interrupts/fe66.default_brk_handler.s index 53d70783..c788385e 100644 --- a/c64/kernal/interrupts/fe66.default_brk_handler.s +++ b/c64/kernal/interrupts/fe66.default_brk_handler.s @@ -12,6 +12,7 @@ default_brk_handler: jsr JRESTOR jsr JIOINIT + jsr setup_vicii // XXX should probably be a part of cint_brk jsr cint_brk cli