Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

apple ][ lo res mode colors?

158 views
Skip to first unread message

Mad Scientist Jr

unread,
Sep 20, 2005, 12:35:04 PM9/20/05
to
Is it true that in lo-res mode (what was the resolution? or was it just
40 column text?) the original Apple II could display 16 colors? What
colors were they?

Thanks

Martin Doherty

unread,
Sep 20, 2005, 1:19:17 PM9/20/05
to
Lo-res mode colors:
0 - black
1 - red
2 - dark blue
3 - pink
4 - dark green
5 - dark gray
6 - mid blue
7 - light blue
8 - brown
9 - orange
10 - light gray
11 - apricot
12 - light green
13 - yellow
14 - aqua
15 - white

There are 40 pixels across, and 48 pixels down. This corresponds to the
text resolution of 40x24, since lo-res mode actually repurposes the same
RAM used by the text screens. Each text character corresponds to two
lo-res pixels stacked vertically (I'm not sure which nibble corresponds
to the upper and lower pixels). There are no restrictions to color
placement (unlike hi-res) since every pixel is true 4-bit color.

Most commonly you'll see a "mixed mode" which displays 40x40 color
pixels plus 4 lines of text at the bottom of the screen. This mode is
supported in Applesoft BASIC via the "GR" command. You can switch the
bottom four text lines into color pixels by PEEKing certain memory
locations (called softswitches) that change the display, but there is no
predefined BASIC command to do this. I say predefined because Applesoft
has a nifty feature that lets you code language extensions using the &
character. So, a very small machine language program and setting up some
vectors would allow you to code, say, &GR2 to set the full 40x48 lo-res
graphics. This is advanced Apple II programming, I haven't learnt how to
do it myself yet.

Sounds like you might enjoy downloading one of the many excellent Apple
II emulators (I use AppleWin on Windows) - just google for "Apple II
emulator". Craig Bower has written a very cool lo-res game called
SnakeByte that you might want to try out, as well as some other programs
that make great use of this neglected graphics mode.
http://www.turbo-2.com/apple (scroll to bottom)

Martin

aiia...@gmail.com

unread,
Sep 20, 2005, 1:37:46 PM9/20/05
to
>So, a very small machine language program and setting up some
>vectors would allow you to code, say, &GR2 to set the full 40x48 lo-res
>graphics. This is advanced Apple II programming

Not really advanced. There are articles on the net that
show how to set up & commands. The articles include
assembly language source, so you just insert the code
needed by your command and assemble it.

Also, there are plenty of lists of peeks,pokes, and calls
that list the graphics softswitches. All you need is 1 poke
to get into full screen mode.

softswitches include:
page1
page2
full screen
mixed mode (with text on the bottom)
graphics mode
text mode

John B. Matthews

unread,
Sep 20, 2005, 10:56:07 PM9/20/05
to
In article <MMXXe.27$Tg5...@news.oracle.com>,
Martin Doherty <martin....@undisclosed.com> wrote:
> [...]

> (I'm not sure which nibble corresponds
> to the upper and lower pixels).
> Martin

Even rows use the low nibble and odd rows use the high nibble

F800: 4A 102 PLOT LSR ;Y-COORD/2
F801: 08 103 PHP ;SAVE LSB IN CARRY
F802: 20 47 F8 104 JSR GBASCALC ;CALC BASE ADR IN GBASL,H
F805: 28 105 PLP ;RESTORE LSB FROM CARRY
F806: A9 0F 106 LDA #$0F ;MASK $0F IF EVEN
F808: 90 02 107 BCC RTMASK
F80A: 69 E0 108 ADC #$E0 ;MASK $F0 IF ODD
F80C: 85 2E 109 RTMASK STA MASK
F80E: B1 26 110 PLOT1 LDA (GBASL),Y ;DATA
F810: 45 30 111 EOR COLOR ; EOR COLOR
F812: 25 2E 112 AND MASK ; AND MASK
F814: 51 26 113 EOR (GBASL),Y ; EOR DATA
F816: 91 26 114 STA (GBASL),Y ; TO DATA
F818: 60 115 RTS

The LSR divides the Y-coordinate by two and saves the lowest bit in the
carry. Later, the carry bit is used to determine which mask (#$0F or
#$F0) will be used in this plot operation.

Any speculation on why Woz used ADC #$E0 at F80A instead of LDA #$F0?
They both take two bytes and two cycles.

--
John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/

Jerry

unread,
Sep 21, 2005, 1:19:30 AM9/21/05
to
John B. Matthews wrote:
> F800: 4A 102 PLOT LSR ;Y-COORD/2
> F801: 08 103 PHP ;SAVE LSB IN CARRY
> F802: 20 47 F8 104 JSR GBASCALC ;CALC BASE ADR IN GBASL,H
> F805: 28 105 PLP ;RESTORE LSB FROM CARRY
> F806: A9 0F 106 LDA #$0F ;MASK $0F IF EVEN
> F808: 90 02 107 BCC RTMASK
> F80A: 69 E0 108 ADC #$E0 ;MASK $F0 IF ODD
> F80C: 85 2E 109 RTMASK STA MASK
> F80E: B1 26 110 PLOT1 LDA (GBASL),Y ;DATA
> F810: 45 30 111 EOR COLOR ; EOR COLOR
> F812: 25 2E 112 AND MASK ; AND MASK
> F814: 51 26 113 EOR (GBASL),Y ; EOR DATA
> F816: 91 26 114 STA (GBASL),Y ; TO DATA
> F818: 60 115 RTS
[...]

> Any speculation on why Woz used ADC #$E0 at F80A instead of LDA #$F0?
> They both take two bytes and two cycles.

Perhaps...
1. To teach us how to use tricks in code? (Not too useful here, but
these types of tricks can be useful elsewhere. I wondered about this
when I read this code back in the day; after you figure it out, it sort
of expands your assembly-language horizons.)
2. To make sure the carry was always clear when the subroutine
finished. (Not that I have any reason for this either).

:)


--
Jerry Penner e-mail: remove the blips and _

Linards Ticmanis

unread,
Sep 29, 2005, 11:46:43 AM9/29/05
to
Hello,

Inspired by this thread I did the math to find out what the NTSC Apple
II/II+/IIe/IIc colors actually are. (The IIgs produces noticeably
different colors because of its RGB operation). Unfortunately, most
emulators don't get the colors right. Maybe somebody feels like patching
the correct color values as given here into some emulator(s)?

The PAL Apples produce almost identical colors to their NTSC cousins,
but unfortunately unlike for NTSC there's no pretty mathematical way to
calculate their theoretical values, since the PAL Apples use some
not-so-well-defined analog circuitry to add together luminance and
chrominance signals, while the NTSC Apples produce both luma and chroma
in a single digital process.

I'm assuming that the A2 logic circuits produce a perfectly rectangular
output on the video out, alternating between 0 (black) and 1 (white),
not counting the sync (which is added afterwards). This is pretty close
to what they actually do. The only possible error is a very slight one
in color saturation, hue and brightness should not be affected by this
assumption.

I'm also assuming that the NTSC decoder at the receiving end is
completely to (modern) spec. The original "NTSC 1953" norm called for
YIQ decoding and had different color primaries than modern sets, but
almost all TV sets actually produced use YUV decoding and the modern
primaries, which were then made the standard in "SMPTE 1979", the modern
NTSC norm. I follow the 1979 norm since the old norm is mostly of
theoretical value only, and when the Apple was released in 1977 the
modern norm was de facto already in place.

Then it is easy to mathematically derive the correct color values. All
it takes is a fourier transform of the waveform. The zeroeth coefficient
(which is 0.0 for black, 0.25 for the 4 "dark" colors, 0.5 for grey
and the four "mid" colors (which are also the hires colors), 0.75 for
the four "bright" colors, and 1.0 for white) of said transform gives the
luminance, the first coefficient (0 for black, grey, white, 1/(2*pi) for
the "mid" colors, and 1/(2*sqrt(2)*pi) for the "dark" and "bright"
colors) gives the color saturation. Phase angels (hues) are multiples of
90° for the 4 "dark" and the 4 "bright" colors, and multiples of 90°
plus 45° for the 4 "mid" colors.

The lores colors 4, 7, 8 and 11 are affected by clipping, i.e. when
these colors are used the Apple is telling the TV to produce a color it
can't actually produce since it's somewhat outside the gamut - none of
the three electron guns in the picture tube can be turned down below
zero power, or above maximum power. This clipping is taken into
consideration in the tables.

The resulting RGB values (in hex) in the SMPTE color space for the 16
lores colors are as follows:

NTSC Apple II Colors RGB Values in SMPTE 1979 color space
---------------------------------------------------------
R, G, B [ 0] = 0x000000 * Hires 0 & 3
R, G, B [ 1] = 0x901740
R, G, B [ 2] = 0x402ca5
R, G, B [ 3] = 0xd043e5 * Hires 2
R, G, B [ 4] = 0x006940
R, G, B [ 5] = 0x808080
R, G, B [ 6] = 0x2f95e5 * Hires 6
R, G, B [ 7] = 0xbfabff
R, G, B [ 8] = 0x405400
R, G, B [ 9] = 0xd06a1a * Hires 5
R, G, B [10] = 0x808080
R, G, B [11] = 0xff96bf
R, G, B [12] = 0x2fbc1a * Hires 1
R, G, B [13] = 0xbfd35a
R, G, B [14] = 0x6fe8bf
R, G, B [15] = 0xffffff * Hires 4 & 7

The numbers in square brackets are the lores color numbers (COLOR= in
Applesoft). The hires colors (HCOLOR= in Applesoft) are marked with an
asterisk.

Note that these RGB values are valid only for the SMPTE 1979 color
space. Converting them to sRGB color space (which is what modern PC
monitors *should* use when set to 6500K color temperature, most are at
least close; this is also the color standard for HDTV sets and for Web
pages) and linearily scaling their brightness so that the maximum
coefficient is 0xff, gives these slightly different values:

NTSC Apple II Colors RGB Values in sRGB color space
---------------------------------------------------
R, G, B [ 0] = 0x000000 * Hires 0, 3
R, G, B [ 1] = 0x8a2140
R, G, B [ 2] = 0x3c22a5
R, G, B [ 3] = 0xc847e4 * Hires 2
R, G, B [ 4] = 0x07653e
R, G, B [ 5] = 0x7b7e80
R, G, B [ 6] = 0x308fe3 * Hires 6
R, G, B [ 7] = 0xb9a9fd
R, G, B [ 8] = 0x3b5107
R, G, B [ 9] = 0xc77028 * Hires 5
R, G, B [10] = 0x7b7e80
R, G, B [11] = 0xf39ac2
R, G, B [12] = 0x2fb81f * Hires 1
R, G, B [13] = 0xb9d060
R, G, B [14] = 0x6ee1c0
R, G, B [15] = 0xf5faff * Hires 4 & 7

Hope this helps,
--
Linards Ticmanis

Message has been deleted

Linards Ticmanis

unread,
Sep 29, 2005, 11:56:42 AM9/29/05
to
Hello,

R, G, B [ 0] = 0x000000 * Hires 0 & 3 Black
R, G, B [ 1] = 0x901740 Magenta
R, G, B [ 2] = 0x402ca5 Dark Blue
R, G, B [ 3] = 0xd043e5 * Hires 2 Purple
R, G, B [ 4] = 0x006940 Dark Green
R, G, B [ 5] = 0x808080 Grey
R, G, B [ 6] = 0x2f95e5 * Hires 6 Medium Blue
R, G, B [ 7] = 0xbfabff Light Blue
R, G, B [ 8] = 0x405400 Brown
R, G, B [ 9] = 0xd06a1a * Hires 5 Orange
R, G, B [10] = 0x808080 Grey
R, G, B [11] = 0xff96bf Pink
R, G, B [12] = 0x2fbc1a * Hires 1 Light Green
R, G, B [13] = 0xbfd35a Yellow
R, G, B [14] = 0x6fe8bf Aqua
R, G, B [15] = 0xffffff * Hires 4 & 7 White

The numbers in square brackets are the lores color numbers (COLOR= in
Applesoft). The hires colors (HCOLOR= in Applesoft) are marked with an
asterisk.

Note that these RGB values are valid only for the SMPTE 1979 color
space. Converting them to sRGB color space (which is what modern PC
monitors *should* use when set to 6500K color temperature, most are at
least close; this is also the color standard for HDTV sets and for Web
pages) and linearily scaling their brightness so that the maximum
coefficient is 0xff, gives these slightly different values:

NTSC Apple II Colors RGB Values in sRGB color space
---------------------------------------------------

R, G, B [ 0] = 0x000000 * Hires 0 & 3 Black
R, G, B [ 1] = 0x8a2140 Magenta
R, G, B [ 2] = 0x3c22a5 Dark Blue
R, G, B [ 3] = 0xc847e4 * Hires 2 Purple
R, G, B [ 4] = 0x07653e Dark Green
R, G, B [ 5] = 0x7b7e80 Grey
R, G, B [ 6] = 0x308fe3 * Hires 6 Medium Blue
R, G, B [ 7] = 0xb9a9fd Light Blue
R, G, B [ 8] = 0x3b5107 Brown
R, G, B [ 9] = 0xc77028 * Hires 5 Orange
R, G, B [10] = 0x7b7e80 Grey
R, G, B [11] = 0xf39ac2 Pink
R, G, B [12] = 0x2fb81f * Hires 1 Light Green
R, G, B [13] = 0xb9d060 Yellow
R, G, B [14] = 0x6ee1c0 Aqua
R, G, B [15] = 0xf5faff * Hires 4 & 7 White

(I send this message in an unfinished state and canceled it, if you
receive this twice your news server doesn't honor cancels.)

Frank M.

unread,
Oct 6, 2005, 8:18:03 AM10/6/05
to
If you're interested, i've taken similar RGB values and made a
Photoshop CS palette that corresponds. i used it for rendering movie
frames into a lores 'movie' project. email me if you want the files or
a GR movie demo disk or just want more info. I digitized the video for
'white wedding' by billy idol (among other things).

-frank-
frank_...@hotmail.com

Linards Ticmanis

unread,
Oct 6, 2005, 9:14:17 AM10/6/05
to

Thanks for the offer, unfortunately I don't have Photoshop. I read the
thread about your lores movies, though, tried some of them. They're
pretty cool.

--
Linards Ticmanis

0 new messages