Everything2
Near Matches
Ignore Exact
Full Text
Everything2

shape table

created by yerricde

(thing) by yerricde (8.7 mon) (print)   ?   (I like it!) 1 C! Sun Apr 22 2001 at 1:53:18

Applesoft BASIC has no support for bitmap graphics. However, it does have support for simple shapes stored in shape tables. A shape table is made up of shapes:

shapes:
  .dcb nn            ; number of shapes
  .dcb shape0-shapes ; offset to first shape
  .dcb shape1-shapes ; offset to second shape
  .dcb shape2-shapes ; offset to third shape
; ...
Each shape is a nul-terminated string of bytecodes:
ccbbbaaa
||||||||
|||||+++- First instruction
||+++---- Second instruction
++------- Third instruction
Each instruction is made of three bits:
pdd
|||
|++- direction (0 up; 1 right; 2 down; 3 left)
+--- draw while moving in that direction

If, after shifting out an instruction, the result is 0, the interpreter goes to the next instruction. This means that the third instruction in a byte cannot move up or draw, and that if the third instruction is 00, then the second instruction cannot be "move up without drawing." I don't suggest moving up often in a shape table; most shape table tools generate a boustrophedon.

Once you store the address of your shape table into locations 233 and 232, you can use these commands to draw shapes:

  • SCALE= n: REM move n pixels for each instruction
  • ROT= n: REM rotate shape clockwise by n/64 circle
  • DRAW n AT x,y: REM draw a shape using current HCOLOR= setting
  • XDRAW n AT x,y: REM draw a shape using XOR

printable version
chaos

Tetris pseudocode Applesoft BASIC Boustrophedon bytecode
INTERCAL bitmap graphics XOR little-endian
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Nodes your sibling would have liked:
Node your homework
Niels Bohr
Translucent, threatening to smash itself
Irn-Bru
condom man page
wasabi
Ken Kesey
25 cent plastic toy vending machines
Planet of the Apes
Analysis of Everything
Ray Bradbury
harmony
Edgar Allan Poe
New Writeups
Ysardo
a brother to a sister(personal)
antigravpussy
your warm whispers(personal)
Clarke
Multiculturalism(idea)
aneurin
Earl of Landaff(person)
Heitah
Pseudocide(idea)
XWiz
Google Knol(lede)
Mythi
July 24, 2008(personal)
locke baron
The fall of Earth(fiction)
BookReader
Fear the Cold(dream)
Pavlovna
Kathleen MacInnes(person)
stainedglass
1(fiction)
kalen
Three "T"s(idea)
octillion369
Undead(idea)
archiewood
Ico(fiction)
Heisenberg
Why I love Everything2(log)
Everything 2 is brought to you by the letter C and The Everything Development Company