From ee66ff085fc9bec99bffd81353ea877e3c3ab4e3 Mon Sep 17 00:00:00 2001 From: Stefan Eilers Date: Wed, 21 Feb 2024 21:49:09 +0100 Subject: [PATCH] Switch "zero page" to $1600 - $16ff --- mos-platform/mega65/CMakeLists.txt | 4 ++++ mos-platform/mega65/unmap-basic.S | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mos-platform/mega65/CMakeLists.txt b/mos-platform/mega65/CMakeLists.txt index 0f9ad6e75..00a36b6e1 100644 --- a/mos-platform/mega65/CMakeLists.txt +++ b/mos-platform/mega65/CMakeLists.txt @@ -16,3 +16,7 @@ add_platform_object_file(mega65-unmap-basic unmap-basic.o unmap-basic.S) add_platform_library(mega65-c kernal.S) target_include_directories(mega65-c BEFORE PUBLIC .) + +target_compile_options(mega65-unmap-basic PRIVATE + -mcpu=mos45gs02 +) diff --git a/mos-platform/mega65/unmap-basic.S b/mos-platform/mega65/unmap-basic.S index 4d813f1d7..12f962786 100644 --- a/mos-platform/mega65/unmap-basic.S +++ b/mos-platform/mega65/unmap-basic.S @@ -15,6 +15,9 @@ ldx #$44 ; unmap all C65 ROMs except $e000-$ffff stx $d030 + lda #$16 ; Switch zero page to $1600 - $16ff + tab + ; restore BASIC ROM after all other exit handlers have completed .section .fini.990,"axR", @progbits @@ -24,7 +27,8 @@ ; restore C65 ROMs to as before ldx #$64 stx $d030 + + lda #$00 ; Switch zero page back to default + tab cli - -