update file device and fix padding lengths
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmGn1WMACgkQO3+8IhRO Y5j7+w//fWws2lKMTvod7vd8uLVDTvwnoJ+uXgzxEqEgk3DHGiTGcaXbJgVjHtIt 7nrtpCI81eEYlHjehhuU9S0JwkpQ7l+d6yi/q2L/5YeLnJDbUp/37Aoz4epRVuxC msVsLytb16oiYmcB9Qwkek/GHtEF7dwgbVfOyZpMcgb/7Lo5I24jU62IEZghaWqV qG8xbsam3ljxILV/DKsy1LT/NQS4Q2Uwo5jetPdKu3+aZFEFBtJi2lTLn+tGNC3f 7INLJERidaNJoe1xxKQmH7TjeXL84++KMuIxk9kPpjBZWd2RkZIdRzVJw2GlpmF2 xEOSeQGIbs5Q12q+kKtJg4LTtkOd9qt6q/THwRCKNsLww0CEjcHJ2aqLznAaXiSM BMcfAS5tm428FiqJbvdHTyxqx+vhlUUWH4+1bthHwEf9AgF14rwkYihVyTgo8dho l9JH7xJhJiHcF1PbGOsQwLVHFsNaIZNVvTG48JXLuTdCl/xLdCecLhlcM0CsDJ8T hhGuNl6IvllwX2j3TiKda+PK7xKxnRFExalI3TN/9RPm8rsnh59wZfgebpFkXGb7 YYSNCePjUFqaWWPQLPtdAO/rrFiRLaUNPv3GGPWu3+O+YcqfFFEAILqVu3cpVNck WPMdn79DINd9eYXebqpITAIIrgTIpNTWw6tPsocIgHTymw2Ir54= =1FMS -----END PGP SIGNATURE-----
2 files changed,
218 insertions(+),
227 deletions(-)
M
uxn-client/xrxs-local.tal
→
uxn-client/xrxs-local.tal
@@ -29,7 +29,7 @@ |50 @Audio2 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ] |b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ] ( variables )@@ -71,7 +71,6 @@ #02cb .System/b DEO2
#0200 .Screen/width DEO2 #0110 .Screen/height DEO2 - ( initialize state ) #00 .ticker STZ #00 .state STZ@@ -82,7 +81,7 @@ GET-USABLE-HEIGHT .list-height STZ
;carts-file .File/name DEO2 #2000 .File/length DEO2 - ;list-buf .File/load DEO2 + ;list-buf .File/read DEO2 .File/success DEI2 .list-len STZ2 CENTER-X .logo-coords/x STZ2@@ -182,6 +181,10 @@ ;draw-pointer JSR2
POP BRK &state6 + [ ;load-cmd + CENTER-X OVR2 ;strlen JSR2 #20 SFT2 SUB2 + CENTER-Y #0004 SUB + #02 ] ;draw-string JSR2 POP BRK@@ -832,117 +835,111 @@
@load-cart ( -> ) .state LDZ INC .state STZ + ;cart ;load-rom JSR2 RTN @load-rom ( filename* -- ) -( - Attempts to load the ROM from filename* and executes it. If the file exists - and has non-zero length, this function does not return, because the new ROM - is executing in its place. - - The screen and both stacks are cleared and all the device vectors are - written to zero as a convenience. All other device bytes are left - untouched, so they could introduce a device state to the next ROM that - it's not expecting. -) - - .File/name DEO2 - #0000 .File/offset-hs DEO2 - #0000 .File/offset-ls DEO2 - - ( return if file can't be found, or zero length ) - #0001 .File/length DEO2 - ;&tmp .File/load DEO2 - .File/success DEI2 ORA JMP JMP2r - - ( clear wst ) - #ab - &wst-loop - POP - .System/wst STH DEIr STHr ,&wst-loop JCN - - ( clear rst ) - LITr ab - &rst-loop - POPr - .System/rst DEI ,&rst-loop JCN - - ( clear screen ) - #01 .Screen/auto DEO - #0000 .Screen/y DEO2 - .Screen/width DEI2 #0007 ADD2 #03 SFT2 #ffff MUL2 STH2 - &screen-yloop - #0000 .Screen/x DEO2 - STH2kr - &screen-xloop-bg - #00 .Screen/sprite DEO - INC2 - ORAk ,&screen-xloop-bg JCN - POP2 - #0000 .Screen/x DEO2 - STH2kr - &screen-xloop-fg - #40 .Screen/sprite DEO - INC2 - ORAk ,&screen-xloop-fg JCN - POP2 - .Screen/y DEI2 #0008 ADD2 - DUP2 .Screen/y DEO2 - .Screen/height DEI2 LTH2 ,&screen-yloop JCN - POP2r - #00 .Screen/auto DEO - - ( reset device vectors ) - LIT2r 0000 #00 - &device-vector-loop - DUP2r STHk DEO2r - #10 ADD - DUP ,&device-vector-loop JCN - POP POP2r - - ( copy the zero-page-loader into f0-ff ) - ;&zero-page-loader LITr f0 - ©-loop - LDAk STHkr STZ - INC2 INCr - STHkr ,©-loop JCN - POP2 ( leave 00 on return stack ) - - ( prepare the stack for the zero-page-loader ) - ( the more we prepare here in advance, the less we'll have to overwrite ) - STHkr #00fe ( arguments for STZ2 at ff ) - STHkr ( argument for JMP at fe (carry on) ) - DUPk #fcfe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #fafe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f8fe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f6fe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f401 ( arguments for STZ2 at fd, plus an extra 01 ) - STHkr ( first argument for ADD2 ) - .File/success ( argument for DEI2 ) - #0100 .File/load ( arguments for DEO2 ) - #ff00 .File/length DEO2 - #00f0 JMP2 - - &zero-page-loader - ( f0 ) DEO2 - ( f1 ) DEI2 - ( f2 ) ADD2 - ( f3 ) &loop DUPr - ( f4 ) STH2k - ( f5 ) STAr - ( f6 ) INC2 - ( f7 ) NEQ2k - ( f8 ) ,&loop - ( f9 ) - ( fa ) JCN - ( fb ) POPr - ( fc ) POP2 - ( fd ) STZ2 ( deletes f4-fd through looping ) - ( fe ) JMP - ( ff ) STZ2 ( deletes fe-ff ) - - &tmp $1 + ( + Attempts to load the ROM from filename* and executes it. If the file exists + and has non-zero length, this function does not return, because the new ROM + is executing in its place. + + The screen and both stacks are cleared and all the device vectors are + written to zero as a convenience. All other device bytes are left + untouched, so they could introduce a device state to the next ROM that + it's not expecting. + ) + + .File/name DEO2 + + ( clear wst ) + #ab + &wst-loop + POP + .System/wst STH DEIr STHr ,&wst-loop JCN + + ( clear rst ) + LITr ab + &rst-loop + POPr + .System/rst DEI ,&rst-loop JCN + + ( clear screen ) + #01 .Screen/auto DEO + #0000 .Screen/y DEO2 + .Screen/width DEI2 #0007 ADD2 #03 SFT2 #ffff MUL2 STH2 + &screen-yloop + #0000 .Screen/x DEO2 + STH2kr + &screen-xloop-bg + #00 .Screen/sprite DEO + INC2 + ORAk ,&screen-xloop-bg JCN + POP2 + #0000 .Screen/x DEO2 + STH2kr + &screen-xloop-fg + #40 .Screen/sprite DEO + INC2 + ORAk ,&screen-xloop-fg JCN + POP2 + .Screen/y DEI2 #0008 ADD2 + DUP2 .Screen/y DEO2 + .Screen/height DEI2 LTH2 ,&screen-yloop JCN + POP2r + #00 .Screen/auto DEO + + ( reset device vectors ) + LIT2r 0000 #00 + &device-vector-loop + DUP2r STHk DEO2r + #10 ADD + DUP ,&device-vector-loop JCN + POP POP2r + + ( copy the zero-page-loader into f0-ff ) + ;&zero-page-loader LITr f0 + ©-loop + LDAk STHkr STZ + INC2 INCr + STHkr ,©-loop JCN + POP2 ( leave 00 on return stack ) + + ( prepare the stack for the zero-page-loader ) + ( the more we prepare here in advance, the less we'll have to overwrite ) + STHkr #00fe ( arguments for STZ2 at ff ) + STHkr ( argument for JMP at fe (carry on) ) + DUPk #fcfe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #fafe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f8fe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f6fe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f401 ( arguments for STZ2 at fd, plus an extra 01 ) + STHkr ( first argument for ADD2 ) + .File/success ( argument for DEI2 ) + #0100 .File/read ( arguments for DEO2 ) + #ff00 .File/length DEO2 + #00f0 JMP2 + + &zero-page-loader + ( f0 ) DEO2 + ( f1 ) DEI2 + ( f2 ) ADD2 + ( f3 ) &loop DUPr + ( f4 ) STH2k + ( f5 ) STAr + ( f6 ) INC2 + ( f7 ) NEQ2k + ( f8 ) ,&loop + ( f9 ) + ( fa ) JCN + ( fb ) POPr + ( fc ) POP2 + ( fd ) STZ2 ( deletes f4-fd through looping ) + ( fe ) JMP + ( ff ) STZ2 ( deletes fe-ff ) + + &tmp $1 @capture-input ( -> )@@ -956,14 +953,15 @@
( constants ) @carts-file "index 00 -@title-loadCart "Select 20 "A 20 "ROM 00 -@title-confirmCart "Load 20 "This 20 "ROM? 00 +@title-loadCart "Select 20 "A 20 "Cartridge 00 +@title-confirmCart "Load 20 "This 20 "Cartridge? 00 -@cart $32 +@load-cmd "load 20 +@cart $20 @dot-rom ".rom 00 ( sprites ) -@blank $16 +@blank $10 @uxn-logo [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 1b 3f 1e 18 18 18 00 00 00 00 00 00 00 00 00 e0 f0 38 1c 0c 0c 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
M
uxn-client/xrxs.tal
→
uxn-client/xrxs.tal
@@ -29,7 +29,7 @@ |50 @Audio2 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ]
|60 @Audio3 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] -|a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ] +|a0 @File [ &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2 ] |b0 @DateTime [ &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1 ] ( variables )@@ -81,7 +81,7 @@ GET-USABLE-HEIGHT .list-height STZ
;carts-file .File/name DEO2 #2000 .File/length DEO2 - ;list-buf .File/load DEO2 + ;list-buf .File/read DEO2 .File/success DEI2 .list-len STZ2 CENTER-X .logo-coords/x STZ2@@ -825,121 +825,114 @@ .state LDZ INC .state STZ
( send it! ) #0020 .File/length DEO2 - #0001 .File/offset-ls DEO2 + #01 .File/append DEO2 ;ctl-file .File/name DEO2 - ;load-cmd .File/save DEO2 + ;load-cmd .File/write DEO2 ;slot-file ;load-rom JSR2 RTN @load-rom ( filename* -- ) -( - Attempts to load the ROM from filename* and executes it. If the file exists - and has non-zero length, this function does not return, because the new ROM - is executing in its place. - - The screen and both stacks are cleared and all the device vectors are - written to zero as a convenience. All other device bytes are left - untouched, so they could introduce a device state to the next ROM that - it's not expecting. -) - - .File/name DEO2 - #0000 .File/offset-hs DEO2 - #0000 .File/offset-ls DEO2 - - ( return if file can't be found, or zero length ) - #0001 .File/length DEO2 - ;&tmp .File/load DEO2 - .File/success DEI2 ORA JMP JMP2r - - ( clear wst ) - #ab - &wst-loop - POP - .System/wst STH DEIr STHr ,&wst-loop JCN - - ( clear rst ) - LITr ab - &rst-loop - POPr - .System/rst DEI ,&rst-loop JCN - - ( clear screen ) - #01 .Screen/auto DEO - #0000 .Screen/y DEO2 - .Screen/width DEI2 #0007 ADD2 #03 SFT2 #ffff MUL2 STH2 - &screen-yloop - #0000 .Screen/x DEO2 - STH2kr - &screen-xloop-bg - #00 .Screen/sprite DEO - INC2 - ORAk ,&screen-xloop-bg JCN - POP2 - #0000 .Screen/x DEO2 - STH2kr - &screen-xloop-fg - #40 .Screen/sprite DEO - INC2 - ORAk ,&screen-xloop-fg JCN - POP2 - .Screen/y DEI2 #0008 ADD2 - DUP2 .Screen/y DEO2 - .Screen/height DEI2 LTH2 ,&screen-yloop JCN - POP2r - #00 .Screen/auto DEO - - ( reset device vectors ) - LIT2r 0000 #00 - &device-vector-loop - DUP2r STHk DEO2r - #10 ADD - DUP ,&device-vector-loop JCN - POP POP2r - - ( copy the zero-page-loader into f0-ff ) - ;&zero-page-loader LITr f0 - ©-loop - LDAk STHkr STZ - INC2 INCr - STHkr ,©-loop JCN - POP2 ( leave 00 on return stack ) - - ( prepare the stack for the zero-page-loader ) - ( the more we prepare here in advance, the less we'll have to overwrite ) - STHkr #00fe ( arguments for STZ2 at ff ) - STHkr ( argument for JMP at fe (carry on) ) - DUPk #fcfe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #fafe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f8fe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f6fe ( arguments for STZ2 at fd and JMP (repeat) ) - OVR2 #f401 ( arguments for STZ2 at fd, plus an extra 01 ) - STHkr ( first argument for ADD2 ) - .File/success ( argument for DEI2 ) - #0100 .File/load ( arguments for DEO2 ) - #ff00 .File/length DEO2 - #00f0 JMP2 - - &zero-page-loader - ( f0 ) DEO2 - ( f1 ) DEI2 - ( f2 ) ADD2 - ( f3 ) &loop DUPr - ( f4 ) STH2k - ( f5 ) STAr - ( f6 ) INC2 - ( f7 ) NEQ2k - ( f8 ) ,&loop - ( f9 ) - ( fa ) JCN - ( fb ) POPr - ( fc ) POP2 - ( fd ) STZ2 ( deletes f4-fd through looping ) - ( fe ) JMP - ( ff ) STZ2 ( deletes fe-ff ) - - &tmp $1 + ( + Attempts to load the ROM from filename* and executes it. If the file exists + and has non-zero length, this function does not return, because the new ROM + is executing in its place. + + The screen and both stacks are cleared and all the device vectors are + written to zero as a convenience. All other device bytes are left + untouched, so they could introduce a device state to the next ROM that + it's not expecting. + ) + + .File/name DEO2 + + ( clear wst ) + #ab + &wst-loop + POP + .System/wst STH DEIr STHr ,&wst-loop JCN + + ( clear rst ) + LITr ab + &rst-loop + POPr + .System/rst DEI ,&rst-loop JCN + + ( clear screen ) + #01 .Screen/auto DEO + #0000 .Screen/y DEO2 + .Screen/width DEI2 #0007 ADD2 #03 SFT2 #ffff MUL2 STH2 + &screen-yloop + #0000 .Screen/x DEO2 + STH2kr + &screen-xloop-bg + #00 .Screen/sprite DEO + INC2 + ORAk ,&screen-xloop-bg JCN + POP2 + #0000 .Screen/x DEO2 + STH2kr + &screen-xloop-fg + #40 .Screen/sprite DEO + INC2 + ORAk ,&screen-xloop-fg JCN + POP2 + .Screen/y DEI2 #0008 ADD2 + DUP2 .Screen/y DEO2 + .Screen/height DEI2 LTH2 ,&screen-yloop JCN + POP2r + #00 .Screen/auto DEO + + ( reset device vectors ) + LIT2r 0000 #00 + &device-vector-loop + DUP2r STHk DEO2r + #10 ADD + DUP ,&device-vector-loop JCN + POP POP2r + + ( copy the zero-page-loader into f0-ff ) + ;&zero-page-loader LITr f0 + ©-loop + LDAk STHkr STZ + INC2 INCr + STHkr ,©-loop JCN + POP2 ( leave 00 on return stack ) + + ( prepare the stack for the zero-page-loader ) + ( the more we prepare here in advance, the less we'll have to overwrite ) + STHkr #00fe ( arguments for STZ2 at ff ) + STHkr ( argument for JMP at fe (carry on) ) + DUPk #fcfe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #fafe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f8fe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f6fe ( arguments for STZ2 at fd and JMP (repeat) ) + OVR2 #f401 ( arguments for STZ2 at fd, plus an extra 01 ) + STHkr ( first argument for ADD2 ) + .File/success ( argument for DEI2 ) + #0100 .File/read ( arguments for DEO2 ) + #ff00 .File/length DEO2 + #00f0 JMP2 + + &zero-page-loader + ( f0 ) DEO2 + ( f1 ) DEI2 + ( f2 ) ADD2 + ( f3 ) &loop DUPr + ( f4 ) STH2k + ( f5 ) STAr + ( f6 ) INC2 + ( f7 ) NEQ2k + ( f8 ) ,&loop + ( f9 ) + ( fa ) JCN + ( fb ) POPr + ( fc ) POP2 + ( fd ) STZ2 ( deletes f4-fd through looping ) + ( fe ) JMP + ( ff ) STZ2 ( deletes fe-ff ) + + &tmp $1 @capture-input ( -> )@@ -959,10 +952,10 @@ @title-loadCart "Select 20 "A 20 "Cartridge 00
@title-confirmCart "Load 20 "This 20 "Cartridge? 00 @load-cmd "load 20 -@cart $32 +@cart $20 ( sprites ) -@blank $16 +@blank $10 @uxn-logo [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 1b 3f 1e 18 18 18 00 00 00 00 00 00 00 00 00 e0 f0 38 1c 0c 0c 0c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00