From a72ac83b12d97bb5061526339d5c8131c3e302c7 Mon Sep 17 00:00:00 2001 From: Lucas Scharenbroich Date: Mon, 30 Aug 2021 20:31:02 -0500 Subject: [PATCH] Add skeleton for fatdog RPG demo --- demos/fatdog-rpg/App.s | 26 +++++ demos/fatdog-rpg/Main.s | 159 ++++++++++++++++++++++++++ demos/fatdog-rpg/_FileInformation.txt | 1 + demos/fatdog-rpg/build-image.bat | 16 +++ demos/fatdog-rpg/build-sprites.bat | 15 +++ demos/fatdog-rpg/package.json | 34 ++++++ 6 files changed, 251 insertions(+) create mode 100644 demos/fatdog-rpg/App.s create mode 100644 demos/fatdog-rpg/Main.s create mode 100644 demos/fatdog-rpg/_FileInformation.txt create mode 100644 demos/fatdog-rpg/build-image.bat create mode 100644 demos/fatdog-rpg/build-sprites.bat create mode 100644 demos/fatdog-rpg/package.json diff --git a/demos/fatdog-rpg/App.s b/demos/fatdog-rpg/App.s new file mode 100644 index 0000000..2bea6dc --- /dev/null +++ b/demos/fatdog-rpg/App.s @@ -0,0 +1,26 @@ +; Fatdog Demos + + TYP $B3 ; S16 file + DSK FatDogRPG + XPL + +; Segment #1 -- Main execution block + + ASM Main.s + +; Segment #2 -- Core GTE Code + + ASM ..\..\src\Core.s + +; Segment #3 -- GTE Rotation Table Data + + ASM ..\..\src\RotData.s + DS 0 + KND #$1001 ; Type and Attributes ($11=Static+Bank Relative,$01=Data) + ALI BANK + SNA RotData + + + + + diff --git a/demos/fatdog-rpg/Main.s b/demos/fatdog-rpg/Main.s new file mode 100644 index 0000000..f6f9bce --- /dev/null +++ b/demos/fatdog-rpg/Main.s @@ -0,0 +1,159 @@ + REL + DSK MAINSEG + + use EDS.GSOS.MACS.s + use Tool222.Macs.s + use ../../src/GTE.s + use ../../src/Defs.s + + + mx %00 + +; Space for player position variables +PlayerX equ AppSpace +PlayerY equ AppSpace+2 + +; Timer handle +TimerHndl dw $FFFF +IntroCounter ds 2 + + phk + plb + + jsl EngineStartUp + + stz PlayerX + stz PlayerY + + ldx #0 ; Use full-screen mode + jsl SetScreenMode + bcs *+5 + sta TimerHndl + + + stz IntroCounter + ldx #^IntroTask + lda #IntroTask + ldy #10 ; Play at 6 fps + jsl AddTimer + bcs *+5 + sta TimerHndl + +:loop + jsl DoTimers + jsl ReadControl + and #$007F ; Ignore the buttons for now + + cmp #'q' + beq :exit + +; Just keep drawing the player. The timer task will animate the position + + jsr DrawPlayer + bra :loop + +:moveup + lda PlayerY + dec + bpl *+5 + lda #0 + sta PlayerY + jmp DrawPlayer + +:movedown + lda PlayerY + inc + cmp #160 + bcc *+5 + lda #160 + sta PlayerY + jmp DrawPlayer + +:moveleft + lda PlayerX + dec + bpl *+5 + lda #0 + sta PlayerX + jmp DrawPlayer + +:moveright + lda PlayerX + inc + cmp #140 + bcc *+5 + lda #140 + sta PlayerX + jmp DrawPlayer + +; Clean up and do a GS/OS Quit +:exit + jsl EngineShutDown + +:quit + _QuitGS qtRec + bcs :fatal +:fatal brk $00 + +qtRec adrl $0000 + da $00 + +; Play a scripted animation +IntroTask + phb + phk + plb + + lda IntroCounter + and #$0007 + asl + asl + tax + + lda IntroPath,x ; X coordinate + sta PlayerX + lda IntroPath+2,x ; Y coordinate + sta PlayerY + + inc IntroCounter + plb + rtl + +IntroPath dw 0,0,10,0,20,0,20,5,20,7,35,15,50,17,80,20 + +DrawPlayer + rts +; lda PlayerY +; asl +; tax +; ldal ScreenAddr,x +; clc +; adc PlayerX +; tay +; jsl Spr_001 +; rts + +; Storage for tiles (not used in this demo) +tiledata ENT + +; Storage for sprites +;StackAddress ds 2 +; PUT sprites/Ships.s + + + + + + + + + + + + + + + + + + diff --git a/demos/fatdog-rpg/_FileInformation.txt b/demos/fatdog-rpg/_FileInformation.txt new file mode 100644 index 0000000..c8c24e4 --- /dev/null +++ b/demos/fatdog-rpg/_FileInformation.txt @@ -0,0 +1 @@ +FatDogRPG=Type(B3),AuxType(0000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) \ No newline at end of file diff --git a/demos/fatdog-rpg/build-image.bat b/demos/fatdog-rpg/build-image.bat new file mode 100644 index 0000000..b90ea5a --- /dev/null +++ b/demos/fatdog-rpg/build-image.bat @@ -0,0 +1,16 @@ +echo off + +REM Copy all of the assets into the ProDOS image for emulator testing +REM +REM Pass the path of the Cadius tool as the first argument (%1) + +set CADIUS="%1" +set IMAGE="..\\..\\emu\\Target.2mg" +set FOLDER="/GTEDEV/FatdogRPG" + +REM Cadius does not overwrite files, so clear the root folder first +%CADIUS% DELETEFOLDER %IMAGE% %FOLDER% +%CADIUS% CREATEFOLDER %IMAGE% %FOLDER% + +REM Now copy files and folders as needed +%CADIUS% ADDFILE %IMAGE% %FOLDER% .\\FatDogRPG diff --git a/demos/fatdog-rpg/build-sprites.bat b/demos/fatdog-rpg/build-sprites.bat new file mode 100644 index 0000000..9b67e7f --- /dev/null +++ b/demos/fatdog-rpg/build-sprites.bat @@ -0,0 +1,15 @@ +echo off + +set MRSPRITE="%1" + +mkdir build +copy assets\all-sprites.gif build\all-sprites.gif +%MRSPRITE% EXTRACT build\all-sprites.gif 0026FF FC0204 +%MRSPRITE% RENAME build\all-sprites_spr*.gif Ship +%MRSPRITE% CODE build\Ship_*.gif 0026FF 09162A 181425 293C5A 3A455B 5400D9 9C44FF A50989 FC0204 FF00AF FFCA00 FFFFFF +type build\Ship_*.txt > sprites\Ships.s + +REM Create a wallpaper and copy that for reference +%MRSPRITE% WALLPAPER build\Ship_*.gif 0026FF FC0204 +copy build\Ship_Wall.gif sprites\Ship_Wallpaper.gif +del /q build\* diff --git a/demos/fatdog-rpg/package.json b/demos/fatdog-rpg/package.json new file mode 100644 index 0000000..9067e2f --- /dev/null +++ b/demos/fatdog-rpg/package.json @@ -0,0 +1,34 @@ +{ + "name": "fatdog-rpg", + "version": "1.0.0", + "description": "Horizontal shoot-em-up", + "main": "index.js", + "config": { + "merlin32": "C:\\Programs\\IIgsXDev\\bin\\Merlin32-1.1.10.exe", + "cadius": "C:\\Programs\\IIgsXDev\\bin\\Cadius.exe", + "gsport": "C:\\Programs\\gsport\\gsport_0.31\\GSPort.exe", + "macros": "../../macros", + "crossrunner": "C:\\Programs\\Crossrunner\\Crossrunner.exe", + "mrsprite": "C:\\Programs\\IIgsXDev\\bin\\MrSprite.exe" + }, + "scripts": { + "build:app": "%npm_package_config_merlin32% -V %npm_package_config_macros% App.s", + "build:image": "build-image.bat %npm_package_config_cadius%", + "build:all": "npm run build:app && npm run build:image", + "build": "npm run build:app && npm run build:image", + "test": "npm run build && %npm_package_config_gsport%", + "debug": "%npm_package_config_crossrunner% GTEShooter -Source GTEShooter_S02_MAINSEG_Output.txt -Debug -CompatibilityLayer" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/lscharen/iigs-game-engine.git" + }, + "author": "Lucas Scharenbroich", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/lscharen/iigs-game-engine/issues" + }, + "homepage": "https://github.com/lscharen/iigs-game-engine#readme", + "devDependencies": { + } +} \ No newline at end of file