diff --git a/build.sh b/build.sh index c1fe748..328795e 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,7 @@ PLATFORM="" ADD_OPTS="" if [ -n "${1}" -a -d "platforms/${1}" ]; then PLATFORM="${1}" - ADD_OPTS="${ADD_OPTS} -I platforms/${PLATFORM}/inc" + ADD_OPTS="${ADD_OPTS} -I platforms/${PLATFORM}" fi export PLATFORM echo ".define PLATFORM \"${PLATFORM}\"" > platform.inc diff --git a/forth.s b/forth.s index 5b08225..4d58265 100644 --- a/forth.s +++ b/forth.s @@ -16,7 +16,9 @@ .include "asm/compiler.s" ; Compiler helpers .include "asm/mathlib.s" ; Math library .include "asm/memmgr.s" ; Memory (heap) management library -PLATFORM_INCLUDE "platform-lib.s" ; Platform library +.if .strlen(PLATFORM) > 0 + .include "platform-lib.s" ; Platform library +.endif .include "asm/env-dictionary.s" ; Environmental queries dictionary .include "asm/forth-dictionary.s" ; Forth built-in dictionary diff --git a/inc/macros.inc b/inc/macros.inc index b9d02f1..610f576 100644 --- a/inc/macros.inc +++ b/inc/macros.inc @@ -1,21 +1,6 @@ ; Macro library for OF816. Contains macros for hand-compiled Forth code and common ; ops used within primitives. Also contains macros for building dictionaries. -; Config/build macros - -.macro PLATFORM_INCLUDE file - .if .strlen(PLATFORM) > 0 - .out .sprintf("Including text platforms/%s/%s", PLATFORM, file) - .include .sprintf("platforms/%s/%s", PLATFORM, file) - .endif -.endmacro - -.macro PLATFORM_INCBIN file - .if .strlen(PLATFORM) > 0 - .out .sprintf("Including binary platforms/%s/%s", PLATFORM, file) - .incbin .sprintf("platforms/%s/%s", PLATFORM, file) - .endif -.endmacro ; General macros & defs .define SHORT_A %00100000 diff --git a/platforms/GoSXB/inc/config.inc b/platforms/GoSXB/config.inc similarity index 100% rename from platforms/GoSXB/inc/config.inc rename to platforms/GoSXB/config.inc diff --git a/platforms/GoSXB/platform-lib.s b/platforms/GoSXB/platform-lib.s index 47c271d..dd1e8af 100644 --- a/platforms/GoSXB/platform-lib.s +++ b/platforms/GoSXB/platform-lib.s @@ -270,7 +270,7 @@ list: .if include_fcode .proc romfs - PLATFORM_INCBIN "fcode/romfs.fc" + .incbin "fcode/romfs.fc" .endproc .endif diff --git a/platforms/IIgs/inc/config.inc b/platforms/IIgs/config.inc similarity index 98% rename from platforms/IIgs/inc/config.inc rename to platforms/IIgs/config.inc index 002af46..d8b531e 100644 --- a/platforms/IIgs/inc/config.inc +++ b/platforms/IIgs/config.inc @@ -1,7 +1,7 @@ ; Apple IIgs Configuration File ; This platform uses it... -PLATFORM_INCLUDE "platform-config.inc" +.include "platform-config.inc" ; *** options *** diff --git a/platforms/IIgs/platform-lib.s b/platforms/IIgs/platform-lib.s index ba6a825..e257b13 100644 --- a/platforms/IIgs/platform-lib.s +++ b/platforms/IIgs/platform-lib.s @@ -2,7 +2,7 @@ cpu_clk = 2800000 ; nominally -PLATFORM_INCLUDE "platform-include.inc" +.include "platform-include.inc" .proc _scrn_tab .addr $400 @@ -664,4 +664,4 @@ con_wr_n: sty ESCNUM1 inc PwrByte jsr _emulation_call jmp _sf_fail -.endproc \ No newline at end of file +.endproc diff --git a/platforms/Neon816/Neon816-hw.inc b/platforms/Neon816/Neon816-hw.inc index 0957fe1..d953ccd 100644 --- a/platforms/Neon816/Neon816-hw.inc +++ b/platforms/Neon816/Neon816-hw.inc @@ -7,8 +7,8 @@ ; -- 01: Bank ; - 09 FDC ; 10-1F Internal Bus Bridge -; 20-27 Flash ROM -; 28-3F Reserved for Flash +; 20-21 Flash ROM +; 22-2F Reserved for Flash ; 30-3F Reserved for Expansion Flash ; 40-47 Video RAM ; 48-7F Reserved for VRAM diff --git a/platforms/Neon816/inc/config.inc b/platforms/Neon816/config.inc similarity index 98% rename from platforms/Neon816/inc/config.inc rename to platforms/Neon816/config.inc index f64ab29..7e169a4 100644 --- a/platforms/Neon816/inc/config.inc +++ b/platforms/Neon816/config.inc @@ -1,6 +1,6 @@ ; Config file for Neon816 port -;PLATFORM_INCLUDE "platform-config.inc" +;.include "platform-config.inc" ; *** options *** diff --git a/platforms/Neon816/romboot.s b/platforms/Neon816/romboot.s index fa0c1ac..54649c9 100644 --- a/platforms/Neon816/romboot.s +++ b/platforms/Neon816/romboot.s @@ -1,4 +1,4 @@ -.p816 + .p816 .a16 .i16 .include "macros.inc" @@ -6,6 +6,7 @@ .segment "ROMBOOT" .proc romboot + ; Go full native mode clc xce rep #SHORT_A|SHORT_I @@ -13,14 +14,15 @@ .i16 lda #$01FF tcs - ; Set up MMU for bank 0 + ; Set up MMU for bank 0 - map all but the top 4K to bank $80, + ; leaving the top (MMU) page for ROM ldx #$001C lda #$8000 : sta f:NeonMMU,x dex dex bpl :- - jml f:Neon_ROM + jml f:Neon_ROM ; assume main firmware starts at $200000 .endproc .segment "VECTORS" @@ -29,7 +31,7 @@ .word $FFFF ; FFE0 - reserved .word $FFFF ; FFE2 - reserved .word $FFFF ; FFE4 - COP - .word $FFFF ; FFE6 - BRK + .word .loword(romboot) ; FFE6 - BRK - handle like reset for now .word $FFFF ; FFE8 - ABORT .word $FFFF ; FFEA - NMI .word $FFFF ; FFEC - reserved @@ -42,5 +44,5 @@ .word $FFFF ; FFF8 - ABORT .word $FFFF ; FFFA - NMI .word .loword(romboot) ; FFFC - RESET - .word $FFFF ; FFFE - IRQ/BRK + .word .loword(romboot) ; FFFE - IRQ/BRK - handle like reset for now .endproc diff --git a/platforms/W65C816SXB/inc/config.inc b/platforms/W65C816SXB/config.inc similarity index 98% rename from platforms/W65C816SXB/inc/config.inc rename to platforms/W65C816SXB/config.inc index 0582b7b..c7e1524 100644 --- a/platforms/W65C816SXB/inc/config.inc +++ b/platforms/W65C816SXB/config.inc @@ -1,7 +1,7 @@ ; Configuration for W65C816SXB Port ; the W65C816SXB port uses this -PLATFORM_INCLUDE "platform-config.inc" +.include "platform-config.inc" ; *** options *** diff --git a/platforms/W65C816SXB/platform-lib.s b/platforms/W65C816SXB/platform-lib.s index 3e6c069..107ef8d 100644 --- a/platforms/W65C816SXB/platform-lib.s +++ b/platforms/W65C816SXB/platform-lib.s @@ -278,7 +278,7 @@ list: .endif .dword 0 .if romloader_at_init -romldr: PLATFORM_INCBIN "fcode/romloader.fc" +romldr: .incbin"fcode/romloader.fc" .endif .endif