# AppleIIbot 280 char Applesoft Demos -- Part 5

## Hi-res Moving Waves

Unlike the previous ones that are just effectively doing fake palette shifting, this one the sinewave pattern is actually actively moving around. This ends up being a bit slower.

1FORI=0TO139:POKE1013+I,4*PEEK(2126+I)-204+(PEEK(2266+I/3)-35)/4^(I-INT(I/3)*3):NEXT
2&"/foL:Be;569e7W4>qM5\bO4=Q2EqY3KegilrZb;3o\a[EA@ln\a/JVA4[<9YDp]b3KQ3KDhE22]aM4DU<[C4ARVC4U-hdbZkbrgZZle;g+SbAaEBRl]\;O^rW[;(14)36/6879:,7::;SW$@#@;#;*#,04M533&&D$$HP(I04&KI0IDAGK]MOTD+\&  Link to machine code source: moving.s ## Ocean Scene (LOGO) link I was working on the Demosplash LOGO demo so was doing a lot of experimenting with compact LOGO code. This scene is similar to one in the final version. LOGO sizecoding is a bit different than the BASIC and 6502 variants. {L} SETPC 4 SETPOS[90 80] CLEAN REPEAT 36[RT 5 FD 2 RT 5] REPEAT 9[RT 40 PU SETPOS[100 80] FD 25 PD BK 10] SETPC 5 PU HOME PD RT 180 FD 119 RT 90 FD 280 RT 90 FD 119 RT 45 REPEAT 20[FD 10 RT 90 FD 10 LT 90] FILL BK 50 SETPC 1 REPEAT 40[FD 1 RT 3] RT 90 REPEAT 40[FD 1 RT 3] HT  ## Thick Sine link Was trying to draw some circles but ended up making this cool looking sine pattern. Eventually got a different version that nearly fits in 64 bytes. Getting sines in a small space is difficult. The Applesoft BASIC ROM does have a cosine table for shape tables but it's missing a term and it's not really much smaller to use it rather than just including the proper table that we want. 1FORI=0TO102:POKE1013+I,4*PEEK(2126+I)-204+(PEEK(2229+I/3)-35)/4^(I-INT(I/3)*3):NEXT 2&"/foL:Be;569e7W4>qM5\bE4=S3EqM3Y3KYdjS1Tr[3Ip\qb3C75EI\r[38Hpbpljeml94Vq=5bBa3\_BrTlF943-35/5768959:+7:;SW@#@;&3*SE%O)CD&/MF-<Z;W$$>?+5a#  Link to machine code source: thick_sine.s ## Turkey Time link I've done a few holidays before with the lo-res block drawing code, this time I made one for Thanksgiving. 0REM/ G O-(>-?!$C<@)%B5:)*-'.),/-4):=&.)8;-4!07%,(16*0(3414(,;5G(*=7D(()EG(>?EG)//GL)88GL).0LL)79LL 25!' 07()/25*, 25,,(34*,)34.0)25..(25&'-45&'
1DEFFNP(X)=PEEK(2054+I*5+X)-32:GR:POKE49234,0:FORI=0TO27:COLOR=FNP(0):FORY=FNP(3)TOFNP(4):HLINFNP(1),FNP(2)ATY:NEXTY,I:GETA


## Hi-res Doom Fire

This is the "Doom Fire" effect once again, but trying to do it for hi-res mode. Trickier than you might think. Partly because there aren't good colors, partly because of the non-linear hi-res memory layout. Also generating random numbers compactly is a challenge as well. In the end it uses a large lookup table for colors, and uses the ROM contents for "randomness".

1FORI=0TO139:POKE1013+I,4*PEEK(2126+I)-192+(PEEK(2266+I/3)-35)/4^(I-INT(I/3)*3):NEXT
2&"*el,cl;EQ8Z2WdEb4U_N74dW9M8Y4P9QfbN74aU9[0h01[80B3R<0\9Vk0\QT7k8)b2j81_0Z_R81R4dYhfUd]R80lY8Q9R8BCP9Q8\3Y_H0T9R4kYhjhbglU0QOOTXbfdeoblodo[S#A*.]5G4:E5S$347'5=-C)77#++,4)@7?=4#,#+&7GH:2  Link to machine code source: flame.s ## Hi-res Screen Wipe link I was working on a hi-res screen wipe for the Peasant's Quest demake and this was an unintended side effect. It goes a bit too fast but I couldn't find the bytes needed to add a delay. 1FORI=0TO138:POKE1013+I,4*PEEK(2126+I)-204+(PEEK(2265+I/3)-35)/4^(I-INT(I/3)*3):NEXT 2&"/foT5XleggbqcmdcX<Qq[5Srcr;52le8=2lr8=4aq;93e6gmGkF0ffVq=-\nTq\nTgjrQn535;3o\7SpW4\cQ<Vo]IU<Y<9I3T:egk8\im6FoTgbqi7dim7g\kKqModjm4cro'daKSA.NIV/3)FU+/16#]3<>(4LP-4:5X;J04.5C<I;F?:@C(U#  Link to machine code source: rectangle.s ## Christmas Scene (BASIC) link I guess this ended up being my Christmas Demo for 2021. All in BASIC. It was tricky getting a decent looking tree as well as an OK looking house. Snow was a pain too. If you let this run forever it will completely cover the screen in snow. 0Q=38:GR:FORI=0TO9:X(I)=RND(1)*Q:Y(I)=I:COLOR=1:VLIN33,QAT16+I:COLOR=4:HLIN9-I/2,9+I/2AT28+I:COLOR=8:VLIN29,33AT16+I:NEXT:VLIN36,QAT20:HLIN0,QAT39:PLOT9,Q 3FORI=0TO9:V=X(I):W=Y(I):COLOR=15:PLOTV,W:PLOTV,W+1:COLOR=0:IFSCRN(V,W+2)>0THENX(I)=RND(1)*Q:W=0 6PLOTV,W:Y(I)=W+1:NEXT:GOTO3  ## Edgarware Intro (BASIC) link Another lo-res boxdrawing, this one because I was re-watching some old Homestar Runner stuff. This one got a lot of views because someone told Strongbad about it. Drop a train on them, Edgar! 0REM&*<DG&,:@C&-9??&/7=>/6:DF 78BC 88BE!::BC%33@A%33DE+15(=+/61:+.715(66(.(15''(/3(*(/1+,(/0-.%/6//'/600//113/4613#2366/159:/35;< 1GR:?" PROGRAMMED IN EDGAR'S MOM'S BASEMENT":DEFFNP(X)=PEEK(2054+I*5+X)-32 2FORI=0TO24:COLOR=FNP(0):FORY=FNP(3)TOFNP(4):HLINFNP(1),FNP(2)ATY:NEXTY,I  ## Cosine Wave Effect 3 link When trying to get the Thick Sine demo down to 64-bytes for Lovebyte I ran into a lot of interesting failure modes. This half-height almost greyscale effect was an interesting one. 1FORI=0TO68:POKE1013+I,4*PEEK(2125+I)-204+(PEEK(2194+I/3)-35)/4^(I-INT(I/3)*3):NEXT 2&"/foT5aXnEDMKYS3TNEn@M2Y[2XW]3eYll5kmapU9rO&BrPk\e:B\aO3[38Hpap\kmgbljSAJ)$46''$U+Q/Y4Z'#/Q#S  Link to machine code source: oops3_cos.s ## Cosine Wave Effect 4 link Yet another cosine mistake when working on Thick Sine for Lovebyte. Note that these are so short they break the encoder I have (it assumes an offset to start of data with a 3-digit length in the FOR loop), I really need to fix the code to handle small code properly. 1FORI=0TO68:POKE1013+I,4*PEEK(2125+I)-204+(PEEK(2194+I/3)-35)/4^(I-INT(I/3)*3):NEXT 2&"/foT5aXnEDYS2XOBrAI2YW2XV]3ceom7l_irI9rI2EqTlUq=>\aK2MK[38Hpap\kmginjSAJ)'043'+$[U;*@63#/Q#5

Link to machine code source: oops4_cos.s

## Orb Horror

1FORI=0TO134:POKE1013+I,4*PEEK(2126+I)-204+(PEEK(2261+I/3)-35)/4^(I-INT(I/3)*3):NEXT