From d05426e2eaf14d6fd26d32519e6521913675ead4 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 11 Jun 2023 20:36:51 -0700 Subject: [PATCH] (inle.tal) Added project --- gui/inle/build.sh | 25 ++ gui/inle/font.tal | 49 +++ gui/inle/hlaoroo.chr | Bin 0 -> 4096 bytes gui/inle/inle.tal | 910 +++++++++++++++++++++++++++++++++++++++++++ gui/inle/names.tal | 11 + gui/inle/sprites.chr | Bin 0 -> 4096 bytes 6 files changed, 995 insertions(+) create mode 100755 gui/inle/build.sh create mode 100644 gui/inle/font.tal create mode 100644 gui/inle/hlaoroo.chr create mode 100644 gui/inle/inle.tal create mode 100644 gui/inle/names.tal create mode 100644 gui/inle/sprites.chr diff --git a/gui/inle/build.sh b/gui/inle/build.sh new file mode 100755 index 0000000..3ed6542 --- /dev/null +++ b/gui/inle/build.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +ID="inle" +ASM="uxnasm" +EMU="uxnemu" +LIN="uxncli $HOME/roms/uxnlin.rom" +SRC="${ID}.tal" +DST="${ID}.rom" +CPY="$HOME/roms" +ARG="" + +if [[ "$*" == *"--lint"* ]] +then + $LIN $SRC +fi + +$ASM $SRC $DST + +if [[ "$*" == *"--save"* ]] +then + cp $DST $CPY +fi + +$EMU $DST $ARG + diff --git a/gui/inle/font.tal b/gui/inle/font.tal new file mode 100644 index 0000000..6a0b8ea --- /dev/null +++ b/gui/inle/font.tal @@ -0,0 +1,49 @@ +@font ( block8 ) + 0000 0000 0000 0000 1010 1010 1000 1000 + 2828 0000 0000 0000 44fe 4444 44fe 4400 + 107e 807c 02fc 1000 0044 0810 2044 0000 + 7884 8864 9a84 7a00 1020 0000 0000 0000 + 2040 4040 4040 2000 0804 0404 0404 0800 + 0044 2810 2844 0000 0010 107c 1010 0000 + 0000 0000 0010 2000 0000 007c 0000 0000 + 0000 0000 0000 1000 0204 0810 2040 8000 + 7c82 8282 8282 7c00 3010 1010 1010 3800 + 7c82 027c 8080 fe00 7c82 021c 0282 7c00 + 2242 82fe 0202 0200 fe80 807c 0282 7c00 + 7c82 80fc 8282 7c00 fe82 0408 0810 1000 + 7c82 827c 8282 7c00 7c82 827e 0202 0200 + 0000 1000 1000 0000 0000 1000 1010 2000 + 0008 1020 1008 0000 0000 7c00 7c00 0000 + 0010 0804 0810 0000 7c82 820c 1000 1000 + 7c82 92aa aa92 6400 7c82 82fe 8282 8200 + fc82 82fc 8282 fc00 7c82 8080 8082 7c00 + fc82 8282 8282 fc00 fe80 80f0 8080 fe00 + fe80 80f0 8080 8000 7c82 808e 8282 7c00 + 8282 82fe 8282 8200 3810 1010 1010 3800 + 0602 0202 0282 7c00 8284 88f0 8884 8200 + 8080 8080 8080 fe00 c6aa 9292 9292 9200 + c2a2 a292 8a8a 8600 7c82 8282 8282 7c00 + fc82 82fc 8080 8000 7c82 8282 8a84 7a00 + fc82 82fc 8282 8200 7c82 807c 0282 7c00 + fe10 1010 1010 1000 8282 8282 8286 7a00 + 8282 8282 4428 1000 9292 9292 92aa c600 + 8244 2810 2844 8200 8282 4428 1010 1000 + fe02 0c10 6080 fe00 6040 4040 4040 6000 + 8040 2010 0804 0200 0c04 0404 0404 0c00 + 1028 0000 0000 0000 0000 0000 0000 fe00 + 1008 0000 0000 0000 0000 7c02 7e82 7e00 + 0000 fc82 fc82 fc00 0000 7c82 8082 7c00 + 0000 0202 7e82 7e00 0000 7c82 fc80 7e00 + 0000 7c82 e080 8000 0000 7c82 7e02 fc00 + 0000 8080 fc82 8200 0000 1000 1010 1000 + 0000 fe02 0282 7c00 0000 8284 f884 8200 + 0000 8080 8080 7e00 0000 6c92 9292 9200 + 0000 bcc2 8282 8200 0000 7c82 8282 7c00 + 0000 fc82 fc80 8000 0000 7c82 7e02 0200 + 0000 bcc2 8080 8000 0000 7e80 7c02 fc00 + 0000 fe10 1010 1000 0000 8282 8282 7c00 + 0000 8282 4428 1000 0000 9292 9292 6c00 + 0000 8244 3844 8200 0000 8282 7e02 7c00 + 0000 fe02 7c80 fe00 2040 4080 4040 2000 + 1010 1010 1010 1000 0804 0402 0404 0800 + 0000 0032 4c00 0000 0000 0000 0000 0000 diff --git a/gui/inle/hlaoroo.chr b/gui/inle/hlaoroo.chr new file mode 100644 index 0000000000000000000000000000000000000000..df7b8cce4d326c7628e0065fd369d76bb7729dcb GIT binary patch literal 4096 zcmeHIzi-n(6n>6FT_D62VrWHGdtj(KK>vaETnPy_7*a8|e?pNM!jHs8AjH(J9V^(F zI>SJiGBYuOEV?iSS3;^0mXGf}+p$B`7PcbgEcxAc-}`m%{LWNsHm9Z>)o4&Q+%Vjv zB<=NbOswE2swgl|LxuXh@N;vyfhYD91R4G-|5HxYKRYP>6V;I+oQ*^P&Lh-J({xtJ zFgTt`nq1HOv|!ht(_g)(PrDCJy+-kOw;C=5f-1BS$#h)1r7nMvK_Mi3O-C+Gqf!AMV zGmmJRXE-2@C(TxI?qAZu+d*rnpXQ_BTe&?^V`0HQhvoUzRi%BZ*QgiX-9wYqdtns9 z{rnX%np^P|CR=gb+JlVZIEk3>uG=ig8*DUXLT+n`w?yuP>(^L%uhy4De!cgICDCl= zlG;xME-z+yD^3gyoE?jND6K4>vL?h&98eWM)!MIOZX8=Z9O?txsD(&Df?43P{_Veh)~|g3fAZ44RX%IaWBUj8-EQ@MkPD=8e;j=LaG-q$eSkus zY2{p#DClJ$^8Ih&Au4h#-~JKBBYd|D52d}YV`z-nL!;#7yiR(VW}}H)2DdCR z%k9kwSI12LM}UIxRR!h?1;d!i_*&M2{r+rQ_~{qo@NB>Q_z(rI){hJP5A{3S+dDNo q{Pk*le?y9H6sPGvW ) + + ( theme ) + #0a6f .System/r DEO2 + #05cf .System/g DEO2 + #0caf .System/b DEO2 + ( vectors ) + ;on-control .Controller/vector DEO2 + ;on-frame .Screen/vector DEO2 + ( random ) + ;prng-init JSR2 + ( get stage ) + .Screen/width DEI2 #03 SFT2 NIP .stage/w STZ + .Screen/height DEI2 #03 SFT2 NIP .stage/h STZ + ( terrain ) + ;start-game JSR2 + + LEAK + +BRK + +@on-control ( -> ) + + ;get-player JSR2 + .Controller/button DEI + [ #01 ] NEQk NIP ,&no-a JCN OVR ;fire JSR2 &no-a + [ #10 ] NEQk NIP ,&no-u JCN OVR ;incr-angle JSR2 &no-u + [ #20 ] NEQk NIP ,&no-d JCN OVR ;decr-angle JSR2 &no-d + [ #40 ] NEQk NIP ,&no-l JCN OVR ;decr-force JSR2 &no-l + [ #80 ] NEQk NIP ,&no-r JCN OVR ;incr-force JSR2 &no-r + POP2 + + LEAK + +BRK + +@on-frame ( -> ) + + ( handle bullet ) + .bullet/alive LDZ #01 NEQ ,&no-bullet JCN + ;update-bullet JSR2 + &no-bullet + ( animation ) + .game/timer LDZ #07 AND ,&skip JCN + ;get-player JSR2 #03 ;draw-arrow JSR2 + #01 ;draw-flag JSR2 + &skip + .game/timer LDZk INC SWP STZ + LEAK + +BRK + +@start-game ( -- ) + + ;set-terrain JSR2 + ;set-wind JSR2 + ;place-players JSR2 + ;place-clouds JSR2 + ;prng JSR2 .stage/id STZ2 + ( drawing ) + #02 ;draw-stage JSR2 + ( name player ) + ;prng JSR2 .player1/name STZ2 + ;prng JSR2 .player2/name STZ2 + ( default force ) + #0004 DUP2 .player1/force STZ2 .player2/force STZ2 + ( initial drawing ) + .player1 ;draw-player JSR2 + .player2 ;draw-player JSR2 + .player1 ;select-player JSR2 + ;next-turn JSR2 + ;next-turn JSR2 + +JMP2r + +@set-wind ( -- ) + + #0001 #0000 [ ;prng JSR2 NIP #01 AND JMP ] SWP2 SUB2 .wind/force STZ2 + ;prng JSR2 #0003 AND2 .wind/rate STZ2 + +JMP2r + +@select-player ( player -- ) + + ( nothing yet ) POP + +JMP2r + +@next-turn ( -- ) + + ( stop all bullets ) + #00 .bullet/alive STZ + + ( clear ) + ;get-player JSR2 + DUP #00 ;draw-arrow JSR2 + DUP #00 ;draw-force JSR2 + #40 ;draw-crosshair JSR2 + + #00 ;draw-clouds JSR2 + #00 ;draw-flag JSR2 + + ( move clouds ) + .clouds/ax LDZ2k #0008 ADD2 ROT STZ2 + .clouds/bx LDZ2k #0004 ADD2 ROT STZ2 + .clouds/cx LDZ2k INC2 INC2 ROT STZ2 + + ( draw ) + #02 ;draw-stage JSR2 + + ( inc ) .game/turn LDZk INC SWP STZ + + ( flip wind ) + .game/turn LDZ #07 AND ,&no-wind JCN + ;set-wind JSR2 + &no-wind + + ( draw ) + .player1 ;draw-name JSR2 + .player2 ;draw-name JSR2 + .player1 ;draw-player JSR2 + .player2 ;draw-player JSR2 + ;get-player JSR2 + DUP #00 ;draw-arrow JSR2 + DUP #01 ;draw-force JSR2 + #4a ;draw-crosshair JSR2 + +JMP2r + +@get-player ( -- player ) + + .player2 .player1 .game/turn LDZ [ #01 AND JMP SWP POP ] + +JMP2r + +@get-other ( -- player ) + + .player1 .player2 .game/turn LDZ [ #01 AND JMP SWP POP ] + +JMP2r + +@place-players ( -- ) + + ( player1 ) + #0008 + DUP ;create-platform JSR2 STH + INC2 #40 SFT2 .player1/x STZ2 + #00 STHr #40 SFT2 #0008 SUB2 .player1/y STZ2 + ( player2 ) + .Screen/width DEI2 #03 SFT2 #0008 SUB2 + DUP ;create-platform JSR2 STH + INC2 #40 SFT2 .player2/x STZ2 + #00 STHr #40 SFT2 #0008 SUB2 .player2/y STZ2 + +JMP2r + +@place-clouds ( -- ) + + ;prng JSR2 ADD .stage/w LDZ ( mod ) DIVk MUL SUB #00 SWP #40 SFT2 .clouds/ax STZ2 + #0030 .clouds/ay STZ2 + ;prng JSR2 ADD .stage/w LDZ ( mod ) DIVk MUL SUB #00 SWP #40 SFT2 .clouds/bx STZ2 + #0060 .clouds/by STZ2 + ;prng JSR2 ADD .stage/w LDZ ( mod ) DIVk MUL SUB #00 SWP #40 SFT2 .clouds/cx STZ2 + #0090 .clouds/cy STZ2 + +JMP2r + +( terrain ) + +@set-terrain ( -- ) + + .stage/w LDZ INC INC #00 + &loop + ( height/2 ) .stage/h LDZ #01 SFT + ( rand ) ;prng JSR2 #0a SFT2 NIP ADD #01 SFT + ( store ) OVR #00 SWP ;terrain ADD2 STA + INC GTHk ,&loop JCN + POP2 + ( soften ) + #0800 + &loop-soften + ,soften JSR + INC GTHk ,&loop-soften JCN + POP2 + +JMP2r + +@soften ( -- ) + + .stage/w LDZ #00 + &loop2 + ( a ) #00 OVR ;terrain ADD2 LDA STH + ( b ) #00 OVR INC ;terrain ADD2 LDA STH + ( c ) #00 OVR INC INC ;terrain ADD2 LDA STH + #00 STHr #00 STHr ADD2 #00 STHr ADD2 #0003 DIV2 NIP + ( store ) OVR #00 SWP ;terrain ADD2 STA + INC GTHk ,&loop2 JCN + POP2 + +JMP2r + +@create-platform ( x -- height ) + + #01 SUB + #00 SWP ;terrain ADD2 DUP2 + ( average ) LDAk STH INC2 LDAk STH INC2 ADDr LDAk STH INC2 ADDr LDA STH ADDr + LITr 04 DIVr + ( flatten ) STHkr ROT ROT STAk INC2 STAk INC2 STAk INC2 STA + STHr + +JMP2r + + + + .bullet/age LDZ2 .wind/rate LDZ2 INC2 #30 SFT2 ( mod2 ) DIV2k MUL2 SUB2 ORA ,&no-wind JCN + .bullet/vx LDZ2 .wind/force LDZ2 ADD2 .bullet/vx STZ2 + &no-wind + +@update-bullet ( -- ) + + ( undraw ) + #40 ;draw-bullet JSR2 + ;collide-bounds JSR2 ;&hit-bound JCN2 + ;collide-ground JSR2 ;&hit-ground JCN2 + ;collide-clouds JSR2 ;&hit-cloud JCN2 + ;collide-other JSR2 ;&hit-other JCN2 + ;collide-self JSR2 ;&hit-self JCN2 + ( origin ) + .bullet/x LDZ2 ,&x STR2 + .bullet/y LDZ2 ,&y STR2 + ( update bullet ) + .bullet/x LDZ2 .bullet/vx LDZ2 ADD2 .bullet/x STZ2 + .bullet/y LDZ2 .bullet/vy LDZ2 SUB2 .bullet/y STZ2 + ( apply wind ) + ( apply gravity ) + .bullet/vy LDZ2 + #0001 SUB2 .bullet/vy STZ2 + ( line ) + .bullet/y LDZ2 #8000 GTH2 ,&offscreen JCN + ,&y LDR2 #8000 GTH2 ,&offscreen JCN + .bullet/x LDZ2 #8000 GTH2 ,&offscreen JCN + ,&x LDR2 #8000 GTH2 ,&offscreen JCN + [ LIT2 &x $2 ] #01 SFT2 [ LIT2 &y $2 ] #01 SFT2 + .bullet/x LDZ2 #01 SFT2 .bullet/y LDZ2 #01 SFT2 #01 ;draw-line JSR2 + &offscreen + .bullet/age LDZ2k INC2 ROT STZ2 + #43 ;draw-bullet JSR2 + +JMP2r + &hit-bound + ;next-turn JSR2 + JMP2r + &hit-ground + #00 ;draw-stage JSR2 + .bullet/x LDZ2 #04 SFT2 ;terrain ADD2 STH2k LDA INC STH2r STA + ;next-turn JSR2 + JMP2r + &hit-cloud + ;next-turn JSR2 + JMP2r + &hit-other + #aaaa ;print JSR2 #0a18 DEO + ;next-turn JSR2 + JMP2r + &hit-self + ;next-turn JSR2 + JMP2r + +@collide-ground ( -- hit ) + + .bullet/y LDZ2 #8000 GTH2 ,&offscreen JCN + ( x ) .bullet/x LDZ2 #04 SFT2 ;terrain ADD2 LDA + #00 SWP #40 SFT2 .bullet/y LDZ2 LTH2 JMP2r + &offscreen + #00 + +JMP2r + +@collide-bounds ( -- hit ) + + .bullet/x LDZ2 .Screen/width DEI2 #10 SFT2 GTH2 + JMP2r + ( TODO ) + .bullet/y LDZ2 .Screen/height DEI2 #10 SFT2 GTH2 + .bullet/x LDZ2 .Screen/width DEI2 #10 SFT2 GTH2 + ORA + +JMP2r + +@collide-clouds ( -- hit ) + + #00 + +JMP2r + +@collide-self ( -- hit ) + + .bullet/age LDZ2 #0020 GTH2 ,&continue JCN + #00 JMP2r + &continue + .bullet/x LDZ2 + DUP2 ;get-player JSR2 /x LDZ2 #0008 SUB2 LTH2 ,&miss JCN + DUP2 ;get-player JSR2 /x LDZ2 #0010 ADD2 GTH2 ,&miss JCN + POP2 + .bullet/y LDZ2 + DUP2 ;get-player JSR2 /y LDZ2 #0020 SUB2 LTH2 ,&miss JCN + DUP2 ;get-player JSR2 /y LDZ2 #0008 ADD2 GTH2 ,&miss JCN + POP2 + #01 + +JMP2r + &miss POP2 #00 JMP2r + +@collide-other ( -- hit ) + + .bullet/x LDZ2 + DUP2 ;get-other JSR2 /x LDZ2 #0008 SUB2 LTH2 ,&miss JCN + DUP2 ;get-other JSR2 /x LDZ2 #0010 ADD2 GTH2 ,&miss JCN + POP2 + .bullet/y LDZ2 + DUP2 ;get-other JSR2 /y LDZ2 #0020 SUB2 LTH2 ,&miss JCN + DUP2 ;get-other JSR2 /y LDZ2 #0008 ADD2 GTH2 ,&miss JCN + POP2 + #01 + ( TODO: set sprite state ) + #aaaa ;print JSR2 #0a18 DEO + +JMP2r + &miss POP2 #00 JMP2r + +@incr-angle ( player -- ) + + DUP /angle LDZ #14 EQU ,&skip JCN + DUP #40 ;draw-crosshair JSR2 + DUP /angle LDZk INC SWP STZ + DUP ;draw-player JSR2 + DUP #43 ;draw-crosshair JSR2 + &skip + POP + +JMP2r + +@decr-angle ( player -- ) + + DUP /angle LDZ #01 LTH ,&skip JCN + DUP #40 ;draw-crosshair JSR2 + DUP /angle LDZk #01 SUB SWP STZ + DUP ;draw-player JSR2 + DUP #43 ;draw-crosshair JSR2 + &skip + POP + +JMP2r + +@incr-force ( player -- ) + + DUP /force LDZ2 #0007 GTH2 ,&skip JCN + DUP /force LDZ2k INC2 ROT STZ2 + DUP #01 ;draw-force JSR2 + &skip + POP + +JMP2r + +@decr-force ( player -- ) + + DUP /force LDZ2 #0001 LTH2 ,&skip JCN + DUP /force LDZ2k #0001 SUB2 ROT STZ2 + DUP #01 ;draw-force JSR2 + &skip + POP + +JMP2r + +@fire ( player -- ) + + STH + #00 STHkr /angle LDZ + DUP2 + ( y ) + ( add force ) DUP2 STHkr /force LDZ2 MUL2 #02 SFT2 ADD2 .bullet/vy STZ2 + ( x ) ( range ) #0014 SWP2 SUB2 STHkr /y LDZ2 #0014 SUB2 .bullet/y STZ2 + ( add force ) DUP2 STHkr /force LDZ2 MUL2 #02 SFT2 ADD2 + ( player2 flip-x ) STHkr .player2 NEQ ,&left JCN #0000 SWP2 SUB2 &left .bullet/vx STZ2 + STHr /x LDZ2 .bullet/x STZ2 + #01 .bullet/alive STZ + #0000 .bullet/age STZ2 + +JMP2r + +( drawing ) + +@draw-stage ( color -- ) + + STH + #35 .Screen/auto DEO + ( x ) #0000 .Screen/x DEO2 + .stage/w LDZ #00 + &loop + ;stage-icns .Screen/addr DEO2 + ( y ) #00 OVR ;terrain ADD2 LDA #01 SUB #00 SWP #30 SFT2 .Screen/y DEO2 + STHkr .Screen/sprite DEO + INC GTHk ,&loop JCN + POP2 + STHkr ;draw-doodads JSR2 + STHkr ;draw-clouds JSR2 + STHkr ;draw-ramps JSR2 + STHr #00 NEQ ;draw-flag JSR2 + +JMP2r + +@draw-doodads ( color -- ) + + STH + #00 .Screen/auto DEO + .stage/w LDZ #00 + &loop + ( x ) #00 OVR #30 SFT2 .Screen/x DEO2 + ( y ) #00 OVR ;terrain ADD2 LDA #02 SUB #00 SWP #30 SFT2 .Screen/y DEO2 + ( doodads ) + #00 OVR .stage/id LDZ2 ADD2 #0003 AND2 #40 SFT2 ;doodad-icns ADD2 .Screen/addr DEO2 + STHkr #00 NEQ #85 MUL .Screen/sprite DEO + #05 ADD GTHk ,&loop JCN + POP2 + POPr + +JMP2r + +@draw-ramps ( color -- ) + + STH + #00 .Screen/auto DEO + .stage/w LDZ #00 + &loop + ( x ) #00 OVR #30 SFT2 .Screen/x DEO2 + ( y ) #00 OVR ;terrain ADD2 LDA #02 SUB #00 SWP #30 SFT2 .Screen/y DEO2 + ( up ) + #00 OVR ;terrain ADD2 LDA2 + EQUk ,&no-up-ramp JCN + LTHk ,&no-up-ramp JCN + ;ramp-icns .Screen/addr DEO2 + STHkr #01 MUL .Screen/sprite DEO + &no-up-ramp + POP2 + ( down ) + #00 OVR #01 SUB ;terrain ADD2 LDA2 + EQUk ,&no-down-ramp JCN + GTHk ,&no-down-ramp JCN + ;ramp-icns/down .Screen/addr DEO2 + STHkr #01 MUL .Screen/sprite DEO + &no-down-ramp + POP2 + INC GTHk ,&loop JCN + POP2 + POPr + +JMP2r + +@draw-clouds ( color -- ) + + #16 .Screen/auto DEO + ;cloud-icns/a .Screen/addr DEO2 + #81 SWP #00 NEQ MUL .Screen/sprite + .clouds/ax LDZ2 #01 SFT2 .Screen/x DEO2 + .clouds/ay LDZ2 #01 SFT2 .Screen/y DEO2 + DEOk + .clouds/bx LDZ2 #01 SFT2 .Screen/x DEO2 + .clouds/by LDZ2 #01 SFT2 .Screen/y DEO2 + ;cloud-icns/b .Screen/addr DEO2 + DEOk + .clouds/cx LDZ2 #01 SFT2 .Screen/x DEO2 + .clouds/cy LDZ2 #01 SFT2 .Screen/y DEO2 + ;cloud-icns/c .Screen/addr DEO2 + DEO + +JMP2r + +@draw-force ( player mask -- ) + + STH + INCk INC LDZ2 #01 SFT2 #0028 SUB2 .Screen/y DEO2 + ( bg ) + LDZ2k #01 SFT2 #0012 SUB2 .Screen/x DEO2 + #10 #05 STHkr MUL ;draw-bar JSR2 + ( fg ) + LDZ2k #01 SFT2 #0012 SUB2 .Screen/x DEO2 + #04 ADD LDZ2 NIP #10 SFT #0f STHr MUL ;draw-bar JSR2 + +JMP2r + +@draw-bar ( size color -- ) + + STH + #00 .Screen/auto DEO + ;progress-icns/fill .Screen/addr DEO2 + #00 + &loop + STHkr .Screen/sprite DEO + .Screen/x DEI2k INC2 INC2 ROT DEO2 + INC GTHk ,&loop JCN + POP2 + POPr + +JMP2r + +@draw-crosshair ( player color -- ) + + STH + DUP ,&player STR + #00 .Screen/auto DEO + DUP /x LDZ2 #01 SFT2 #0020 SUB2 ,&offset-x STR2 + /y LDZ2 #01 SFT2 #0028 SUB2 ,&offset-y STR2 + #4000 + &loop + #00 OVR #10 SFT2 ;sin-tbl ADD2 + DUP2 LDA #00 SWP #02 SFT2 [ LIT2 &offset-x $2 ] ADD2 .Screen/x DEO2 + INC2 LDA #00 SWP #02 SFT2 [ LIT2 &offset-y $2 ] ADD2 .Screen/y DEO2 + DUP #03 AND ,&odd JCN + STHkr .Screen/pixel DEO + &odd + ( selected ) + DUP [ LIT &player $1 ] ;get-marker JSR2 NEQ ,&no-sel JCN + .Screen/x DEI2k #0003 SUB2 ROT DEO2 + .Screen/y DEI2k #0003 SUB2 ROT DEO2 + ;crosshair-icn .Screen/addr DEO2 + STHkr .Screen/sprite DEO + &no-sel + INC GTHk ,&loop JCN + POP2 + POPr + +JMP2r + +@get-marker ( player -- marker ) + + DUP .player2 EQU ,&player2 JCN + #14 SWP /angle LDZ SUB JMP2r + &player2 + /angle LDZ #2c ADD #3f AND + +JMP2r + +@draw-flag ( mask -- ) + + STH + ( direction ) + .wind/force LDZ2 #8000 LTH2 STH + ( x ) + .Screen/width DEI2 #0006 SUB2 + ( flip-x ) #00 STHkr #000c MUL2 ADD2 + #01 SFT2 .Screen/x DEO2 + ( y ) + #00 .stage/w LDZ INC #01 SFT ;terrain ADD2 LDA + #00 SWP #0004 SUB2 #30 SFT2 .Screen/y DEO2 + ( top ) + #02 .Screen/auto DEO + ;flag/top + ( rate ) .wind/rate LDZ2 #0030 MUL2 ADD2 + ( animate ) #00 [ LIT &f $1 ] #40 SFT2 ADD2 + .Screen/addr DEO2 + #81 ( flipx ) STHr #40 SFT ORA STHr MUL .Screen/sprite + DEOk + ( pole ) + ;flag/pole .Screen/addr DEO2 + DEOk DEO + ( animate ) + ,&f LDR INC #03 ( mod ) DIVk MUL SUB ,&f STR + +JMP2r + +@draw-arrow ( player color -- ) + + STH + #00 .Screen/auto DEO + ( x ) LDZ2k #01 SFT2 #0004 SUB2 .Screen/x DEO2 + ( y ) INC INC LDZ2 #0040 SUB2 + ( y+blink ) #00 .game/timer LDZ #0f AND #02 SFT2 ADD2 + #01 SFT2 .Screen/y DEO2 + ;arrow-icn .Screen/addr DEO2 + STHr .Screen/sprite DEO + +JMP2r + +@draw-bullet ( color -- ) + + #00 .Screen/auto DEO + .bullet/x LDZ2 #0006 SUB2 #01 SFT2 .Screen/x DEO2 + .bullet/y LDZ2 #0006 SUB2 #01 SFT2 .Screen/y DEO2 + ;bullet-icn .Screen/addr DEO2 + .Screen/sprite DEO + +JMP2r + +@draw-player ( player -- ) + + DUP .player2 EQU ;draw-player2 JCN2 + STHk + LDZ2k #01 SFT2 #0008 SUB2 .Screen/x DEO2 + INC INC LDZ2 #0028 SUB2 #01 SFT2 .Screen/y DEO2 + #16 .Screen/auto DEO + ;player1-icns/ears .Screen/addr DEO2 + #85 .Screen/sprite DEOk + ;player1-icns/eye [ #00 STHr #06 ADD LDZ #03 SFT ] #50 SFT2 ADD2 .Screen/addr DEO2 + DEOk + ;player1-icns/body .Screen/addr DEO2 + DEO + +JMP2r + +@draw-player2 ( player -- ) + + STHk + LDZ2k #01 SFT2 #0008 SUB2 .Screen/x DEO2 + INC INC LDZ2 #0028 SUB2 #01 SFT2 .Screen/y DEO2 + #16 .Screen/auto DEO + ;player2-icns/ears .Screen/addr DEO2 + #85 .Screen/sprite DEOk + ;player2-icns/eye [ #00 STHr #06 ADD LDZ #03 SFT ] #50 SFT2 ADD2 .Screen/addr DEO2 + DEOk + ;player2-icns/body .Screen/addr DEO2 + DEO + +JMP2r + +@draw-name ( player -- ) + + DUP /x LDZ2 #01 SFT2 #0020 SUB2 .Screen/x DEO2 + DUP /y LDZ2 #0068 SUB2 #01 SFT2 .Screen/y DEO2 + ( to /name ) #07 ADD + LDZk #0f AND #00 SWP #0005 MUL2 ;names/first ADD2 #05 ;draw-label JSR2 + INC LDZ #0f AND #00 SWP #0006 MUL2 ;names/last ADD2 #05 ;draw-label JSR2 + +JMP2r + +@draw-label ( str* color -- ) + + STH + #01 .Screen/auto DEO + &while + LDAk #20 SUB #00 SWP #30 SFT2 ;font ADD2 .Screen/addr DEO2 + STHkr .Screen/sprite DEO + INC2 LDAk ,&while JCN + POP2 + POPr + +JMP2r + +@text "buckthorn $1 + +@draw-line ( x1* y1* x2* y2* color -- ) + + ( load ) STH ,&y STR2 ,&x STR2 .line/y STZ2 .line/x STZ2 + ,&x LDR2 .line/x LDZ2 SUB2 ;abs2 JSR2 .line/dx STZ2 + #0000 ,&y LDR2 .line/y LDZ2 SUB2 ;abs2 JSR2 SUB2 .line/dy STZ2 + #ffff #00 .line/x LDZ2 ,&x LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sx STR2 + #ffff #00 .line/y LDZ2 ,&y LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sy STR2 + .line/dx LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2 + &loop + .line/x LDZ2 DUP2 .Screen/x DEO2 [ LIT2 &x $2 ] EQU2 + .line/y LDZ2 DUP2 .Screen/y DEO2 [ LIT2 &y $2 ] EQU2 + STHkr .Screen/pixel DEO + AND ,&end JCN + .line/e1 LDZ2 #10 SFT2 DUP2 + .line/dy LDZ2 ;lts2 JSR2 ,&skipy JCN + .line/e1 LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2 + .line/x LDZ2 [ LIT2 &sx $2 ] ADD2 .line/x STZ2 + &skipy + .line/dx LDZ2 ;gts2 JSR2 ,&skipx JCN + .line/e1 LDZ2 .line/dx LDZ2 ADD2 .line/e1 STZ2 + .line/y LDZ2 [ LIT2 &sy $2 ] ADD2 .line/y STZ2 + &skipx + ,&loop JMP + &end + POPr + +JMP2r + +@abs2 DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 JMP2r +@lts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 GTH2 JMP2r +@gts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 LTH2 JMP2r + +( library ) + +@prng-init ( -- ) + + ( seed ) + #00 .DateTime/second DEI + #00 .DateTime/minute DEI #60 SFT2 EOR2 + #00 .DateTime/hour DEI #c0 SFT2 EOR2 ,prng/x STR2 + #00 .DateTime/hour DEI #04 SFT2 + #00 .DateTime/day DEI #10 SFT2 EOR2 + #00 .DateTime/month DEI #60 SFT2 EOR2 + .DateTime/year DEI2 #a0 SFT2 EOR2 ,prng/y STR2 + +JMP2r + +@prng ( -- number* ) + + LIT2 &x $2 + DUP2 #50 SFT2 EOR2 + DUP2 #03 SFT2 EOR2 + LIT2 &y $2 DUP2 ,&x STR2 + DUP2 #01 SFT2 EOR2 EOR2 + ,&y STR2k POP + +JMP2r + +@print ( short* -- ) + + SWP ,&byte JSR + &byte ( byte -- ) DUP #04 SFT ,&char JSR + &char ( char -- ) #0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO + +JMP2r + +@progress-icns + 3f40 8080 8080 403f + ff00 0000 0000 00ff + fc02 0101 0101 02fc + &fill + 0000 183c 3c18 0000 +@crosshair-icn + 0010 106c 1010 0000 +@arrow-icn + 0018 18ff 7e3c 1800 +@bullet-icn + 0000 183c 3c18 0000 +@flag + &pole + 0101 0101 0001 0001 0101 0101 0101 0101 + &top + ( high ) + 0101 3fff 3f07 0101 0101 0000 0000 0101 + 01f9 3f3f 1f07 0101 0101 0000 0000 0101 + 0181 ffff 7f07 0101 0101 0000 0000 0101 + ( med ) + 0101 0307 070f 3f79 0101 0000 0000 0101 + 0101 0307 0f3f 7d41 0101 0000 0000 0101 + 0101 0307 4f7f 3d01 0101 0000 0000 0101 + ( low ) + 0101 0303 0303 0707 0101 0000 0000 0000 + 0101 0103 0707 0703 0101 0000 0000 0000 + 0101 0103 0307 0703 0101 0000 0000 0000 + ( none ) + 0101 0303 0303 0707 0101 0000 0000 0000 + 0101 0103 0707 0703 0101 0000 0000 0000 + 0101 0103 0307 0703 0101 0000 0000 0000 + +@cloud-icns + &a + 0000 0c1e 1e0f 0500 0000 1c3e 3e3f ff7f + 0004 0200 c0e0 50a0 0004 0e04 c0e0 f0e0 + &b + 0000 081c 1400 0000 0000 193d 7f3f 0000 + 0070 f8f8 54a0 0000 00f0 f8f8 fcf0 0000 + &c + 0000 402e 0f00 0000 0000 40ee 5f0e 0000 + 0000 0000 0000 0000 0000 0000 0000 0000 + +@doodad-icns + 0000 0000 2054 2a04 0000 0000 2074 2e24 + 0000 0000 40a2 552a 0000 0000 40e2 577a + 0000 0000 0000 0000 0000 0000 0000 0424 + 0000 0000 0000 0000 0000 0000 0000 0008 + +@ramp-icns + 0000 0000 0000 0001 + &down + 0000 0000 0000 0080 + +@stage-icns + ffff ffff ffff ffff + ffff aa55 aa55 aa55 + aa55 aa55 8800 2200 + 0000 0000 0000 0000 + &up + 0103 070f 1f3f 7fff + ffff fefd faf5 ead5 + aa55 aa55 a850 a240 + 8800 2200 8800 0000 + &down + 0000 0000 0000 0000 + 80c0 e0f0 f8fc feff + ffff bf5f af57 ab55 + aa55 aa55 0a05 2201 + 8800 2200 8800 0000 + +@player1-icns + &ears + ( 0 ) + 0002 0e0e 0606 1f3f 0c0c 0000 0000 0000 + 0020 e0e0 6000 fcfe c0c0 0000 0000 0000 + ( 1 ) + 0000 020e 0e06 1f3f 000c 0c00 0000 0000 + 0000 20e0 6000 fcfe 00c0 c000 0000 0000 + ( 2 ) + 0000 041c 0e06 1f3f 0019 1900 0000 0000 + 0000 40e0 6000 fcfe 0080 8000 0000 0000 + &eye + ( 0 ) + 7f7f 7f7f 7f3f 1f07 0103 0707 0703 0000 + ffc7 8383 c7ff fef8 f0f8 fcfc fcf8 0000 + ( 1 ) + 7f7f 7f7f 7f3f 1f07 0103 0707 0703 0000 + 8f07 078f ffff fef8 f0f8 fcfc fcf8 0000 + ( 2 ) + 7f7e 7e7f 7f3f 1f07 0103 0707 0703 0000 + 1f0f 0f1f ffff fef8 f0f8 fcfc fcf8 0000 + &body + 5f3f 3f1f 1200 0000 4101 0000 0000 0000 + e0e0 e040 4000 0000 e0e0 e000 0000 0000 + +@player2-icns + &ears + ( 0 ) + 0003 030c 0e00 1f3f 0000 0403 0000 0000 + 008e 8e30 7860 f0f8 0000 100c 0000 0000 + ( 1 ) + 0000 0303 0c00 1f3f 0000 0004 0300 0000 + 0000 8e8e 3078 f0f8 0000 0010 0c00 0000 + ( 2 ) + 0000 0101 0600 1f3f 0000 0002 0100 0000 + 0000 c7c7 1878 f0f8 0000 0008 8600 0000 + &eye + ( 0 ) + 7fe3 d1c1 e3ff 7f1f 0f1f 3f3f 3f1f 0000 + fcfe fefe fefe fcf0 80c0 e0e0 e0c0 0000 + ( 1 ) + 71e8 e0f1 ffff 7f1f 0f1f 3f3f 3f1f 0000 + fcfe fefe fefe fcf0 80c0 e0e0 e0c0 0000 + ( 2 ) + 78f4 f0f8 ffff 7f1f 0f1f 3f3f 3f1f 0000 + fc7e 7efe fefe fcf0 80c0 e0e0 e0c0 0000 + &body + 0707 0702 0200 0000 0707 0700 0000 0000 + f0f8 fefe b000 0000 8080 0606 0000 0000 + +@platform-icns + 0000 0000 0000 0000 0f3f 3f7f 7f7f 7f7f + 0000 0000 0000 0000 ffff ffff ffff ffff + 0000 0000 0000 0000 ffff ffff ffff ffff + 0000 0000 0000 0000 f0fc fcfe fefe fefe + 0000 0000 0000 0000 7f7f 7778 7050 2000 + 0000 0000 0000 0000 ffff ffff 3e1c 0000 + 0000 0000 0000 0000 ffff ff3f 1303 0100 + 0000 0000 0000 0000 fefe fefe eeca 0400 + +@sin-tbl + 8000 8c00 9802 a505 b009 bc0f c715 d11d + da25 e22e ea38 f043 f64f fa5a fd67 ff73 + ff80 ff8c fd98 faa5 f6b0 f0bc eac7 e2d1 + dada d1e2 c7ea bcf0 b0f6 a5fa 98fd 8cff + 80ff 73ff 67fd 5afa 4ff6 43f0 38ea 2ee2 + 25da 1dd1 15c7 0fbc 09b0 05a5 0298 008c + 0080 0073 0267 055a 094f 0f43 1538 1d2e + 2525 2e1d 3815 430f 4f09 5a05 6702 7300 + +~names.tal +~font.tal + +@terrain + diff --git a/gui/inle/names.tal b/gui/inle/names.tal new file mode 100644 index 0000000..f4224a2 --- /dev/null +++ b/gui/inle/names.tal @@ -0,0 +1,11 @@ +@names +&first +"Blue $1 "Fern $1 "Leaf $1 "Corn $1 +"Pine $1 "Snow $1 "Seed $1 "Fuzz $1 +"Rain $1 "Buck $1 "Rose $1 "Sage $1 +"Worm $1 "Haze $1 "Hawk $1 "Bell $1 +&last +"stack $1 "marsh $1 "clove $1 "thorn $1 +"patch $1 "grass $1 "shade $1 "berry $1 +"woods $1 "stone $1 "cedar $1 "brush $1 +"storm $1 "cloud $1 "mound $1 "beans $1 diff --git a/gui/inle/sprites.chr b/gui/inle/sprites.chr new file mode 100644 index 0000000000000000000000000000000000000000..f50b2e8f7e0d2c656c8ff7fdc252a128ecdf71ee GIT binary patch literal 4096 zcmeH`ze)o^5XL8WiXg%wHdhE6(xvkOg0qj1Ml5{=J5zZn?*Z}zR-%QE;MMkGYpo#L z2#c(@?wFlT8i@o^kom5d{bv8%eLrs1ficr4fKq9VXm^UD7X{E-=e!4~MxzR%Qmv|R zK5tMnOCi=IZiJ+-y!E~#@%&#^%1%PmT9p8lo#ef9w*CHB)%DrrbllGyDE{Gowh%4u zl@V(aWq-NbV4G{N+)^6rz>S14`)T`Vo$s>eb?a8j-ppnXyq~h~4u{X|f4hdzy}!La z-Sc}xxH_U|;criFj<2)l{<;+n5irR66WGkxf8K^7-UAlj2lhW(DeL9Ol_HcL@f`K6^Y6aqp(2nYcoAOwVf5D)@FU9>srO literal 0 HcmV?d00001