• Please review our updated Terms and Rules here

Apple 2 Character ROM format?

mechaniputer

Member
Joined
May 23, 2015
Messages
47
Hi everyone,

I'm working on my Apple 2 emulator again. Trying to rewrite it to render the display through opengl instead of the hacky (text mode only) ncurses I was using up to now.

I've been trying to figure out what the format of the character roms is. For example I downloaded the 341-0036 ROM. The first 16 bytes of the ROM go:
0x1c 0x00 0x2a 0x22 0x2c 0x2e 0x1e 0x20 0x08 0x00 0x22 0x14 0x3e 0x22 0x22 0x22

Since the characters are 5x7 bitmaps, I'd expect that to contain several whole characters. No matter how I slice it though, it ends up displaying garbage. Anybody know how the ROM is formatted? Thanks!
 

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,177
Location
Chaffee, MO
It is likely in a ROW and COLUMN format. If you start at a known Character like 0x41 "A", you will see
how to decode the ROM. In fact, you can modify the HEX code in the ROM and burn that in an EPROM.
I've done that on my old TRS-80 Model 1.

I've attached the TRS-80 Model 4 Bitmap so you can see how a typical ROM is laid out in ROW / COLUMN
format.

Basically, every eight hex bytes is a Character. The first hex byte is Row 0, the next hex byte is Row 1........

Larry
 

Attachments

  • Row-Column.png
    Row-Column.png
    3.9 KB · Views: 4
  • M4-Chargen1.png
    M4-Chargen1.png
    8.7 KB · Views: 4

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,177
Location
Chaffee, MO
I found the Apple II Schematic and the 2732 ROM has A0, A1, A2 (the first 3 address Lines) to select from
2 ^ 3 = 8 Address {0..7} = 8 Bits for the first character. Of that 8 Bit by a Row Character only 7 rows of
{0..4} = 5 Bits are used for the Character.

Larry
 

Attachments

  • APPLE2VIDEO.png
    APPLE2VIDEO.png
    171.5 KB · Views: 4

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,177
Location
Chaffee, MO
I'm curious how you read the EPROM. The second Character should be "A" but it isn't.
So, it has to be a BAD read, or the EPROM is losing it's stored program.

Can you write a small assembly program to move the ROM into high Memory
and then save it? Or read it with an EPROM Programmer.

Larry
 

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,177
Location
Chaffee, MO
Your character is a 5 x 7 and the "A" is the second group of 8 HEX Bytes as follows:
0x08 xx001000
0x14 xx010100
0x22 xx100010
0x22 xx100010
0x3E xx111110
0x22 xx100010
0x22 xx100010
0x00 xxxxxxxx

A0, A1, A2 = 3 Bits that select 2 ^ 3 = 8 HEX Bytes to be read in a repeating pattern from the
2732 EPROM.

This matches what is in the chargen-lc.bin file.


Larry
 
Last edited:

resman

Veteran Member
Joined
Jan 1, 2014
Messages
511
Location
Lake Tahoe
Note that I shifted the characters up a scanline to get true lower case descenders (like the Apple //e) from the original 2513 and subsequent character ROMS. Those have the characters shifted a scanline lower (blank line on top) with no lower case. They are scanned out as a 7x8 matrix.
 

mechaniputer

Member
Joined
May 23, 2015
Messages
47
I'm curious how you read the EPROM. The second Character should be "A" but it isn't.
So, it has to be a BAD read, or the EPROM is losing it's stored program.

Can you write a small assembly program to move the ROM into high Memory
and then save it? Or read it with an EPROM Programmer.

Larry
It looks like the ROM I found online is a bad dump. I guess this shows the usefulness of trying to validate preserved data by actually using it. We have so much information about vintage computers preserved online, but how much of it has issues we don't even know about?
 

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,177
Location
Chaffee, MO
That HEX file in "Apple\ II\ Character\ ROM\ -\ 341-0036.bin" appears to be correct.
0x08 thru 0x0F have the the Character "A" that is moved down one Row.
are

Code:
00000000   00 1C 22 2A  2E 2C 20 1E  00 08 14 22  22 3E 22 22  .."*., ...."">""
00000010   00 3C 22 22  3C 22 22 3C  00 1C 22 20  20 20 22 1C  .<""<""<.."   ".
00000020   00 3C 22 22  22 22 22 3C  00 3E 20 20  3C 20 20 3E  .<"""""<.>  <  >
00000030   00 3E 20 20  3C 20 20 20  00 1E 20 20  20 26 22 1E  .>  <   ..   &".
00000040   00 22 22 22  3E 22 22 22  00 1C 08 08  08 08 08 1C  .""">"""........
00000050   00 02 02 02  02 02 22 1C  00 22 24 28  30 28 24 22  ......".."$(0($"

Larry
 
Top