From ab1b29565b81ea7b50a3b4a269dd90d3645922ab Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Thu, 18 Apr 2019 22:59:35 +0930 Subject: [PATCH] implement functionality of RAMTAS routine as described in C64 Programmer's Reference Guide --- c64/kernal/ramtas.s | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/c64/kernal/ramtas.s b/c64/kernal/ramtas.s index 645f68b2..02204ba8 100644 --- a/c64/kernal/ramtas.s +++ b/c64/kernal/ramtas.s @@ -1,3 +1,38 @@ ; Function defined on pp272-273 of C64 Programmers Reference Guide ramtas: + ; C64 Programmer's Reference guide p291: + + ; Clear $0000-$0101, $0200-$03ff + ; PGS: $0000, $0001 are CPU IO ports, so shouldn't get written to + LDY #$02 + LDA #$00 +ramtas_l1: + STA $02,Y + INY + BNE ramtas_l1 +ramtas_l2: + STA $0200,Y + STA $0300,Y + INY + BNE ramtas_l2 + + ; allocate cassette buffer + + ; set screen address to $0400 + ; https://www.c64-wiki.com/wiki/Screen_RAM + ; Since we are setting $D018, we also make sure we are using the + ; ROM character set (C64 Programmer's Reference Guide p322) + LDA #$14 + STA $D018 + + ; Make sure we have the correct VIC-II memory bank for the screen to really be at $0400 + ; and not $4400, $8400 or $C400 + ; https://www.c64-wiki.com/wiki/VIC_bank#Selecting_VIC_banks + LDA $DD02 + ORA #$03 + STA $DD02 + LDA $DD00 + ORA #$03 + STA $DD00 + rts