reorganize everything

This commit is contained in:
Dennis Gunia
2024-06-24 20:38:02 +02:00
parent ea1069e59c
commit 1ed6034d99
3867 changed files with 16188 additions and 13447 deletions

View File

@@ -0,0 +1 @@
../../monitor_v2/zout/symbols.s

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,271 @@
CS_PIO_BD .EQU 0xF5
CS_PIO_BC .EQU 0xF7
CS_PIO_AD .EQU 0xF4
CS_PIO_AC .EQU 0xF6
CS_I2C_S1 .EQU 0xF3
CS_I2C_SX .EQU 0xF2
iic_init:
LD A,0xCF
OUT (CS_PIO_AC), A
LD A,11110101b
OUT (CS_PIO_AC), A
LD A,00000000b ; Reset PCF8584 minimum 30 clock cycles
OUT (CS_PIO_AD), A
LD BC,0x1000
CALL _pause_loop
LD A,0000010b
OUT (CS_PIO_AD), A
LD BC,0x2000
CALL _pause_loop
LD A, 0x80 ;S1 -> Select S0, PIN disabled, ESO = 0, Interrupt disabled, STA, STA, ACK = 0
OUT (CS_I2C_S1),A
CALL _slow_access
;CALL _slow_access
LD A,0x55 ;S0 -> Loads byte 55H into register S0'; effective own address becomes AAH
OUT (CS_I2C_SX),A
CALL _slow_access
LD A, 0xA0 ;S1 -> Loads byte A0H into register S1, i.e. next byte will be loaded into the clock control register S2.
OUT (CS_I2C_S1),A
CALL _slow_access
; 000100000
LD A,0x18 ;Load 18H into S2 register (clock control - 4.43 MHz, 90 KHz)
LD A,0x00 ;Load 18H into S2 register (clock control - 4.43 MHz, 90 KHz)
OUT (CS_I2C_SX),A
CALL _slow_access
;CALL _slow_access
;CALL _slow_access
;CALL _slow_access
LD A,0xC1 ;S1 -> loads byte C1H into register S1; register enable
;serial interface, set I 2C-bus into idle mode;
;SDA and SCL are HIGH. The next write or read
;operation will be to/from data transfer register
;S0 if A0 = LOW.;
OUT (CS_I2C_S1),A
CALL _slow_access
RET
;------------------------------------------------------------------------------
; iic_send
;
; Sends data over the i2c bus
; A contains BYTE COUNTER
; B contains ADDRESS
; DE contains location of Data Buffer
;------------------------------------------------------------------------------
iic_send:
;CALL PRINTINLINE;
;defb "SEND A",10,13,0
PUSH BC
PUSH AF
CALL iic_bus_rdy
;CALL PRINTINLINE
;defb "SEND START",10,13,0
LD A,B ;Load 'slave address' into S0 register:
OUT (CS_I2C_SX),A
CALL _slow_access
LD A, 0xC5 ;Load C5H into S1. 'C5H' = PCF8584 generates
;the 'START' condition and clocks out the slave
;address and the clock pulse for slave acknowledgement.
OUT (CS_I2C_S1),A
POP AF
LD C,A
INC C
_iic_send_1: ; LOOP 1 : Wait for bus ready
IN A,(CS_I2C_S1) ; Read byte from S1 register
BIT 7,A ; Is bus free? (S1 ~BB=1?)
JR NZ,_iic_send_1 ; No - loop
BIT 4,A ; slave acknowledged? (LRB = 0?)
JR NZ, _iic_send_stop ; if not, cancel transmission
LD A,(DE) ; Load next byte from buffer
INC DE
DEC C
JR Z, _iic_send_stop ; if counter = 0, exit loop
OUT (CS_I2C_SX),A ; Send byte
JR _iic_send_1 ; if counter > 0, loop again
_iic_send_stop:
LD A, 0xC3 ;STOP
OUT (CS_I2C_S1),A
CALL _slow_access
POP BC
RET
;------------------------------------------------------------------------------
; iic_read
;
; Sends data over the i2c bus
; A contains BYTE COUNTER
; B contains ADDRESS
; DE contains location of Data Buffer
;------------------------------------------------------------------------------
iic_read:
PUSH DE
PUSH BC
PUSH AF
LD A,B ;Load 'slave address' into S0 register:
OR 0x01 ;Set RW Bit for read operation
OUT (CS_I2C_SX),A
CALL _slow_access
CALL iic_bus_rdy ; Is bus ready
LD A, 0xC5 ;Load C5H into S1. 'C5H' = PCF8584 generates
;the 'START' condition and clocks out the slave
;address and the clock pulse for slave acknowledgement.
OUT (CS_I2C_S1),A
;Setup counter
POP AF
LD C,A ; Load BYTE COUNTER into C
INC C ; Offset C by 1
_iic_read_1: ;Wait for PIN = 0
IN A,(CS_I2C_S1) ; Read byte from S1 register
BIT 7,A ; S1 PIN=1?
JR NZ,_iic_read_1 ; No - loop
BIT 3,A ; S1 LRB=0? slave ACK?
JR NZ, _iic_read_error ; No ACK -> an error has occured
DEC C
LD A, C
DEC A ;If n = m 1?
JR Z, _iic_read_last
IN A,(CS_I2C_SX)
LD (DE),A
INC DE
JR _iic_read_1
_iic_read_last: ;read last byte
LD A, 0x40
OUT (CS_I2C_S1),A
CALL _slow_access
IN A,(CS_I2C_SX) ;receives the final data byte. Neg. ACK is also sent.
LD (DE),A
INC DE
_iic_read_last_1:
IN A,(CS_I2C_S1) ; Read byte from S1 register
BIT 7,A ; S1 PIN=1?
JR NZ,_iic_read_last_1 ; No - loop
_iic_read_error:
NOP
_iic_read_stop:
LD A, 0xC3
OUT (CS_I2C_S1),A
CALL _slow_access
IN A,(CS_I2C_SX) ;transfers the final data byte from the
;data buffer to accumulator.
CALL _slow_access
LD (DE),A
POP BC
POP DE
RET
;------------------------------------------------------------------------------
; iic_rdy
;
; Waits until the PCF8584 signals a byte transmission/reception is complete.
;------------------------------------------------------------------------------
iic_rdy:
PUSH AF
_iic_rdy_loop:
IN A,(CS_I2C_S1) ; Read byte from S1 register
BIT 7,A ; Is Tx/Rx complete? (S1 PIN=0?)
;call print_a_hex
JR NZ,_iic_rdy_loop ; No - loop
_iic_rdy_done:
POP AF
RET
;------------------------------------------------------------------------------
; i2c_bus_rdy
;
; Waits until the I2C bus is free before RETurning
;------------------------------------------------------------------------------
iic_bus_rdy:
PUSH AF
_iic_blp:
IN A,(CS_I2C_S1) ; Read byte from S1 register
PUSH AF
call print_a_hex
POP AF
BIT 0,A ; Is bus free? (S1 ~BB=1?)
JR Z,_iic_blp ; No - loop
POP AF
RET
;------------------------------------------------------------------------------
; _pause_loop
;
; Timer function
;
; 16-bit (BC) decrement counter, performing 4xNEG loop until BC
; reaches zero.
;
; 61 T-states in loop = 15.25uS per loop @ 4 MHz - near enough
; a second delay for 65,535 iterations.
;
; Set iteration count in BC before calling this function.
; Destroys: BC
;------------------------------------------------------------------------------
_pause_loop:
PUSH AF ; 11 T-states
_pause_loop_lp:
;NEG ; 8 T-states
;NEG ; 8 T-states
;NEG ; 8 T-states
;NEG ; 8 T-states
PUSH BC ; 11 T-states
POP BC ; 10 T-states
PUSH BC ; 11 T-states
POP BC ; 10 T-states
DEC BC ; 6 T-states
LD A,C ; 9 T-states
OR B ; 4 T-states
JP NZ,_pause_loop_lp ; 10 T-states
POP AF ; 10 T-states
RET ; Pause complete, RETurn
iic_force_stop:
IN A,(CS_I2C_S1)
BIT 0, A
RET NZ
LD A, 11000011b
OUT (CS_I2C_S1),A
NOP
NOP
JR iic_force_stop
_slow_access:
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
PUSH AF
POP AF
PUSH AF
POP AF
PUSH AF
POP AF
PUSH AF
POP AF
PUSH AF
POP AF
PUSH AF
POP AF
POP AF
RET

View File

@@ -0,0 +1,11 @@
;----------------------------------------------------------------
;BIOS Driver for SI5351
;by Dennis Gunia (01/2024)
;----------------------------------------------------------------
;Device address
ADDR_SI_CLK .EQU 0x00
;================================================================
; SI registers
;================================================================

View File

@@ -0,0 +1,706 @@
; TMS9918A graphics subroutines
; Copyright 2018-2020 J.B. Langston
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in
; all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
; DEALINGS IN THE SOFTWARE.
; VDP Programmer's Guide: http://map.grauw.nl/resources/video/ti-vdp-programmers-guide.pdf
phase 0xE400
; ---------------------------------------------------------------------------
; configuration parameters; can be changed at runtime
TmsPort:
defb 0xE0 ; port for TMS vram (reg is 1 higher)
TmsWait:
defb 64 ; iterations to wait after ram access
TmsMode:
defw 0 ; mode registers
TmsNameAddr:
defw 3800h ; name table address (multiples of 400H)
TmsColorAddr:
defw 2000h ; color table address (multiples of 40H)
TmsPatternAddr:
defw 0 ; pattern table (multiples of 800H)
TmsSpritePatternAddr:
defw 1800h ; sprite attribute table (multiples of 80H)
TmsSpriteAttrAddr:
defw 3bc0h ; sprite pattern table (multiples of 800H)
TmsScreenColors:
defb 0 ; background (low nybble), text color (high nybble)
; ---------------------------------------------------------------------------
; register constants
dephase
setup_vars:
ld a,0xE0
ld (TmsPort),a
ld a,2
ld (TmsWait),a
ld a,0
ld (TmsMode),a
ld a,0
ld (TmsMode+1),a
ld a,0
ld (TmsNameAddr),a
ld a,38h
ld (TmsNameAddr+1),a
ld a,0
ld (TmsPatternAddr),a
ld a,0
ld (TmsPatternAddr+1),a
ld a,0
ld (TmsColorAddr),a
ld a,20h
ld (TmsColorAddr+1),a
ld a,0
ld (TmsSpritePatternAddr),a
ld a,0x18
ld (TmsSpritePatternAddr+1),a
ld a,0xc0
ld (TmsSpriteAttrAddr),a
ld a,0x3b
ld (TmsSpriteAttrAddr+1),a
ret
TmsWriteBit: equ 40h ; bit to indicate memory write
; Registers
TmsCtrl0Reg: equ 80h
TmsCtrl1Reg: equ 81h
TmsNameReg: equ 82h
TmsColorTableReg: equ 83h
TmsPatternReg: equ 84h
TmsSpriteAttrReg: equ 85h
TmsSpritePatternReg: equ 86h
TmsColorReg: equ 87h
; Control Register Bits
TmsM3: equ 200h
TmsExtVideo: equ 100h
Tms16k: equ 80h
TmsDisplayEnable: equ 40h
TmsIntEnableBit: equ 20h
TmsM1: equ 10h
TmsM2: equ 8
TmsSprite32: equ 2
TmsSpriteMag: equ 1
; ---------------------------------------------------------------------------
; table lengths
TmsTileNameLen: equ 300h
TmsTextNameLen: equ 3c0h
TmsTileColorLen: equ 20h
TmsBitmapColorLen: equ 800h
TmsTilePatternLen: equ 800h
TmsTextPatternLen: equ 800h
TmsMulticolorPatternLen: equ 600h
TmsBitmapPatternLen: equ 1800h
; ---------------------------------------------------------------------------
; color constants
TmsTransparent: equ 0
TmsBlack: equ 1
TmsMediumGreen: equ 2
TmsLightGreen: equ 3
TmsDarkBlue: equ 4
TmsLightBlue: equ 5
TmsDarkRed: equ 6
TmsCyan: equ 7
TmsMediumRed: equ 8
TmsLightRed: equ 9
TmsDarkYellow: equ 0ah
TmsLightYellow: equ 0bh
TmsDarkGreen: equ 0ch
TmsMagenta: equ 0dh
TmsGray: equ 0eh
TmsWhite: equ 0fh
; ---------------------------------------------------------------------------
; port I/O routines
; These routines access the ports configured in TmsPort.
; These memory locations can be set at runtime to support different hardware
; configurations from the same binary. TmsProbe automatically detects the
; TMS9918A on common ports.
; The TMS9918A RAM must not be accessed more than once every 8 us or display
; corruption may occur. During vblank and with the display disabled,
; accesses can be 2 us apart, but we will always use 8 us minimum delay.
; TmsRamIn/TmsRamOut include a configurable delay loop, which waits for the
; configured iterations between VRAM writes to work properly with faster CPUs
; Minimum time to execute each procedure call:
; Z80: 88 cycles, 8.8 us @ 10 MHz
; Z180: 80 cycles, 8.64 us @ 9.216 MHz, 4.32 us @ 18.432, 2.16 us @ 36.864
;
; Additional delay per djnz iteration:
; Z80: 8 cycles * (iterations - 1)
; 0.8 us @ 10 MHz
; Z180: 7 cycles * (iterations - 1)
; 0.756 us @ 9.216 MHz, 0.378 us @ 18.432, 0.189 us @ 36.864
; Delay loop iterations required for different CPU speeds:
; Z80 @ 10 MHz or less: 1
; Z180 @ 9.216 MHz or less: 1
; Z180 @ 18.432 MHz: 10
; Z180 @ 36.864 MHz: 31
TmsWaits: defb 1, 10, 31 ; wait iterations to add for different CPU speeds
; set up wait time based on clock multiplier in E
TmsSetWait:
ld a,1
ld (TmsWait), a
ret
; try to find TMS9918A on common ports
TmsProbe:
ld hl, TmsPorts
ld b, TmsNumPorts
TmsProbeNext:
ld a, (hl)
ld (TmsPort), a
call TmsRegIn ; clear vsync bit
call TmsRegIn ; check it again
jp m, TmsProbeFailed ; if still set, not a TMS9918A
ld de, 0ffffh ; long enough for another vsync
TmsProbeWait:
call TmsRegIn ; check vsync bit again
ret m ; if set, it's a TMS9918A (and Z is clear)
dec de ; otherwise, keep waiting
ld a, e
or d
jp nz, TmsProbeWait
TmsProbeFailed:
inc hl ; if still clear after this long, try next port
djnz TmsProbeNext
xor a ; set Z if we ran out of ports to check
ret
TmsPorts: ; List of ports to probe:
defb 0x80 ; ColecoVision / SG-1000
defb 98h ; MSX
defb 10h ; Sord M5 (conflicts with z80ctrl SIO port)
;defb 8 ; Tatung Einstein (conflicts with z80ctrl drive ports)
;defb 1 ; MTX (not supported by TMS9918A video card)
; add additional ports to check here
TmsNumPorts: equ $ - TmsPorts
; set a single register value
; A = register value
; E = register to set
TmsSetReg:
call TmsRegOut
ld a, e
; fallthrough to TmsRegOut
; write to configured register port
; parameters:
; A = value to write
TmsRegOut:
push bc
ld bc, (TmsPort)
inc c
out (c), a
pop bc
ret
; read from configured register port
; returns:
; A = value read
TmsRegIn:
push bc
ld bc, (TmsPort)
inc c
in a, (c)
pop bc
ret
; write to configured VRAM port
; parameters:
; A = value to write
; Z80 | Z180 cycles...
TmsRamOut: ; 17 | 16 (call)
push bc ; 11 | 11
ld bc, (TmsPort) ; 20 | 18
out (c), a ; 12 | 10
TmsRamOutDelay:
djnz TmsRamOutDelay ; 8 | 7 plus (13 | 9) * (iterations-1)
pop bc ; 10 | 9
ret ; 10 | 9
; read from configured VRAM port
; returns:
; A = value read
TmsRamIn:
push bc
ld bc, (TmsPort)
TmsRamInDelay:
djnz TmsRamInDelay
in a, (c)
ld bc, (TmsPort)
TmsRamInDelay2:
djnz TmsRamInDelay2
pop bc
ret
; ---------------------------------------------------------------------------
; register configuration routines
; set the background color
; A = requested color
TmsBackground:
and 0fh
ld b, a
ld a, (TmsScreenColors)
and 0f0h
or b
ld (TmsScreenColors), a
ld e, TmsColorReg
jp TmsSetReg
; set the sprite configuration
; A = sprite options
TmsSpriteConfig:
and TmsSprite32|TmsSpriteMag
ld b, a
ld a, (TmsMode)
and ~(TmsSprite32|TmsSpriteMag)
or b
ld (TmsMode), a
ld e, TmsCtrl1Reg
jp TmsSetReg
; enable vblank interrupts
TmsIntEnable:
ld a, (TmsMode)
or TmsIntEnableBit
ld (TmsMode), a
ld e, TmsCtrl1Reg
jp TmsSetReg
; disable vblank interrupts
TmsIntDisable:
ld a, (TmsMode)
and ~TmsIntEnableBit
ld (TmsMode), a
ld e, TmsCtrl1Reg
jp TmsSetReg
; ---------------------------------------------------------------------------
; initialization routines
TmsBlankFlags: equ Tms16k
TmsTileFlags: equ Tms16k | TmsDisplayEnable
TmsTextFlags: equ Tms16k | TmsDisplayEnable | TmsM1
TmsMulticolorFlags: equ Tms16k | TmsDisplayEnable | TmsM2
TmsBitmapFlags: equ Tms16k | TmsDisplayEnable | TmsM3
; reset registers and clear all 16KB of video memory
TmsReset:
ld hl, TmsBlankFlags ; blank the screen with 16KB enabled
ld (TmsMode), hl
ld a, l
ld e, TmsCtrl1Reg
call TmsSetReg
ld a, h
ld e, TmsCtrl0Reg
call TmsSetReg
ld a, TmsTransparent
call TmsBackground
ld a, TmsTransparent
call TmsTextColor
ld de, 0 ; clear entire VRAM
ld bc, 4000h
ld a, 0
call TmsFill
ret
; initialize for multicolor mode
TmsMulticolor:
call TmsReset
ld de, (TmsNameAddr)
call TmsWriteAddr
ld d, 6 ; name table has 6 sections
ld e, 0 ; lines in first section start at 0
TmsSectionLoop:
ld c, 4 ; each section has 4 identical lines
TmsLineLoop:
ld b, 32 ; each line is 32 bytes long
ld a, e ; same starting value for each line in section
TmsByteLoop:
call TmsRamOut
inc a ; byte value
djnz TmsByteLoop
dec c ; line counter
jp nz, TmsLineLoop
ld e, a ; next starting value = current + 32
dec d ; section counter
jp nz, TmsSectionLoop
ld hl, TmsMulticolorFlags
ld (TmsMode), hl
jp TmsInitNonBitmap
; initialize for tiled graphics
TmsTile:
call TmsReset
ld hl, TmsTileFlags
ld (TmsMode), hl
jp TmsInitNonBitmap
; initialize for text mode
; HL = address of font to load
TmsTextMode:
push hl
call TmsReset
pop hl
ld de, (TmsPatternAddr) ; load font from address in hl
ld bc, TmsTextPatternLen
call TmsWrite
ld hl, TmsTextFlags
ld (TmsMode), hl
; fallthrough to TmsInitNonBitmap
; non-bitmap color and pattern table configuration
TmsInitNonBitmap:
; set up color table address (register = address / 400H)
ld a, (TmsColorAddr)
and 0c0h
ld (TmsColorAddr), a
ld d, a
ld a, (TmsColorAddr+1)
and 3fh
ld (TmsColorAddr+1), a
rl d
rla
rl d
rla
ld e, TmsColorTableReg
call TmsSetReg
; set up pattern table address (register = address / 800H)
xor a
ld (TmsPatternAddr), a
ld a, (TmsPatternAddr+1)
and 38h
ld (TmsPatternAddr+1), a
rrca
rrca
rrca
ld e, TmsPatternReg
call TmsSetReg
jp TmsInitCommon
; initialize for bitmapped graphics
TmsBitmap:
call TmsReset
ld de, (TmsNameAddr) ; initialize name table with 3 sets
call TmsWriteAddr ; of 256 bytes ranging from 00-FF
ld b, 3
xor a
TmsBitmapLoop:
call TmsRamOut
inc a
jp nz, TmsBitmapLoop
djnz TmsBitmapLoop
ld hl, TmsBitmapFlags
ld (TmsMode), hl
; set up color table at 0H (register = 7FH) or 2000H (register = 0FFH)
xor a
ld (TmsColorAddr), a
ld (TmsPatternAddr), a
ld a, (TmsColorAddr+1)
and 20h
ld (TmsColorAddr+1), a
ld a, 0ffh ; color table at 2000H
jp nz, TmsColorTableHigh
ld a, 7fh ; color table at 0H
TmsColorTableHigh:
ld e, TmsColorTableReg
call TmsSetReg
; set up pattern table at 0H (register = 3) or 2000H (register = 7)
ld a, (TmsPatternAddr+1)
and 20h
ld (TmsPatternAddr+1), a
ld a, 7 ; pattern table at 2000H
jp nz, TmsPatternTableHigh
ld a, 3 ; pattern table at 0H
TmsPatternTableHigh:
ld e, TmsPatternReg
call TmsSetReg
; fall through to TmsInitCommon
; common initialization for all modes
TmsInitCommon:
; set up name table address (register = address / 400H)
xor a
ld (TmsNameAddr), a
ld a, (TmsNameAddr+1)
and 3ch
ld (TmsNameAddr+1), a
rrca
rrca
ld e, TmsNameReg
call TmsSetReg
; set up sprite pattern table address (register = address / 80H)
ld a, (TmsSpriteAttrAddr)
and 80h
ld (TmsSpriteAttrAddr), a
ld d, a
ld a, (TmsSpriteAttrAddr+1)
and 7fh
rl d
rla
ld e, TmsSpriteAttrReg
call TmsSetReg
; set up sprite attribute table address (register = address / 800H)
xor a
ld (TmsSpritePatternAddr), a
ld a, (TmsSpritePatternAddr+1)
and 38h
ld (TmsSpritePatternAddr+1), a
rrca
rrca
rrca
ld e, TmsSpritePatternReg
call TmsSetReg
; set up control registers
ld e, TmsCtrl1Reg
ld a, (TmsMode)
call TmsSetReg
ld a, (TmsMode+1)
ld e, TmsCtrl0Reg
jp TmsSetReg
; ---------------------------------------------------------------------------
; memory access routines
; set the next address of vram to write
; DE = address
TmsWriteAddr:
ld a, e ; send lsb
call TmsRegOut
ld a, d ; mask off msb to max of 16KB
and 3fh
or TmsWriteBit ; indicate that this is a write
call TmsRegOut
ret
; set the next address of vram to read
; DE = address
TmsReadAddr:
ld a, e ; send lsb
call TmsRegOut
ld a, d ; mask off msb to max of 16KB
and 3Fh
call TmsRegOut
ret
; copy bytes from ram to vram
; HL = ram source address
; DE = vram destination address
; BC = byte count
TmsWrite:
call TmsWriteAddr
TmsWriteLoop:
ld a, (hl)
call TmsRamOut
inc hl
dec bc
ld a, b
or c
jp nz, TmsWriteLoop
ret
; fill a section of memory with a single value
; A = value to fill
; DE = vram destination address
; BC = byte count
TmsFill:
push af
call TmsWriteAddr
pop af
TmsFillLoop:
call TmsRamOut
dec c
jp nz, TmsFillLoop
djnz TmsFillLoop
ret
; ---------------------------------------------------------------------------
; text routines
; set text color
; A = requested color
TmsTextColor:
add a, a ; text color into high nybble
add a, a
add a, a
add a, a
ld b, a ; save for later
ld a, (TmsScreenColors) ; get current colors
and 0fh ; mask off old text color
or b ; set new text color
ld (TmsScreenColors), a
ld e, TmsColorReg
jp TmsSetReg ; save it back
; set the address to place text at X/Y coordinate
; A = X
; E = Y
TmsTextPos:
ld d, 0
ld hl, 0
add hl, de ; Y x 1
add hl, hl ; Y x 2
add hl, hl ; Y x 4
add hl, de ; Y x 5
add hl, hl ; Y x 10
add hl, hl ; Y x 20
add hl, hl ; Y x 40
ld e, a
add hl, de ; add X for final address
ld de, (TmsNameAddr) ; add name table base address
add hl, de
ex de, hl
jp TmsWriteAddr
; copy a null-terminated string to VRAM
; HL = ram source address
TmsStrOut:
ld a, (hl)
cp 0 ; return when NULL is encountered
ret z
call TmsRamOut
inc hl
jp TmsStrOut
; repeat a character a certain number of times
; A = character to output
; B = count
TmsRepeat:
call TmsRamOut
djnz TmsRepeat
ret
; output a character
; A = character to output
TmsChrOut: equ TmsRamOut
; ---------------------------------------------------------------------------
; bitmap routines
TmsClearPixel: equ 0A02Fh ; cpl, and b
TmsSetPixel: equ 0B0h ; nop, or b
; set operation for TmsPlotPixel to perform
; HL = pixel operation (TmsClearPixel, TmsSetPixel)
TmsPixelOp:
ld (TmsPixelOpPlaceHolder), hl
ret
; set or clear pixel at X, Y position
; B = Y position
; C = X position
TmsPlotPixel:
ld a, b ; bail out if Y coord > 191
cp 192
ret nc
call TmsXYAddr ; get address in DE for X/Y coord in BC
ld a, c ; get lower 3 bits of X coord
and 7
ld b, 0
ld c, a
ld hl, TmsMaskLookup ; address of mask in table
add hl, bc
ld b, (hl) ; save mask in B
ld hl, (TmsPatternAddr) ; get base address for pattern table
add hl, de
ex de, hl
call TmsReadAddr ; set read within pattern table
call TmsRamIn
TmsPixelOpPlaceHolder:
or b ; mask bit in previous byte
nop ; place holder for 2 byte mask operation
push af
call TmsWriteAddr ; set write address within pattern table
pop af
jp TmsRamOut
TmsMaskLookup:
defb 80h, 40h, 20h, 10h, 8h, 4h, 2h, 1h
; set the color for a block of pixels in bitmap mode
; B = Y position
; C = X position
; A = foreground/background color to set
TmsPixelColor:
push af
ld a, b ; bail out if Y coord > 191
cp 192
ret nc
call TmsXYAddr ; get address in DE for X/Y coord in BC
ld hl, (TmsColorAddr) ; add the color table base address
add hl, de
ex de, hl
call TmsWriteAddr ; set write address within color table
pop af
jp TmsRamOut
; calculate address byte containing X/Y coordinate
; B = Y position
; C = X position
; returns address in DE
TmsXYAddr:
ld a, b ; d = (y / 8)
rrca
rrca
rrca
and 1fh
ld d, a
ld a, c ; e = (x & f8)
and 0f8h
ld e, a
ld a, b ; e += (y & 7)
and 7
or e
ld e, a
ret

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
export OPT_GEN_SYMBOLTABLE=0
export OPT_GEN_MONFILE=1
export OPT_GEN_OBJFILE=1
export OPT_WRITEROM=0
export FILENAME=test

View File

@@ -0,0 +1,303 @@
.include "include/extern_symbols.s" ;include monitor symbols.
org 0x8000
call TermInit
ret
;-------------------------------------------------
; Z8C/MEGA80 VDP Console IO Functions
; by Dennis Gunia 2022/02
; Version 0.1
;
; For Z8C Monitor
;-------------------------------------------------
; Constant Values
TermVarMemoryLocation equ 0x40E0
; Dynamic VARs
TermVarTemplate:
phase TermVarMemoryLocation ;Change pointers to this template to the specified location
TermCurrentX: ; Start sector
defb 0x01
TermCurrentY: ; Start sector
defb 0x04
TermCursorState:
defb 0x00
TermCursorEnabled:
defb 0x00
TermVarTemplateEnd:
dephase
TermInit:
; Copy TermVarTemplate to memory
LD HL, TermVarMemoryLocation ;Load destination into HL
LD BC, [TermVarTemplate] ;Load source into BC
LD DE, [TermVarTemplateEnd] ;Load end into DE
TermInit_copy_loop:
LD A,(BC) ;Copy value
LD (HL),A
INC BC ;Increment pointers
INC HL
PUSH HL ;Backup HL
SBC HL,DE ;Check if next pointer matches end
POP HL ;Restore HL
JP NZ, TermInit_copy_loop ;Loop if pointer != end
; template copy done
; install font
call setup_vars
ld hl, TmsFont
call TmsTextMode ; initialize text mode
ld a, TmsDarkRed ; set colors
call TmsBackground
ld a, TmsWhite
call TmsTextColor
ld a, 0 ; put title at 11, 1
ld e, 0
call TmsTextPos
ld hl, TitleMessage ; output title
call TmsStrOut
ld a, 0 ; put title at 11, 1
ld e, 4
call TmsTextPos
ret
TermSetCursor:
ld a, (TermCurrentY)
ld e, a
ld a, (TermCurrentX)
call TmsTextPos
ret
TermPrintStr:
; BC contains String offset
; Prints null terminated string
PUSH AF
PUSH BC
TermPrintStr_LOOP:
LD A,(BC)
; Return if nullbyte
OR 0
JR Z, TermPrintStr_EXIT
; Print Char
CALL TermPrintChar
; INC BC and JP start of loop
INC BC
jp TermPrintStr_LOOP
TermPrintStr_EXIT:
POP BC
POP AF
RET
TermPrintChar:
push AF
push BC
push DE
push HL
; check if special char
cp 0x7F ; Backspace
jp z, TermPrintCharSPDelete
cp 13
jp z, TermPrintCharSPCR
cp 10
jp z, TermPrintCharSPLF
; a has char
call TmsChrOut
ld a,(TermCurrentX)
inc a
cp 39
jp z,TermPrintCharWrap; if line end
jp nc,TermPrintCharWrap; if line end
ld (TermCurrentX), a
call TermSetCursor
jp TermPrintCharDone
TermPrintCharWrap:
xor a
ld (TermCurrentX), a
ld a,(TermCurrentY)
cp 23 ; if already last line
jp z, TermPrintCharSPLFScroll
inc a
ld (TermCurrentY),a
call TermSetCursor
jp TermPrintCharDone
TermPrintCharSPDelete:
ld a,(TermCurrentX)
and a
jp z, TermPrintCharSPDeleteWrap ; if at pos X 0 then go previous line
dec a ; else decrement X
ld (TermCurrentX), a
call TermSetCursor
ld a, " "
call TmsChrOut
call TermSetCursor
jp TermPrintCharDone
TermPrintCharSPDeleteWrap:
ld a,39
ld (TermCurrentX), a
ld a,(TermCurrentY)
dec a
ld (TermCurrentY),a
call TermSetCursor
ld a, " "
call TmsChrOut
call TermSetCursor
jp TermPrintCharDone
TermPrintCharSPLF: ; linefeed
ld a,(TermCurrentY)
cp 23 ; if already last line
jp z, TermPrintCharSPLFScroll
inc a
ld (TermCurrentY),a
call TermSetCursor
jp TermPrintCharDone
TermPrintCharSPLFScroll:
call TermScroll
ld a,23
ld (TermCurrentY),a
call TermSetCursor
jp TermPrintCharDone
TermPrintCharSPCR: ; linefeed
xor a
ld (TermCurrentX),a
call TermSetCursor
jp TermPrintCharDone
TermPrintCharDone:
pop HL
pop DE
pop BC
pop AF
ret
TermScroll:
ld bc, 0x3800 ; load start of text-buffer into pointer
TermScrollLine:
ld h,b
ld l,c
ld de, 40 ; line width
add hl, de
ld a,l ; setup VDP address
out (0x81),a
ld a,h
and 3fh
out (0x81),a
call VDPWait
in a, (0x80) ; read byte
push af
ld a,c ; setup VDP address
out (0x81),a
ld a,b
and 3fh
or 40h ; write bit
out (0x81),a
pop af
call VDPWait
out (0x80),a
inc bc
ld h,b
ld l,c
ld de, VDPTextBufferEnd ; buffer end
sbc hl, de
jp nz, TermScrollLine
; clear last line
ld bc,920
ld a,c ; setup VDP address
out (0x81),a
ld a,b
and 3fh
or 40h ; write bit
out (0x81),a
ld c,40
TermScrollClearLine:
ld bc, 0x3800 + 920
TermScrollClearLineLoop:
ld a,c ; setup VDP addressh
out (0x81),a
ld a,b
and 3fh
or 40h ; write bit
out (0x81),a
ld a, ' '
out (0x80),a
call VDPWait
inc bc
ld h,b
ld l,c
ld de, 0x3800 + 960 ; buffer end
sbc hl, de
jp nz, TermScrollClearLineLoop
ret
VDPWait:
nop
nop
nop
nop
ret
VDPTextBufferStart equ 0
VDPTextBufferEnd equ 0x3800 + 920
TitleMessage:
db ' Z8C Mk IV - A Z80 Homebrew Computer '
db ' ROM Ver. 1.0 by Dennis Gunia (2022) '
db ' 48k RAM - 4MHz Z80 CPU ',0
TmsSubs:
.include "tms.s" ; TMS graphics routines
; .include "utility.s" ; BDOS utility routines
.include "font1.s"
TermClear:
ld bc, 0x3800
TermClearLoop:
ld a,c ; setup VDP addressh
out (0x81),a
ld a,b
and 3fh
or 40h ; write bit
out (0x81),a
ld a, ' '
out (0x80),a
call VDPWait
inc bc
ld h,b
ld l,c
ld de, 0x3800 + 960 ; buffer end
sbc hl, de
jp nz, TermClearLoop
xor a
ld (TermCurrentX), a
ld (TermCurrentY), a
call TermSetCursor
ret

Binary file not shown.

View File

@@ -0,0 +1,210 @@
:10800000CD0880C90104000021E04001048011E492
:10801000400A770323E5ED52E1C21180CDF18121C1
:10802000E084CD37833E06CD9C823E0FCD4D843E0D
:10803000001E00CD6084216981CD77843E001E043E
:10804000CD6084C93AE1405F3AE040CD6084C9F533
:10805000C50AF6002807CD608003C35180C1F1C96D
:10806000F5C5D5E5FE7FCAA180FE0DCAF480FE0AE3
:10807000CAD480CD80823AE0403CFE27CA8B80D2B1
:108080008B8032E040CD4480C3FE80AF32E0403A86
:10809000E140FE17CAE6803C32E140CD4480C3FE99
:1080A000803AE040A7CABA803D32E040CD44803EED
:1080B00020CD8082CD4480C3FE803E2732E0403A0E
:1080C000E1403D32E140CD44803E20CD8082CD4430
:1080D00080C3FE803AE140FE17CAE6803C32E140B0
:1080E000CD4480C3FE80CD03813E1732E140CD44B4
:1080F00080C3FE80AF32E040CD4480C3FE80E1D13A
:10810000C1F1C90100386069112800197DD3817C53
:10811000E63FD381CD6481DB80F579D38178E63F7A
:10812000F640D381F1CD6481D38003606911983B1F
:10813000ED52C2068101980379D38178E63FF6407B
:10814000D3810E2801983B79D38178E63FF640D35E
:10815000813E20D380CD648103606911C03BED5224
:10816000C24781C900000000C920205A3843204D71
:108170006B204956202D2041205A383020486F6D01
:10818000656272657720436F6D707574657220202B
:10819000202020524F4D205665722E20312E302047
:1081A00062792044656E6E69732047756E6961203F
:1081B0002832303232292020202020202020202068
:1081C000202034386B2052414D202D20344D487AE8
:1081D000205A3830204350552020202020202020B5
:1081E0002000E04000000038002000000018C03BE4
:1081F000003EE03200E43E023201E43E003202E49E
:108200003E003203E43E003204E43E383205E43EF0
:10821000003208E43E003209E43E003206E43E202B
:108220003207E43E00320AE43E18320BE43EC0322C
:108230000CE43E3B320DE4C9010A1F3E013201E469
:10824000C921658206037E3200E4CD7682CD768236
:10825000FA608211FFFFCD7682F81B7BB2C2568294
:108260002310E3AFC9809810CD6C827BC5ED4B0025
:10827000E40CED79C1C9C5ED4B00E40CED78C1C942
:10828000C5ED4B00E4ED7910FEC1C9C5ED4B00E42E
:1082900010FEED78ED4B00E410FEC1C9E60F473A41
:1082A0000EE4E6F0B0320EE41E87C36882E60347B0
:1082B0003A02E4E6FCB03202E41E81C368823A026C
:1082C000E4F6203202E41E81C368823A02E4E6DF6B
:1082D0003202E41E81C368822180002202E47D1EF6
:1082E00081CD68827C1E80CD68823E00CD9C823E1E
:1082F00000CD4D841100000100403E00CD3E84C9F8
:10830000CDD882ED5B04E4CD178416061E000E0462
:1083100006207BCD80823C10FA0DC210835F15C20F
:108320000E8321C8002202E4C34C83CDD88221C031
:10833000002202E4C34C83E5CDD882E1ED5B08E482
:10834000010008CD2F8421D0002202E43A06E4E6A1
:10835000C03206E4573A07E4E63F3207E4CB12178F
:10836000CB12171E83CD6882AF3208E43A09E4E6E7
:10837000383209E40F0F0F1E84CD6882C3CA83CD43
:10838000D882ED5B04E4CD17840603AFCD80823C38
:10839000C28C8310F721C0022202E4AF3206E4321D
:1083A00008E43A07E4E6203207E43EFFC2B1833E28
:1083B0007F1E83CD68823A09E4E6203209E43E0755
:1083C000C2C5833E031E84CD6882AF3204E43A0501
:1083D000E4E63C3205E40F0F1E82CD68823A0CE4DD
:1083E000E680320CE4573A0DE4E67FCB12171E8587
:1083F000CD6882AF320AE43A0BE4E638320BE40F80
:108400000F0F1E86CD68821E813A02E4CD68823A43
:1084100003E41E80C368827BCD6C827AE63FF6401F
:10842000CD6C82C97BCD6C827AE63FCD6C82C9CDA2
:1084300017847ECD8082230B78B1C23284C9F5CDFA
:108440001784F1CD80820DC2438410F7C9878787D6
:1084500087473A0EE4E60FB0320EE41E87C3688207
:108460001600210000192929192929295F19ED5B16
:1084700004E419EBC317847EFE00C8CD808223C3B9
:108480007784CD808210FBC922A984C978FEC0D030
:10849000CDCF8479E60706004F21B38409462A0828
:1084A000E419EBCD2484CD8B82B000F5CD1784F197
:1084B000C380828040201008040201F578FEC0D0FD
:1084C000CDCF842A06E419EBCD1784F1C3808278DE
:1084D0000F0F0FE61F5779E6F85F78E607B35FC91D
:1084E000000000000000000038446C445444380090
:1084F000387C547C447C380000287C7C7C3810001C
:108500000010387C7C381000103838107C7C10004B
:108510000010387C7C103800000000303000000073
:10852000FCFCFCCCCCFCFCFC00007848487800004B
:10853000FCFC84B4B484FCFC001C0C3448483000BF
:10854000384444381038100010181410307060008F
:108550000C342C342C6C60000054386C38540000FF
:108560002030383C38302000081838783818080097
:1085700010387C107C381000282828282800280073
:108580003C5454341414140038443028184438002F
:10859000000000000078780010387C107C3810381B
:1085A00010387C1010101000101010107C381000C3
:1085B0000010187C181000000010307C30100000F3
:1085C0000000004040407C000028287C2828000053
:1085D000101038387C7C00007C7C3838101000008B
:1085E00000000000000000001038381010001000DB
:1085F0006C6C48000000000000287C28287C2800C3
:10860000203840300870100064640810204C4C0082
:10861000205050205448340030302000000000002A
:1086200010202020202010002010101010102000FA
:108630000028387C382800000010107C1010000042
:1086400000000000003030200000007C000000002E
:10865000000000000030300000040810204000003E
:1086600038444C5464443800103010101010380056
:108670003844041820407C0038440438044438004E
:10868000081828487C0808007C40407804443800DA
:1086900018204078444438007C0408102020200032
:1086A00038444438444438003844443C04083000DA
:1086B000000030300030300000003030003030201A
:1086C000081020402010080000007C00007C000002
:1086D000201008040810200038440418100010006E
:1086E00038445C545C403800384444447C44440082
:1086F000784444784444780038444040404438004A
:1087000078444444444478007C40407840407C00B5
:108710007C404078404040003844405C44443C0049
:108720004444447C44444400381010101010380075
:108730000404040444443800444850605048440051
:108740004040404040407C00446C54444444440019
:108750004464544C44444400384444444444380041
:1087600078444478404040003844444454483400FD
:10877000784444784844440038444038044438003D
:108780007C1010101010100044444444444438003D
:10879000444444444428100044445454545428004D
:1087A0004444281028444400444444281010100035
:1087B0007808102040407800382020202020380001
:1087C0000040201008040000380808080808380095
:1087D000102844000000000000000000000000FC21
:1087E0003030100000000000000038043C443C0021
:1087F0004040784444447800000038444044380005
:1088000004043C4444443C000000384478403800B0
:10881000182020782020200000003C44443C0438EC
:1088200040407048484848001000101010101800D0
:108830000800180808084830404048506050480078
:108840001010101010101800000068545444440018
:10885000000070484848480000003844444438004C
:10886000000078444444784000003C4444443C04C4
:1088700000005824202070000000384038043800E0
:108880000020782020281000000048484858280080
:10889000000044444428100000004444547C280054
:1088A00000004848304848000000484848381060F8
:1088B0000000780830407800182020602020180040
:1088C00010101000101010003008080C08083000BC
:1088D000285000000000000010386C44447C000068
:1088E0003844404044381030480048484858280030
:1088F0000C00384478403800380038043C443C00D0
:10890000280038043C443C00300038043C443C001F
:10891000382838043C443C00003844404438103087
:10892000380038447840380028003844784038000F
:10893000300038447840380028001010101018001B
:10894000102800101010180020001010101018002F
:1089500028001028447C44003828386C447C4400AB
:108960000C007C4078407C00000078147C503C0077
:108970003C50507C50505C00380030484848300033
:1089800028003048484830006000304848483000EF
:10899000380048484858280060004848485828008F
:1089A0002800484848381060483048484848300057
:1089B000280048484848300000103840403810002F
:1089C0001824207820245C004428107C107C10009F
:1089D000605050685C48480008141038101050204F
:1089E000180038043C443C00180010101010180007
:1089F00018003048484830001800484848582800B7
:108A000028500070484848002850004868584800DE
:108A100038043C443C003C00304848483000780072
:108A2000100010304044380000007C4040400000FE
:108A30000000FC04040000004048503844081C00BA
:108A40004048502C541C04001000101038381000FE
:108A500000002448240000000000482448000000D2
:108A60005400A8005400A80054A854A854A854A81E
:108A7000A8FC54FCA8FC54FC10101010101010108E
:108A8000101010F01010101010F010F01010101046
:108A9000505050D050505050000000F050505050A6
:108AA00000F010F01010101050D010D05050505056
:108AB000505050505050505000F010D05050505026
:108AC00050D010F000000000505050F000000000A6
:108AD00010F010F000000000000000F01010101066
:108AE0001010101C00000000101010FC000000000E
:108AF000000000FC101010101010101C10101010AE
:108B0000000000FC00000000101010FC10101010FD
:108B1000101C101C101010105050505C5050505031
:108B2000505C407C00000000007C405C5050505085
:108B300050DC00FC0000000000FC00DC50505050F5
:108B4000505C405C5050505000FC00FC00000000A5
:108B500050DC00DC5050505010FC00FC00000000C5
:108B6000505050FC0000000000FC00FC10101010E1
:108B7000000000FC505050505050507C000000004D
:108B8000101C101C00000000001C101C1010101005
:108B90000000007C50505050505050DC505050500D
:108BA00010FC00FC10101010101010F0000000005D
:108BB0000000001C10101010FCFCFCFCFCFCFCFC79
:108BC00000000000FCFCFCFCE0E0E0E0E0E0E0E0B5
:108BD0001C1C1C1C1C1C1C1CFCFCFCFC00000000C5
:108BE0000000344848340000007048704848704025
:108BF0007848404040404000007C28282828280031
:108C0000784820102048780000003C484830000098
:108C100000004848487040400000285010101000E4
:108C20003810384438103800304848784848300008
:108C30000038444428286C00304020103848300068
:108C400000002854542800000010385454381000F4
:108C5000003840784038000000304848484800005C
:108C6000007800780078000000103810003800000C
:108C7000403008304000780008304030080078006C
:108C800000081410101010101010101010502000B8
:108C90000010007C00100000002850002850000048
:108CA0003048483000000000000000303000000074
:108CB0000000002000000000001C10105050200098
:108CC00050282828000000006010207000000000DC
:108CD00000007878787800000000000000000000B4
:108CE00001003879D38178E63FF640D3813E20D326
:108CF00080CD648103606911C03BED52C2E38CAF4B
:0A8D000032E04032E140CD4480C96A
:00000001FF

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,209 @@
!8000 CD 08 80 C9 01 04 00 00 21 E0 40 01 04 80 11 E4
!8010 40 0A 77 03 23 E5 ED 52 E1 C2 11 80 CD F1 81 21
!8020 E0 84 CD 37 83 3E 06 CD 9C 82 3E 0F CD 4D 84 3E
!8030 00 1E 00 CD 60 84 21 69 81 CD 77 84 3E 00 1E 04
!8040 CD 60 84 C9 3A E1 40 5F 3A E0 40 CD 60 84 C9 F5
!8050 C5 0A F6 00 28 07 CD 60 80 03 C3 51 80 C1 F1 C9
!8060 F5 C5 D5 E5 FE 7F CA A1 80 FE 0D CA F4 80 FE 0A
!8070 CA D4 80 CD 80 82 3A E0 40 3C FE 27 CA 8B 80 D2
!8080 8B 80 32 E0 40 CD 44 80 C3 FE 80 AF 32 E0 40 3A
!8090 E1 40 FE 17 CA E6 80 3C 32 E1 40 CD 44 80 C3 FE
!80A0 80 3A E0 40 A7 CA BA 80 3D 32 E0 40 CD 44 80 3E
!80B0 20 CD 80 82 CD 44 80 C3 FE 80 3E 27 32 E0 40 3A
!80C0 E1 40 3D 32 E1 40 CD 44 80 3E 20 CD 80 82 CD 44
!80D0 80 C3 FE 80 3A E1 40 FE 17 CA E6 80 3C 32 E1 40
!80E0 CD 44 80 C3 FE 80 CD 03 81 3E 17 32 E1 40 CD 44
!80F0 80 C3 FE 80 AF 32 E0 40 CD 44 80 C3 FE 80 E1 D1
!8100 C1 F1 C9 01 00 38 60 69 11 28 00 19 7D D3 81 7C
!8110 E6 3F D3 81 CD 64 81 DB 80 F5 79 D3 81 78 E6 3F
!8120 F6 40 D3 81 F1 CD 64 81 D3 80 03 60 69 11 98 3B
!8130 ED 52 C2 06 81 01 98 03 79 D3 81 78 E6 3F F6 40
!8140 D3 81 0E 28 01 98 3B 79 D3 81 78 E6 3F F6 40 D3
!8150 81 3E 20 D3 80 CD 64 81 03 60 69 11 C0 3B ED 52
!8160 C2 47 81 C9 00 00 00 00 C9 20 20 5A 38 43 20 4D
!8170 6B 20 49 56 20 2D 20 41 20 5A 38 30 20 48 6F 6D
!8180 65 62 72 65 77 20 43 6F 6D 70 75 74 65 72 20 20
!8190 20 20 20 52 4F 4D 20 56 65 72 2E 20 31 2E 30 20
!81A0 62 79 20 44 65 6E 6E 69 73 20 47 75 6E 69 61 20
!81B0 28 32 30 32 32 29 20 20 20 20 20 20 20 20 20 20
!81C0 20 20 34 38 6B 20 52 41 4D 20 2D 20 34 4D 48 7A
!81D0 20 5A 38 30 20 43 50 55 20 20 20 20 20 20 20 20
!81E0 20 00 E0 40 00 00 00 38 00 20 00 00 00 18 C0 3B
!81F0 00 3E E0 32 00 E4 3E 02 32 01 E4 3E 00 32 02 E4
!8200 3E 00 32 03 E4 3E 00 32 04 E4 3E 38 32 05 E4 3E
!8210 00 32 08 E4 3E 00 32 09 E4 3E 00 32 06 E4 3E 20
!8220 32 07 E4 3E 00 32 0A E4 3E 18 32 0B E4 3E C0 32
!8230 0C E4 3E 3B 32 0D E4 C9 01 0A 1F 3E 01 32 01 E4
!8240 C9 21 65 82 06 03 7E 32 00 E4 CD 76 82 CD 76 82
!8250 FA 60 82 11 FF FF CD 76 82 F8 1B 7B B2 C2 56 82
!8260 23 10 E3 AF C9 80 98 10 CD 6C 82 7B C5 ED 4B 00
!8270 E4 0C ED 79 C1 C9 C5 ED 4B 00 E4 0C ED 78 C1 C9
!8280 C5 ED 4B 00 E4 ED 79 10 FE C1 C9 C5 ED 4B 00 E4
!8290 10 FE ED 78 ED 4B 00 E4 10 FE C1 C9 E6 0F 47 3A
!82A0 0E E4 E6 F0 B0 32 0E E4 1E 87 C3 68 82 E6 03 47
!82B0 3A 02 E4 E6 FC B0 32 02 E4 1E 81 C3 68 82 3A 02
!82C0 E4 F6 20 32 02 E4 1E 81 C3 68 82 3A 02 E4 E6 DF
!82D0 32 02 E4 1E 81 C3 68 82 21 80 00 22 02 E4 7D 1E
!82E0 81 CD 68 82 7C 1E 80 CD 68 82 3E 00 CD 9C 82 3E
!82F0 00 CD 4D 84 11 00 00 01 00 40 3E 00 CD 3E 84 C9
!8300 CD D8 82 ED 5B 04 E4 CD 17 84 16 06 1E 00 0E 04
!8310 06 20 7B CD 80 82 3C 10 FA 0D C2 10 83 5F 15 C2
!8320 0E 83 21 C8 00 22 02 E4 C3 4C 83 CD D8 82 21 C0
!8330 00 22 02 E4 C3 4C 83 E5 CD D8 82 E1 ED 5B 08 E4
!8340 01 00 08 CD 2F 84 21 D0 00 22 02 E4 3A 06 E4 E6
!8350 C0 32 06 E4 57 3A 07 E4 E6 3F 32 07 E4 CB 12 17
!8360 CB 12 17 1E 83 CD 68 82 AF 32 08 E4 3A 09 E4 E6
!8370 38 32 09 E4 0F 0F 0F 1E 84 CD 68 82 C3 CA 83 CD
!8380 D8 82 ED 5B 04 E4 CD 17 84 06 03 AF CD 80 82 3C
!8390 C2 8C 83 10 F7 21 C0 02 22 02 E4 AF 32 06 E4 32
!83A0 08 E4 3A 07 E4 E6 20 32 07 E4 3E FF C2 B1 83 3E
!83B0 7F 1E 83 CD 68 82 3A 09 E4 E6 20 32 09 E4 3E 07
!83C0 C2 C5 83 3E 03 1E 84 CD 68 82 AF 32 04 E4 3A 05
!83D0 E4 E6 3C 32 05 E4 0F 0F 1E 82 CD 68 82 3A 0C E4
!83E0 E6 80 32 0C E4 57 3A 0D E4 E6 7F CB 12 17 1E 85
!83F0 CD 68 82 AF 32 0A E4 3A 0B E4 E6 38 32 0B E4 0F
!8400 0F 0F 1E 86 CD 68 82 1E 81 3A 02 E4 CD 68 82 3A
!8410 03 E4 1E 80 C3 68 82 7B CD 6C 82 7A E6 3F F6 40
!8420 CD 6C 82 C9 7B CD 6C 82 7A E6 3F CD 6C 82 C9 CD
!8430 17 84 7E CD 80 82 23 0B 78 B1 C2 32 84 C9 F5 CD
!8440 17 84 F1 CD 80 82 0D C2 43 84 10 F7 C9 87 87 87
!8450 87 47 3A 0E E4 E6 0F B0 32 0E E4 1E 87 C3 68 82
!8460 16 00 21 00 00 19 29 29 19 29 29 29 5F 19 ED 5B
!8470 04 E4 19 EB C3 17 84 7E FE 00 C8 CD 80 82 23 C3
!8480 77 84 CD 80 82 10 FB C9 22 A9 84 C9 78 FE C0 D0
!8490 CD CF 84 79 E6 07 06 00 4F 21 B3 84 09 46 2A 08
!84A0 E4 19 EB CD 24 84 CD 8B 82 B0 00 F5 CD 17 84 F1
!84B0 C3 80 82 80 40 20 10 08 04 02 01 F5 78 FE C0 D0
!84C0 CD CF 84 2A 06 E4 19 EB CD 17 84 F1 C3 80 82 78
!84D0 0F 0F 0F E6 1F 57 79 E6 F8 5F 78 E6 07 B3 5F C9
!84E0 00 00 00 00 00 00 00 00 38 44 6C 44 54 44 38 00
!84F0 38 7C 54 7C 44 7C 38 00 00 28 7C 7C 7C 38 10 00
!8500 00 10 38 7C 7C 38 10 00 10 38 38 10 7C 7C 10 00
!8510 00 10 38 7C 7C 10 38 00 00 00 00 30 30 00 00 00
!8520 FC FC FC CC CC FC FC FC 00 00 78 48 48 78 00 00
!8530 FC FC 84 B4 B4 84 FC FC 00 1C 0C 34 48 48 30 00
!8540 38 44 44 38 10 38 10 00 10 18 14 10 30 70 60 00
!8550 0C 34 2C 34 2C 6C 60 00 00 54 38 6C 38 54 00 00
!8560 20 30 38 3C 38 30 20 00 08 18 38 78 38 18 08 00
!8570 10 38 7C 10 7C 38 10 00 28 28 28 28 28 00 28 00
!8580 3C 54 54 34 14 14 14 00 38 44 30 28 18 44 38 00
!8590 00 00 00 00 00 78 78 00 10 38 7C 10 7C 38 10 38
!85A0 10 38 7C 10 10 10 10 00 10 10 10 10 7C 38 10 00
!85B0 00 10 18 7C 18 10 00 00 00 10 30 7C 30 10 00 00
!85C0 00 00 00 40 40 40 7C 00 00 28 28 7C 28 28 00 00
!85D0 10 10 38 38 7C 7C 00 00 7C 7C 38 38 10 10 00 00
!85E0 00 00 00 00 00 00 00 00 10 38 38 10 10 00 10 00
!85F0 6C 6C 48 00 00 00 00 00 00 28 7C 28 28 7C 28 00
!8600 20 38 40 30 08 70 10 00 64 64 08 10 20 4C 4C 00
!8610 20 50 50 20 54 48 34 00 30 30 20 00 00 00 00 00
!8620 10 20 20 20 20 20 10 00 20 10 10 10 10 10 20 00
!8630 00 28 38 7C 38 28 00 00 00 10 10 7C 10 10 00 00
!8640 00 00 00 00 00 30 30 20 00 00 00 7C 00 00 00 00
!8650 00 00 00 00 00 30 30 00 00 04 08 10 20 40 00 00
!8660 38 44 4C 54 64 44 38 00 10 30 10 10 10 10 38 00
!8670 38 44 04 18 20 40 7C 00 38 44 04 38 04 44 38 00
!8680 08 18 28 48 7C 08 08 00 7C 40 40 78 04 44 38 00
!8690 18 20 40 78 44 44 38 00 7C 04 08 10 20 20 20 00
!86A0 38 44 44 38 44 44 38 00 38 44 44 3C 04 08 30 00
!86B0 00 00 30 30 00 30 30 00 00 00 30 30 00 30 30 20
!86C0 08 10 20 40 20 10 08 00 00 00 7C 00 00 7C 00 00
!86D0 20 10 08 04 08 10 20 00 38 44 04 18 10 00 10 00
!86E0 38 44 5C 54 5C 40 38 00 38 44 44 44 7C 44 44 00
!86F0 78 44 44 78 44 44 78 00 38 44 40 40 40 44 38 00
!8700 78 44 44 44 44 44 78 00 7C 40 40 78 40 40 7C 00
!8710 7C 40 40 78 40 40 40 00 38 44 40 5C 44 44 3C 00
!8720 44 44 44 7C 44 44 44 00 38 10 10 10 10 10 38 00
!8730 04 04 04 04 44 44 38 00 44 48 50 60 50 48 44 00
!8740 40 40 40 40 40 40 7C 00 44 6C 54 44 44 44 44 00
!8750 44 64 54 4C 44 44 44 00 38 44 44 44 44 44 38 00
!8760 78 44 44 78 40 40 40 00 38 44 44 44 54 48 34 00
!8770 78 44 44 78 48 44 44 00 38 44 40 38 04 44 38 00
!8780 7C 10 10 10 10 10 10 00 44 44 44 44 44 44 38 00
!8790 44 44 44 44 44 28 10 00 44 44 54 54 54 54 28 00
!87A0 44 44 28 10 28 44 44 00 44 44 44 28 10 10 10 00
!87B0 78 08 10 20 40 40 78 00 38 20 20 20 20 20 38 00
!87C0 00 40 20 10 08 04 00 00 38 08 08 08 08 08 38 00
!87D0 10 28 44 00 00 00 00 00 00 00 00 00 00 00 00 FC
!87E0 30 30 10 00 00 00 00 00 00 00 38 04 3C 44 3C 00
!87F0 40 40 78 44 44 44 78 00 00 00 38 44 40 44 38 00
!8800 04 04 3C 44 44 44 3C 00 00 00 38 44 78 40 38 00
!8810 18 20 20 78 20 20 20 00 00 00 3C 44 44 3C 04 38
!8820 40 40 70 48 48 48 48 00 10 00 10 10 10 10 18 00
!8830 08 00 18 08 08 08 48 30 40 40 48 50 60 50 48 00
!8840 10 10 10 10 10 10 18 00 00 00 68 54 54 44 44 00
!8850 00 00 70 48 48 48 48 00 00 00 38 44 44 44 38 00
!8860 00 00 78 44 44 44 78 40 00 00 3C 44 44 44 3C 04
!8870 00 00 58 24 20 20 70 00 00 00 38 40 38 04 38 00
!8880 00 20 78 20 20 28 10 00 00 00 48 48 48 58 28 00
!8890 00 00 44 44 44 28 10 00 00 00 44 44 54 7C 28 00
!88A0 00 00 48 48 30 48 48 00 00 00 48 48 48 38 10 60
!88B0 00 00 78 08 30 40 78 00 18 20 20 60 20 20 18 00
!88C0 10 10 10 00 10 10 10 00 30 08 08 0C 08 08 30 00
!88D0 28 50 00 00 00 00 00 00 10 38 6C 44 44 7C 00 00
!88E0 38 44 40 40 44 38 10 30 48 00 48 48 48 58 28 00
!88F0 0C 00 38 44 78 40 38 00 38 00 38 04 3C 44 3C 00
!8900 28 00 38 04 3C 44 3C 00 30 00 38 04 3C 44 3C 00
!8910 38 28 38 04 3C 44 3C 00 00 38 44 40 44 38 10 30
!8920 38 00 38 44 78 40 38 00 28 00 38 44 78 40 38 00
!8930 30 00 38 44 78 40 38 00 28 00 10 10 10 10 18 00
!8940 10 28 00 10 10 10 18 00 20 00 10 10 10 10 18 00
!8950 28 00 10 28 44 7C 44 00 38 28 38 6C 44 7C 44 00
!8960 0C 00 7C 40 78 40 7C 00 00 00 78 14 7C 50 3C 00
!8970 3C 50 50 7C 50 50 5C 00 38 00 30 48 48 48 30 00
!8980 28 00 30 48 48 48 30 00 60 00 30 48 48 48 30 00
!8990 38 00 48 48 48 58 28 00 60 00 48 48 48 58 28 00
!89A0 28 00 48 48 48 38 10 60 48 30 48 48 48 48 30 00
!89B0 28 00 48 48 48 48 30 00 00 10 38 40 40 38 10 00
!89C0 18 24 20 78 20 24 5C 00 44 28 10 7C 10 7C 10 00
!89D0 60 50 50 68 5C 48 48 00 08 14 10 38 10 10 50 20
!89E0 18 00 38 04 3C 44 3C 00 18 00 10 10 10 10 18 00
!89F0 18 00 30 48 48 48 30 00 18 00 48 48 48 58 28 00
!8A00 28 50 00 70 48 48 48 00 28 50 00 48 68 58 48 00
!8A10 38 04 3C 44 3C 00 3C 00 30 48 48 48 30 00 78 00
!8A20 10 00 10 30 40 44 38 00 00 00 7C 40 40 40 00 00
!8A30 00 00 FC 04 04 00 00 00 40 48 50 38 44 08 1C 00
!8A40 40 48 50 2C 54 1C 04 00 10 00 10 10 38 38 10 00
!8A50 00 00 24 48 24 00 00 00 00 00 48 24 48 00 00 00
!8A60 54 00 A8 00 54 00 A8 00 54 A8 54 A8 54 A8 54 A8
!8A70 A8 FC 54 FC A8 FC 54 FC 10 10 10 10 10 10 10 10
!8A80 10 10 10 F0 10 10 10 10 10 F0 10 F0 10 10 10 10
!8A90 50 50 50 D0 50 50 50 50 00 00 00 F0 50 50 50 50
!8AA0 00 F0 10 F0 10 10 10 10 50 D0 10 D0 50 50 50 50
!8AB0 50 50 50 50 50 50 50 50 00 F0 10 D0 50 50 50 50
!8AC0 50 D0 10 F0 00 00 00 00 50 50 50 F0 00 00 00 00
!8AD0 10 F0 10 F0 00 00 00 00 00 00 00 F0 10 10 10 10
!8AE0 10 10 10 1C 00 00 00 00 10 10 10 FC 00 00 00 00
!8AF0 00 00 00 FC 10 10 10 10 10 10 10 1C 10 10 10 10
!8B00 00 00 00 FC 00 00 00 00 10 10 10 FC 10 10 10 10
!8B10 10 1C 10 1C 10 10 10 10 50 50 50 5C 50 50 50 50
!8B20 50 5C 40 7C 00 00 00 00 00 7C 40 5C 50 50 50 50
!8B30 50 DC 00 FC 00 00 00 00 00 FC 00 DC 50 50 50 50
!8B40 50 5C 40 5C 50 50 50 50 00 FC 00 FC 00 00 00 00
!8B50 50 DC 00 DC 50 50 50 50 10 FC 00 FC 00 00 00 00
!8B60 50 50 50 FC 00 00 00 00 00 FC 00 FC 10 10 10 10
!8B70 00 00 00 FC 50 50 50 50 50 50 50 7C 00 00 00 00
!8B80 10 1C 10 1C 00 00 00 00 00 1C 10 1C 10 10 10 10
!8B90 00 00 00 7C 50 50 50 50 50 50 50 DC 50 50 50 50
!8BA0 10 FC 00 FC 10 10 10 10 10 10 10 F0 00 00 00 00
!8BB0 00 00 00 1C 10 10 10 10 FC FC FC FC FC FC FC FC
!8BC0 00 00 00 00 FC FC FC FC E0 E0 E0 E0 E0 E0 E0 E0
!8BD0 1C 1C 1C 1C 1C 1C 1C 1C FC FC FC FC 00 00 00 00
!8BE0 00 00 34 48 48 34 00 00 00 70 48 70 48 48 70 40
!8BF0 78 48 40 40 40 40 40 00 00 7C 28 28 28 28 28 00
!8C00 78 48 20 10 20 48 78 00 00 00 3C 48 48 30 00 00
!8C10 00 00 48 48 48 70 40 40 00 00 28 50 10 10 10 00
!8C20 38 10 38 44 38 10 38 00 30 48 48 78 48 48 30 00
!8C30 00 38 44 44 28 28 6C 00 30 40 20 10 38 48 30 00
!8C40 00 00 28 54 54 28 00 00 00 10 38 54 54 38 10 00
!8C50 00 38 40 78 40 38 00 00 00 30 48 48 48 48 00 00
!8C60 00 78 00 78 00 78 00 00 00 10 38 10 00 38 00 00
!8C70 40 30 08 30 40 00 78 00 08 30 40 30 08 00 78 00
!8C80 00 08 14 10 10 10 10 10 10 10 10 10 10 50 20 00
!8C90 00 10 00 7C 00 10 00 00 00 28 50 00 28 50 00 00
!8CA0 30 48 48 30 00 00 00 00 00 00 00 30 30 00 00 00
!8CB0 00 00 00 20 00 00 00 00 00 1C 10 10 50 50 20 00
!8CC0 50 28 28 28 00 00 00 00 60 10 20 70 00 00 00 00
!8CD0 00 00 78 78 78 78 00 00 00 00 00 00 00 00 00 00
!8CE0 01 00 38 79 D3 81 78 E6 3F F6 40 D3 81 3E 20 D3
!8CF0 80 CD 64 81 03 60 69 11 C0 3B ED 52 C2 E3 8C AF
!8D00 32 E0 40 32 E1 40 CD 44 80 C9