Here's a code for a program I made, implementing IS>( and DS<(. You move a ship (a letter B) and fire shots with 2ND and ALPHA. Shoot the targets. Press ENTER to quit. Preferably don't press ON. This will cause the row under text to be blanked. This makes you unable to play games like Portal, Contra, etc. Don't want that? Run prgmASM2 on the homescreen, by using the Asm( token before the program name. This is retrieved through the CATALOG menu.
The BASIC code is as follows:
:StoreGDB 7 :AxesOff :FnOff :0→Xmin:94→Xmax :0→Ymax:-62→Ymin :DelVar PDispGraph ;Delvar P, followed by DispGraph. DispGraph is used because the asmprgm :Asm(prgmASM ;for blacking the screen works weird directly following a clearing screen function. :" =→Str1 ;More on what prgmASM does later. :randInt(10,93→X ;In this case, the window size update works as clearing screen. Otherwise, the :randInt(-61,-2→Z ;blacking of the screen would make everything else invisible. :Repeat E=105 ;Quit if ENTER is pressed :Text(P,0,"B :Pt-Off(X,Z,3 :getKey→E :If Ans=25 and P ;Move up :Then :P-1→P :End ;Optimized for speed :If E=34 and P≠57 ;Move Down :Then :P+1→P :End :If E=21 and 93<V ;You get to fire two shots. Press 2ND for this one... :Then :2→V:P→U :End :If E=31 and 93<T ;...and ALPHA for this one. :Then :2→T:P→S :End :IS>(V,93 ;IS>( is actually used!?! :Text(U,V,Str1 :IS>(T,93 :Text(S,T,Str1 :If T+3=X and 2≥abs(S+3+Z) ;The target got hit. or V+3=X and 2≥abs(U+3+Z ;As a reminder, " and " has priority over " or " :Then :Pt-On(X,Z,3 :randInt(10,93→X :randInt(-61,-2→Z :End :End :Asm(prgmASM2 ;More later :RecallGDB 7 :ClrHome
Still wondering what prgmASM and prgmASM2 are?
:AsmPrgm :210000; LD HL $0000 :115F3F; LD DE $5F3F :EF624D; bcall(); whatever made a black rectangle :21F589; LD HL $F589 :FDCB05CB; set the flag for the blank row under text :C9 ; RET
:AsmPrgm :FDCB058B; reset that flag :C9
In short, use IS>( or DS<( when you want incrementing without stopping a loop, or if you are using Goto statements. Gotos inside loops can cause memory leaks, which I will not go into now.
Implementation of IS>( loop:
:0→B :Lbl GO :Disp B :IS>(B,99 :Goto GO
While this can easily be replaced by:
:For(B,0,99 :Disp B :End
However, it causes memory leaks if you put a Goto statement inside.
Comments? Suggestions? Errors? Optimizations?
Fire Emblem for TI 83/4+ Progress: Demo: 75% Total: 40% Postponed indefinitely