Skip to content

Commit

Permalink
Change CORE to work with (and test) PCEAS's new .AREA functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrandwood committed Feb 6, 2024
1 parent 1aa7165 commit 5268673
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
10 changes: 10 additions & 0 deletions examples/asm/elmer/include/core-kernel.asm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@



; ***************************************************************************
; ***************************************************************************
;
; core_kernel - Start of kernel code.
;

core_kernel = *



; ***************************************************************************
; ***************************************************************************
;
Expand Down
2 changes: 1 addition & 1 deletion examples/asm/elmer/include/core-stage1.s2i
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
; ***************************************************************************
; ***************************************************************************

core_ram1st
core_kernel

const_FFFF
const_0000
Expand Down
18 changes: 16 additions & 2 deletions examples/asm/elmer/include/core-startup.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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.

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions examples/asm/elmer/include/core.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
;
Expand Down

0 comments on commit 5268673

Please sign in to comment.