From 6dff921cde11b349fb839d5d76399c85743895a3 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 22 May 2023 11:43:47 -0700 Subject: [PATCH] Implemented block picking --- gui/dads/dads.tal | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/gui/dads/dads.tal b/gui/dads/dads.tal index eaa55c9..7e03964 100644 --- a/gui/dads/dads.tal +++ b/gui/dads/dads.tal @@ -48,9 +48,38 @@ BRK BRK +( +@|core ) + +@pick ( x y -- * ) + + ,&t STR2 + #0900 + &l + #00 OVR #0006 MUL2 ;game ADD2 [ LIT2 &t $2 ] is-at ?&found + INC GTHk ?&l + POP2 + #ffff + +JMP2r +&found ( bounds* -- block* ) + + NIP #00 SWP #0006 MUL2 ;game ADD2 + +JMP2r + +@is-at ( block* x y -- f ) + + OVR2 LDA2 STH2 + SWP2 INC2 INC2 LDA2 SUB2 + STHr LTH + SWP STHr LTH AND + +JMP2r + @move ( x y -- ) - phex #0a18 DEO + pick phex #0a18 DEO JMP2r @@ -75,6 +104,7 @@ JMP2r #00 OVR draw-block INC GTHk ?&l POP2 + JMP2r @draw-block ( id* -- )