PECBM-11 (88 x 100 Pseudo-hires-mode for the PET/CBM 3032 and 4032).

Instructions:

SYS 32584: Turn on mode
SYS 32435: Copy graphic-data from ($4ACC-$5363) into display-routine
SYS 32406: Turn off mode

Technical background:

The release of the demo "A Bright Shining Star" by Genesis Project in July 2022
proved how graphics data can be displayed - with certain limitations - on the
Commodore PET. In short this is accomplished by code that is racing the raster-
beam and updating the characters in video-RAM just before they are displayed.
As such each 8 pixel-block consists of the corresonding line of one of the
256 ROM-characters.

As a rasterline takes 64 cycles on the PET, with usual LDA#/STA$-technique
(taking 6 cycles each) you can update 10 characters per rasterline this way.
This mode is called PECBM and stand for "PET Extended Char Bitmap".

My mode uses the same basic technique, but can display 11 chars-wide graphics
(88 pixels) instead of just 10 (80 pixels). This is accomplished by pre-loading
the first line of each of the 25 characters lines using the cycles gained by
this to update another character in each rasterline.
In other words: Instead of updating 10 characters per line for 8 lines which
takes 10 * 8 * 6 = 480 cycles - I update 11 characters per line for 7 lines
which takes 11 * 7 * 6 = 462 cycles. All this in a total of 8 rasterlines of
64 CPU-cycles = 512 cycles. I use the remaining 50 cycles per 8-rasterline-
block to update the first 8 characters of each first character-rasterline.
The reamining 3 characters of the first character-rasterline are updated during
VBLANK.

The display-routine itself is accomplished by setting up a VIA-timer-IRQ that
is synced to the VBLANK-bit and stabilized on each call, effectively providing
a stable-raster-interrupt. The original PIA-interrupt is deactivated (or
avoided in BASIC 2). The IRQ-display-routine takes about 208 of the 260
rasterlines the PET has and it still needs to do its normal housekeeping after
that, but simple BASIC-programs still are able to be run, even more so if you
turn off the graphic-display when not needed.

I also adapted the display-routine slightly so it would work on the
PET/CBM 4032. The 40xx PETs have a CRTC-controller that produces the display
differently than the older PETs. It is quite flexible and can be set to a mode
that closely enough resembles the older PETs display-characteristics. However,
since it reports the VBLANK slightly differently a separate display-routine
needs to be loaded when a 4032 is recognized or chosen.

tokra, signing off, August 28th 2023