[PATCH uxn] (launcher.tal) Add expanded rom launching
Export this patch
diff --git a/projects/software/launcher.tal b/projects/software/launcher.tal
index 17d2807..e8a1ae2 100644
--- a/projects/software/launcher.tal
+++ b/projects/software/launcher.tal
@@ -1,6 +1,6 @@
( launcher )
-|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1
+|00 @System &vector $2 &expansion $2 &wst $1 &rst $1 &metadata $2 &r $2 &g $2 &b $2 &debug $1 &halt $1
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|30 @Audio0 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
@@ -232,31 +232,46 @@ JMP2r
( release inputs )
#0000 .Controller/button DEO2
- #00 .Mouse/state DEO
+ LIT [ 00 -Mouse/state ] DEO
- ;get-entry JSR2 LDA2k LIT2 "?? NEQ2 ?&size-ok
- POP2 ;error-txt !pstr
- &size-ok
+ get-entry LDA2k ,&size-short STR2
#0005 ADD2
- DUP2 ;check-rom JSR2 ,&valid JCN
+ DUP2 check-rom ?&valid
( check if tal file )
- DUP2 ;scap JSR2 #0004 SUB2 ;&tal-ext ;scmp JSR2 #01 NEQ ,&no-tal JCN
+ DUP2 scap #0004 SUB2 ;&tal-ext scmp #01 NEQ ?&no-tal
( assemble tal file )
- DUP2 ;&output-path ;scpy JSR2
- ;&rom-ext ;&output-path ;scat JSR2
- ;&output-path ;asma-assemble-file JSR2
- ;load-dir JSR2
- ;redraw JSR2
+ DUP2 ;&output-path scpy
+ ;&rom-ext ;&output-path scat
+ ;&output-path asma-assemble-file
+ load-dir
+ redraw
JMP2r
&no-tal
POP2 JMP2r
&valid
- ;load-rom JSR2
+ LIT2 [ &size-short $2 ] LIT2 "?? NEQ2 ?{
+ DUP2 .File/name DEO2
+ #7f00 .File/length DEO2 ;expansion-buffer .File/read DEO2
+ #8000 .File/length DEO2 ;expansion-buffer .File/read DEO2
+ &w
+ copy-half-bank
+ .File/success DEI2 #8000 NEQ2 ?&done-expansion
+ copy-half-bank
+ ,&bank LDR2 INC2 ,&bank STR2
+ .File/success DEI2 #8000 EQU2 ?&w }
+ &done-expansion
+ load-rom
JMP2r
&tal-ext ".tal $1
&rom-ext ".rom $1
&output-path $20
+ &cmd [ 01 8000 0000 =expansion-buffer &bank 0001 &addr 0000 ]
+
+@copy-half-bank ( -- )
+ ;expansion-buffer .File/read DEO2
+ ;run-file/cmd .System/expansion DEO2
+ ,run-file/addr LDR #80 EOR ,run-file/addr STR JMP2r
@redraw ( -- )
@@ -523,7 +538,11 @@ JMP2r
~projects/library/asma.tal
+
@asma-heap
|e000 &end @asma-read-buffer
|f800 &end @asma-write-buffer
|ffff &end
+
+|8000
+@expansion-buffer
uxn/patches/.build.yml: SUCCESS in 42s
[(launcher.tal) Add expanded rom launching][0] from [Dave VanEe][1]
[0]: https://lists.sr.ht/~rabbits/public-inbox/patches/47754
[1]: mailto:dave.vanee@protonmail.com
✓ #1115067 SUCCESS uxn/patches/.build.yml https://builds.sr.ht/~rabbits/job/1115067