From ef2dfe53eb4027bd976a3350bfa1f32d92d26e0a Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 22 May 2023 10:31:19 -0700 Subject: [PATCH] Starting game state --- gui/dads/dads.tal | 115 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 104 insertions(+), 11 deletions(-) diff --git a/gui/dads/dads.tal b/gui/dads/dads.tal index 6bf57d5..a0a2ea4 100644 --- a/gui/dads/dads.tal +++ b/gui/dads/dads.tal @@ -25,16 +25,7 @@ ( vectors ) ;on-mouse .Mouse/vector DEO2 draw-border - #0008 .Screen/y DEO2 - #0008 .Screen/x DEO2 - draw-a - - #0008 .Screen/x DEO2 - #0038 .Screen/y DEO2 - draw-w - #0008 .Screen/x DEO2 - #0050 .Screen/y DEO2 - draw-d + draw-blocks BRK @@ -43,13 +34,64 @@ BRK @on-mouse ( -> ) -[ LIT2 00 -Mouse/state ] DEI NEQ #42 ADD ;cursor-icn update-cursor + [ LIT2 00 -Mouse/state ] DEI NEQ #42 ADD ;cursor-icn update-cursor + .Mouse/state DEI ?&on-touch BRK +&on-touch ( -> ) + + .Mouse/x DEI2 #0008 SUB2 NIP #18 DIV + .Mouse/y DEI2 #0008 SUB2 NIP #18 DIV + move + #00 .Mouse/state DEO + +BRK + +@move ( x y -- ) + + phex #0a18 DEO + +JMP2r + +@game ( size, pos ) [ + &a 0202 0000 =draw-a + &b 0201 0200 =draw-b + &v 0201 0201 =draw-v + &w 0101 0002 =draw-w + &x 0101 0102 =draw-x + &d 0102 0003 =draw-d + &y 0102 0103 =draw-y + &z 0201 0203 =draw-z + &c 0201 0204 =draw-c ] + ( @|drawing ) +@draw-blocks ( -- ) + + #0900 + &l + #00 OVR draw-block + INC GTHk ?&l + POP2 +JMP2r + +@draw-block ( id* -- ) + + #0006 MUL2 ;game ADD2 + INC2 INC2 LDA2k to-screen + INC2 INC2 LDA2 JSR2 + +JMP2r + +@to-screen ( x y -- ) + + #00 SWP #03 MUL #0008 ADD2 .Screen/y DEO2 + #00 SWP #03 MUL #0008 ADD2 .Screen/x DEO2 + +JMP2r + @draw-a ( -- ) #56 .Screen/auto DEO @@ -58,6 +100,53 @@ BRK JMP2r +@draw-c ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/c .Screen/addr DEO2 + #03 draw-times + +JMP2r + +@draw-z ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/z .Screen/addr DEO2 + #03 draw-times + +JMP2r + +@draw-y ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/y .Screen/addr DEO2 + #03 draw-times + +JMP2r +@draw-x ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/x .Screen/addr DEO2 + #03 draw-times + +JMP2r + +@draw-v ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/v .Screen/addr DEO2 + #03 draw-times + +JMP2r + +@draw-b ( -- ) + + #56 .Screen/auto DEO + ;blocks-chr/b .Screen/addr DEO2 + #03 draw-times + +JMP2r + @draw-d ( -- ) #26 .Screen/auto DEO @@ -136,6 +225,10 @@ JMP2r .Screen/sprite DEO JMP2r +( +@|stdlib ) + +@phex ( short* -- ) SWP phex/b &b DUP #04 SFT phex/c &c #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO JMP2r ( @|assets )