• Please review our updated Terms and Rules here

PET Character ROM replacement revisited

jltursan

Veteran Member
Joined
Sep 24, 2010
Messages
842
Location
Madrid, Spain
After drooling over the sgray's colour PET project, I've been trying to found some more info about this cool project, the character ROM replacement. Seems that for(,,)/Nils haven't updated the project since a while.

Are there any known updates to the project or maybe it can be found anywhere in its original form?, also I know it has been asked before; but, any plans to build a small batch of PCB? :)
 
Shhh, don't tell anyone... I want to add programmable character sets to ColourPET ;-) I actually purchased a couple dual-port rams to try to build Nils' circuit, although I got a larger capacity, so I would only need one ;-)
I have the pdf's of Nils' project if you need a copy.

It can be done with normal ram rather than dpram (which is expensive), but would require extra support chips. I've worked out a block diagram of how it would work and I need to decide which would be the best way to implement it.

Steve
 
On the other hand, if you just want to select among a number of different complete (fixed) sets it would be trivial to put them into a large E(E)PROM in one of JB's adapters and select among them with a switch or one of the PIA ports.
 
Sure, but where's the fun in trivial? ;-) I hear it would be trivial to build a 40/80 column hardware switching board for the pet too! ;-) Sorry, couldn't resist!

Steve
 
Sure, but where's the fun in trivial? ;-) I hear it would be trivial to build a 40/80 column hardware switching board for the pet too! ;-) Sorry, couldn't resist!

Steve
You're right, that does sound trivial ;-)

But the multiple sets in one EPROM might be worth mentioning somewhere, especially if you find a suitable I/O pin or pins; what do the other bits in the POKE 59468,12 or 14 do?

In any case, a similar POKE to change character sets (English to German or Japanese for example) or even to "fix" programs that were confused by the original PET having different character sets might be useful to someone and worth writing up...
 
The way it works is you have 14 address lines from the CRTC controller. Ten of those address lines are used to access the ram (2^10 = 1024 bytes). The top 4 lines are not used for ram. The top two of those 4 are used to invert the video signal and to select the upper 2K of a 4K character rom (if installed). The other 2 of those 4 lines are unused. By changing the register that controls the video ram start address you can force any of those upper 4 lines to be on or off. We could use those 2 unused lines as an extended character set selector or other uses (like toggling Colour on/off, or changing between 40/80 columns -- assuming you have the right hardware attached ;-) ).

Steve
 
I want to add programmable character sets to ColourPET I actually purchased a couple dual-port rams to try to build Nils' circuit, although I got a larger capacity, so I would only need one

That sounds absolutely cool!, when will be available? ;)
I remember reading that the standard RAM version needed 5-6 logic ICs, does a PCB schematic ever existed for this?

The idea of using several ROM character sets is also interesting. I'm not sure how big is the character matrix (always 8x8 in PET machines?); but maybe a slighty bigger pseudo-hires can be doable by redefining a new set of 2^6 shapes giving a 2x3 pixel matrix for each character. A 80x75 is not a big achievement; but it's better than nothing. Of course if would be uneven in the Y axis, being each third pixel smaller than the others; but I've done something similar in the Exidy Sorcerer and doesn't looks bad. Can think on any other way to increase the resolution of these pseudo graphic modes...

Also, I remember switching between two ROM banks (in a PCjr) using software and the BASIC MOTOR instruction that switches high/low a 8255 pin tied to the ROM, maybe it's doable in the PET.

And just brainstorming, can't be the character ROM space addressing routed to another RAM addressing. This way the full charset would be redefinible over standard RAM. If a vector can be defined somewhere and the hardware can use it, it would be the definitive solution. Just dreaming...
 
Oh, I'd say 2018 or so :) I don't know of any existing soft-font only boards, but there was one "graphics board" called the SuperSoft HR board that comes close.

Characters use an 8x8 matrix, but the CRTC chip could handle taller. For example, the CBM-II machines have an 8x16 matrix (8x14 visible). You'd need to make some modifications on the PET to support a larger matrix (yes, I've even considered this too).

The PET font contains "semigraphics" characters that allow you to control 4 blocks within each character, so yes you can get 80x50 "pixels" on a regular 40x25 character screen. It is possible to burn an alternate character set with say 6 blocks per character to get 80x75 "pixels". It's possible to adjust the character height. so you could set it to 6 pixels that way it would be more uniform (4 wide by 2 high pixels).

The character set is not mapped into the address space. It's only available to the video circuitry. Nils' solution is to use dual-port ram, which lets the chip be accessed by two different circuits at the same time. DPRAM is simpler to implement, but expensive and small capacity (1K to 8K). I picked up some IDT7134 4kx8 dpram chips so I only need one, rather than the two 1K dprams in Nils circuit. This also matches the 4K maximum character rom size in the PET (of which normally only 2K is installed. 4K roms are in the SuperPET to allow APL character set)

With normal ram only one can access at a time, so you need to add multiplexers. You need one quad multiplexer chip for every 4 address lines. The character set has 12 so you need 3 chips. You also need 2 quad buffer chips for the 8 data lines. Including one RAM chip that's 6 chips so far. On top of that you need a couple more chips to map the ram into the address space and select if rom or ram is accessed by the video circuit, so 1 or 2 more.

With regular ram you could potentially have more capacity (say 32K). With 32K character ram you could do some interesting IRQ tricks and simulate a complete bitmap screen. To have larger font ram (or ROM) you'd also need a way to control the upper address lines, so you'd need to map a latch somewhere in memory, which would add a couple more chips.

I don't know if it's feasible to have the character set in main ram...

Steve
 
Last edited:
...We could use those 2 unused lines as an extended character set selector or other uses (like toggling Colour on/off, or changing between 40/80 columns -- assuming you have the right hardware attached ;-) ).
Steve
The advantage of using a bit of the user port to switch a character set would be that it would work equally well on both the old non-CRTC PETs and the new ones. A single jumper wire in either case, just a different place to clip it to.

I guess if you reallywanted programmability you could just do something similar to the existing video circuitry, with some RAM multiplexed between the CG area and one of the spare ROMs, and a control bit to switch between the CG ROM and the RAM; would need some pretty tricky timing if you wanted it on a by-character basis.
 
As a matter of fact a friend and I both had dual character sets in our 2001-8s way back when. I even wrote an editor to create the characters; wonder if it's still around on an old tape somewhere...
 
I think at minimum you want it software controllable. I don't think switching character-by-character is needed.... I can't even imagine how to do that ;-)

Steve
 
I think at minimum you want it software controllable. I don't think switching character-by-character is needed.... I can't even imagine how to do that ;-)

Steve
Switching wouldn't really be much different from what you're doing in the Colo(u)rPET; loading would be tricky, but you could have several pre-loaded 'layers' to pick from. Let's see, a 512K EPROM would give you 32 different sets or layers with only 5 bits...

BTW, what's the magic poke to select the alternate character set in the CRTC models?
 
Switching wouldn't really be much different from what you're doing in the Colo(u)rPET; loading would be tricky, but you could have several pre-loaded 'layers' to pick from. Let's see, a 512K EPROM would give you 32 different sets or layers with only 5 bits...

BTW, what's the magic poke to select the alternate character set in the CRTC models?

Not sure I'm following?!? switching complete sets is easy. character-by-character? hmmm. But yes, if you had a large set of font's on a big eprom you'd have to control it with something other than the crtc lines. You'd need a latch mapped into memory somewhere. Perhaps by detecting a write to ROM area, like $E000 or $F000.

Register 12 is "start address hi". You want to set bits 4 and 5 (RVS and CHR OPTION), so:

poke 59520,12: poke 59521,48

Steve
 
Not sure I'm following?!? switching complete sets is easy. character-by-character? hmmm.
OK, I'll admit I haven't thought through the details and am just exploring different options off the top of my pointy head, and we are also actually talking about several different things (and you've played with this a lot more than I have).

But what if, instead of 4 or 8 bits to select a colour as in your ColourPET they selected a character 'plane' instead?

As to loading a CG RAM, you have indirect access to the CG address lines so all you'd need would be a MUX to access the data lines instead of the fixed connection to the SR and a routine to cycle through all the characters while writing the dot patterns to the RAM. Simple, right? ;-)

Also, as you know, unlike bits 0-6 video bit7 isn't connected to the CG but reverses the video, while bit 7 of the CG comes from CA2 of the VIA which selects Graphic mode; I'm still thinking that instead of reverse video you could use bit 7 to select a different set of characters (with a bit in a port somewhere to restore normal mode for compatibility). This goes back to my wanting to display both the normal and the Japanese characters together on the same page.

Just thinking out loud...

Register 12 is "start address hi". You want to set bits 4 and 5 (RVS and CHR OPTION), so:

poke 59520,12: poke 59521,48

Steve
Thanks; I'll play with that when I get a chance.
 
Last edited:
OK, I'll admit I haven't thought through the details and am just exploring different options off the top of my pointy head, and we are also actually talking about several different things (and you've played with this a lot more than I have).

But what if, instead of 4 or 8 bits to select a colour as in your ColourPET they selected a character 'plane' instead?

As to loading a CG RAM, you have indirect access to the CG address lines so all you'd need would be a MUX to access the data lines instead of the fixed connection to the SR and a routine to cycle through all the characters while writing the dot patterns to the RAM. Simple, right? ;-)

Also, as you know, unlike bits 0-6 video bit7 isn't connected to the CG but reverses the video, while bit 7 of the CG comes from CA2 of the VIA which selects Graphic mode; I'm still thinking that instead of reverse video you could use bit 7 to select a different set of characters (with a bit in a port somewhere to restore normal mode for compatibility). This goes back to my wanting to display both the normal and the Japanese characters together on the same page.

Just thinking out loud...

Thanks; I'll play with that when I get a chance.

Ok, I think I get you now. What you are saying is to use some of the "colour ram" memory bits to select a font rather than colour. We have 8 bits, 4 foreground and 4 background. It would be possible to use the 4 background bits to select one of 16 character sets, and that could be set on a per-character basis. It could work I think. So we would have 16 x 128 =2048 possible characters on the screen (128 unique characters due to the hardware reverse bit). If we made those characters redefinable then we effectively have a complete 320x200 bitmap mode, with the benefit of each 8x8 block being one of 16 colours. Nice. 2048 characters also works nicely for future 80 column ColourPET giving us a 640x200 bitmap. Somehow I think this will take more than 2 chips! ;-) LOL

As for bit 7... Yes, that limits you to 128 unique characters plus the reverse. It would be possible to connect that bit 7 back up to the character rom to give 256 unique characters and then you shift the higher address lines up one (the first pet actually had all 8 bits connected like this). While we're at it, we could also connect the CRTC chip's RA3 line and have 16 pixel tall characters. We would double the vertical resolution to 400 pixels. Then we... ahhhh!!!!! Where will it end? ;-)

Steve
 
Well, I worked out a block diagram for a proposed "ColourPET40+SoftFont/Graphics" board. I've incorporated 16 selectable soft-font sets (each set is a complete 4K character rom containing 4 fonts, so 64 total fonts), 64 rom fonts, and I've added some additional ColourPET features, like transparent background, and definable background and border colours. At the moment the design is approximately 14 IC's but probably needs 4-6 more to complete. It will probably require mounting on two sockets, one ribbon cable, plus a few additional flyouts to the motherboard, but it's definitely do-able. It will contain a 64K sram, which will allow a full 320x200 bitmap mode (perhaps two) with 16 colours (one per 8x8 block), plus 64K character set eprom.

I'm debating whether to include an rgb to composite video converter, and perhaps some other goodies. I can also include a 16-pixel tall font option but that will cut the total fonts in half and require some motherboard hacking (not much really).

I have most of the parts now, except the rgb encoder, and will try to breadboard it if there is some interest...

Steve
 
Last edited:
It will contain a 64K sram, which will allow a full 320x200 bitmap mode (perhaps two) with 16 colours (per 8x8 block), plus 64K character set eprom.

(snip)

I have most of the parts now, except the rgb encoder, and will try to breadboard it if there is some interest...
Double wow!

Interest shown,
Robert Bernardo
Fresno Commodore User Group
http://videocam.net.au/fcug
 
Back
Top