In this tar file:

VIOv20.asm      disassembly of the original VIO 1P 2.0 ROM
VIOv20.bin      binary image "  "     "      "   "  "   "
VIOv20.hex      Intel hex image "     "      "   "  "   "
vio_v20_annotated.asm disassembly of the original VIO 1P 2.0 ROM with some added comments
vio_v20mod.asm  modified assembly to eliminate weird mangling of "`afg["
vio_v20mod.bin  binary from asm file above
vio_v20mod.hex  Intel hex from bin file above
vio_v20mod.lst  listing produces during assembly
vio_v20modpal.hex modified monitor with proper PAL-video compatible timings for the 6845
VIOchar.bin     original character ROM
VIOchar.hex     Intel hex image 
VIOchar.txt     Textual presentation of the character ROM


z80asm -i vio_v20mod.asm -o vio_v20mod.bin
z80asm -i vio_v20mod.asm -lvio_v20mod.lst

The weird mangling process:
At a28eh a routine checks the character to print with a short table. If a
character matches, the value is replaced by the corresponding value from
the second part of the table. Clever code, and a nice demonstration of the 
cpir instruction which is really a search instruction. 
But as it mangled every character to be printed, I nopped the call out.
That and a remark at the end of the code are the only changes to the code.


First half of the table. For these characters is searched:
a295h - 60h  `
a296h - 61h  a
a297h - 66h  f
a298h - 67h  g
a299h - 5Bh  [

Second half of the table. These are the replacements:
a29Ah - 61h  a
a29Bh - 66h  f
a29Ch - 68h  h
a29Dh - 6Ch  l
a29Eh - 5Eh  ^

MC 6845 VDU register values. Original 20x40, PAL compatible, for 25x40 (with 8x9 font ROM):
REGTAB:
	defb	00h, 03fh	; R0  Horizontal Total         ;             ;
	defb	01h, 028h	; R1  Horizontal Displayed     ;             ;
	defb	02h, 030h	; R2  Horizontal Sync Position ;             ;
	defb	03h, 005h	; R3  Horizontal Sync Width    ;             ;
	defb	04h, 019h	; R4  Vertical Total           ;             ; 01eh for 25 rows, 8x9 font
	defb	05h, 00eh	; R5  Vertical Total Adjust    ; 01h for PAL ;
	defb	06h, 014h	; R6  Vertical Displayed       ;             ; 019h for 25 rows, 8x9 font
	defb	07h, 017h	; R7  Vertical Sync position   ; 16h for PAL ; 01ah for 25 rows, 8x9 font
	defb	08h, 000h	; R8  Interlace and Skew       ;             ;
	defb	09h, 00bh	; R9  Maximum Raster Address   ;             ; 009h for 25 rows, 8x9 font
	defb	0ah, 060h	; R10 Cursor Start Raster      ;             ;
	defb	0bh, 009h	; R11 Cursor End Raster        ;             ;
	defb	0ch, 000h	; R12 Display Start Address (High) ;         ;
	defb	0dh, 000h	; R13 Display Start Address (Low)  ;         ;
	defb	0eh, 000h	; R14 Cursor Address (High)        ;         ;
	defb	0fh, 000h	; R15 Cursor Address (Low)         ;         ;
	defb	PARTERM		; table terminator
RTEND:

fjkraan@electrickery.nl, 2023-02-08
