💾 Archived View for mirrors.apple2.org.za › archive › ground.icaen.uiowa.edu › MiscInfo › Programmin… captured on 2024-07-09 at 04:06:15.

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

From jonINTERNETrelayCHAT@napaVALLEYnet.CLARInet Sun Feb 13 11:34:39 CST 2000

On screen, every 14 columns:
           |G|  |CT1|   |CT1|   |CT1|   |---CT1---|   |CT1|   |CT1|   |CT1|
           v v  v   v   v   v   v   v   v         v   v   v   v   v   v   v
Column:    CGB C00 C01 C02 C03 C04 C05 C06   CGB C07 C08 C09 C10 C11 C12 C13
Bit Value: 128 001 002 004 008 016 032 064   128 001 002 004 008 016 032 064
                                             ^ ^
                                             |G|

In memory, every 2 bytes:
           |G|      |CT2|   |CT2|   |CT2|    |G|  |CT2|   |CT2|   |CT2|
           v v      v   v   v   v   v   v    v v  v   v   v   v   v   v
Column:    CGB C06 C05 C04 C03 C02 C01 C00   CGB C13 C12 C11 C10 C09 C08 C07
Bit Value: 128 064 032 016 008 004 002 001   128 064 032 016 008 004 002 001
                ^                                                         ^
                |---------------------------CT1---------------------------|

CT1 bit pairs:
      00 = Black  01 = Blue or Magenta  10 = Orange or Green  11 = White

CT2 bit pairs:
      00 = Black  01 = Orange or Green  10 = Blue or Magenta  11 = White

G (color group) bits:
      0 = Black, White, Magenta, or Green  1 = Black, White, Orange, or Blue

Column values are column on screen modulo 14.

On the two bits that are from two different bytes, if the two bytes have
different color group bits then 01 or 10 will result in brown, purple,
cyan, or pink:

  Color Group Bits As In Memory
        \/      \/
        01      10
+> 01  Brown   Pink
+> 10  Cyan   Purple
|
+- Bit Pair Bits

The above table might not be right. The Apple II has a way of not
cooperating with consistancy in the way of HiRes graphics.

To work around some of these wacky limitations, you can use the following
subroutines:

Pix^2 Version 1:
  63999 HCOLOR=ZZ : HPLOT (XX*2),(YY*2) TO (XX*2)+1,(YY*2) TO (XX*2)+1,(YY*2)+1
        TO (XX*2),(YY*2)+1:RETURN
Draws bulky square pixels on the screen. XX is loaded with the horizontal
coordinate, a number between 0 and 139. YY is loaded with the vertical
coordinate, a number between 0 and 95. ZZ is loaded with a color number,
which is from 0 to 7. 0 or 4 is black, 1 is green, 2 is magenta, 3 or 7 is
white, 5 is orange, and 6 is blue. Color group conflicts will occur.

Pix^2 Version 2:
  63999 HCOLOR=ZZ : HPLOT (XX*2),YY TO (XX*2)+1,YY : RETURN
Draws rectangular pixels on the screen. XX is loaded with the horizontal
coordinate, a number between 0 and 139. YY is loaded with the vertical
coordinate, a number between 0 and 191. ZZ is loaded with a color number,
which is from 0 to 7. 0 or 4 is black, 1 is green, 2 is magenta, 3 or 7 is
white, 5 is orange, and 6 is blue. Color group conflicts will occur.

Pix^2 Version 3 Beta:
  63990 IF ZZ = 7 THEN ZZ = 3
  63991 IF ZZ = 4 THEN ZZ = 0
  63992 XX = XX*2
  63993 IF ZZ <> 0 AND ZZ <> 3 THEN GOTO 63008
  63994 VTAB INT(YY/8)+1:BA=((PEEK(40)+(256*PEEK(41)))-1024)+8192
  63995 BA=BA+(1024*(YY-(INT(YY/8)*8)))+INT(XX/7)
  63996 IF BA <> INT(BA) THEN BA = INT(BA)
  63997 IF PEEK(BA) > 128 THEN ZZ = ZZ + 4
  63998 XX = XX/2
  63999 HCOLOR=ZZ : HPLOT (XX*2),YY TO (XX*2)+1,YY : RETURN
Draws rectangular pixels on screen. XX is loaded with the horizontal
coordinate, a number between 0 and 139. YY is loaded with the vertical
coordinate, a number between 0 and 191. ZZ is loaded with a color number,
which is from 0 to 7. 0 or 4 is black, 1 is green, 2 is magenta, 3 or 7 is
white, 5 is orange, and 6 is blue. Checks the color group bit of the
existing pixels so that using white or black won't change the color group
bit regardless of whether you use 0, 3, 4, or 7 as the value of ZZ. Since
this subroutine is in beta, don't expect it to work.

These subroutines are backwards compatible. Version 2 does everything
version 1 did, and version 3 does everything version 2 does. Programs that
use version 1 can also use versions 2 and 3, and programs that use version
2 can also use version 3.

-- 
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
jonrelay@napanet.net                        dimension18.cjb.net
An Apple II fanatic since 1998!     S0.5 LIS+++! Suzy+++! M1987
A Macintosh fanatic since 1996?       OM0.1 OZY++ MIL+++! M1987
An Ozy & Millie fanatic since 2000. MC1.0 CHL+++! TAM+++! M1987
"Remember, if it's not a secure web server, it's an _insecure_
web server!"                                              -- Me

 *_     Syntax Error: an error on a criminal's tax record.
   |    Bad Subscript: a criminal reading a book on a subway.
  ---   Unimplemented Trap: when a bear trap isn't set up 
 |' ,|  properly and thus does not work.
  ---   Overflow: too many ice cubes.      <Can't Restart>

          Don't forget: Tammy Day on February 15th!
Please remove capital letters from my e-mail address to respond.