From 810dfb75afc59a1349a4fc83e962ef8357bc1ee1 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Sun, 5 May 2019 16:31:24 +0930 Subject: [PATCH] put setup VIC-II routine at $E5A0 for Advanced Pinball Simulator. Issue #23 --- c64/kernal/cint.s | 17 +---------------- c64/kernal/e5a0.setup_vicii.s | 19 +++++++++++++++++++ src/collect_data.c | 15 ++++++++------- 3 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 c64/kernal/e5a0.setup_vicii.s diff --git a/c64/kernal/cint.s b/c64/kernal/cint.s index fbd47056..bf760279 100644 --- a/c64/kernal/cint.s +++ b/c64/kernal/cint.s @@ -1,22 +1,7 @@ ;; Function defined on pp272-273 of C64 Programmers Reference Guide ;; Compute's Mapping the 64 p215 cint: - ;; Set up default IO values (Compute's Mapping the 64 p215) - lda #$1b ; Enable text mode - sta $d011 - lda #$c8 ; 40 column etc - sta $d016 - - ;; Compute's Mapping the 64, p156 - ;; We use a different colour scheme of white text on all blue - lda #$06 - sta $D020 - sta $D021 - - ;; Turn off sprites - ;; (observed hanging around after running programs and resetting) - lda #$00 - sta $D015 + jsr setup_vicii ;; Initialise cursor blink flags (Compute's Mapping the 64 p215) lda #$00 diff --git a/c64/kernal/e5a0.setup_vicii.s b/c64/kernal/e5a0.setup_vicii.s new file mode 100644 index 00000000..671bfadf --- /dev/null +++ b/c64/kernal/e5a0.setup_vicii.s @@ -0,0 +1,19 @@ + +setup_vicii: + ;; Set up default IO values (Compute's Mapping the 64 p215) + lda #$1b ; Enable text mode + sta $d011 + lda #$c8 ; 40 column etc + sta $d016 + + ;; Compute's Mapping the 64, p156 + ;; We use a different colour scheme of white text on all blue + lda #$06 + sta $D020 + sta $D021 + + ;; Turn off sprites + ;; (observed hanging around after running programs and resetting) + lda #$00 + sta $D015 + diff --git a/src/collect_data.c b/src/collect_data.c index 116b24c0..cd1a2f9d 100644 --- a/src/collect_data.c +++ b/src/collect_data.c @@ -74,7 +74,7 @@ int main (int argc, char *argv[]) { int collect_cycles=5000000; // KERNAL part is actually just under 7KB - int rom_bottom=0xe4b7; + int rom_bottom=0xa000; int rom_top=0xffff; char *filename=NULL; @@ -198,13 +198,14 @@ int main (int argc, char *argv[]) { int nf=sscanf((char *)buffer,".C:%x%*[^:]:%*x X:%*x Y:%*x SP:%x %*[^ ] %d",&pc,&sp,&cycles); if (nf==3) { // fprintf(stdout,"%x %x %d\n",pc,sp,cycles); - // Detect entry into ROM via code - if (pc>=rom_bottom&&pc<=rom_top) { - if (last_pcrom_top) { - // PC has just entered the ROM - fprintf(stdout,"$%04x called from $%04x @ cycle %d\n",pc,last_pc,cycles); + // Detect entry into ROM via code + if (pc<0xc000||pc>=0xe000) + if (pc>=rom_bottom&&pc<=rom_top) { + if (last_pcrom_top) { + // PC has just entered the ROM + fprintf(stdout,"$%04x called from $%04x @ cycle %d\n",pc,last_pc,cycles); + } } - } // Detect entry into ROM via interrupt if (pc>=rom_bottom&&pc<=rom_top) if (sp==(last_sp-3)) {