	title	Resetprogramm fuer JOYCE
	name	('RESET')

; Diseses Programm setzt einige Einstellungen
; des JOYE/PCW in den Grundzustand:

; Bildschirm:
; - Ausschalten der 24x80 Einstellung
; - Statuszeile einschalten
; - Cursor sichtbar machen
; - Normales Videoattribut einschalten
; - Unterstreichung ausschalten
; - Dunklen Hintergrund einschalten
; - Hellen Vordergrund einschalten
; - Cursor in die obere linke Ecke setzen
; - Bildschirm loeschen

; Tastatur:
; - Ruecksetzen aller Belegungen

; Zeichensatz:
; - Nationalen Zeichensatz einstellen auf Amerikanisch
;   oder mit Wahl 0..7 wie im Handbuch beschrieben
; - Bei keiner Wahl oder 0..7 Ruecksetzen des gesamten
;   Zeichensatz sonst wird Zeichensatz nicht angefasst

; Copyright (C)	Werner Cirsovius
;		Hohe Weide 44
;		D-2000 Hamburg 20
;		Tel.: 040/4223247

;		Version 1.0, Mai 1987

DEFLANG	equ	0		; Voreingestellet Sprache - Amerikanisch
				; Kann 0..7 sein

OS	equ	0000h
BDOS	equ	0005h
CCP	equ	0080h

.conout	equ	 2
.string	equ	 9
.vers	equ	12

CPMv	equ	030h

null	equ	00h
tab	equ	09h
cr	equ	0dh
esc	equ	1bh
eot	equ	'$'
DEL	equ	7fh

_USERF	equ	30

TE_RES	equ	00c2h
KM_EXP	equ	00d4h
KM_KEY	equ	00d7h
SCR_RUN	equ	00e9h

CHARMTX	equ	0b800h
COMRAM	equ	0c000h

MSB	equ	10000000b

$LAN_V_K.RES:			; \
	db	'Zeichensatz ('	; |
	db	023h		; |
	db	040h		; |
	db	05bh		; |
	db	05ch		; |
	db	05dh		; |
	db	05eh		; |
	db	060h		; |
	db	07bh		; |
	db	07ch		; |
	db	07dh		; |
	db	07eh		; |
	db	'), '		; |
$DUMMY:				; |
	db	eot		; /
$RES.STRG:
	db	'Bildschirm und Tastatur eingestellt',eot
$ILL.CPU:
	db	'Benoetigt Z80 CPU',eot
$ILL.OS:
	db	'Benoetigt CP/M 3.x',eot
$RES.VIDEO:
	db	'y'		; Ausschalten der 24x80 Einstellung
	db	'1'		; Statuszeile einschalten
	db	'e'		; Cursor sichtbar machen
	db	'q'		; Normales Videoattribut einschalten
	db	'u'		; Unterstreichung ausschalten
	db	'c'+MSB,63	; Dunklen Hintergrund einschalten
	db	'b'+MSB,0	; Hellen Vordergrund einschalten
	db	'H'		; Cursor in die obere linke Ecke setzen
	db	'E'		; Bildschirm loeschen
	db	null
;
; Programm RESET starten
;
RESET.START:
	sub	a		; CPU pruefen
	ld	de,$ILL.CPU
	jp	pe,FinalStrg	; Muss Z80 sein
	ld	c,.vers
	call	BDOS		; Betriebssystem ueberpruefen
	cp	CPMv
	ld	de,$ILL.OS
	jr	c,FinalStrg	; Muss CP/M PLUS sein
	ld	de,3*(_USERF-1)
	ld	hl,(OS+1)
	add	hl,de		; USER_Funktion berechnen
	ld	(XBIOS+1),hl	; Eintragen
	call	XBIOS		; Terminal zuruecksetzen
	dw	TE_RES
	ld	hl,$RES.VIDEO
	call	PutStrg		; Kontrollsequenz ausgeben
	ld	de,$DUMMY
	ld	hl,CCP		; Zeiger auf Befehlseingabe
	ld	a,(hl)		; Test ob Eingabe
	or	a
	ld	a,'0'+DEFLANG
	jr	z,DefMatrix	; Nein, Voreinstellung benutzen
SkpBlnk:
	inc	hl
	ld	a,(hl)		; Eingabe testen
	cp	' '
	jr	z,SkpBlnk	; Leerzeichen ignorieren
	cp	'0'		; Bereich testen
	jr	c,NoMatrix
	cp	'7'+1
	jr	nc,NoMatrix	; Zeichensatz nicht anfassen
DefMatrix:
	call	ResMatrix	; Zeichensatz setzen
	ld	de,$LAN_V_K.RES
NoMatrix:
	push	de
	call	ResToken	; Erweiterungszeichen setzen
	call	ResKey		; Zeichen setzen
	pop	de
	ld	c,.string
	call	BDOS
	ld	de,$RES.STRG
FinalStrg:
	ld	c,.string
	call	BDOS		; Letzte Meldung ausgeben
	jp	OS		; Und Ende
;
; Sprung auf USER_Funktion
;
XBIOS:
	jp	$-$
;
; Kontrollsequenz in ^HL ausgeben
;
PutStrg:
	ld	a,(hl)		; Zeichen holen
	or	a		; Test ob Ende
	ret	z
	res	7,a		; Hochwertiges Bit ausschalten
	call	ESCout		; Als ESCape-Sequenz ausgeben
	bit	7,(hl)		; Test ob Parameter kommt
	inc	hl
	jr	z,PutStrg	; Nein
	ld	a,(hl)		; Parameter holen
	call	Conout		; Und ausgeben
	inc	hl
	jr	PutStrg
;
; ESCape-Sequenz 'ESCape Akku' ausgeben
;
ESCout:
	push	af
	ld	a,esc
	call	Conout		; ESCape ausgeben
	pop	af
;
; Zeichen im Akku auf Konsole ausgeben
;
Conout:
	push	hl
	ld	e,a
	ld	c,.conout
	call	BDOS		; Ausgeben
	pop	hl
	ret
;
; Tastaturzeichen setzen
; ENTRY	Register B haelt ASCII-Wert
;	Register C haelt Tastennummer
;	Register D haelt Statusbits
;
KeySet:
	push	hl
	push	bc
	call	XBIOS		; Zeichen setzen
	dw	KM_KEY
	pop	bc
	pop	hl
	ret
;
; Tasten besetzen
;
; Teil 1: Tasten fuer normal und Shift-Zustand setzen
;
ResKey:
	ld	hl,NORM.TAB	; Tabelle laden
NormLoop:
	ld	c,(hl)		; Nummer der Taste holen
	inc	hl
	ld	b,(hl)		; ASCII-Wert holen
	inc	hl
	ld	d,0000001b	; Auf normal setzen
	call	KeySet
	ld	d,0000010b	; Auf Shift setzen
	call	KeySet
	ld	a,(hl)
	cp	-1		; Ende testen
	jr	nz,NormLoop
;
; Teil 2: Spezialtasten setzen
;
	ld	hl,SPEC.TAB
SpecLoop:
	ld	c,(hl)		; Nummer der Taste holen
	inc	hl
	ld	d,(hl)		; Bit-Zustand holen
	inc	hl
	ld	b,(hl)		; ASCII-Wert holen
	inc	hl
	call	KeySet		; Taste definieren
	ld	a,(hl)
	cp	-1		; Ende testen
	jr	nz,SpecLoop
;
; Teil 3: Buchstabentasten setzen
;
	ld	hl,LETT.TAB
LettLoop:
	ld	c,(hl)		; Nummer der Taste holen
	inc	hl
	ld	b,(hl)		; ASCII-Wert holen
	inc	hl
	ld	d,0000001b	; Auf normal setzen
	call	KeySet
	res	5,b		; In Grossbuchstaben wandeln
	ld	d,0000010b	; Auf Shift setzen
	call	KeySet
	res	6,b		; In Kontrollzeichen wandeln
	ld	d,0000100b	; Auf Alt setzen
	call	KeySet
	ld	a,(hl)
	cp	-1		; Ende testen
	jr	nz,LettLoop
;
; Teil 4: Nummerntasten setzen
;
	ld	hl,NUM.TAB
NumLoop:
	ld	c,(hl)		; Nummer der Taste holen
	inc	hl
	ld	b,(hl)		; ASCII-Wert holen (normal)
	inc	hl
	ld	d,0000001b	; Auf normal setzen
	call	KeySet
	ld	b,(hl)		; ASCII-Wert holen (Shifted)
	inc	hl
	ld	d,0000010b	; Auf Shift setzen
	call	KeySet
	ld	a,(hl)
	cp	-1		; Ende testen
	jr	nz,NumLoop
	ret
;
; Erweiterungszeichen setzen
;
ResToken:
	ld	hl,(BDOS+1)	; Hoechste Speicheradresse laden
	dec	h
	ld	bc,-TOK.LEN
	add	hl,bc		; Benoetigte Adresse berechnen
	push	hl
	ex	de,hl
	ld	hl,TOK.TAB
	ld	bc,TOK.LEN
	ldir			; Tabelle umkopieren
	pop	hl
TokLoop:
	ld	b,(hl)		; Erweiterungszeichen laden
	inc	hl
	ld	c,(hl)		; Laenge holen
	inc	hl
	push	hl
	push	bc
	call	XBIOS		; Erweiterung setzen
	dw	KM_EXP
	pop	bc
	pop	hl
	ld	b,0
	add	hl,bc		; Auf naechsten String zeigen
	ld	a,(hl)
	cp	-1		; Ende testen
	jr	nz,TokLoop
	ret
;
; Tastentabelle fuer normalen und Shift-Zustand
; Byte 1: Tasten-Nummer
; Byte 2: Tasten-Wert
;
NORM.TAB:
	db	66,80h		; STOP
	db	68,tab		; TAB
	db	23,92h		; [+]
	db	76,98h		; [-]
	db	 8,esc		; EXIT
	db	16,89h		; DEL ->
	db	72,DEL		; <-DEL
	db	75,8bh		; CAN
	db	 2,81h		; f1
	db	10,8ch		; AUSBL
	db	20,8eh		; ERS
	db	15,93h		; <-
	db	 1,95h		; FORM
	db	11,8dh		; COPY
	db	14,91h		; Cursor up
	db	79,96h		; Cursor down
	db	 3,8dh		; EINBL
	db	 5,94h		; WORT
	db	 6,94h		; ->
	db	78,cr		; ENTER
	db	18,cr		; RETURN
	db	 0,83h		; f3
	db	73,85h		; f5
	db	-1
;
; Tastentabelle fuer spezielle Tasten
; Byte 1: Tasten-Nummer
; Byte 2: Zustands-Bits
; Byte 3: Tasten-Wert
;
SPEC.TAB:
	db	13,00010101b,8fh	; ZEILE  - Unshift, alt, extra
	db	13,00001010b,90h	; ZEILE  - Shift, Shift+alt
	db	16,00001100b,97h	; DEL -> - Alt, shift+alt
	db	72,00001100b,9ah	; <- DEL - Alt, shift+alt
	db	-1
;
; Tastentabelle fuer Zustand normal, Shift und Alt (Buchstabben)
; Byte 1: Tasten-Nummer
; Byte 2: Tasten-Wert
;
LETT.TAB:
	db	69,'a'
	db	54,'b'
	db	62,'c'
	db	61,'d'
	db	58,'e'
	db	53,'f'
	db	52,'g'
	db	44,'h'
	db	35,'i'
	db	45,'j'	
	db	37,'k'
	db	36,'l'
	db	38,'m'
	db	46,'n'
	db	34,'o'
	db	27,'p'
	db	67,'q'
	db	50,'r'
	db	60,'s'
	db	51,'t'
	db	42,'u'
	db	55,'v'
	db	59,'w'
	db	63,'x'
	db	71,'y'
	db	43,'z'
	db	28,'{'
	db	29,'|'
	db	26,'}'
	db	-1
;
; Tastentabelle fuer Zustand normal und Shiftt (Zahlen)
; Byte 1: Tasten-Nummer
; Byte 2: Tasten-Wert fuer Shift-Zustand
; Byte 3: Tasten-Wert fuer normalen Zustand
;
NUM.TAB:
	db	64,'1','!'
	db	65,'2','"'
	db	57,'3','@'
	db	56,'4','$'
	db	49,'5','%'
	db	48,'6','&'
	db	41,'7','/'
	db	40,'8','('
	db	33,'9',')'
	db	32,'0','='
	db	25,'~','?'
	db	24,'^','`'
	db	17,'+','*'
	db	19,'#',''''
	db	39,',',';'
	db	31,'.',':'
	db	30,'-','_'
	db	22,'<','>'
	db	-1
;
; Tabelle fuer erweiterte Strings
; Byte 1:  String-Nummer
; Byte 2:  Stringlaenge
; Byte3..: String
;
TOK.TAB:
	db	80h,1,03h
	db	81h,1,1ah
	db	82h,1,1ah
	db	83h,1,11h
	db	84h,1,11h
	db	85h,1,13h
	db	86h,1,13h
	db	87h,1,10h	
	db	88h,1,10h
	db	89h,1,07h
	db	8bh,1,08h
	db	8ch,1,15h
	db	8dh,1,17h
	db	8eh,1,1dh
	db	8fh,3,06h,02h,02h
	db	90h,2,06h,02h	
	db	91h,1,1fh	
	db	92h,1,16h
	db	93h,1,01h
	db	94h,1,06h
	db	95h,1,12h
	db	96h,1,1eh
	db	97h,1,0bh
	db	98h,1,1ch
	db	99h,1,05h
	db	9ah,1,18h
	db	-1
TOK.LEN	equ	$-TOK.TAB
;
; 
; Zeichensatz setzen
;
ResMatrix:
	ld	hl,(BDOS+1)	; Hoechste Speicheradresse laden
	dec	h
	ld	bc,-CODLEN
	add	hl,bc		; Raum fuer Tabelle lassen
	ld	bc,-COMRAM
	add	hl,bc		; Test ob im COMMON
	ret	nc		; Nein - Abbruch
	call	NationalSet	; National Zeichensatz erstellen
	ld	hl,CHARMAT
	ld	de,COMRAM
	ld	bc,CODLEN
	ldir			; Komplette Tabelle umpacken
	ld	bc,COMRAM+MATLEN
	call	XBIOS		; Umpacken
	dw	SCR_RUN
	ret
;
; Nationalen Zeichensatz erstellen
;
NationalSet:
	sub	'0'		; Aus ASCII Binaerwert machen
	ret	z		; Amerikanisch ist voreingestellt
	ld	l,a
	add	a,a		; * 2
	add	a,a		; * 4
	add	a,l		; * 5
	add	a,a		; *10
	add	a,l		; *11
	ld	l,a
	ld	h,0
	ld	de,Natset
	add	hl,de		; Referenzadresse berechnen
	ld	b,NatLen
SetLoop:
	push	bc
	push	de
	push	hl
	call	ChrAdr		; Adresse aus Referenz berechnen
	ex	de,hl
	call	ChrAdr		; Adresse fuer zu setzendes Zeichen berechnen
	ld	b,MatxLen
ChrLoop:
	ld	c,(hl)		; Zeichensatz austauschen
	ld	a,(de)
	ld	(hl),a
	ld	a,c
	ld	(de),a
	inc	de
	inc	hl
	djnz	ChrLoop		; Alle Zeilem
	pop	hl
	pop	de
	pop	bc
	inc	de
	inc	hl
	djnz	SetLoop		; Alle Zeichen
	ret
;
; Adresse eines Zeichens in der Matrix berechnen
;
ChrAdr:
	ld	l,(hl)		; Zeichen als Index
	ld	h,0
	add	hl,hl		; *2
	add	hl,hl		; *4
	add	hl,hl		; *8
	ld	bc,CHARMAT
	add	hl,bc		; Adresse berechnen
	ret
;
; Nationale Zeichensaetze
; - 0: Amerikanisch - Voreinstellung
; - 1: Franzoesisch
; - 2: Deutsch
; - 3: Englisch
; - 4: Daenisch
; - 5: Schwedisch
; - 6: italienisch
; - 7: Spanisch
;
Natset:
	db	023h,040h,05bh,05ch,05dh,05eh
	db	060h,07bh,07ch,07dh,07eh
NatLen	equ	$-Natset
	db	023h,0eah,0a2h,0f5h,0a6h,05eh
	db	060h,0e1h,0eeh,0ebh,0b2h
	db	023h,0a6h,0d0h,0d3h,0d4h,05eh
	db	060h,0f0h,0f3h,0f4h,0bah
	db	0a3h,040h,05bh,05ch,05dh,05eh
	db	060h,07bh,07ch,07dh,07eh
	db	023h,040h,0d6h,0d8h,0d7h,05eh
	db	060h,0f6h,0f8h,0f7h,07eh
	db	023h,0c1h,0d0h,0d3h,0d7h,0d4h
	db	0e1h,0f0h,0f3h,0f7h,0f4h
	db	023h,040h,0a2h,05ch,0e1h,05eh
	db	0eeh,0eah,0edh,0ebh,0ech
	db	0adh,040h,0afh,0d9h,0aeh,05eh
	db	060h,0b2h,0f9h,07dh,07eh
;
; Die komplette Zeichenmatrix
;
CHARMAT:
	db	000h,000h,066h,0dbh,0dbh,0dbh,066h,000h	; 00
MatxLen	equ	$-CHARMAT
	db	03ch,042h,081h,099h,081h,042h,03ch,000h	; 01
	db	0feh,0c6h,0c0h,0c0h,0c0h,0c0h,0c0h,000h	; 02
	db	010h,038h,038h,06ch,06ch,0c6h,0feh,000h	; 03
	db	03ch,042h,0a5h,099h,0a5h,042h,03ch,000h	; 04
	db	000h,000h,000h,024h,018h,024h,000h,000h	; 05
	db	000h,000h,018h,000h,07eh,000h,018h,000h	; 06
	db	000h,000h,018h,018h,000h,066h,066h,000h	; 07
	db	0feh,06ch,06ch,06ch,06ch,06ch,06ch,000h	; 08
	db	018h,018h,018h,018h,07eh,03ch,018h,000h	; 09
	db	0feh,0c6h,060h,030h,060h,0c6h,0feh,000h	; 0a
	db	000h,020h,060h,0feh,0feh,060h,020h,000h	; 0b
	db	000h,008h,00ch,0feh,0feh,00ch,008h,000h	; 0c
	db	000h,018h,018h,07eh,018h,018h,07eh,000h	; 0d
	db	000h,024h,066h,0ffh,0ffh,066h,024h,000h	; 0e
	db	07ch,0c6h,0c6h,0c6h,0c6h,06ch,0eeh,000h	; 0f
	db	000h,000h,073h,0deh,0cch,0deh,073h,000h	; 10
	db	07ch,0c6h,0c6h,0fch,0c6h,0c6h,0f8h,0c0h	; 11
	db	066h,066h,03ch,066h,066h,066h,03ch,000h	; 12
	db	03ch,060h,03ch,066h,066h,066h,03ch,000h	; 13
	db	000h,000h,01eh,030h,07ch,030h,01eh,000h	; 14
	db	038h,06ch,0c6h,0feh,0c6h,06ch,038h,000h	; 15
	db	000h,0c0h,060h,030h,038h,06ch,0c6h,000h	; 16
	db	000h,000h,066h,066h,066h,07ch,060h,060h	; 17
	db	000h,000h,0feh,06ch,06ch,06ch,06ch,000h	; 18
	db	000h,000h,03ch,066h,066h,07ch,060h,060h	; 19
	db	000h,000h,07eh,0d8h,0d8h,0d8h,070h,000h	; 1a
	db	000h,073h,0ceh,018h,018h,018h,00ch,000h	; 1b
	db	003h,006h,03ch,066h,066h,03ch,060h,0c0h	; 1c
	db	000h,0e6h,03ch,018h,038h,06ch,0c7h,000h	; 1d
	db	003h,006h,066h,066h,066h,03ch,060h,0c0h	; 1e
	db	000h,000h,066h,0c3h,0dbh,0dbh,07eh,000h	; 1f
	db	000h,000h,000h,000h,000h,000h,000h,000h	; 20
	db	018h,018h,018h,018h,018h,000h,018h,000h	; 21
	db	06ch,06ch,06ch,000h,000h,000h,000h,000h	; 22
	db	06ch,06ch,0feh,06ch,0feh,06ch,06ch,000h	; 23
	db	018h,03eh,058h,03ch,01ah,07ch,018h,000h	; 24
	db	000h,0c6h,0cch,018h,030h,066h,0c6h,000h	; 25
	db	038h,06ch,038h,076h,0dch,0cch,076h,000h	; 26
	db	018h,018h,018h,000h,000h,000h,000h,000h	; 27
	db	00ch,018h,030h,030h,030h,018h,00ch,000h	; 28
	db	030h,018h,00ch,00ch,00ch,018h,030h,000h	; 29
	db	000h,066h,03ch,0ffh,03ch,066h,000h,000h	; 2a
	db	000h,018h,018h,07eh,018h,018h,000h,000h	; 2b
	db	000h,000h,000h,000h,000h,018h,018h,030h	; 2c
	db	000h,000h,000h,07eh,000h,000h,000h,000h	; 2d
	db	000h,000h,000h,000h,000h,018h,018h,000h	; 2e
	db	006h,00ch,018h,030h,060h,0c0h,080h,000h	; 2f
	db	038h,06ch,0ceh,0d6h,0e6h,06ch,038h,000h	; 30
	db	018h,038h,018h,018h,018h,018h,07eh,000h	; 31
	db	03ch,066h,006h,03ch,060h,066h,07eh,000h	; 32
	db	03ch,066h,006h,01ch,006h,066h,03ch,000h	; 33
	db	01ch,03ch,06ch,0cch,0feh,00ch,01eh,000h	; 34
	db	07eh,062h,060h,07ch,006h,066h,03ch,000h	; 35
	db	03ch,066h,060h,07ch,066h,066h,03ch,000h	; 36
	db	07eh,066h,006h,00ch,018h,018h,018h,000h	; 37
	db	03ch,066h,066h,03ch,066h,066h,03ch,000h	; 38
	db	03ch,066h,066h,03eh,006h,066h,03ch,000h	; 39
	db	000h,000h,018h,018h,000h,018h,018h,000h	; 3a
	db	000h,000h,018h,018h,000h,018h,018h,030h	; 3b
	db	00ch,018h,030h,060h,030h,018h,00ch,000h	; 3c
	db	000h,000h,07eh,000h,07eh,000h,000h,000h	; 3d
	db	060h,030h,018h,00ch,018h,030h,060h,000h	; 3e
	db	03ch,066h,066h,00ch,018h,000h,018h,000h	; 3f
	db	07ch,0c6h,0deh,0deh,0deh,0c0h,07ch,000h	; 40
	db	018h,03ch,066h,066h,07eh,066h,066h,000h	; 41
	db	0fch,066h,066h,07ch,066h,066h,0fch,000h	; 42
	db	03ch,066h,0c0h,0c0h,0c0h,066h,03ch,000h	; 43
	db	0f8h,06ch,066h,066h,066h,06ch,0f8h,000h	; 44
	db	0feh,062h,068h,078h,068h,062h,0feh,000h	; 45
	db	0feh,062h,068h,078h,068h,060h,0f0h,000h	; 46
	db	03ch,066h,0c0h,0c0h,0ceh,066h,03eh,000h	; 47
	db	066h,066h,066h,07eh,066h,066h,066h,000h	; 48
	db	07eh,018h,018h,018h,018h,018h,07eh,000h	; 49
	db	01eh,00ch,00ch,00ch,0cch,0cch,078h,000h	; 4a
	db	0e6h,066h,06ch,078h,06ch,066h,0e6h,000h	; 4b
	db	0f0h,060h,060h,060h,062h,066h,0feh,000h	; 4c
	db	0c6h,0eeh,0feh,0feh,0d6h,0c6h,0c6h,000h	; 4d
	db	0c6h,0e6h,0f6h,0deh,0ceh,0c6h,0c6h,000h	; 4e
	db	07ch,0c6h,0c6h,0c6h,0c6h,0c6h,07ch,000h	; 4f
	db	0fch,066h,066h,07ch,060h,060h,0f0h,000h	; 50
	db	07ch,0c6h,0c6h,0c6h,0dah,0cch,076h,000h	; 51
	db	0fch,066h,066h,07ch,06ch,066h,0e6h,000h	; 52
	db	03ch,066h,060h,03ch,006h,066h,03ch,000h	; 53
	db	07eh,05ah,018h,018h,018h,018h,03ch,000h	; 54
	db	066h,066h,066h,066h,066h,066h,03ch,000h	; 55
	db	066h,066h,066h,066h,066h,03ch,018h,000h	; 56
	db	0c6h,0c6h,0c6h,0d6h,0feh,0eeh,0c6h,000h	; 57
	db	0c6h,06ch,038h,038h,06ch,0c6h,0c6h,000h	; 58
	db	066h,066h,066h,03ch,018h,018h,03ch,000h	; 59
	db	0feh,0c6h,08ch,018h,032h,066h,0feh,000h	; 5a
	db	03ch,030h,030h,030h,030h,030h,03ch,000h	; 5b
	db	0c0h,060h,030h,018h,00ch,006h,002h,000h	; 5c
	db	03ch,00ch,00ch,00ch,00ch,00ch,03ch,000h	; 5d
	db	018h,03ch,07eh,018h,018h,018h,018h,000h	; 5e
	db	000h,000h,000h,000h,000h,000h,000h,0ffh	; 5f
	db	030h,018h,00ch,000h,000h,000h,000h,000h	; 60
	db	000h,000h,078h,00ch,07ch,0cch,076h,000h	; 61
	db	0e0h,060h,07ch,066h,066h,066h,0dch,000h	; 62
	db	000h,000h,03ch,066h,060h,066h,03ch,000h	; 63
	db	01ch,00ch,07ch,0cch,0cch,0cch,076h,000h	; 64
	db	000h,000h,03ch,066h,07eh,060h,03ch,000h	; 65
	db	01ch,036h,030h,078h,030h,030h,078h,000h	; 66
	db	000h,000h,03eh,066h,066h,03eh,006h,07ch	; 67
	db	0e0h,060h,07ch,066h,066h,066h,0e6h,000h	; 68
	db	018h,000h,038h,018h,018h,018h,03ch,000h	; 69
	db	006h,000h,00eh,006h,006h,066h,066h,03ch	; 6a
	db	0e0h,060h,066h,06ch,078h,06ch,0e6h,000h	; 6b
	db	038h,018h,018h,018h,018h,018h,03ch,000h	; 6c
	db	000h,000h,06ch,0feh,0d6h,0d6h,0c6h,000h	; 6d
	db	000h,000h,0dch,066h,066h,066h,066h,000h	; 6e
	db	000h,000h,03ch,066h,066h,066h,03ch,000h	; 6f
	db	000h,000h,0dch,066h,066h,07ch,060h,0f0h	; 70
	db	000h,000h,076h,0cch,0cch,07ch,00ch,01eh	; 71
	db	000h,000h,0dch,076h,060h,060h,0f0h,000h	; 72
	db	000h,000h,03ch,060h,03ch,006h,07ch,000h	; 73
	db	030h,030h,07ch,030h,030h,036h,01ch,000h	; 74
	db	000h,000h,066h,066h,066h,066h,03eh,000h	; 75
	db	000h,000h,066h,066h,066h,03ch,018h,000h	; 76
	db	000h,000h,0c6h,0d6h,0d6h,0feh,06ch,000h	; 77
	db	000h,000h,0c6h,06ch,038h,06ch,0c6h,000h	; 78
	db	000h,000h,066h,066h,066h,03eh,006h,07ch	; 79
	db	000h,000h,07eh,04ch,018h,032h,07eh,000h	; 7a
	db	00eh,018h,018h,070h,018h,018h,00eh,000h	; 7b
	db	018h,018h,018h,018h,018h,018h,018h,000h	; 7c
	db	070h,018h,018h,00eh,018h,018h,070h,000h	; 7d
	db	076h,0dch,000h,000h,000h,000h,000h,000h	; 7e
	db	038h,06ch,0c6h,0c6h,0c6h,06ch,038h,000h	; 7f
	db	000h,000h,03ch,03ch,03ch,03ch,000h,000h	; 80
	db	018h,018h,0ffh,000h,000h,0ffh,000h,000h	; 81
	db	024h,024h,024h,027h,027h,024h,024h,024h	; 82
	db	024h,024h,027h,020h,020h,03fh,000h,000h	; 83
	db	000h,000h,0ffh,000h,000h,0ffh,018h,018h	; 84
	db	024h,024h,024h,024h,024h,024h,024h,024h	; 85
	db	000h,000h,03fh,020h,020h,027h,024h,024h	; 86
	db	024h,024h,027h,020h,020h,027h,024h,024h	; 87
	db	024h,024h,024h,0e4h,0e4h,024h,024h,024h	; 88
	db	024h,024h,0e4h,004h,004h,0fch,000h,000h	; 89
	db	000h,000h,0ffh,000h,000h,0ffh,000h,000h	; 8a
	db	024h,024h,0e7h,000h,000h,0ffh,000h,000h	; 8b
	db	000h,000h,0fch,004h,004h,0e4h,024h,024h	; 8c
	db	024h,024h,0e4h,004h,004h,0e4h,024h,024h	; 8d
	db	000h,000h,0ffh,000h,000h,0e7h,024h,024h	; 8e
	db	024h,024h,0e7h,000h,000h,0e7h,024h,024h	; 8f
	db	000h,000h,000h,018h,018h,000h,000h,000h	; 90
	db	018h,018h,018h,018h,018h,000h,000h,000h	; 91
	db	000h,000h,000h,01fh,01fh,000h,000h,000h	; 92
	db	018h,018h,018h,01fh,00fh,000h,000h,000h	; 93
	db	000h,000h,000h,018h,018h,018h,018h,018h	; 94
	db	018h,018h,018h,018h,018h,018h,018h,018h	; 95
	db	000h,000h,000h,00fh,01fh,018h,018h,018h	; 96
	db	018h,018h,018h,01fh,01fh,018h,018h,018h	; 97
	db	000h,000h,000h,0f8h,0f8h,000h,000h,000h	; 98
	db	018h,018h,018h,0f8h,0f0h,000h,000h,000h	; 99
	db	000h,000h,000h,0ffh,0ffh,000h,000h,000h	; 9a
	db	018h,018h,018h,0ffh,0ffh,000h,000h,000h	; 9b
	db	000h,000h,000h,0f0h,0f8h,018h,018h,018h	; 9c
	db	018h,018h,018h,0f8h,0f8h,018h,018h,018h	; 9d
	db	000h,000h,000h,0ffh,0ffh,018h,018h,018h	; 9e
	db	018h,018h,018h,0ffh,0ffh,018h,018h,018h	; 9f
	db	078h,00ch,07ch,0cch,076h,000h,0feh,000h	; a0
	db	03ch,066h,066h,066h,03ch,000h,07eh,000h	; a1
	db	038h,044h,038h,000h,000h,000h,000h,000h	; a2
	db	03ch,066h,060h,0f8h,060h,066h,0feh,000h	; a3
	db	038h,044h,0bah,0a2h,0bah,044h,038h,000h	; a4
	db	07eh,0f4h,0f4h,074h,034h,034h,034h,000h	; a5
	db	01eh,030h,038h,06ch,038h,018h,0f0h,000h	; a6
	db	018h,018h,07eh,018h,018h,018h,018h,000h	; a7
	db	040h,0c0h,044h,04ch,054h,01eh,004h,000h	; a8
	db	040h,0c0h,04ch,052h,044h,008h,01eh,000h	; a9
	db	0e0h,010h,062h,016h,0eah,00fh,002h,000h	; aa
	db	000h,033h,066h,0cch,066h,033h,000h,000h	; ab
	db	000h,0cch,066h,033h,066h,0cch,000h,000h	; ac
	db	0e0h,090h,094h,0eeh,084h,084h,083h,000h	; ad
	db	018h,000h,018h,030h,066h,066h,03ch,000h	; ae
	db	018h,000h,018h,018h,018h,018h,018h,000h	; af
	db	01ch,036h,030h,0fch,030h,030h,0e0h,000h	; b0
	db	000h,018h,03ch,066h,060h,066h,03ch,018h	; b1
	db	000h,066h,000h,000h,000h,000h,000h,000h	; b2
	db	00ch,018h,030h,000h,000h,000h,000h,000h	; b3
	db	010h,038h,06ch,0c6h,000h,000h,000h,000h	; b4
	db	000h,0c6h,0cch,018h,020h,05bh,0dbh,000h	; b5
	db	040h,0c0h,046h,049h,046h,009h,006h,000h	; b6
	db	0e0h,010h,066h,019h,0e6h,009h,006h,000h	; b7
	db	0f0h,080h,0e6h,019h,0e6h,009h,006h,000h	; b8
	db	0f0h,010h,026h,049h,086h,009h,006h,000h	; b9
	db	038h,0c6h,0c6h,0f8h,0c6h,0c6h,0f8h,000h	; ba
	db	000h,038h,06ch,0c6h,0c6h,06ch,038h,000h	; bb
	db	000h,038h,07ch,0feh,0feh,07ch,038h,000h	; bc
	db	066h,066h,03ch,018h,07eh,018h,03ch,000h	; bd
	db	03ch,042h,0b9h,0a5h,0b9h,0a9h,066h,03ch	; be
	db	0fbh,055h,051h,051h,000h,000h,000h,000h	; bf
	db	00ch,030h,018h,03ch,066h,07eh,066h,000h	; c0
	db	00ch,030h,07eh,060h,07ch,060h,07eh,000h	; c1
	db	00ch,030h,07eh,018h,018h,018h,07eh,000h	; c2
	db	00ch,030h,03ch,066h,066h,066h,03ch,000h	; c3
	db	00ch,030h,066h,066h,066h,066h,03ch,000h	; c4
	db	018h,066h,018h,03ch,066h,07eh,066h,000h	; c5
	db	018h,066h,07eh,060h,07ch,060h,07eh,000h	; c6
	db	018h,066h,07eh,018h,018h,018h,07eh,000h	; c7
	db	018h,066h,03ch,066h,066h,066h,03ch,000h	; c8
	db	018h,066h,066h,066h,066h,066h,03ch,000h	; c9
	db	030h,00ch,018h,03ch,066h,07eh,066h,000h	; ca
	db	030h,00ch,07eh,060h,07ch,060h,07eh,000h	; cb
	db	030h,00ch,07eh,018h,018h,018h,07eh,000h	; cc
	db	030h,00ch,03ch,066h,066h,066h,03ch,000h	; cd
	db	030h,00ch,066h,066h,066h,066h,03ch,000h	; ce
	db	066h,000h,066h,03ch,018h,018h,018h,000h	; cf
	db	066h,000h,018h,03ch,066h,07eh,066h,000h	; d0
	db	066h,000h,07eh,060h,07ch,060h,07eh,000h	; d1
	db	066h,000h,07eh,018h,018h,018h,07eh,000h	; d2
	db	066h,000h,03ch,066h,066h,066h,03ch,000h	; d3
	db	066h,000h,066h,066h,066h,066h,03ch,000h	; d4
	db	03ch,066h,0c0h,0c0h,066h,03ch,000h,018h	; d5
	db	03eh,078h,0d8h,0feh,0d8h,0d8h,0deh,000h	; d6
	db	018h,000h,018h,03ch,066h,07eh,066h,000h	; d7
	db	07ah,0cch,0ceh,0d6h,0e6h,066h,0bch,000h	; d8
	db	032h,04ch,000h,066h,076h,06eh,066h,000h	; d9
	db	032h,04ch,000h,03ch,066h,07eh,066h,000h	; da
	db	032h,04ch,03ch,066h,066h,066h,03ch,000h	; db
	db	0c0h,030h,00ch,030h,0cch,030h,0c0h,000h	; dc
	db	006h,018h,060h,018h,066h,018h,006h,000h	; dd
	db	006h,00ch,07eh,018h,07eh,030h,060h,000h	; de
	db	000h,000h,032h,04ch,000h,07eh,000h,000h	; df
	db	00ch,030h,078h,00ch,07ch,0cch,076h,000h	; e0
	db	00ch,030h,03ch,066h,07eh,060h,03ch,000h	; e1
	db	00ch,030h,000h,038h,018h,018h,03ch,000h	; e2
	db	00ch,030h,000h,03ch,066h,066h,03ch,000h	; e3
	db	00ch,030h,000h,066h,066h,066h,03eh,000h	; e4
	db	018h,066h,078h,00ch,07ch,0cch,076h,000h	; e5
	db	018h,066h,03ch,066h,07eh,060h,03ch,000h	; e6
	db	018h,066h,000h,038h,018h,018h,03ch,000h	; e7
	db	018h,066h,000h,03ch,066h,066h,03ch,000h	; e8
	db	018h,066h,000h,066h,066h,066h,03ch,000h	; e9
	db	030h,00ch,078h,00ch,07ch,0cch,076h,000h	; ea
	db	030h,00ch,03ch,066h,07eh,060h,03ch,000h	; eb
	db	030h,00ch,000h,038h,018h,018h,03ch,000h	; ec
	db	030h,00ch,000h,03ch,066h,066h,03ch,000h	; ed
	db	030h,00ch,000h,066h,066h,066h,03ch,000h	; ee
	db	066h,000h,066h,066h,066h,03eh,006h,07ch	; ef
	db	066h,000h,078h,00ch,07ch,0cch,076h,000h	; f0
	db	066h,000h,03ch,066h,07eh,060h,03ch,000h	; f1
	db	066h,000h,038h,018h,018h,018h,03ch,000h	; f2
	db	066h,000h,000h,03ch,066h,066h,03ch,000h	; f3
	db	066h,000h,000h,066h,066h,066h,03eh,000h	; f4
	db	000h,000h,03ch,060h,060h,03ch,000h,018h	; f5
	db	000h,000h,06ch,01ah,07eh,0d8h,06eh,000h	; f6
	db	018h,000h,078h,00ch,07ch,0cch,076h,000h	; f7
	db	000h,000h,07ah,0cch,0d6h,066h,0bch,000h	; f8
	db	032h,04ch,000h,0dch,066h,066h,066h,000h	; f9
	db	032h,04ch,078h,00ch,07ch,0cch,076h,000h	; fa
	db	032h,04ch,000h,03ch,066h,066h,03ch,000h	; fb
	db	008h,00ch,0feh,007h,0feh,00ch,008h,000h	; fc
	db	010h,030h,07fh,0e0h,07fh,030h,010h,000h	; fd
	db	000h,024h,07eh,0c3h,07eh,024h,000h,000h	; fe
	db	000h,07eh,000h,07eh,000h,07eh,000h,000h	; ff
;
MATLEN	equ	$-CHARMAT
;
; Verschieben der kompletten Zeichenmatrix
;
	ld	hl,COMRAM	; Adresse der modifizierten Matrix
	ld	de,CHARMTX	; Zeiger auf Matrix der Naschine
	ld	bc,MATLEN
	ldir			; Umpacken
	ret
;
CODLEN	equ	$-CHARMAT

	end	RESET.START

