Help with some 82-BASIC code
[Prev][Next][Index][Thread]
Help with some 82-BASIC code
I threw together some quick code earlier today that puts "yes" on the
left and "no" on the right, and moves a highlight back and forth using
the left and right arrow keys. Y= and GRAPH can also be used to select
yes or no.. Looking at the code now though it seems a bit... messy.
I was wondering if anybody had any ideas for optimization of this
little routine, and also: Without ASM is there any way to speed up the
process of drawing the highlights? (The Pxl-Change(y,x) command I
guess..)
Here's the code:
[earlier junk in program]
:0\->\\@\
:1\->\F
:1\->\S
:Lbl S
:If (F=2) and (S=1)
:Goto 1
:For(Y,55,61,1)
:For(X,0,12,1)
:Pxl-Change(Y,X)
:End
:End
:If \@\=0
:Then
:1\->\\@\
:Goto D
:End
:If (F=2) and (S=0)
:Then
:1\->\S
:Goto 2
:End
:Lbl 1
:For(Y,55,61,1)
:For(X,85,94,1)
:Pxl-Change(Y,X)
:End
:End
:If F=2
:Then
:0\->\S
:Goto S
:End
:Lbl 2
:F+1\->\F
:If F>2
:1\->\F
:Lbl D
:Repeat Ans\<>\0
:getKey
:If Ans=11
:Goto Y
:If Ans=15
:Goto V
:If (Ans=24 or Ans=26)
:Goto S
:If Ans=105
:Then
:If F=1
:Goto Y
:If F=2
:Goto V
:Else
:Goto D
:End
:End
The reason for all of the "If (F=2) etc etc" commands is that I wanted
the "NO" to de-highlight before the "YES" highlighted when moving back
to yes. YES is the default and the reason for the use of theta in the
beginning is so before it gets to the getkey routine it highlights
YES..
Anyways, any ideas appreciated.
Thanks!-
Rolf