	PAGE


swap$code:
	@sei				; ffd5
	@lda	3eh,#			; ffd0	
	@sta	force$map		; ffd2
	@lda	z80$on,#		; ffd6
	@sta	mode$reg		; ffd8
	@nop				; ffdb
	@jmp	bios$02			; ffdc
	@nop				; ffdf

	di				; ffe5
	mvi	a,3eh			; ffe0
	sta	force$map		; ffe2
	lxi	b,mode$reg		; ffe6
	mvi	a,z80$off		; ffe9
	outp	a			; ffeb
	nop				; ffed
	rst	1			; ffee jump to load CP/M

swap$size	equ	$-swap$code
free$space	equ	1000h-230-16-$

	page
;	*********************************
;	*				*
;	*	Fixed data tables	*
;	*				*
;	*********************************
;
;

	org	1000h-230-16		; -246
;
;	40 column color to RGBI
;
color$convert$tbl:
	db	00h			; 0 black
	db	0fh			; 1 white
	db	08h			; 2 red
	db	07h			; 3 cyan
	db	0bh			; 4 purple
	db	04h			; 5 green
	db	02h			; 6 blue
	db	0dh			; 7 yellow
	db	0ah			; 8 orange
	db	0ch			; 9 brown
	db	09h			; A light red
	db	06h			; B gray 1
	db	01h			; C gray 2
	db	05h			; D light green
	db	03h			; E light blue
	db	0eh			; F gray 3

;
;
	org	1000h-86-144		; 8*18 ; -230
;
extra$char$table:
	db	000h,060h,030h,018h,00ch,006h,003h,000h	; 1
	db	018h,03ch,066h,000h,000h,000h,000h,000h	; 2
	db	000h,000h,000h,000h,000h,000h,07fh,000h	; 3
	db	060h,030h,018h,000h,000h,000h,000h,000h	; 4
	db	01ch,030h,030h,060h,030h,030h,01ch,000h	; 5
	db	018h,018h,018h,018h,018h,018h,018h,000h	; 6
	db	038h,00ch,00ch,006h,00ch,00ch,038h,000h	; 7
	db	000h,01bh,02ah,066h,000h,000h,000h,000h	; 8
	db	000h,000h,000h,000h,000h,041h,07fh,000h	; 9
	db	000h,0f2h,05bh,039h,001h,04eh,065h,037h	; 10
	db	006h,003h,01eh,007h,00bh,068h,04bh,034h	; 11
	db	017h,001h,044h,062h,02dh,018h,012h,00bh	; 12
	db	063h,059h,031h,017h,000h,00bh,059h,072h	; 13
	db	02bh,018h,00fh,063h,000h,04fh,02bh,005h	; 14
	db	04ch,068h,02dh,017h,016h,069h,049h,025h	; 15
	db	017h,013h,045h,068h,029h,018h,017h,007h	; 16
	db	00ch,068h,04bh,034h,013h,00fh,005h,04bh	; 17
	db	070h,031h,00dh,00dh,008h,008h,06ch,00dh	; 18

	org	1000h-75-11			; -86

mmu$init$data:
	db	3fh,3fh,7fh,3eh,7eh		; config regs
	db	z80$on,common$16K
	db	00
dir$ptrs:					; part of both MMU data and
	db	00,01				; dir$ptrs
	db	00


	org	1000h-75		; -75

special$skew:
	skew	21,5,0
	skew	19,5,0
	skew	18,5,0
	skew	17,5,0

	org	free$space

	end

