From 38e1cc10d4579a80a945b130da6267118517d30c Mon Sep 17 00:00:00 2001 From: David Stancu Date: Mon, 15 Jan 2018 10:58:58 -0500 Subject: [PATCH] working assemble -> deploy thanks to the FB group for some assist --- README.md | 18 +++++++++++++++++- assemble.sh | 6 ++++++ src/main.S | 39 ++++++++++++++++++++++++++++++++++----- 3 files changed, 57 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e2311cb..bc3d81c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Apple IIgs simple pong game, with animation and sound. Written in 100% 658c16 as - GNU build tools (`autoconf`, `gcc`, etc.) - Basic understanding of C/C++ build issues, since you'll likely face some. - An Apple IIGS emulator of your flavor + the appropriate ROM (which you will have to source for yourself) + - The assemble script uses `gsplus` ### Building @@ -17,4 +18,19 @@ There are two scripts here which will get all the tools needed to assemble the g ```bash ./build_env.sh # to grab utils ./assemble.sh # to assemble the game -``` \ No newline at end of file +``` + +The `assemble` script runs the assembly source through Merlin32, then changes the ProDOS file kind to `S16`, an executable format that is used for GS/OS applications. `_FileInformation.txt` is what `cadius` uses to manage the ProDOS metadata for each record (since obviously this information can't be mapped to your computer's filesystem). + +## References + +There are a lot of good materials out there: here is what I used to make this game. + +- [IIgs Hardware Architecture](http://www.goldstarsoftware.com/applesite/Documentation/AppleIIgsHardwareReferenceManual.PDF) + - p. 74 has a memory map +- [Scanlon's IIgs Assembly Programming](ftp://ftp.apple.asimov.net/pub/apple_II/documentation/programming/65816_gs/Apple%20IIGS%20Assembly%20Language%20Programming.pdf) +- [Programming the 65816 and 65xx family](https://apple2.gs/downloads/Programmanual.pdf) +- ["PEI Slam" fast SHR rendering](https://retrocomputing.stackexchange.com/questions/52/how-do-i-use-shadowed-memory-to-render-super-hi-res-quickly) +- [Changing ProDOS file types with Cadius](https://groups.google.com/forum/#!topic/comp.sys.apple2/dqcTdS9epdQ) +- [6502 opcode list](http://www.defence-force.org/computing/oric/coding/annexe_2/) +- [BrutalDeluxe GS/OS internals (VERY USEFUL)](http://brutaldeluxe.fr/documentation/gsos/Apple_IIgs_GSOS_internals_v1.pdf) \ No newline at end of file diff --git a/assemble.sh b/assemble.sh index 54221bc..07afe6a 100755 --- a/assemble.sh +++ b/assemble.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash ls src/*.S | xargs ./bin/cadius INDENTFILE ls src/*.S | xargs ./bin/merlin -V ./src/macro + +sed -ie 's/Type(00)/Type(B3)/' src/_FileInformation.txt + +./bin/cadius DELETEFILE blankdisk.po NEW.DISK/main +./bin/cadius ADDFILE blankdisk.po NEW.DISK src/main +gsplus \ No newline at end of file diff --git a/src/main.S b/src/main.S index 9fc1fe8..3adc25d 100644 --- a/src/main.S +++ b/src/main.S @@ -1,10 +1,39 @@ + REL + TYP $B3 + DSK main.l + + MX %00 ; enable 16-bit mode + +; Important locations + SPEAKER EQU $E0C030 +PRODOS16 EQU $E100A8 + + PHK + PLB + +* Beep code freezes +*beep LDA SPEAKER +* LDY #1000 +* LDX #1000 +*loop DEX +* BNE loop +* DEY +* BNE beep + + JSL PRODOS16 + ; This exit code is "device busy", why is it the only one + ; that works?! + DA $29 + ADRL QP + bcs ERROR + +ERROR BRK + +QP adrl $0000 + DA $00 + -PONGENTRY EQU $2000 - ORG PONGENTRY -beep LDA SPEAKER - RTL - END