• Please review our updated Terms and Rules here

Business keyboard for PET 4032

azog

Experienced Member
Joined
Apr 19, 2004
Messages
127
Location
New Jersey
I have a PET 4032 with the "graphics" keyboard. It's a Fat-40 with CTRC. I'd like to use a "business" keyboard layout (which has number keys at the top row, rather than symbols, much like a normal keyboard).

I've found that keyboard decoding is part of the "edit ROM", and there were several different ones:

http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/index.html

Using the naming scheme on that list, the one I would like to find, if it exists, would be called edit-4-40-b-60Hz, which is unfortunately not listed here.

Does such exist?
 
I have a PET 4032 with the "graphics" keyboard. It's a Fat-40 with CTRC. I'd like to use a "business" keyboard layout (which has number keys at the top row, rather than symbols, much like a normal keyboard).

I've found that keyboard decoding is part of the "edit ROM", and there were several different ones:

http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/index.html

Using the naming scheme on that list, the one I would like to find, if it exists, would be called edit-4-40-b-60Hz, which is unfortunately not listed here.

Does such exist?
I doubt it. I believe there's a ROM out there for a 4032 with a real business keyboard (e.g. an 8032 modded into a Fat 40), as well as the ROM that converts the Fat 40 with graphic kb to an 8032, but I haven't seen a ROM that just decodes a graphic keyboard as the business version.

Shouldn't be too difficult though ;-)
 
Some people on this forum posted custom editor ROMs before, but I can't recall exactly which combinations were produced. As far as I know, the keyboard matrix part of the editor ROM is just an array of keycodes so you should be able to extract it from another business editor ROM and paste into the same place. If I recall correctly, it took me one or at most two attempts to cook up a DVORAK ROM, so this shouldn't be much more difficult given you have two sources to work from.

Hexane produced an edit-4-80-n-60Hz: http://vintagemashups.net/wp-content/uploads/2010/12/edit-4-80-n-60Hz.901474-03.bin
magicappstore produced an edit-4-80-n-50Hz: http://www.vectorlight.net/documents/vintage/pet/edit-4-80-n-50Hz.901498-01.bin

There may be more of those hidden at various sites. Those files most definitely should be uploaded to Zimmers and/or another PET file area, even if they're homebrewed.

See also this thread: http://www.vintage-computer.com/vcforum/showthread.php?23970-Keyboard-layout
 
Last edited:
I've found the keyboard decode table in edit-4-40-n-60Hz.901499-01. It is starting at offset location (decimal) 1855 for 80 characters.

I did also find the keyboard decode table for a business 80 column keyboard. It is at a different location, but the scancodes match http://www.zimmers.net/anonftp/pub/cbm/firmware/computers/pet/d/petio.txt

I copied the business keyboard scan into the ROM edit-4-40-n-60Hz.901499-01, but apparently the keyboard is physically wired differently between the two, so I'll have to manually edit what I want. As already mentioned, "should be possible", just a matter of pick-n-choose which scancode goes to which location. Ultimately I would just prefer to have the upper physical row (not scan row) of symbols mapped to numbers and characters, and leave everything else as it is, including the keypad.

If I have any success, I'll post a ROM image link here. I don't have a programmer, so I can only test it in VICE. I really really need to get a programmer, since this would be like the umpteenth time I've wanted one...
 
I'd rather use a hex editor and enter each scan code from the graphics keyboard into the position that I want the character to appear. As you might've read from the DVORAK thread I linked to, I had the idea to generate a such keymap like the one you're looking for, just that I'd use it on a non-CRTC 2001N/3000 model. The keymap part would be identical though. Obviously I never took that step, but if you do, I can borrow your results... ;-)

As for a programmer, perhaps you know someone who has one? The editor ROM is only 2K, so any 2716 or TMS2516 should work. It is a bit harder to replace the other ROM chips as they're 4K and the pin compatible 2532 part is harder to find and much fewer programmers support it. Of course one can install adapters to use the more common 2732 etc.
 
Well, here is my current progress: http://www.azog.org/40-b-test.bin

This works in VICE, and does indeed change the upper row to be numbers. But it reveals something I had not anticipated...

I think SHIFT handling is different between the 80 column and the 40 column models. This ROM above, when SHIFTed, simply sets the high bit. So while I now have numbers, I have no special characters...

But I guess it's a step forward.
 
Well, here is my current progress: http://www.azog.org/40-b-test.bin

This works in VICE, and does indeed change the upper row to be numbers. But it reveals something I had not anticipated...

I think SHIFT handling is different between the 80 column and the 40 column models. This ROM above, when SHIFTed, simply sets the high bit. So while I now have numbers, I have no special characters...

But I guess it's a step forward.
Yeah, I seem to recall something about that in one of the 40>80 conversion threads.

If you can get it working 100% in Vice I can test it in a real 4032 and burn an EPROM for ya.
 
The issue of course is that on a graphics keyboard, each shifted key generates a graphic symbol. Thus I'd expect when you move around the numeric keys and shift them, you'll get the graphic symbols associated with them. Also you need to rearrange the special symbols elsewhere, e.g. the former numeric keypad. If you came up with a solution that generates numbers + symbols on the top row, you'd end up with a keypad to the right with two sets of graphic symbols, for which you won't have matching keycaps anyway.

Perhaps you need a true business keyboard anyway, but I suppose it won't fit in the case cutout.
 
I still think it could be possible.

Since (graphical) SHIFT simply sets the high bit, the scan code probably looks like:

cpa #00 ; assuming that scancode 00 is the shift key (255 = no keys)
bne not-shifted
ora %10000000 ; set high bit
not-shifted:
... ; continue the reset of the scan

Looking at PETSCII codes, shifted characters on the numbers are $10 greater than the non-shifted. Instead of ORA'ing, it would just be an "ADC #$10".

There are other differences I am seeing.

And yes, the keyboard cutout would not hold the different keyboard. Even if I were to simply install the different keyboard, the matrix is different, and I would be back at square one. But this also reveals another avenue to explore...
 
Hm, the document on Zimmers says shift always sets the high bit to generate a graphic character, but if we check the CHR$ codes we see a differerent behaviour:

For scan codes $20 - $3F (space to ? mark), $80 will be added on shift to generate CHR$ codes $A0 - $BF.
For scan codes $40 - $5F (@, A, B, C ... to left arrow), $20 will be added on shift to generate CHR$ codes $60 - $7F.

I know that onscreen POKE codes are different, starting with @ = $00 and then going upwards, but it seems to me the scan codes more closely resembles CHR$ (or ASCII if you want) than POKE codes (the order the characters are stored in the character ROM).

What we're looking for here is a way to subtract $10 from each scan code in the range of $30-$39, which would have the by-effect that SHIFT+0 would generate a good old space. The question then remains how to generate graphic characters $B0-$B9.

Actually there must be a routine that takes the scan code, with or without the high bit set, and then translates it further. Without disassembling the ROM, I think there is where we'd need to start digging to radically change how the keyboard is read and displayed.
 
And yes, the keyboard cutout would not hold the different keyboard. Even if I were to simply install the different keyboard, the matrix is different, and I would be back at square one. But this also reveals another avenue to explore...
Well, finding and physically fitting a B keyboard might be tricky, but you'd just be converting an 8032 to a FAT40 after all, and that has been done and there is a ROM AFAIK. Might even be one that Anders pointed to.

For stuff like this I find a chip like the Dallas DS1220Y invaluable; no programmer required, just run a jumper to /WE and you can poke around to your heart's content without having to erase/reprogram etc. If you mess up, just put the original back in and put the DS1220 in one of the spare sockets, or add a 'bank-swap' switch.
 
Well, finding and physically fitting a B keyboard might be tricky, but you'd just be converting an 8032 to a FAT40 after all, and that has been done and there is a ROM AFAIK. Might even be one that Anders pointed to.

I've seen projects to convert a 4032 to an 8032 (FAT-40 upgrade), but not in reverse. Searches usually hit this particular type of upgrade. I did try the ROMs Anders posted, but they're for 80 cols.

But going on my hunch above, that the editor is simply ORA'ing the scanned codes, I actually found something a little promising. At $E578 is indeed an ORA $#80. I've patched in various values into this operand, and it indeed does change the SHIFT behavior.

This ROM edit replacees the ORA operand with 00. In effect it disables the SHIFT key by doing nothing to the original value: http://www.azog.org/40-no-shift.bin. This is cumulative to an earlier ROM edit I posted, which changed the upper row into numbers.

Still gonna run with this.
 
I've seen projects to convert a 4032 to an 8032 (FAT-40 upgrade), but not in reverse. Searches usually hit this particular type of upgrade. I did try the ROMs Anders posted, but they're for 80 cols.
If anybody knows, Anders or Steve would: am I dreaming or was there an 8032>FAT40 conversion discussed here (or somewhere else?), complete with ROM?
 
I can't remember. There might've been a discussion, but even then one would still have a proper business keyboard unlike the graphics keyboard azog is using, mimicing part of the business keyboard functionality.
 
I can't remember. There might've been a discussion, but even then one would still have a proper business keyboard unlike the graphics keyboard azog is using, mimicing part of the business keyboard functionality.
I thought we were talking hypothetically about using a business keyboard on a FAT40 (or the same thing, converting an 8032 to a FAT40, something I'm a little interested in myself) and whether in that case it might be easier to just mod the video part of the 8032 ROM 80 -> 40 instead of changing the FAT40 Graphic keyboard routines to Business.

I'm going to have to dig through my ROM images...
 
whether in that case it might be easier to just mod the video part of the 8032 ROM 80 -> 40 instead of changing the FAT40 Graphic keyboard routines to Business

Looking at the FAT40 upgrades to an 8032, it appears the primary differences is additional screen RAM and glue logic, as well as a new dot clock (doubled from the 40 column version). Apparently the CRTC makes no distinction between 40 and 80 column, so the dot clock must be derived in ROM. But where? Assuming if you halve the dot clock of an 80 column screen to 40 columns, you would not even need the additional screen RAM and decoders.

In any event, I've made some further progress on remapping the keyboard scan table and shift routines. I have it to the point where numbers appear on the upper row, and the proper symbols appear when SHIFTed.

In the meanwhile, these changes lose the graphics characters, but have an idea how to cope with that. Logically it's pretty easy (if the keycode equals 30, the shifted version is 5c. If it is between 31-39, subtract 16; otherwise set the high bit). There is 17 free bytes in the SHIFT handler, of which I've used 9 bytes, leaving 8 bytes free to do the rest...

I need to try to find the SHIFT handler in an 8032/80 column ROM to see how it's dealt with.
 
Here we go:

http://www.azog.org/edit-4-40-hybrid-60Hz.bin

This modifies the keyboard layout so that numbers appear in the upper row, symbols appear on the shifted numbers, and most of the graphics characters are retained (you lose the graphics characters from the upper row).

If you're interested in gory details: http://www.azog.org/?p=1722

MikeS offered to burn me a ROM, I'd like to take him up on that offer :)
 
Back
Top