From a9d4e30a0d7b022cf670dc7f42c3853bfd3c45b6 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 7 Jun 2023 18:44:34 -0700 Subject: [PATCH] (wireworld) Optimizing mouse-picking --- gui/wireworld/wireworld.tal | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/wireworld/wireworld.tal b/gui/wireworld/wireworld.tal index 9e3fc3a..c651a72 100644 --- a/gui/wireworld/wireworld.tal +++ b/gui/wireworld/wireworld.tal @@ -92,8 +92,8 @@ BRK &no-menu ( color ) .color LDZ .Mouse/state DEI #01 GTH #00 EQU MUL - ( cell* ) .Mouse/x DEI2 #02 SFT2 NIP .Mouse/y DEI2 #02 SFT2 NIP - get-addr STA + ( cell* ) .Mouse/x DEI2 #02 SFT2 .Mouse/y DEI2 #02 SFT2 #60 SFT2 ADD2 + ;get-addr/current LDA2 ADD2 STA redraw BRK @@ -224,6 +224,8 @@ JMP2r JMP2r +@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 )