summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Stevens <nilix@nilfm.cc>2022-02-18 00:06:00 -0700
committerDerek Stevens <nilix@nilfm.cc>2022-02-18 00:06:00 -0700
commit7caa246483409cc81c22f969a8803ed90d69ecc7 (patch)
treeb05b94d00ff07f0522a15116b0d5e04610b76e7e
parentc04c464cba18504079b5086cf01d6d26d03d2c1e (diff)
implement 1p/2p menu
-rw-r--r--soulgrind.tal52
1 files changed, 48 insertions, 4 deletions
diff --git a/soulgrind.tal b/soulgrind.tal
index c0a7028..7faff10 100644
--- a/soulgrind.tal
+++ b/soulgrind.tal
@@ -108,14 +108,15 @@
;titlescreen .File/read DEO2
- ;fp-xrxs-version .File/name DEO2
- #00f0 .File/length DEO2
+ ;file-xrxs-version .File/name DEO2
+ #0010 .File/length DEO2
;buffer .File/read DEO2
.File/success DEI2 #0000 NEQ2 .xrxs STZ
- ;main-loop .Screen/vector DEO2
+ ;main-loop .Screen/vector DEO2
+ ;key-listen-press-start .Controller/vector DEO2
BRK
@clear-screen ( -> )
@@ -139,6 +140,26 @@ RTN
@key-listen-mode-select ( -> )
+ .Controller/button DEI
+ DUP #c0 AND #00 EQU ,&no-left-right JCN
+
+ .state LDZ #01 NEQ ,&no-1p JCN
+ #02 .state STZ
+ ,&no-left-right JMP
+ &no-1p
+ #01 .state STZ
+
+ &no-left-right
+
+ DUP #09 AND #00 EQU ,&no-confirm JCN
+
+ .state LDZ #01 NEQ ,&no-1p-go JCN
+ #40 .state STZ
+ ,&no-confirm JMP
+ &no-1p-go
+ #10 .state STZ
+ &no-confirm
+ POP
BRK
@key-listen-1p-game ( -> )
@@ -149,11 +170,13 @@ BRK
.Controller/button DEI
#08 NEQ ,&no-press-start JCN
+
( if xrxs, go to game mode selection )
.xrxs LDZ #00 EQU ,&no-xrxs JCN
#01 .state STZ
;key-listen-mode-select .Controller/vector DEO2
BRK
+
( if no xrxs, just proceed to single player game )
&no-xrxs
#40 .state STZ
@@ -218,7 +241,28 @@ RTN
( display Single Player/Multiplayer )
+ [ ;txt-1p
+ .center/x LDZ2 OVR2 ;strlen JSR2 #30 SFT2 #0010 ADD2 SUB2
+ .Screen/height DEI2 #0010 SUB2
+ #01 ] ;draw-string JSR2
+
+ [ ;txt-2p
+ .center/x LDZ2 #0010 ADD2
+ .Screen/height DEI2 #0010 SUB2
+ #01 ] ;draw-string JSR2
+
( display selection arrow )
+
+ ;arrow .Screen/addr DEO2
+ .Screen/height DEI2 #0010 SUB2 .Screen/y DEO2
+ .state LDZ #01 NEQ ,&no-1p-arrow JCN
+ .center/x LDZ2 ;txt-1p ;strlen JSR2 #30 SFT2 #0018 ADD2 SUB2 .Screen/x DEO2
+ ,&draw-arrow JMP
+ &no-1p-arrow
+ .center/x LDZ2 #0008 ADD2 .Screen/x DEO2
+ &draw-arrow
+
+ #01 .Screen/sprite DEO
RTN
@@ -292,7 +336,7 @@ RTN
RTN
-@blank $10
+@blank [ 0000 0000 0000 0000 ]
@buffer $10