Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Integer BASIC
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Graphics and sound=== When launched, the only [[game controller]] for the Apple was the [[paddle controller]], which had two controllers on a single connector. The position of the controller could be read using the {{code|PDL}} function, passing in the controller number, 0 or 1, like {{code|A{{=}}PDL(0):PRINT A|basic}}, returning a value between 0 and 255.{{sfn|Raskin|1978|p=36}}{{efn|The manual suggests, but does not outright state, that the actual range of values is less than 0 to 255.{{sfn|Raskin|1978|p=36}}}} The Apple machines did not include dedicated sound hardware, only a simple "beeper". Producing sounds was accomplished by {{code|PEEK}}ing the memory-mapped location of the speaker, -16336.{{efn|The negative number is a side-effect of the integers being stored in signed format, so any memory location over 32767 appeared as a negative value in BASIC.{{sfn|Mini|1977|p=18}}}} Repeatedly PEEKing that value produced tones, and the manual suggested using a mathematical expression to do this, like {{code|S{{=}}PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)-PEEK(-16336)|basic}}.{{sfn|Raskin|1978|p=84}} Support for graphics was more detailed. Graphics mode was turned on with the {{code|GR}} statement and off with {{code|TEXT}}.{{sfn|Raskin|1978|p=31}} Drawing was modal and normally started by issuing a command to change the color, which was accomplished by setting a pseudo-variable; {{code|COLOR{{=}}12}} would set the drawing color to 12, light green. One could then {{code|PLOT 10,10}} to produce a single spot of that color,{{sfn|Raskin|1978|p=32}} {{code|HLIN 0,39 AT 20}} to draw a horizontal line at row 20 that spanned the screen, or {{code|VLIN 5,15 AT 7}} to draw a shorter vertical line down column 7.{{sfn|Raskin|1978|p=33}} {{code|A{{=}}SCRN X,Y}} returned the color of the screen at X,Y.{{sfn|Raskin|1978|p=120}}{{efn|Note the odd syntax of the SCRN, which is technically a function because it returns a value, but does not use function-like syntax which would be {{code|A{{=}}SCRN(X,Y)}}.}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)