mirror of
https://github.com/blondie7575/GSCats.git
synced 2024-06-07 21:29:31 +00:00
First pass on ProDOS-based bank loader
This commit is contained in:
parent
79972bbb52
commit
adb74d6fb4
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/GSCats.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/GSCats.xcscheme
|
/GSCats.xcodeproj/xcuserdata/qd.xcuserdatad/xcschemes/GSCats.xcscheme
|
||||||
/gscats.lst
|
/gscats.lst
|
||||||
/GSCats.xcodeproj/xcuserdata/qd.xcuserdatad/xcdebugger
|
/GSCats.xcodeproj/xcuserdata/qd.xcuserdatad/xcdebugger
|
||||||
|
/loader.lst
|
||||||
|
|
16
Makefile
16
Makefile
|
@ -17,23 +17,31 @@ PGM=gscats
|
||||||
MRSPRITE=../MrSprite/mrsprite CODE
|
MRSPRITE=../MrSprite/mrsprite CODE
|
||||||
PALETTE=00ff00 000000 ffff00 886611 cc9933 eebb44 dd6666 ff99aa 00ff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffffff
|
PALETTE=00ff00 000000 ffff00 886611 cc9933 eebb44 dd6666 ff99aa 00ff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffff00 ffffff
|
||||||
|
|
||||||
all: $(PGM)
|
all: loader $(PGM)
|
||||||
|
|
||||||
|
|
||||||
$(PGM):
|
$(PGM):
|
||||||
@PATH=$(PATH):/usr/local/bin; $(CL65) -t apple2enh --cpu 65816 --start-addr $(ADDR) -l$(PGM).lst $(PGM).s
|
@PATH=$(PATH):/usr/local/bin; $(CL65) -t apple2enh --cpu 65816 --start-addr $(ADDR) -l$(PGM).lst $(PGM).s
|
||||||
java -jar $(AC) -d $(PGM).2mg $(PGM)
|
java -jar $(AC) -d $(PGM).2mg CODEBANK
|
||||||
java -jar $(AC) -p $(PGM).2mg $(PGM) BIN 0x$(ADDR) < $(PGM)
|
java -jar $(AC) -p $(PGM).2mg CODEBANK BIN 0x$(ADDR) < $(PGM)
|
||||||
java -jar $(AC) -d $(PGM).2mg SPRITEBANK00
|
java -jar $(AC) -d $(PGM).2mg SPRITEBANK00
|
||||||
java -jar $(AC) -p $(PGM).2mg SPRITEBANK00 BIN 0x0000 < Art/spritebank00.bin
|
java -jar $(AC) -p $(PGM).2mg SPRITEBANK00 BIN 0x0000 < Art/spritebank00.bin
|
||||||
rm -f $(PGM)
|
rm -f $(PGM)
|
||||||
rm -f $(PGM).o
|
rm -f $(PGM).o
|
||||||
osascript V2Make.scpt $(PROJECT_DIR) $(PGM)
|
osascript V2Make.scpt $(PROJECT_DIR) $(PGM)
|
||||||
|
|
||||||
|
loader:
|
||||||
|
@PATH=$(PATH):/usr/local/bin; $(CL65) -t apple2enh --cpu 65816 --start-addr $(ADDR) -lloader.lst loader.s
|
||||||
|
java -jar $(AC) -d $(PGM).2mg $(PGM)
|
||||||
|
java -jar $(AC) -p $(PGM).2mg $(PGM) BIN 0x$(ADDR) < loader
|
||||||
|
rm -f loader
|
||||||
|
rm -f loader.o
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(PGM)
|
rm -f $(PGM)
|
||||||
rm -f $(PGM).o
|
rm -f $(PGM).o
|
||||||
rm ~/Library/Application\ Support/Sweet16/Disk\ Images/*
|
rm -f loader
|
||||||
|
rm -f loader.o
|
||||||
|
|
||||||
.PHONY: art
|
.PHONY: art
|
||||||
art:
|
art:
|
||||||
|
|
|
@ -9,6 +9,8 @@ KBDSTROBE = $e0c010
|
||||||
COUT = $fded
|
COUT = $fded
|
||||||
VRAM = $e12000
|
VRAM = $e12000
|
||||||
VRAMBANK = $e10000
|
VRAMBANK = $e10000
|
||||||
|
PRODOS = $bf00 ; MLI entry point
|
||||||
|
PRODOSRETURN = $300 ; Indirect jump to get back to ProDOS from any bank
|
||||||
|
|
||||||
; Zero page locations we use (unused by Monitor, Applesoft, or ProDOS)
|
; Zero page locations we use (unused by Monitor, Applesoft, or ProDOS)
|
||||||
PARAM0 = $06
|
PARAM0 = $06
|
||||||
|
|
BIN
gscats.2mg
BIN
gscats.2mg
Binary file not shown.
6
gscats.s
6
gscats.s
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
.include "macros.s"
|
.include "macros.s"
|
||||||
.include "equates.s"
|
.include "equates.s"
|
||||||
.include "loader.s"
|
|
||||||
|
.org $800
|
||||||
|
|
||||||
|
|
||||||
mainBank2:
|
mainBank2:
|
||||||
SYNCDBR
|
SYNCDBR
|
||||||
|
@ -25,7 +27,7 @@ mainBank2:
|
||||||
|
|
||||||
quitGame:
|
quitGame:
|
||||||
CLASSICVIDEO
|
CLASSICVIDEO
|
||||||
jml (proDOSLongJump)
|
jml (PRODOSRETURN)
|
||||||
|
|
||||||
|
|
||||||
.include "graphics.s"
|
.include "graphics.s"
|
||||||
|
|
75
loader.s
75
loader.s
|
@ -6,48 +6,83 @@
|
||||||
; Created by Quinn Dunki on 7/29/17
|
; Created by Quinn Dunki on 7/29/17
|
||||||
;
|
;
|
||||||
|
|
||||||
|
.include "equates.s"
|
||||||
|
.include "macros.s"
|
||||||
|
|
||||||
|
LOADBUFFER = $1000 ; Clear of this loader code
|
||||||
|
BUFFERSIZE = $8200 ; About max size we can fit between buffer and this loader code
|
||||||
|
MAINENTRY = $020800
|
||||||
|
|
||||||
.org $800
|
.org $800
|
||||||
|
|
||||||
main:
|
main:
|
||||||
|
OP8 ; We launch in emulation. Stay there for now
|
||||||
|
|
||||||
|
; Open the main code file
|
||||||
|
jsr PRODOS
|
||||||
|
.byte $c8
|
||||||
|
.addr fileOpenCode
|
||||||
|
bne ioError
|
||||||
|
|
||||||
|
; Load the code into bank 0
|
||||||
|
jsr PRODOS
|
||||||
|
.byte $ca
|
||||||
|
.addr fileReadCode
|
||||||
|
bne ioError
|
||||||
|
|
||||||
|
; Close the file
|
||||||
|
jsr PRODOS
|
||||||
|
.byte $cc
|
||||||
|
.addr fileCloseCode
|
||||||
|
|
||||||
NATIVE
|
NATIVE
|
||||||
|
|
||||||
; Copy main code that ProDOS 8 loaded into bank 2.
|
; Copy code into bank 2
|
||||||
; Bank 2 is our "main" code bank because the GS fast
|
|
||||||
; graphics path really messes with banks 0 and 1.
|
|
||||||
; ProDOS 8 doesn't know anything about non-zero banks
|
|
||||||
; though, so things get loaded here and moved.
|
|
||||||
|
|
||||||
mainCopyStart:
|
mainCopyStart:
|
||||||
ldx #0
|
ldx #0
|
||||||
lda #mainBank2
|
|
||||||
sta mainCopyDest+1
|
|
||||||
|
|
||||||
mainCopyLoop:
|
mainCopyLoop:
|
||||||
lda mainBank2,x
|
lda LOADBUFFER,x
|
||||||
|
|
||||||
mainCopyDest:
|
mainCopyDest:
|
||||||
sta $020800,x
|
sta MAINENTRY,x
|
||||||
inx
|
inx
|
||||||
cpx #endMainBank2-mainBank2
|
inx
|
||||||
|
cpx #LOADBUFFER+BUFFERSIZE
|
||||||
bne mainCopyLoop
|
bne mainCopyLoop
|
||||||
|
|
||||||
; Set up a long jump into bank 2, and
|
; Set up a long jump into bank 2, and
|
||||||
; a way for game code to get back here to exit
|
; a way for game code to get back here to exit
|
||||||
; properly to ProDOS 8
|
; properly to ProDOS 8
|
||||||
lda #returnToProDOS
|
lda #returnToProDOS
|
||||||
sta proDOSLongJump
|
sta PRODOSRETURN
|
||||||
lda #mainBank2
|
jml MAINENTRY
|
||||||
sta mainLongJump
|
|
||||||
|
|
||||||
jml (mainLongJump)
|
|
||||||
|
|
||||||
returnToProDOS:
|
returnToProDOS:
|
||||||
SYNCDBR
|
SYNCDBR
|
||||||
EMULATION
|
EMULATION
|
||||||
rts
|
rts
|
||||||
|
|
||||||
mainLongJump:
|
ioError:
|
||||||
.byte 00,08,02
|
brk
|
||||||
proDOSLongJump:
|
|
||||||
.byte 00,00,00
|
|
||||||
|
|
||||||
|
fileOpenCode:
|
||||||
|
.byte 3
|
||||||
|
.addr codePath
|
||||||
|
.addr $9200 ; 1k below BASIC.SYSTEM
|
||||||
|
.byte 0 ; Result (file handle)
|
||||||
|
.byte 0 ; Padding
|
||||||
|
|
||||||
|
fileReadCode:
|
||||||
|
.byte 4
|
||||||
|
.byte 1 ; File handle (we know it's gonna be 1)
|
||||||
|
.addr LOADBUFFER
|
||||||
|
.word BUFFERSIZE
|
||||||
|
.word 0 ; Result (bytes read)
|
||||||
|
|
||||||
|
fileCloseCode:
|
||||||
|
.byte 1
|
||||||
|
.byte 1 ; File handle (we know it's gonna be 1)
|
||||||
|
|
||||||
|
codePath:
|
||||||
|
pstring "/GSAPP/CODEBANK"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user