whscullin / apple2js

An Apple II emulator originally written in Javascript, now being converted to TypeScript
http://www.scullinsteel.com/apple2/
MIT License
442 stars 57 forks source link

Online Emulator / Applesoft HLINE doesn't work as expected #41

Closed gllona closed 4 years ago

gllona commented 4 years ago

Hi, Thanks for the wonderful emulator.

When i try: GR COLOR=8 HLINE 5,15 AT 10

It behaves as: HLINE 0,15 AT 10

Thanks!

whscullin commented 4 years ago

You've discovered a fun quirk of AppleSoft BASIC. If you enter those commands as program, and do LIST:

]10 GR

]20 COLOR=8

]30 HLINE 5,15 AT 10

]LIST

 10  GR
 20  COLOR= 8
 30  HLIN E5,15 AT 10

]

you'll see that the command is actually HLIN, and AppleSoft has treated the following characters as a variable. AppleSoft variables don't need to be declared, and the variable E5 will be treated as having a default value of 0