mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2025-01-20 18:29:51 +00:00
Reorg files; focus on S16 artifact
This commit is contained in:
parent
7e6c4a0c91
commit
50a3f27a9a
BIN
assets/smw-bg-1-bw.png
Normal file
BIN
assets/smw-bg-1-bw.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
BIN
assets/smw-bg-1.png
Normal file
BIN
assets/smw-bg-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
@ -13,6 +13,5 @@ REM Cadius does not overwrite files, so clear the root folder first
|
||||
%CADIUS% CREATEFOLDER %IMAGE% %FOLDER%
|
||||
|
||||
REM Now copy files and folders as needed
|
||||
%CADIUS% ADDFILE %IMAGE% %FOLDER% test\\GTETestApp
|
||||
%CADIUS% ADDFILE %IMAGE% %FOLDER% src\\GTETool
|
||||
%CADIUS% ADDFILE %IMAGE% %FOLDER% src\\GTETestApp
|
||||
%CADIUS% ADDFILE %IMAGE% %FOLDER% emu\\test.pic
|
||||
|
@ -11,9 +11,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run build && build-image.bat %npm_package_config_cadius% && %npm_package_config_gsport%",
|
||||
"build": "npm run build:tool && npm run build:test",
|
||||
"build:test": "%npm_package_config_merlin32% -V %npm_package_config_macros% test\\App.s",
|
||||
"build:tool": "%npm_package_config_merlin32% -V %npm_package_config_macros% src\\Tool.s",
|
||||
"build": "%npm_package_config_merlin32% -V %npm_package_config_macros% src\\App.s",
|
||||
"build:watch": "watch \"npm run build\" src"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -86,7 +86,6 @@ SHR_SCB equ $E19D00
|
||||
|
||||
lda #0 ; Set the virtual Y-position
|
||||
jsr SetYPos
|
||||
brl Exit
|
||||
|
||||
; Load a picture and copy it into Bank $E1. Then turn on the screen.
|
||||
|
||||
@ -97,16 +96,51 @@ EvtLoop
|
||||
cmp #'q'
|
||||
bne :1
|
||||
brl Exit
|
||||
|
||||
:1 cmp #'l'
|
||||
bne :2
|
||||
brl DoLoadPic
|
||||
jsr DoLoadPic
|
||||
bra EvtLoop
|
||||
|
||||
:2 cmp #'m'
|
||||
bne :3
|
||||
brl DoMessage
|
||||
jsr DumpBanks
|
||||
bra EvtLoop
|
||||
|
||||
:3 cmp #'f' ; render a 'f'rame
|
||||
bne :4
|
||||
brl DoFrame
|
||||
:4 bra EvtLoop
|
||||
jsr DoFrame
|
||||
bra EvtLoop
|
||||
|
||||
:4 cmp #'h' ; Show the 'h'eads up display
|
||||
bne :5
|
||||
jsr DoHUP
|
||||
:5 bra EvtLoop
|
||||
|
||||
SecondsStr str 'SECONDS'
|
||||
TicksStr str 'TICKS'
|
||||
|
||||
; Print a bunch of messages on screen
|
||||
DoHUP
|
||||
lda #SecondsStr
|
||||
ldx #{160-12*4}
|
||||
ldy #$7777
|
||||
jsr DrawString
|
||||
lda OneSecondCounter ; Number of elapsed seconds
|
||||
ldx #{160-4*4} ; Render the word 4 charaters from right edge
|
||||
jsr DrawWord
|
||||
|
||||
lda #TicksStr
|
||||
ldx #{8*160+160-12*4}
|
||||
ldy #$7777
|
||||
jsr DrawString
|
||||
PushLong #0
|
||||
_GetTick
|
||||
pla
|
||||
plx
|
||||
ldx #{8*160+160-4*4}
|
||||
jsr DrawWord
|
||||
rts
|
||||
|
||||
|
||||
; Set up the code field and render it
|
||||
@ -232,87 +266,8 @@ stk_save lda #0000 ; load the stack
|
||||
|
||||
phk ; restore data bank
|
||||
plb
|
||||
jmp EvtLoop
|
||||
|
||||
HexToChar dfb '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
|
||||
; Convert a byte (Acc) into a string and store at (Y)
|
||||
ByteToString sep #$20
|
||||
pha
|
||||
|
||||
and #$F0
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
tax
|
||||
ldal HexToChar,x
|
||||
sta: $0000,y
|
||||
|
||||
pla
|
||||
and #$0F
|
||||
tax
|
||||
ldal HexToChar,x
|
||||
sta: $0001,y
|
||||
|
||||
rep #$20
|
||||
rts
|
||||
|
||||
; Pass in Acc = High, X = low
|
||||
Addr3ToString phx
|
||||
jsr ByteToString
|
||||
iny
|
||||
iny
|
||||
lda 1,s
|
||||
xba
|
||||
jsr ByteToString
|
||||
iny
|
||||
iny
|
||||
pla
|
||||
jsr ByteToString
|
||||
rts
|
||||
|
||||
|
||||
:count = 4
|
||||
:ptr = 6
|
||||
:addr = 10
|
||||
DoMessage stz :addr
|
||||
lda #13
|
||||
sta :count
|
||||
lda #BlitBuff
|
||||
sta :ptr
|
||||
lda #^BlitBuff
|
||||
sta :ptr+2
|
||||
|
||||
:loop lda [:ptr]
|
||||
tax
|
||||
ldy #2
|
||||
lda [:ptr],y
|
||||
|
||||
ldy #Hello+1
|
||||
jsr Addr3ToString
|
||||
|
||||
lda #Hello
|
||||
ldx :addr
|
||||
ldy #$7777
|
||||
jsr DrawString
|
||||
|
||||
lda :addr
|
||||
clc
|
||||
adc #160*8
|
||||
sta :addr
|
||||
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
|
||||
dec :count
|
||||
lda :count
|
||||
bne :loop
|
||||
|
||||
jmp EvtLoop
|
||||
|
||||
DoLoadPic
|
||||
lda BankLoad
|
||||
ldx #ImageName ; Load+Unpack Boot Picture
|
||||
@ -328,7 +283,7 @@ DoLoadPic
|
||||
dex
|
||||
dex
|
||||
bpl :copySHR
|
||||
jmp EvtLoop
|
||||
rts
|
||||
|
||||
Exit
|
||||
pea $0007 ; disable 1-second interrupts
|
||||
@ -349,7 +304,7 @@ Exit
|
||||
bcs Fatal
|
||||
Fatal brk $00
|
||||
|
||||
Hello str '000000'
|
||||
Hello str '000000' ; str adds leading length byte
|
||||
|
||||
****************************************
|
||||
* Fatal Error Handler *
|
||||
@ -617,6 +572,7 @@ qtRec adrl $0000
|
||||
da $00
|
||||
|
||||
put App.Init.s
|
||||
put App.Msg.s
|
||||
put font.s
|
||||
put blitter/Template.s
|
||||
put blitter/Tables.s
|
||||
@ -636,3 +592,30 @@ qtRec adrl $0000
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
124
src/App.Msg.s
Normal file
124
src/App.Msg.s
Normal file
@ -0,0 +1,124 @@
|
||||
HexToChar dfb '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
|
||||
|
||||
; Convert a byte (Acc) into a string and store at (Y)
|
||||
ByteToString and #$00FF
|
||||
sep #$20
|
||||
pha
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
and #$0F
|
||||
tax
|
||||
ldal HexToChar,x
|
||||
sta: $0000,y
|
||||
|
||||
pla
|
||||
and #$0F
|
||||
tax
|
||||
ldal HexToChar,x
|
||||
sta: $0001,y
|
||||
|
||||
rep #$20
|
||||
rts
|
||||
|
||||
; Convert a word (Acc) into a string and store at (Y)
|
||||
WordToString pha
|
||||
bra Addr2ToString
|
||||
|
||||
; Pass in Acc = High, X = low
|
||||
Addr3ToString phx
|
||||
jsr ByteToString
|
||||
iny
|
||||
iny
|
||||
lda 1,s
|
||||
Addr2ToString xba
|
||||
jsr ByteToString
|
||||
iny
|
||||
iny
|
||||
pla
|
||||
jsr ByteToString
|
||||
rts
|
||||
|
||||
; A=Value
|
||||
; X=Screen offset
|
||||
WordBuff dfb 4
|
||||
ds 4
|
||||
DrawWord phx ; Save register value
|
||||
ldy #WordBuff+1
|
||||
jsr WordToString
|
||||
plx
|
||||
lda #WordBuff
|
||||
ldy #$7777
|
||||
jsr DrawString
|
||||
rts
|
||||
|
||||
; Rendout out the bank addresses of all the blitter fields
|
||||
:count = tmp0
|
||||
:ptr = tmp1
|
||||
:addr = tmp3
|
||||
DumpBanks stz :addr
|
||||
lda #13
|
||||
sta :count
|
||||
lda #BlitBuff
|
||||
sta :ptr
|
||||
lda #^BlitBuff
|
||||
sta :ptr+2
|
||||
|
||||
:loop lda [:ptr]
|
||||
tax
|
||||
ldy #2
|
||||
lda [:ptr],y
|
||||
|
||||
ldy #Hello+1
|
||||
jsr Addr3ToString
|
||||
|
||||
lda #Hello
|
||||
ldx :addr
|
||||
ldy #$7777
|
||||
jsr DrawString
|
||||
|
||||
lda :addr
|
||||
clc
|
||||
adc #160*8
|
||||
sta :addr
|
||||
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
inc :ptr
|
||||
|
||||
dec :count
|
||||
lda :count
|
||||
bne :loop
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,10 @@
|
||||
TYP $B3 ; S16 file
|
||||
; IIgs Game Engine
|
||||
;
|
||||
DSK GTETestApp
|
||||
TYP $B3 ; S16 file
|
||||
XPL
|
||||
|
||||
; Segment #1 -- Main execution block
|
||||
|
||||
ASM App.Main.s
|
||||
SNA Main
|
||||
@ -26,5 +31,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
RTL
|
15
src/Tool.s
15
src/Tool.s
@ -1,15 +0,0 @@
|
||||
*-------------------------------------*
|
||||
* GTE Tool *
|
||||
*-------------------------------------*
|
||||
DSK GTETool
|
||||
TYP $BA
|
||||
XPL
|
||||
|
||||
*-------------------------------------*
|
||||
* Segment #1 *
|
||||
*-------------------------------------*
|
||||
|
||||
ASM GTE.Main.s
|
||||
ASM GTE.Line.s
|
||||
SNA Main
|
||||
|
@ -643,3 +643,4 @@ s_Template hex 00000000
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user