ChibiAkumas Tutorials
|
Lesson P3 - Bitmap Functions on the Apple II |
Lesson P12 - Joystick Reading on the Apple II | |
Lesson P23 (Z80) - Sound with the 'Beeper' on the Apple II |
The Apple IIc memory map is pretty
typical. We'll use Graphics Mode, and Page 2 - this means for our purposes the area $0C00-$3FFF can be used for our main program code. Notice that the area $C000-$FFFF allows us to access the hardware... Each "Port" has a different purpose, but rather strangely when we want to do something like set the graphics mode, we write ANY value to the graphics port... the value makes no difference! |
|
Writing
any value to these memory addreses causes the hardware change. For example, to change the system to graphics mode: lda #0 sta $C050 ; Text off sta $C052 ; Mixed Mode off sta $c057 ; Display hires sta $C055 ; Hires screen 2 Reading from the ports will also have the same effect! |
|
Colors on the Apple II are effectively an 'Artifact' of the
screen... certain combinations of Off (0) and On (1) pixels will appear colored... this is known as Composite Artifact colors... Unlike pretty much every system in existance, 8 bits of a byte draw 7 pixels!.... the top bit is a 'Color bit'... selecting 'Palette 0 or 1 The remaining 7 bits are the 7 pixels of bitmap data... because each line is 40 bytes wide, the Apple II screen is a rather odd resolution of 280�192 |
|
||||||||||||||||||||||||||||||||||||||
Because of these artifacts, a '2 color' bitmap will show colors
depending on the combination of the pixels... My Akusprite editor offers a half horizontal resolution mode, where the 4 colors will be converted to the correct bit combinations |
|
Memory addresses for Screen Mode 2 is
split into 3 chunks,also, every 8 lines we effectively 'reset' our
high memory address and add $80
Pixels in Each line are in normal Left->Right format, however remember 7 pixels are defined by each byte, with 1 bit defining the color palette. We can calculate the address of the start of a line by splitting the bits of the Y line number... YPOS:
Address= Base+(AA*$0028) + (BBB*$0080) + (CC*$0400) + XPOS |
|