From 5268673c66d879dcd90c3d24b7da9f378c4411f6 Mon Sep 17 00:00:00 2001 From: John Brandwood Date: Tue, 6 Feb 2024 13:02:39 -0500 Subject: [PATCH] Change CORE to work with (and test) PCEAS's new .AREA functionality. --- examples/asm/elmer/include/core-kernel.asm | 10 ++++++++++ examples/asm/elmer/include/core-stage1.s2i | 2 +- examples/asm/elmer/include/core-startup.asm | 18 ++++++++++++++++-- examples/asm/elmer/include/core.inc | 4 ---- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/examples/asm/elmer/include/core-kernel.asm b/examples/asm/elmer/include/core-kernel.asm index b2a975c6..347a0616 100644 --- a/examples/asm/elmer/include/core-kernel.asm +++ b/examples/asm/elmer/include/core-kernel.asm @@ -44,6 +44,16 @@ +; *************************************************************************** +; *************************************************************************** +; +; core_kernel - Start of kernel code. +; + +core_kernel = * + + + ; *************************************************************************** ; *************************************************************************** ; diff --git a/examples/asm/elmer/include/core-stage1.s2i b/examples/asm/elmer/include/core-stage1.s2i index 0757f489..6000553a 100644 --- a/examples/asm/elmer/include/core-stage1.s2i +++ b/examples/asm/elmer/include/core-stage1.s2i @@ -30,7 +30,7 @@ ; *************************************************************************** ; *************************************************************************** -core_ram1st +core_kernel const_FFFF const_0000 diff --git a/examples/asm/elmer/include/core-startup.asm b/examples/asm/elmer/include/core-startup.asm index b89b75e3..db619c85 100644 --- a/examples/asm/elmer/include/core-startup.asm +++ b/examples/asm/elmer/include/core-startup.asm @@ -250,7 +250,7 @@ core_boot: jmp * + 3 ; Allow someone to patch this. .if !USING_STAGE1 ; Because the Stage1 does it! - lda core_ram1st ; Did a previous overlay set + lda core_kernel ; Did a previous overlay set bne .not_first ; up the kernel already? ; Is there a duplicate of the main ISO data track? @@ -273,7 +273,7 @@ core_boot: jmp * + 3 ; Allow someone to patch this. ; Copy the kernel code to its destination in MPR1. - tii (core_ram1st + $2000), core_ram1st, (core_ramcpy - core_ram1st) + tii (core_kernel + $2000), core_ram1st, (core_ramcpy - core_ram1st) ; Copy the ISO's directory into kernel memory in MPR1. @@ -414,9 +414,23 @@ core_hw_reset: sei ; Disable interrupts. .if USING_STAGE1 ; Read the already-assembled equates for the kernel code. + ; + ; N.B. The area() changes are only here to test PCEAS! + +!: .area -1 ; Tag the STAGE1 symbols. include "core-stage1.s" + .area area(!-) ; Restore previous area. + + .if (core_kernel != core_ram1st) + .fail Stage1 kernel has not been built with the same core_ram1st! + .endif + + .if (area(core_kernel) != -1) + .fail .AREA is not working correctly! + .endif + .else USING_STAGE1 ; Remember where the startup code ends in MPR2. diff --git a/examples/asm/elmer/include/core.inc b/examples/asm/elmer/include/core.inc index 1c52ea9e..91d7ea6c 100644 --- a/examples/asm/elmer/include/core.inc +++ b/examples/asm/elmer/include/core.inc @@ -125,10 +125,6 @@ core_ram1st = $F8:2680 core_ram1st = $F8:22D0 .endif USING_PSGDRIVER - .bss - .org core_ram1st - .code - ; ; Include the "CORE(not TM)" startup code to begin the HuCARD / Overlay. ;