progress on FAT16 support

This commit is contained in:
Dennis Gunia
2024-01-12 13:29:20 +01:00
parent ee2f22df09
commit 507eb3a017
40 changed files with 19699 additions and 6346 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,7 +21,7 @@ iic_init:
LD A,0000010b LD A,0000010b
OUT (CS_PIO_AD), A OUT (CS_PIO_AD), A
LD BC,0x1000 LD BC,0x2000
CALL _pause_loop CALL _pause_loop
LD A, 0x80 ;S1 -> Select S0, PIN disabled, ESO = 0, Interrupt disabled, STA, STA, ACK = 0 LD A, 0x80 ;S1 -> Select S0, PIN disabled, ESO = 0, Interrupt disabled, STA, STA, ACK = 0
@@ -267,4 +267,5 @@ _slow_access:
POP AF POP AF
PUSH AF PUSH AF
POP AF POP AF
POP AF
RET 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

@@ -1,55 +1,303 @@
.include "include/extern_symbols.s" ;include monitor symbols. .include "include/extern_symbols.s" ;include monitor symbols.
org 0x8000 org 0x8000
IIC_RTC equ 11010000b call TermInit
;Testing code ret
;-------------------------------------------------
CALL iic_init ; Z8C/MEGA80 VDP Console IO Functions
; by Dennis Gunia 2022/02
;JP PROMPT_BEGIN ; Version 0.1
LD BC,$1000
CALL _pause_loop
JP PROMPT_BEGIN
LD DE, 0xC000 ; Set I2C Buffer Location
LD A,0x00 ; store string in buffer
LD (DE),A
LD B, IIC_RTC ; Set I2C Address
LD A, 1 ; Set I2C Buffer length
call iic_send
JP PROMPT_BEGIN
.include "include/kdrv_iic.s"
;------------------------------------------------------------------------------
; PRINTINLINE
; ;
; String output function ; For Z8C Monitor
; ;-------------------------------------------------
; Prints in-line data (bytes immediately following the PRINTINLINE call)
; until a string terminator is encountered (0 - null char). ; Constant Values
;------------------------------------------------------------------------------ TermVarMemoryLocation equ 0x40E0
PRINTINLINE:
EX (SP),HL ; PUSH HL and put RET ADDress into HL
; 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, TmsDarkGreen ; 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 AF
PUSH BC PUSH BC
nxtILC: TermPrintStr_LOOP:
LD A,(HL) LD A,(BC)
CP 0
JR Z,endPrint ; Return if nullbyte
CALL print_char OR 0
INC HL JR Z, TermPrintStr_EXIT
JR nxtILC ; Print Char
endPrint: CALL TermPrintChar
INC HL ; Get past "null" terminator
; INC BC and JP start of loop
INC BC
jp TermPrintStr_LOOP
TermPrintStr_EXIT:
POP BC POP BC
POP AF POP AF
EX (SP),HL ; PUSH new RET ADDress on stack and restore HL
RET 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

View File

@@ -1,21 +1,210 @@
:10800000CD1C80010010CDEF80C399001100C03E4F :10800000CD0880C90104000021E04001048011E492
:10801000001206D03E01CD5E80C399003ECFD3F65C :10801000400A770323E5ED52E1C21180CDF18121C1
:108020003EF5D3F63E00D3F4010010CDEF803E02C2 :10802000E084CD37833E0CCD9C823E0FCD4D843E07
:10803000D3F4010010CDEF803E80D3F3CD09813E13 :10803000001E00CD6084216981CD77843E001E043E
:1080400055D3F2CD09813EA0D3F3CD09813E183E30 :10804000CD6084C93AE1405F3AE040CD6084C9F533
:1080500000D3F2CD09813EC1D3F3CD0981C9C5F565 :10805000C50AF6002807CD608003C35180C1F1C96D
:10806000CDE18078D3F2CD09813EC5D3F3F14F0C39 :10806000F5C5D5E5FE7FCAA180FE0DCAF480FE0AE3
:10807000DBF3CB7F20FACB6720091A130D2804D33A :10807000CAD480CD80823AE0403CFE27CA8B80D2B1
:10808000F218ED3EC3D3F3CD0981C1C9D5C5F5784A :108080008B8032E040CD4480C3FE80AF32E0403A86
:10809000F601D3F2CD0981CDE1803EC5D3F3F14F96 :10809000E140FE17CAE6803C32E140CD4480C3FE99
:1080A0000CDBF3CB7F20FACB5F201C0D793D28063B :1080A000803AE040A7CABA803D32E040CD44803EED
:1080B000DBF2121318EB3E40D3F3CD0981DBF21251 :1080B00020CD8082CD4480C3FE803E2732E0403A0E
:1080C00013DBF3CB7F20FA003EC3D3F3CD0981DB72 :1080C000E1403D32E140CD44803E20CD8082CD4430
:1080D000F2CD098112C1D1C9F5DBF3CB7F20FAF1D2 :1080D00080C3FE803AE140FE17CAE6803C32E140B0
:1080E000C9F5DBF3F5CDE702F1CB4728F5F1C9F58A :1080E000CD4480C3FE80CD03813E1732E140CD44B4
:1080F000C5C1C5C10B79B0C2F080F1C9DBF3CB4774 :1080F00080C3FE80AF32E040CD4480C3FE80E1D13A
:10810000C03EC3D3F3000018F300000000000000DD :10810000C1F1C90100386069112800197DD3817C53
:1081100000F5F1F5F1F5F1F5F1F5F1F5F1C9E3F55A :10811000E63FD381CD6481DB80F579D38178E63F7A
:10812000C57EFE002806CDB7022318F523C1F1E372 :10812000F640D381F1CD6481D38003606911983B1F
:01813000C985 :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 :00000001FF

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,209 @@
!8000 CD 1C 80 01 00 10 CD EF 80 C3 99 00 11 00 C0 3E !8000 CD 08 80 C9 01 04 00 00 21 E0 40 01 04 80 11 E4
!8010 00 12 06 D0 3E 01 CD 5E 80 C3 99 00 3E CF D3 F6 !8010 40 0A 77 03 23 E5 ED 52 E1 C2 11 80 CD F1 81 21
!8020 3E F5 D3 F6 3E 00 D3 F4 01 00 10 CD EF 80 3E 02 !8020 E0 84 CD 37 83 3E 0C CD 9C 82 3E 0F CD 4D 84 3E
!8030 D3 F4 01 00 10 CD EF 80 3E 80 D3 F3 CD 09 81 3E !8030 00 1E 00 CD 60 84 21 69 81 CD 77 84 3E 00 1E 04
!8040 55 D3 F2 CD 09 81 3E A0 D3 F3 CD 09 81 3E 18 3E !8040 CD 60 84 C9 3A E1 40 5F 3A E0 40 CD 60 84 C9 F5
!8050 00 D3 F2 CD 09 81 3E C1 D3 F3 CD 09 81 C9 C5 F5 !8050 C5 0A F6 00 28 07 CD 60 80 03 C3 51 80 C1 F1 C9
!8060 CD E1 80 78 D3 F2 CD 09 81 3E C5 D3 F3 F1 4F 0C !8060 F5 C5 D5 E5 FE 7F CA A1 80 FE 0D CA F4 80 FE 0A
!8070 DB F3 CB 7F 20 FA CB 67 20 09 1A 13 0D 28 04 D3 !8070 CA D4 80 CD 80 82 3A E0 40 3C FE 27 CA 8B 80 D2
!8080 F2 18 ED 3E C3 D3 F3 CD 09 81 C1 C9 D5 C5 F5 78 !8080 8B 80 32 E0 40 CD 44 80 C3 FE 80 AF 32 E0 40 3A
!8090 F6 01 D3 F2 CD 09 81 CD E1 80 3E C5 D3 F3 F1 4F !8090 E1 40 FE 17 CA E6 80 3C 32 E1 40 CD 44 80 C3 FE
!80A0 0C DB F3 CB 7F 20 FA CB 5F 20 1C 0D 79 3D 28 06 !80A0 80 3A E0 40 A7 CA BA 80 3D 32 E0 40 CD 44 80 3E
!80B0 DB F2 12 13 18 EB 3E 40 D3 F3 CD 09 81 DB F2 12 !80B0 20 CD 80 82 CD 44 80 C3 FE 80 3E 27 32 E0 40 3A
!80C0 13 DB F3 CB 7F 20 FA 00 3E C3 D3 F3 CD 09 81 DB !80C0 E1 40 3D 32 E1 40 CD 44 80 3E 20 CD 80 82 CD 44
!80D0 F2 CD 09 81 12 C1 D1 C9 F5 DB F3 CB 7F 20 FA F1 !80D0 80 C3 FE 80 3A E1 40 FE 17 CA E6 80 3C 32 E1 40
!80E0 C9 F5 DB F3 F5 CD E7 02 F1 CB 47 28 F5 F1 C9 F5 !80E0 CD 44 80 C3 FE 80 CD 03 81 3E 17 32 E1 40 CD 44
!80F0 C5 C1 C5 C1 0B 79 B0 C2 F0 80 F1 C9 DB F3 CB 47 !80F0 80 C3 FE 80 AF 32 E0 40 CD 44 80 C3 FE 80 E1 D1
!8100 C0 3E C3 D3 F3 00 00 18 F3 00 00 00 00 00 00 00 !8100 C1 F1 C9 01 00 38 60 69 11 28 00 19 7D D3 81 7C
!8110 00 F5 F1 F5 F1 F5 F1 F5 F1 F5 F1 F5 F1 C9 E3 F5 !8110 E6 3F D3 81 CD 64 81 DB 80 F5 79 D3 81 78 E6 3F
!8120 C5 7E FE 00 28 06 CD B7 02 23 18 F5 23 C1 F1 E3 !8120 F6 40 D3 81 F1 CD 64 81 D3 80 03 60 69 11 98 3B
!8130 C9 !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

View File

@@ -45,3 +45,6 @@ CS_PIO_BD .EQU 0xF5
CS_PIO_BC .EQU 0xF7 CS_PIO_BC .EQU 0xF7
CS_PIO_AD .EQU 0xF4 CS_PIO_AD .EQU 0xF4
CS_PIO_AC .EQU 0xF6 CS_PIO_AC .EQU 0xF6
CS_APU_DATA .EQU 0xF8
CS_APU_CTRL .EQU 0xF9

View File

@@ -6,33 +6,32 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
beep: beep:
push AF push AF
push BC
push DE push DE
beep_loop: beep_loop:
LD A,0x08 LD A,0x08
OUT (CS_PIO_AD), A OUT (CS_PIO_AD), A
LD BC, 0x28
CALL beep_pause CALL beep_pause
LD A,0x00 LD A,0x00
OUT (CS_PIO_AD), A OUT (CS_PIO_AD), A
LD BC, 0x24
CALL beep_pause CALL beep_pause
DEC DE DEC DE
ld A,D ld A,D
or E or E
jr NZ, beep_loop jr NZ, beep_loop
pop de pop de
pop bc
pop af pop af
ret ret
beep_pause: beep_pause:
NEG ; 8 T-states PUSH BC
NEG ; 8 T-states _beep_pause_l1:
;NEG ; 8 T-states
;NEG ; 8 T-states
NEG ; 8 T-states NEG ; 8 T-states
NEG ; 8 T-states NEG ; 8 T-states
DEC BC ; 6 T-states DEC BC ; 6 T-states
LD A,C ; 9 T-states LD A,C ; 9 T-states
OR B ; 4 T-states OR B ; 4 T-states
JP NZ,beep_pause ; 10 T-states JP NZ,_beep_pause_l1 ; 10 T-states
POP BC
RET ; Pause complete, RETurn RET ; Pause complete, RETurn

View File

@@ -0,0 +1,201 @@
ADDR_RTC .equ 0xD0
OP_RTIME:
call print_newLine
_OP_RTIME_NN:
;set pointer
ld hl,[_OP_RTIME_RD_CMD]
ld b, 1
ld c, ADDR_RTC
call iic_send_buffer
or a
jp nz, _OP_IIC_ACK_ERR
;read RTC data
ld hl,[var_scratch]
ld b,8
ld c, ADDR_RTC
call iic_receive_buffer
or a
jp nz, _OP_IIC_ACK_ERR
;process display hours
ld a,(var_scratch+2)
and 00110000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+2)
and 00001111b
call print_bcd
ld a,':'
call print_char
;display minutes
ld a,(var_scratch+1)
and 01110000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+1)
and 00001111b
call print_bcd
ld a,':'
call print_char
;display seconds
ld a,(var_scratch+0)
and 01110000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+0)
and 00001111b
call print_bcd
ld a,' '
call print_char
;display date
ld a,(var_scratch+4)
and 00110000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+4)
and 00001111b
call print_bcd
ld a,'.'
call print_char
ld a,(var_scratch+5)
and 00010000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+5)
and 00001111b
call print_bcd
ld a,'.'
call print_char
ld a,'2'
call print_char
ld a,'0'
call print_char
ld a,(var_scratch+6)
and 11110000b
RRA
RRA
RRA
RRA
call print_bcd
ld a,(var_scratch+6)
and 00001111b
call print_bcd
RET
_OP_RTIME_RD_CMD:
db 0x00
_OP_STIME_STR_DAY: db 10,13,"Enter Date (00-31) : ",0
_OP_STIME_STR_MON: db 10,13,"Enter Month (00-12) : ",0
_OP_STIME_STR_YEAR: db 10,13,"Enter Year (00-99) : ",0
_OP_STIME_STR_HOUR: db 10,13,"Enter Hours (00-23) : ",0
_OP_STIME_STR_MIN: db 10,13,"Enter Minutes (00-59) : ",0
_OP_STIME_STR_SEC: db 10,13,"Enter Seconds (00-59) : ",0
_OP_STIME_INVALID: db " invaild input. Retry!",0
;HL contains pointer to stack
;BC returns value (BCD)
_OP_STIME_PROMPT:
push hl
call print_str
pop hl
call read_bcd
cp 0xFF ;if failed
jp Z, _OP_STIME_PROMPT_ERR
ld b,a
call read_bcd
cp 0xFF ;if failed
jp Z, _OP_STIME_PROMPT_ERR
ld c,a
ret
_OP_STIME_PROMPT_ERR:
push HL
ld hl, [_OP_STIME_INVALID]
call print_str
pop hl
jp _OP_STIME_PROMPT
OP_STIME:
xor a
ld (var_scratch),a ;set pointer
;date
ld hl, [_OP_STIME_STR_DAY]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 00110000b ;mask bits; bit6 low -> 24h mode
or c ;add second digit
ld (var_scratch+5),a
;month
ld hl, [_OP_STIME_STR_MON]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 00010000b ;mask bits; bit6 low -> 24h mode
or c ;add second digit
ld (var_scratch+6),a
;year
ld hl, [_OP_STIME_STR_YEAR]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 11110000b ;mask bits; bit6 low -> 24h mode
or c ;add second digit
ld (var_scratch+7),a
;hours
ld hl, [_OP_STIME_STR_HOUR]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 00110000b ;mask bits; bit6 low -> 24h mode
or c ;add second digit
ld (var_scratch+3),a
; minutes
ld hl, [_OP_STIME_STR_MIN]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 01110000b ;mask bits
or c ;add second digit
ld (var_scratch+2),a
; seconds
ld hl, [_OP_STIME_STR_SEC]
call _OP_STIME_PROMPT
ld a,b
call _shift4
and 01110000b ;mask bits / bit6 low -> 24h mode (enable clock)
or c ;add second digit
ld (var_scratch+1),a
inc de ;next
ld c, ADDR_RTC
ld b, 8
ld hl,[var_scratch]
call iic_send_buffer
or a
jp nz, _OP_IIC_ACK_ERR
ret
_shift4:
RLCA
RLCA
RLCA
RLCA
ret

View File

@@ -0,0 +1,26 @@
OP_LSDSK:
call ideif_prnt_devtable
ret
OP_SELDSK:
;DE contains pointer
push de
pop hl
ld a,(hl)
sbc 69
jr c,_OP_SELDSK_INVALID
cp 4
jr nc, _OP_SELDSK_INVALID
call 0x8000
ret
_OP_SELDSK_INVALID:
ld hl,[_OP_SELDSK_INVALID_STR]
call print_str
LD DE,0x20
LD BC,0x70
CALL beep
ret
_OP_SELDSK_INVALID_STR:
db 10,13,"Invalid drive letter",10,13,0

View File

@@ -0,0 +1,130 @@
OP_IO_IN:
push DE
pop HL
call DHEX_TO_BYTE
ld c,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
in a,(c)
push af
call print_newLine
pop af
call print_a_hex
ret
OP_IO_OUT:
push DE
pop HL
call DHEX_TO_BYTE
ld c,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc hl
inc hl
ld a,(hl)
cp ' '
jp nz, ERR_SYNTAX
inc hl
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
pop af
out (c),a
ret
OP_IIC_OUT:
push DE
pop HL
call DHEX_TO_BYTE ;load start addr
ld (var_scratch+1),A ;store result in ram
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc hl
inc hl
LD BC,[var_scratch + 2]
XOR A
LD (var_scratch),A
_OP_IIC_OUT_LOOP:
ld a,(hl)
cp 0 ;if 0 then end
jp z,_OP_IIC_OUT_SEND
cp ' '
jp nz, ERR_SYNTAX
inc hl ;next byte
call DHEX_TO_BYTE
ld (bc),a
inc bc ;incerement pointer
ld a,(var_scratch)
inc a ;increment counter
ld (var_scratch),a
inc HL
inc HL
jr _OP_IIC_OUT_LOOP
_OP_IIC_OUT_SEND:
ld hl,[var_scratch + 2]
ld a,(var_scratch) ;load amount of bytes
ld b,a
ld a,(var_scratch+1) ;load start addr
ld c,a
call iic_send_buffer
or a
jp nz, _OP_IIC_ACK_ERR
ret
_OP_IIC_ACK_ERR:
LD HL,[_OP_IIC_ACK_ERR_str]
call print_str
ret
_OP_IIC_ACK_ERR_str:
db 10,13,"bus-error: no ACK",0
OP_IIC_IN:
push DE
pop HL
call DHEX_TO_BYTE ;load start addr
ld C,a ;store start addr to B
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc hl
inc hl
ld a,(hl)
cp ' '
jp nz, ERR_SYNTAX
inc hl
call DHEX_TO_BYTE ;read length
ld b,a ;store length in B
push bc
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
ld hl,[var_scratch]
call iic_receive_buffer
pop bc
or a
jp nz, _OP_IIC_ACK_ERR
ld hl,[_OP_IIC_IN_LOOP_TEXT]
call print_str
ld hl,[var_scratch]
;print data
_OP_IIC_IN_LOOP:
ld a,(hl)
call print_a_hex
ld a, ' '
call print_char
inc hl
djnz _OP_IIC_IN_LOOP
ret
_OP_IIC_IN_LOOP_TEXT:
db 10,13,"rec-buff: ",0
OP_CLR:
call print_clear
ret

View File

@@ -0,0 +1,148 @@
OP_EXEC:
;DE contains pointer
push DE
pop HL
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc HL
inc HL
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
ld h,b
ld l,c
jp (hl)
OP_CALL:
;DE contains pointer
push DE
pop HL
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc HL
inc HL
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
ld h,b
ld l,c
call _OP_CALL
call print_newLine
ret
_OP_CALL
jp (hl)
OP_DUMP:
;DE contains pointer
push DE
pop HL
call DHEX_TO_BYTE ;parse start address
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc HL
inc HL
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc HL
inc HL
ld a,(HL)
cp ' '
jp nz, ERR_SYNTAX
inc HL
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
pop af
ld h,b
ld l,c
ld b,a
call dump_pretty
ret
OP_SET:
;DE contains pointer
push DE
pop HL
call DHEX_TO_BYTE ;parse start address
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc HL
inc HL
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
;bc now contains the start address
INC HL
INC HL
;hl now cointains start addr of data bytes
_OP_SET_LOOP:
ld a,(hl)
cp 0 ;if 0 then end
RET Z
cp ' '
jp nz, ERR_SYNTAX
inc hl ;next byte
call DHEX_TO_BYTE
ld (bc),a ;load byte to
ld a,e
and a
jp nz, ERR_SYNTAX
inc bc
inc hl
inc hl
jp _OP_SET_LOOP
OP_DASM:
push DE
pop HL
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc hl
inc hl
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
inc hl
inc hl
ld a,(HL)
cp ' '
jp nz, ERR_SYNTAX
inc hl
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, ERR_SYNTAX
ld h,b
ld l,c
pop af ;restore af
ld b,a
call disassemble
ret

View File

@@ -0,0 +1,165 @@
COMMAND_LUT:
db "date", 0 , [OP_RTIME], [OP_RTIME]>>8 ;Read time
db "setdate", 0 , [OP_STIME], [OP_STIME]>>8 ;Read time
db "pin ", 0 , [OP_IO_IN], [OP_IO_IN]>>8 ;Read port
db "dump ",0, [OP_DUMP], [OP_DUMP]>>8 ;print pretty hexdump
db "pout ", 0 , [OP_IO_OUT], [OP_IO_OUT]>>8 ;Write port
db "iin ", 0, [OP_IIC_IN], [OP_IIC_IN]>>8 ;Read IIC
db "iout ", 0, [OP_IIC_OUT], [OP_IIC_OUT]>>8 ;Write IIC
db "call ", 0, [OP_CALL], [OP_CALL]>>8 ;Call to addr
db "clr", 0, [OP_CLR], [OP_CLR]>>8 ;Call to addr
db "dasm ", 0, [OP_DASM], [OP_DASM]>>8 ;Call to addr
db "jp ", 0,[OP_EXEC], [OP_EXEC]>>8 ;jump to addr
db "rst", 0,0x00,0x00 ;soft reset
db "lsdsk", 0,[OP_LSDSK], [OP_LSDSK]>>8 ;list disks
db "seldsk ", 0,[OP_SELDSK], [OP_SELDSK]>>8 ;select disk
db "$", 0, [OP_EXEC], [OP_EXEC]>>8 ;jump to addr
db "i", 0, [OP_IO_IN], [OP_IO_IN]>>8 ;Read port
db "o", 0, [OP_IO_OUT], [OP_IO_OUT]>>8 ;Write port
db "!", 0, [OP_SET], [OP_SET]>>8 ;Write memory
db "?", 0, [OP_DUMP], [OP_DUMP]>>8 ;Print memory
db 0xFF ;End of Table
IN_BUFFER .equ var_buffer
COMMAND:
call print_newLine
ld a,'>'
call print_char
xor a ;reset buffer len
ld (var_buffer_len),a
COMMAND_READ:
call read_char
jp z, COMMAND_READ ;wait for input
cp 13 ; enter
jp z,COMMAND_PROCESS
cp 10
jp z, COMMAND_READ; skip LF for file load
cp 0x08 ; backspace 0x08 VT102 0x7f Putty
jp z,COMMAND_BACKSPACE
push af
; a contains latest char
ld hl,[var_buffer]
ld d,0
ld a,(var_buffer_len)
ld e,a
add hl,de ;hl now contains pointer to last position in buffer
inc a
ld (var_buffer_len),a ;store incremented buffer length
pop af
ld (hl),a
call print_char
inc hl
xor a ;a = 0
ld (hl),a ;always add null termination after last char
jp COMMAND_READ
COMMAND_BACKSPACE:
ld a,(var_buffer_len)
and a
jp z, COMMAND_READ ; do not continue if already at char 0
dec a ;decrement length
ld (var_buffer_len),a ;and store it
ld e,a ;load de with decremented value
ld d,0
ld hl,[var_buffer]
add hl,de ;hl now contains pointer to last position in buffer
xor a ; store null byte to current location
ld (hl),a
;call print_delete
ld a, 0x08
call print_char
ld a, 0x20
call print_char
ld a, 0x08
call print_char
jp COMMAND_READ
COMMAND_PROCESS:
;compare
LD HL,[COMMAND_LUT] ;Lookup table
COMMAND_PROCESS_LOOP:
LD DE,[var_buffer] ;Buffer
LD A,(HL) ;Load first byte of entry
CP 0xFF
JP Z,COMMAND_PROCESS_NOT_FOUND ;if first byte is 0xFF, End is reached
; compare string loop
COMMAND_PROCESS_LOOP_STR1:
LD A,(DE)
LD B,A
LD A,(HL)
OR B ;not 0 -> match
JP Z, COMMAND_PROCESS_FOUND ;match
LD A,(DE)
LD B,A
;LD A,(HL) ;Load first byte of entry
;call print_a_hex
LD A,(HL)
;compare byte
XOR B
OR A ;if identical = resoult shopuld be zero
JP Z, COMMAND_PROCESS_LOOP_STR2 ;then continue
; if not identical
LD A,(HL)
OR A ;if reached end of compare string
JP Z, COMMAND_PROCESS_FOUND ;match
JR COMMAND_PROCESS_NEXT_ENTRY ;next entry on no match
COMMAND_PROCESS_LOOP_STR2: ;continue with next char
INC HL
INC DE
JR COMMAND_PROCESS_LOOP_STR1
COMMAND_PROCESS_NEXT_ENTRYI: ;do not jump here
INC HL
COMMAND_PROCESS_NEXT_ENTRY: ;jump here
LD A,(HL)
OR A
JP NZ,COMMAND_PROCESS_NEXT_ENTRYI ;loop until end of string
INC HL ;skip pointer
INC HL
INC HL
JP COMMAND_PROCESS_LOOP
COMMAND_PROCESS_NOT_FOUND:
LD HL,[_STR_NOT_FOUND]
CALL print_str
JP COMMAND
COMMAND_PROCESS_FOUND:
PUSH HL
POP BC
INC BC
LD A,(BC)
LD L,A
INC BC
LD A,(BC)
LD H,A
;HL: pointer to start of routine
;DE: buffer start of arguments
CALL _COMMAND_PROCESS_FOUND
JP COMMAND
_COMMAND_PROCESS_FOUND
JP (HL)
NOT_IMPLEMENTED:
LD HL,[_STR_NOT_IMPLEMENTED]
CALL print_str
RET
ERR_SYNTAX:
LD HL,[_STR_SYNTAX]
CALL print_str
RET
_STR_NOT_IMPLEMENTED:
db 10,13,"not implemented",10,13,0
_STR_NOT_FOUND:
db 10,13,"invalid command",10,13,0
_STR_SYNTAX:
db 10,13,"invalid syntax",10,13,0

View File

@@ -99,6 +99,12 @@ print_a_hex:
pop de pop de
pop bc pop bc
pop af pop af
ret
print_bcd:
ADD 48 ;offset for ascii number
call print_char
ret
read_char: read_char:
call A_RTS_ON call A_RTS_ON
@@ -112,6 +118,21 @@ read_char:
in a, (CS_SIO_A_D) ; read char if avail in a, (CS_SIO_A_D) ; read char if avail
ret ; return ret ; return
read_bcd;
call read_char
jp z, read_bcd
call print_char
sbc 48 ;remove ascii offset
jp c, _read_bcd_invalid ;if carry, wrong input
cp 10
jp z, _read_bcd_invalid ;if equal or greater than 10, also error
and 0x0F ;mask unused bits
ret
_read_bcd_invalid
ld a, 0xFF
ret
;MSG_CRSR_0: ;MSG_CRSR_0:
; db 0x1B, "[?25h",0 ; db 0x1B, "[?25h",0
;MSG_CRSR_1: ;MSG_CRSR_1:

View File

@@ -32,6 +32,11 @@
IDE_REG_ALTSTS .EQU 10110b ;Alternate Status/Digital Output IDE_REG_ALTSTS .EQU 10110b ;Alternate Status/Digital Output
IDE_REG_DRVADDR .EQU 10111b ;Drive Address IDE_REG_DRVADDR .EQU 10111b ;Drive Address
IDE_REG_LBA0 .EQU 01011b ;Start sector register
IDE_REG_LBA1 .EQU 01100b ;Low byte of the cylinder number
IDE_REG_LBA2 .EQU 01101b ;High two bits of the cylinder number
IDE_REG_LBA3 .EQU 01110b ;Head and device select register
;================================================================ ;================================================================
; I/O access functions ; I/O access functions

View File

@@ -12,73 +12,378 @@
;================================================================ ;================================================================
; IDE Variables ; IDE Variables
;================================================================ ;================================================================
MEM_IDE_BASE .EQU 0x5000 phase var_idebuffer
MEM_IDE_DEVICE .EQU MEM_IDE_BASE MEM_IDE_DEVICE:
MEM_IDE_STATUS .EQU MEM_IDE_BASE + 1 ;1Byte: 0x00 if status is okay defs 1
MEM_IDE_STATUS:
defs 1 ;1Byte: 0x00 if status is okay
MEM_IDE_PARTITION:
defs 4 ;4*16Bytes: LBA first sector
MEM_IDE_POINTER:
defs 4 ;4*16Bytes: LBA first sector
MEM_IDE_DEV_TABLE:
defs 16*4
MEM_IDE_SELECTED:
defs 1
MEM_IDE_STRING_0:
defs 40
MEM_IDE_STRING_1:
defs 40
MEM_IDE_STRING_2:
defs 40
MEM_IDE_STRING_3:
defs 40
MEM_IDE_BUFFER:
defs 512
MEM_IDE_FSBUFFER:
defs 256
dephase
;DEV-Table layout
;<STATUS> <TYPE> <FIRST-SECTOR (4-byte)> <Length (4-byte)> <I/O Addr> <Master/Slave> 0x00 0x00
;Status: 0x00 -> Ready
; 0x01 -> Not found
; 0x02 -> No supported filesystem
;I/O Addr: Base addr of 82C55
;Type: File system type
MEM_IDE_PARTITION .EQU MEM_IDE_BASE + 2 ;4*16Bytes: LBA first sector
MEM_IDE_POINTER .EQU MEM_IDE_BASE + 6 ;4*16Bytes: LBA first sector
MEM_IDE_BUFFER .EQU MEM_IDE_BASE + 65 ;512Byte: buffer for read/write data IDE_DEV_TABLE:
db 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, [MEM_IDE_STRING_0], [MEM_IDE_STRING_0]>>8, 0x00, 0x00
db 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x01, [MEM_IDE_STRING_1], [MEM_IDE_STRING_1]>>8, 0x00, 0x00
db 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, [MEM_IDE_STRING_2], [MEM_IDE_STRING_2]>>8, 0x00, 0x00
db 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, [MEM_IDE_STRING_3], [MEM_IDE_STRING_3]>>8, 0x00, 0x00
;================================================================ ;================================================================
; IDE funtions ; IDE funtions
;================================================================ ;================================================================
;------------------------------------------------------------------------------
; ideif_init_table
;
; initializes drive table
;------------------------------------------------------------------------------
ideif_init_devtable:
;copy default values to ram
ld hl,[IDE_DEV_TABLE]
ld de,[MEM_IDE_DEV_TABLE]
ld bc,16*4
ldir
;set selected device
ld a,0
ld (MEM_IDE_SELECTED),a
;set empty names
xor a
ld (MEM_IDE_STRING_0),a
ld (MEM_IDE_STRING_1),a
ld (MEM_IDE_STRING_2),a
ld (MEM_IDE_STRING_3),a
ret
;------------------------------------------------------------------------------
; ideif_prnt_devtable
;
; prints drive table
;------------------------------------------------------------------------------
ideif_prnt_devtable:
call print_newLine
ld hl,[_ideif_prnt_devtable_hdr]
call print_str
ld hl,[MEM_IDE_DEV_TABLE]
ld b,0 ;device number
_ideif_prnt_devtable_l1: ;loop 1 -> for each device
;print if selected
ld a,(MEM_IDE_SELECTED)
cp b
jp z,_ideif_prnt_devtable_l1_sel
ld a, ' '
jr _ideif_prnt_devtable_l1_nxt
_ideif_prnt_devtable_l1_sel:
ld a, '*'
_ideif_prnt_devtable_l1_nxt:
call print_char
;print drive letter
ld a,b
add 69 ;offset letter to D
call print_char
ld a, ':'
call print_char
ld a, ' '
call print_char
;print status
push hl
ld a,(HL)
or a
jr z, _ideif_prnt_devtable_l1_s00
cp 0x01
jr z, _ideif_prnt_devtable_l1_s01
cp 0x02
jr z, _ideif_prnt_devtable_l1_s02
cp 0xFF
jr z, _ideif_prnt_devtable_l1_sFF
jr _ideif_prnt_devtable_l1_sFF
_ideif_prnt_devtable_l1_s00
ld hl,[_ideif_prnt_devtable_s00]
jr _ideif_prnt_devtable_l1_es
_ideif_prnt_devtable_l1_s01
ld hl,[_ideif_prnt_devtable_s01]
jr _ideif_prnt_devtable_l1_es
_ideif_prnt_devtable_l1_s02
ld hl,[_ideif_prnt_devtable_s02]
jr _ideif_prnt_devtable_l1_es
_ideif_prnt_devtable_l1_sFF
ld hl,[_ideif_prnt_devtable_sFF]
_ideif_prnt_devtable_l1_es
call print_str
pop hl
inc hl
;print FS-Type
ld a,'0'
call print_char
ld a,'x'
call print_char
ld a,(HL)
call print_a_hex
ld a,' '
call print_char
inc hl
;print first sector
push hl
pop ix
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
inc hl
ld a,(ix+3)
call print_a_hex
ld a,(ix+2)
call print_a_hex
ld a,(ix+1)
call print_a_hex
ld a,(ix+0)
call print_a_hex
ld a,' '
call print_char
;print length
ld a,(ix+7)
call print_a_hex
ld a,(ix+6)
call print_a_hex
ld a,(ix+5)
call print_a_hex
ld a,(ix+4)
call print_a_hex
ld a,' '
call print_char
;print Port
ld a,'0'
call print_char
ld a,'x'
call print_char
ld a,(HL)
call print_a_hex
ld a,' '
call print_char
inc hl
;print M/S
ld a,(HL)
push hl
or a
jp z,_ideif_prnt_devtable_l1_ms
ld hl,[_ideif_prnt_devtable_slave]
jp _ideif_prnt_devtable_l1_e2
_ideif_prnt_devtable_l1_ms
ld hl,[_ideif_prnt_devtable_master]
_ideif_prnt_devtable_l1_e2
call print_str
pop hl
inc hl
;print str
push bc
ld a,(hl)
ld c,a
inc hl
ld a,(hl)
ld b,a
inc hl
push hl
ld h,b
ld l,c
call print_str
call print_newLine
pop hl
pop bc
;next
inc hl
inc hl
inc b
ld a,b
cp 4
ret z
jp _ideif_prnt_devtable_l1
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ideif_init_drive ; ideif_init_drive
; ;
; initializes drive ; initializes selected drive in table
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
ideif_init_drive: ideif_init_drive:
xor a call ideif_get_drv_pointer
ld (MEM_IDE_DEVICE),A ;Set device to 0 ; load addresses. not used atm
ld (MEM_IDE_STATUS),A ;Set status to 0 (OK) ;ld a,(IX+6) ;load IO Addr
di ;disable interrupt ;ld d,a
call ide_reset ;Reset drives on bus ;ld a,(IX+7) ;load Master/Slave bit
ld hl, [str_dev_waitready] ;ld e,a
call print_str ;print waiting message call ide_reset
ld DE, 0x1FFF ;preload timeout counter
ideif_init_drive_loop1: ld bc, 0x5FFF ;preload timeout counter
_ideif_init_drive_loop:
ld b, IDE_REG_CMDSTS ld b, IDE_REG_CMDSTS
call ide_regread_8 ;read drive status register call ide_regread_8 ;read drive status register
OR A or a
JR Z, ideif_init_drive_nodrv ;no drive found jr z,_ideif_init_drive_nodrv ;no drive found
BIT 6,A ;Wait for device ready bit 6,a
JR NZ, ideif_init_drive_detected jr nz, _ideif_init_drive_found
DEC DE ; decrement timeout dec de
LD A,D ld a,d
OR E or e
JR Z, ideif_init_drive_nodrv jr z, _ideif_init_drive_nodrv
JR ideif_init_drive_loop1 jr _ideif_init_drive_loop
ideif_init_drive_nodrv: _ideif_init_drive_nodrv:
ld hl, [str_dev_notfound] ld(ix+0),0x01
call print_str ret
RET
ideif_init_drive_detected: _ideif_init_drive_found:
ld hl, [str_dev_ready] ld (ix+0),0x02
call print_str ;get drive name
LD B, IDE_REG_CMDSTS ;Get drive identification ld b, IDE_REG_CMDSTS ;Get drive identification
LD A, IDE_CMD_IDENT ld a, IDE_CMD_IDENT
call ide_regwrite_8 ;Write command to drive call ide_regwrite_8 ;Write command to drive
LD HL,MEM_IDE_BUFFER ;set read/write buffer start address ld hl, MEM_IDE_BUFFER ;set read/write buffer start address
call ide_readsector_256 ;read 256 words from device call ide_readsector_256 ;read 256 words from device
LD HL,MEM_IDE_BUFFER + 20 ;print device serial ld hl,MEM_IDE_BUFFER + 54 ;print device serial
LD B, 20 ld a,(ix+12) ;load str pointer into de
CALL print_str_fixed ld e,a
ld hl, [str_dev_ready2] ld a,(ix+13)
ld d,a
ld bc,40 ;copy 40 char
ldir
;get partition table
;read bootsector
ld a,1 ;read 1 sector
ld B,IDE_REG_SECTOR
call ide_regwrite_8
ld a,1 ;read sector 0
ld b,IDE_REG_SSECTOR
call ide_regwrite_8
ld a,0 ;read cylinder 0
ld b,IDE_REG_LCYL
call ide_regwrite_8
ld a,0
ld b,IDE_REG_HCYL
call ide_regwrite_8
ld a,10100000b ;read head 0
ld b,IDE_REG_HEAD
call ide_regwrite_8
ld a,IDE_CMD_READSEC ;send read command
ld b,IDE_REG_CMDSTS
call ide_regwrite_8
ld hl, MEM_IDE_BUFFER ;set read/write buffer start address
call ide_readsector_512_inv ;read 256 words from device
;prepare partitions
ld b,4 ;Partition table length
ld c,0 ;Partition ID counter
ld iy,MEM_IDE_BUFFER+446 ;Load offest of first partition table entry
_ideif_init_drive_prt_l1:
ld a,(iy+4) ;load status byte
or a
jp NZ, _ideif_init_drive_prt_fnd ;If not zero, jump to print function
jp _ideif_init_drive_prt_ln
_ideif_init_drive_prt_ln:
ld de,16
add iy,de
djnz _ideif_init_drive_prt_l1
ret
_ideif_init_drive_prt_fnd;
ld a,(iy+4)
ld (ix+1),a ;store partition type
cp 0x0E ;if not 0xE0, continue with next entry
jr nz, _ideif_init_drive_prt_ln
;get start LBA
ld a,(iy+0x08)
ld (ix+0x02),a
ld a,(iy+0x09)
ld (ix+0x03),a
ld a,(iy+0x0A)
ld (ix+0x04),a
ld a,(iy+0x0B)
ld (ix+0x05),a
ld (ix+0),0x00
;get count LBA
ld a,(iy+0x0C)
ld (ix+0x06),a
ld a,(iy+0x0D)
ld (ix+0x07),a
ld a,(iy+0x0E)
ld (ix+0x08),a
ld a,(iy+0x0F)
ld (ix+0x09),a
ld (ix+0),0x00
ret
;------------------------------------------------------------------------------
; ideif_get_drv_pointer
;
; gets pointer to selected drive in table in IX
;------------------------------------------------------------------------------
ideif_get_drv_pointer:
push af
push bc
;get selected drive
ld a,(MEM_IDE_SELECTED)
;multiply a *8
rlca ;*2
rlca ;*4
rlca ;*8
ld b,0
ld c,a
ld ix,[MEM_IDE_DEV_TABLE]
add ix,bc
pop bc
pop af
ret
;------------------------------------------------------------------------------
; ideif_init_all
;
; initializes interface
;------------------------------------------------------------------------------
ideif_init_all:
ld hl, [str_dev_waitready]
call print_str ;print waiting message
call ideif_init_devtable
call ideif_init_drive
ld hl, [str_dev_done]
call print_str call print_str
LD HL,MEM_IDE_BUFFER + 54 ;print device name
LD B, 40
CALL print_str_fixed
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
RET RET
;------------------------------------------------------------------------------
; ideif_drv_sel
;
; Selects drive from table and initializes the fat16 file system
; A contains drive id
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; read_lba_sector ; read_lba_sector
; ;
@@ -90,24 +395,23 @@ read_lba_sector:
LD B,IDE_REG_SECTOR ;amount of sectores LD B,IDE_REG_SECTOR ;amount of sectores
CALL ide_regwrite_8 CALL ide_regwrite_8
LD A,(HL)
LD B,IDE_REG_LBA0
CALL ide_regwrite_8
INC HL
LD A,(HL)
LD B,IDE_REG_LBA1
CALL ide_regwrite_8
INC HL
LD A,(HL)
LD B,IDE_REG_LBA2
CALL ide_regwrite_8
INC HL
LD A,(HL) LD A,(HL)
AND 00001111b AND 00001111b
OR 11100000b OR 11100000b
LD B,IDE_REG_HEAD LD B,IDE_REG_LBA3
CALL ide_regwrite_8 CALL ide_regwrite_8
INC HL
LD A,(HL)
LD B,IDE_REG_HCYL
CALL ide_regwrite_8
INC HL
LD A,(HL)
LD B,IDE_REG_LCYL
CALL ide_regwrite_8
INC HL
LD A,(HL)
LD B,IDE_REG_SSECTOR
CALL ide_regwrite_8
INC HL
LD A,IDE_CMD_READSEC ;send read command LD A,IDE_CMD_READSEC ;send read command
LD B,IDE_REG_CMDSTS LD B,IDE_REG_CMDSTS
@@ -117,17 +421,29 @@ read_lba_sector:
ret ret
;================================================================ ;================================================================
; IDE strings ; IDE strings
;=============================================================== ;===============================================================
str_dev_waitready: str_dev_waitready:
db 13,10,"Detecting drives ",0 db 13,10,"Detecting drives ... ",0
str_dev_done:
db "done!",13,10,0
str_dev_ready: _ideif_prnt_devtable_hdr:
db "found!",13,10,"ID: ",0 db "DRV Status Type LBA Length Port M/S Name",10,13,0
str_dev_ready2: _ideif_prnt_devtable_s00:
db " Desc: ",0 db "Avail ",0
_ideif_prnt_devtable_s01:
str_dev_notfound: db "Not Found ",0
db "no drive",13,10,0 _ideif_prnt_devtable_s02:
db "Unkown FS ",0
_ideif_prnt_devtable_sFF:
db "Ctrl. Err ",0
_ideif_prnt_devtable_master:
db "Master ",0
_ideif_prnt_devtable_slave:
db "Slave ",0

View File

@@ -0,0 +1,289 @@
;----------------------------------------------------------------
;BIOS Driver for I2C Protocol (Software)
;by Dennis Gunia (01/2024)
;
; SCL is connected to PA1 of PIO (U6) with pull-up
; SDA is connected to PA0 of PIO (U6) with pull-up
;----------------------------------------------------------------
;================================================================
; I/O registers
;================================================================
;================================================================
; I/O pins
;================================================================
IIC_CLK .EQU 00000001b
IIC_DATA .EQU 00000010b
;================================================================
; basic access functions
;================================================================
;HL contains buffer location
;B defines amount of bytes to send
;C contains device address
iic_send_buffer:
CALL iic_send_sbit ;Send startbit
LD A,C
AND 0xFE ;Mask R/W bit (must be 0 for write)
CALL iic_send_byte ;Send Address
CALL iic_read_ack
OR A ; if no ack, error
JP NZ, iic_send_buffer_err
iic_send_buffer_loop;
LD A,(HL)
INC HL
CALL iic_send_byte
CALL iic_read_ack
OR A ; if no ack, error
JP NZ, iic_send_buffer_err
DJNZ iic_send_buffer_loop ;loop for remaining bytes
iic_send_buffer_done:
CALL iic_send_ebit
LD A,0
RET
iic_send_buffer_err:
CALL iic_send_ebit
LD A,1
RET
;HL contains buffer location
;B defines amount of bytes to send
;C contains device address
iic_receive_buffer:
DEC B
CALL iic_send_sbit ;Send startbit
LD A,C
OR 0x01 ;set R/W bit (must be 1 for read)
CALL iic_send_byte ;Send Address
CALL iic_read_ack
OR A ; if no ack, error
JP NZ, iic_receive_buffer_err
iic_receive_buffer_loop:
CALL iic_receive_byte
LD (HL),A
INC HL
CALL iic_send_ack
DJNZ iic_receive_buffer_loop
; last time:
CALL iic_receive_byte
LD (HL),A
INC HL
CALL iic_send_nack
iic_receive_buffer_done:
CALL iic_send_ebit
LD A,0
RET
iic_receive_buffer_err:
CALL iic_send_ebit
LD A,1
RET
;================================================================
; I/O access functions
;================================================================
;Reset PIO configuration
iic_init:
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs
LD A,0xF0
OUT (CS_PIO_AC), A
RET
; send start bit
iic_send_sbit:
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SDA and SCL is now output)
LD A,0xFC
OUT (CS_PIO_AC), A
;SCL HIGH, SDA LOW
LD A,0x02
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x00
OUT (CS_PIO_AD), A
NOP
NOP
RET
; send end/stop bit
iic_send_ebit:
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SDA and SCL is now output)
LD A,0xFC
OUT (CS_PIO_AC), A
;SCL HIGH, SDA LOW
LD A,0x02
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x03 ; both high
OUT (CS_PIO_AD), A
NOP
NOP
;release bus
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
NOP
NOP
;Set inputs/outputs (SDA and SCL is now input, sound enabled)
LD A,11110111b
OUT (CS_PIO_AC), A
NOP
NOP
RET
iic_read_ack:
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SCL is now output, SDA input)
LD A,0xFD
OUT (CS_PIO_AC), A
NOP
NOP
LD A,0x00 ;set SCL LOW
OUT (CS_PIO_AD), A
NOP
NOP
XOR 0x02 ;set SCL HIGH
OUT (CS_PIO_AD), A
NOP
IN A,(CS_PIO_AD) ; Read SDA
NOP
NOP
PUSH AF
AND 0xFE ; Filter input
XOR 0x02 ;set SCL LOW
OUT (CS_PIO_AD), A
NOP
NOP
POP AF
AND 1
RET
iic_send_ack:
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SDA and SCL is now output)
LD A,0xFC
OUT (CS_PIO_AC), A
NOP
NOP
LD A,0x00 ; SCL LOW, SDA LOW
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x02 ; SCL HIGH, SDA LOW
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x00 ; SCL LOW, SDA LOW
OUT (CS_PIO_AD), A
NOP
NOP
RET
iic_send_nack:
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SDA and SCL is now output)
LD A,0xFC
OUT (CS_PIO_AC), A
NOP
NOP
LD A,0x02 ; SCL LOW, SDA HIGH
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x03 ; both high
OUT (CS_PIO_AD), A
NOP
NOP
LD A,0x02 ; SCL LOW, SDA HIGH
OUT (CS_PIO_AD), A
NOP
NOP
RET
;A contains byte
iic_send_byte:
PUSH BC
LD C,A ;buffer
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SDA and SCL is now output)
LD A,0xFC
OUT (CS_PIO_AC), A
LD B,8 ;bit counter
iic_send_byte_loop:
;prepare data
RL C
LD A,0
RLA ; set SCA bit from carry, SCL LOW
OUT (CS_PIO_AD), A
NOP
NOP
XOR 0x02 ;set SCL HIGH
OUT (CS_PIO_AD), A
NOP
NOP
XOR 0x02 ;set SCL LOW
OUT (CS_PIO_AD), A
NOP
NOP
DJNZ iic_send_byte_loop ;loop until counter is 0
;transmittion end / end loop
LD A,C
POP BC
RET
iic_receive_byte:
PUSH BC
;Set port to controll mode (MODE3)
LD A,0xCF
OUT (CS_PIO_AC), A
;Set inputs/outputs (SCL is now output, SDA input)
LD A,0xFD
OUT (CS_PIO_AC), A
LD B,8 ;bit counter
LD C,0
iic_receive_byte_loop:
XOR A ;set SCL LOW
OUT (CS_PIO_AD), A
NOP
NOP
LD A,2 ;set SCL HIGH
OUT (CS_PIO_AD), A
NOP
IN A, (CS_PIO_AD)
NOP
RRA ;read SDA bit
RL C ;store bit
XOR A ;set SCL LOW again
OUT (CS_PIO_AD), A
NOP
NOP
DJNZ iic_receive_byte_loop
LD A,C
POP BC
RET

View File

@@ -0,0 +1,120 @@
;Power-On self test
POST_START:
call POST_CHECK_PIO
call POST_CHECK_APU
call POST_TEST_RTC
call POST_CHECK_IDE_30
call POST_CHECK_IDE_40
ret
POST_CHECK_PIO:
ld hl,[str_post_pio]
call print_str
in a,(CS_PIO_AC) ;test read from pio
cp 0x00 ;0x78 when not installed
jp nz, _POST_CHECK_PIO_FAILED
ld a, 0x00 ;set present flag
ld (var_pio_present),a
ld hl,[str_post_ok]
call print_str
ret
_POST_CHECK_PIO_FAILED:
ld a, 0xFF
ld (var_pio_present),a
ld hl,[str_post_nd]
call print_str
ret
POST_CHECK_APU:
ld hl,[str_post_apu]
call print_str
ld a, 0xFF
out (CS_APU_DATA),a
nop
nop
in a,(CS_APU_DATA)
cp 0xFF
jp nz, _POST_CHECK_APU_FAILED
ld a, 0x00 ;set present flag
ld (var_apu_present),a
ld hl,[str_post_ok]
call print_str
ret
_POST_CHECK_APU_FAILED:
ld a, 0xFF
ld (var_apu_present),a
ld hl,[str_post_nd]
call print_str
ret
POST_CHECK_IDE_30:
ld hl,[str_post_ide_30]
call print_str
in a,(0x30)
or a
jp nz, _POST_CHECK_IDE_FAILED
ld hl,[str_post_ok]
call print_str
ret
POST_CHECK_IDE_40:
ld hl,[str_post_ide_40]
call print_str
in a,(0x40)
or a
jp nz, _POST_CHECK_IDE_FAILED
ld hl,[str_post_ok]
call print_str
ret
_POST_CHECK_IDE_FAILED
ld hl,[str_post_nd]
call print_str
ret
POST_TEST_RTC:
ld a, 0x06
ld (var_scratch),a
ld hl,[str_post_rtc]
call print_str
ld hl,[var_scratch]
ld b, 1
ld c, ADDR_RTC
call iic_send_buffer
or a
jp nz, _POST_TEST_RTC_NOTFOUND
ld hl,[var_scratch]
ld b, 1
ld c, ADDR_RTC
call iic_receive_buffer
ld a, (var_scratch)
or a
jp z, _POST_TEST_RTC_INVALID
ld hl,[str_post_ok]
call print_str
jp _OP_RTIME_NN
_POST_TEST_RTC_NOTFOUND:
ld hl,[str_post_nd]
call print_str
ret
_POST_TEST_RTC_INVALID:
ld hl,[str_post_rtc_iv]
call print_str
ret
str_post_ide_30:
db 13,10,"Check Diskctrl.@030h... ",0
str_post_ide_40:
db 13,10,"Check Diskctrl.@040h... ",0
str_post_pio:
db 13,10,"Check IO-Controller ... ",0
str_post_apu:
db 13,10,"Check AMD8911 APU ... ",0
str_post_rtc:
db 13,10,"Check DS1307 RTC ... ",0
str_post_nd:
db "not detected!",0
str_post_rtc_iv:
db "not set. Check battery and run 'setdate'!",0
str_post_ok:
db "ok! ",0

View File

@@ -1,12 +1,21 @@
;----------------------------------------------------------------
;Z8C Homebrew Computer Monitor
;by Dennis Gunia (01/2023)
;----------------------------------------------------------------
;================================================================
; Memory areas
;================================================================
SYS_RAM_START equ 0x4000 SYS_RAM_START equ 0x4000
SYS_BUF_START equ 0x4010 SYS_BUF_START equ 0x4010
PRG_RAM_START equ 0x4110 PRG_RAM_START equ 0x4110
PRG_RAM_TOP equ 0xFF00 PRG_RAM_TOP equ 0xFF00
STACK_RAM_TOP equ 0xFFFF STACK_RAM_TOP equ 0xFFFF
;VAR_CONSOLE_CONF equ 0x07 ;CLK/TRG Clock @ 1843220.5/s ;================================================================
; Terminal configuration
;================================================================
VAR_CONSOLE_CONF equ 0x0F ;CPU/16 Clock @ 230402.5625/s VAR_CONSOLE_CONF equ 0x0F ;CPU/16 Clock @ 230402.5625/s
VAR_CONSOLE_BAUD equ 24 ;BAUD timer constant VAR_CONSOLE_BAUD equ 24 ;BAUD timer constant
;CLK/TRG Clock @ 1843220.5/s ;CLK/TRG Clock @ 1843220.5/s
; -> 0x16 : 14400 ; -> 0x16 : 14400
@@ -14,14 +23,18 @@ VAR_CONSOLE_BAUD equ 24 ;BAUD timer constant
; -> 12 : 19200 ; -> 12 : 19200
; -> 24 : 9600 ; -> 24 : 9600
;================================================================
; Includes (1/2)
;================================================================
; include IO device addresses ; include IO device addresses
.include "addresses.s" .include "addresses.s"
;================================================================
; RST Vectors for BASIC
;================================================================
org 0x0000 org 0x0000
RST_00: ;Hardware Restart RST_00: ;Hardware Restart
ld sp, STACK_RAM_TOP jp BOOT_PHASE0
di
jp mon_start_init_sound
org 0x0008 org 0x0008
RST_08 ;Print Char RST_08 ;Print Char
@@ -35,12 +48,16 @@ RST_10 ;receive char
RST_18 ;Buffer length RST_18 ;Buffer length
jp EXEC_RST_18 jp EXEC_RST_18
;================================================================
; Default interrupt vectors
;================================================================
INT_VEC: INT_VEC:
org 0x0044 org 0x0044
;DEFW EXEC_INT_VDP ;DEFW EXEC_INT_VDP
;memory var template ;================================================================
; Memory layout
;================================================================
mon_var_template: mon_var_template:
phase SYS_RAM_START phase SYS_RAM_START
@@ -60,73 +77,54 @@ var_curserchar:
defb 0 defb 0
var_curserlastaddr: var_curserlastaddr:
defw 0 defw 0
var_pio_present:
defb 0
var_apu_present:
defb 0
var_scratch: var_scratch:
defs 16 ;16 bytes space for scratch vars defs 16 ;16 bytes space for scratch vars
var_ps2mem: var_ps2mem:
defs 16 ;16 bytes space for scratch vars defs 16 ;16 bytes space for scratch vars
var_buffer: var_buffer:
defb 0 ;var lentgh defb 0 ;var lentgh
var_idebuffer:
defs 768
dephase dephase
mon_var_template_end: mon_var_template_end:
nop nop
;end memory var template
;================================================================
; Start of monitor
;================================================================
org 0x0050 org 0x0050
mon_start_init_sound: BOOT_PHASE0: ;Setup Hardware
;CALL BTLDR_ENTRY ;call bootloader first ;Setup Stack-Pointer
;ld D,0x08 ; Select register #8 ld sp, STACK_RAM_TOP
;ld A,0x00 ; Volume channel A 0 ;Disable Interrupts
;call AY0_WRITE_REG di
;ld D,0x09 ; Select register #9 ;Setup PIO on MIO Board
;ld A,0x00 ; Volume channel B 0
;call AY0_WRITE_REG
;ld D,0x0A ; Select register #10
;ld A,0x00 ; Volume channel C 0
;call AY0_WRITE_REG
mon_start_init_ctc:
; Set CTC Ch2 Interrupt Vector
;LD A,40h ; it vector defined in bit 7­3,bit 2­1 don't care, bit 0 = 0
;OUT (IO_CTC0_C0),A
; Init CTC Channel 2
;LD A,10100111b
;OUT (IO_CTC0_C2),A
;LD A,0x34 ; 55Hz ISR
;LD A,0xFF ; 55Hz ISR
;OUT (IO_CTC0_C2),A
;INIT PIO
LD A,0xCF LD A,0xCF
OUT (CS_PIO_AC), A OUT (CS_PIO_AC), A
LD A,11110101b LD A,11110111b ;All pins inputs except speaker
OUT (CS_PIO_AC), A
LD A,00000011B ;Preset I2C pins to high
OUT (CS_PIO_AC), A OUT (CS_PIO_AC), A
;Set variables
xor a
;ld i, a
;im 2 ;set int mode 2
ld (var_curserstate),a ld (var_curserstate),a
ld (var_curseron),a ld (var_curseron),a
ld a, " " ld a, " "
ld (var_curserchar),a ld (var_curserchar),a
;Initialize Console (Serial-Port)
;ei ; Enable Interrupts
;jr mon_start_ram ;skip serial, cause not used atm
mon_start_init_serial:
call CONSOLE_INIT call CONSOLE_INIT
;jp mon_start_complete
mon_start_ram: BOOT_PHASE1: ;Copy default values to RAM
ld hl,mon_var_template ld hl,mon_var_template
ld de,mon_var_template_end ld de,mon_var_template_end
ld bc,SYS_RAM_START ld bc,SYS_RAM_START
mon_start_ram_loop: BOOT_PHASE1_LOOP:
ld a,(hl) ;copy values ld a,(hl) ;copy values
ld (bc),a ld (bc),a
inc hl inc hl
@@ -134,379 +132,54 @@ mon_start_ram_loop:
push hl ;check if end is reached push hl ;check if end is reached
sbc hl,de sbc hl,de
pop hl pop hl
jp nz, mon_start_ram_loop jp nz, BOOT_PHASE1_LOOP
;template copy done ;template copy done
mon_start_complete: BOOT_PHASE2: ;Hardware initialized.
; Print banner
;call keyboard_init_io
;call vdpconsole_init
;call print_str
;jp splash_run
;jp ps2demo_run
;call debug_init
;call vdp_cursor_on
;jp COLD
call print_clear call print_clear
ld hl, [STR_Banner_Start] ld hl, [STR_Banner_Start]
call print_str call print_str
call ideif_init_drive ; Power-On Self Tests
call POST_START
; Detect IDE drives
call ideif_init_all
; Beep after start
LD DE,0x40 LD DE,0x40
LD BC,0x48
CALL beep CALL beep
;call vdp_cursor_on ; Start commandline
call PROMPT_BEGIN jp COMMAND
;halt CPU if prompt exits ; This instruction should never be reached
halt halt
; Misc Functions ;================================================================
AY0_WRITE_REG: ; Includes (2/2)
LD B,A ;================================================================
LD A,D
OUT (IO_AY0_ADDR),A
LD A,B
OUT (IO_AY0_DATA),A
RET
PROMPT_BEGIN:
call print_newLine
;call A_RTS_ON
ld a,'>'
call print_char
xor a ;reset buffer len
ld (var_buffer_len),a
PROMPT_BEGIN_READ_LOOP:
call read_char
;call keybd_read_ascii
jp z, PROMPT_BEGIN_READ_LOOP ; wait until char avail
push af
pop af
; process special ops
cp 13 ; enter
jp z,PROMPT_BEGIN_READ_PROCESS
cp 10
jp z, PROMPT_BEGIN_READ_LOOP; skip LF for file load
cp 0x08 ; backspace 0x08 VT102 0x7f Putty
jp z,PROMPT_BEGIN_READ_BACKSPACE
push af
; a contains latest char
ld hl,[var_buffer]
ld d,0
ld a,(var_buffer_len)
ld e,a
add hl,de ;hl now contains pointer to last position in buffer
inc a
ld (var_buffer_len),a ;store incremented buffer length
pop af
ld (hl),a
call print_char
inc hl
xor a ;a = 0
ld (hl),a ;always add null termination after last char
jp PROMPT_BEGIN_READ_LOOP
PROMPT_BEGIN_READ_BACKSPACE:
ld a,(var_buffer_len)
and a
jp z, PROMPT_BEGIN_READ_LOOP ; do not continue if already at char 0
dec a ;decrement length
ld (var_buffer_len),a ;and store it
ld e,a ;load de with decremented value
ld d,0
ld hl,[var_buffer]
add hl,de ;hl now contains pointer to last position in buffer
xor a ; store null byte to current location
ld (hl),a
;call print_delete
ld a, 0x08
call print_char
ld a, 0x20
call print_char
ld a, 0x08
call print_char
jp PROMPT_BEGIN_READ_LOOP
PROMPT_BEGIN_READ_PROCESS:
;call print_newLine
;ld hl,var_buffer
;call print_str
ld a,([var_buffer])
cp '$' ;jump to addr
jp z, CMD_EXEC
cp '?' ;print hexdump
jp z, CMD_VIEW
cp '!' ;set memory
jp z, CMD_SET
cp 'i' ;in IO
jp z, CMD_IO_READ
cp 'o' ;out IO
jp z, CMD_IO_WRITE
cp 'd' ;disassemble
jp z, CMD_DASM
cp 'x' ;start xmodem
jp z, xmodem_init
call print_newLine
ld hl, [STR_Unknown]
call print_str
jp PROMPT_BEGIN
ret
CMD_EXEC:
xor a ;write null byte to buffer pos 0 to prevent reexecute the last command
ld (var_buffer),a
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+3 ;load 2nd byte
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld h,b
ld l,c
jp (hl)
CMD_VIEW:
call print_newLine
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+3 ;load 2nd byte
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld a,(var_buffer+5)
cp ' '
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+6 ;load length
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
;draw header
ld hl,[STR_HEXDUMP_HEADER]
call print_str
pop af
;loading vars done. display results
ld h, b ;pointer to current byte
ld l, c ;pointer to current byte
ld b, a ;bytes counter
;draw row
CMD_VIEW_ROW:
call print_newLine
ld a,h ;print start
call print_a_hex
ld a,l
call print_a_hex
ld a, ' '
call print_char
ld c, 16 ;column counter
CMD_VIEW_ROW_LOOP:
ld a,(hl)
call print_a_hex
inc hl ;increment pointer
dec b ;decrement byte counter
dec c ;decrement column counter
ld a,b
and a
jp z,CMD_VIEW_END ;if byte counter = 0 -> end reached
ld a,c
and a
jp z,CMD_VIEW_ROW ;else if column counter = 0 -> 16 chars printed. next row
ld a, ' '
call print_char
jp CMD_VIEW_ROW_LOOP ;else
CMD_VIEW_END:
call print_newLine
jp PROMPT_BEGIN
CMD_SET:
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+3 ;load 2nd byte
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
;bc now contains the start address
ld hl,var_buffer+5
CMD_SET_LOOP:
ld a,(hl)
cp 0 ;if 0 then end
jp z, CMD_SET_END
cp ' '
jp nz, CMD_SYNTAX_ERROR
inc hl ;next byte
call DHEX_TO_BYTE
ld (bc),a ;load byte to
ld a,e
and a
jp nz, CMD_SYNTAX_ERROR
inc bc
inc hl
inc hl
jp CMD_SET_LOOP
CMD_SET_END:
call print_newLine
jp PROMPT_BEGIN
CMD_IO_WRITE:
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld c,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld a,(var_buffer+3)
cp ' '
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+4 ;load 1st byte
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
pop af
out (c),a
call print_newLine
jp PROMPT_BEGIN
CMD_IO_READ:
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld c,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
in a,(c)
push af
call print_newLine
pop af
call print_a_hex
call print_newLine
jp PROMPT_BEGIN
CMD_DASM:
call print_newLine
ld hl,var_buffer+1 ;load 1st byte
call DHEX_TO_BYTE
ld b,a ;store result in b
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+3 ;load 2nd byte
call DHEX_TO_BYTE
ld c,a
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld a,(var_buffer+5)
cp ' '
jp nz, CMD_SYNTAX_ERROR
ld hl,var_buffer+6 ;load length
call DHEX_TO_BYTE
push af
ld a,e ;check for error
and a
jp nz, CMD_SYNTAX_ERROR
ld h,b
ld l,c
pop af ;restore af
ld b,a
call disassemble
jp PROMPT_BEGIN
CMD_SYNTAX_ERROR:
call print_newLine
ld hl, [STR_SyntaxError]
call print_str
jp PROMPT_BEGIN
Includes:
;.include "bootldr.s"
.include "console.s" .include "console.s"
.include "conversions.s" .include "conversions.s"
;.include "basic.s"
.include "disassembler.s" .include "disassembler.s"
.include "disassembler_table.s" .include "disassembler_table.s"
.include "rst.s" .include "rst.s"
.include "beep.s" .include "beep.s"
.include "xmodem.s"
.include "kdrv_ide8255.s" ;include ide interface driver. .include "kdrv_ide8255.s" ;include ide interface driver.
.include "kdrv_ideif.s" ;include ide driver. .include "kdrv_ideif.s" ;include ide driver.
.include "prettydump.s" ;include monitor symbols. .include "kdrv_siic.s"
.include "prettydump.s"
.include "command.s"
.include "cmd_mem.s"
.include "cmd_io.s"
.include "cmd_date.s"
.include "cmd_disk.s"
.include "post.s"
;================================================================
; Strings ; Strings
;================================================================
STR_Banner_Start: STR_Banner_Start:
db "Z8C Monitor V2 by Dennis Gunia (2022)",0 db "Z8C Monitor V2.1 by Dennis Gunia (2022-2024)",0
STR_SyntaxError:
db "syn?",0
STR_Unknown:
db "cmd?",0
STR_HEXDUMP_HEADER:
db 'BASE 0 1 2 3 4 5 6 7 8 9 A B C D E F',0
;.include "debug.s"

View File

@@ -1,320 +1,541 @@
:0700000031FFFFF3C35000C4 :03000000C35000EA
:03000800C3C40E60 :03000800C3040D21
:03001000C3C80E54 :03001000C3080D15
:03001800C3D40E40 :03001800C3140D01
:1000440000000000000000000000000000000000AC :1000440000000000000000000000000000000000AC
:10005400000000000000000000000000000000009C :10005400000000000000000000000000000000009C
:0B006400000000000000000000000091 :10006400000000000000000000000000000000008C
:100050003ECFD3F63EF5D3F6AF3204403205403EF4 :10007400000000000000000000000000000000007C
:1000600020320640CD7E02214400116E0001004086 :10008400000000000000000000000000000000006C
:100070007E022303E5ED52E1C27000CDCA02216089 :10009400000000000000000000000000000000005C
:1000800013CDBF02CDF411114000CDD70ECD990094 :1000A400000000000000000000000000000000004C
:1000900076477AD34078D341C9CDD1023E3ECDB721 :1000B400000000000000000000000000000000003C
:1000A00002AF320040CDF802CAA500F5F1FE0DCA3C :1000C400000000000000000000000000000000002C
:1000B000FC00FE0ACAA500FE08CAD600F5212940A8 :1000D400000000000000000000000000000000001C
:1000C00016003A00405F193C320040F177CDB7028C :1000E400000000000000000000000000000000000C
:1000D00023AF77C3A5003A0040A7CAA5003D320070 :1000F40000000000000000000000000000000000FC
:1000E000405F160021294019AF773E08CDB7023E88 :1001040000000000000000000000000000000000EB
:1000F00020CDB7023E08CDB702C3A5003A2940FE85 :1001140000000000000000000000000000000000DB
:1001000024CA2F01FE3FCA4E01FE21CAB801FE6972 :1001240000000000000000000000000000000000CB
:10011000CA1D02FE6FCAF401FE64CA3902FE78CA23 :1001340000000000000000000000000000000000BB
:10012000060FCDD102218B13CDBF02C39900C9AFF9 :1001440000000000000000000000000000000000AB
:10013000322940212A40CD2403477BA7C2720221E5 :10015400000000000000000000000000000000009B
:100140002C40CD24034F7BA7C272026069E9CDD158 :10016400000000000000000000000000000000008B
:1001500002212A40CD2403477BA7C27202212C40F2 :10017400000000000000000000000000000000007B
:10016000CD24034F7BA7C272023A2E40FE20C272FA :10018400000000000000000000000000000000006B
:1001700002212F40CD2403F57BA7C27202219013E8 :10019400000000000000000000000000000000005B
:10018000CDBF02F1606947CDD1027CCDE7027DCDC4 :1001A400000000000000000000000000000000004B
:10019000E7023E20CDB7020E107ECDE70223050D0B :1001B400000000000000000000000000000000003B
:1001A00078A7CAB20179A7CA87013E20CDB702C39A :1001C400000000000000000000000000000000002B
:1001B0009901CDD102C39900212A40CD2403477B68 :1001D400000000000000000000000000000000001B
:1001C000A7C27202212C40CD24034F7BA7C272022A :1001E400000000000000000000000000000000000B
:1001D000212E407EFE00CAEE01FE20C2720223CD17 :1001F40000000000000000000000000000000000FB
:1001E0002403027BA7C27202032323C3D301CDD110 :1002040000000000000000000000000000000000EA
:1001F00002C39900212A40CD24034F7BA7C272027B :1002140000000000000000000000000000000000DA
:100200003A2C40FE20C27202212D40CD2403F57B02 :1002240000000000000000000000000000000000CA
:10021000A7C27202F1ED79CDD102C39900212A4023 :1002340000000000000000000000000000000000BA
:10022000CD24034F7BA7C27202ED78F5CDD102F148 :1002440000000000000000000000000000000000AA
:10023000CDE702CDD102C39900CDD102212A40CD14 :10025400000000000000000000000000000000009A
:100240002403477BA7C27202212C40CD24034F7B9D :10026400000000000000000000000000000000008A
:10025000A7C272023A2E40FE20C27202212F40CD68 :10027400000000000000000000000000000000007A
:100260002403F57BA7C272026069F147CD7503C311 :10028400000000000000000000000000000000006A
:100270009900CDD102218613CDBF02C399003E4F14 :10029400000000000000000000000000000000005A
:10028000D304DB01D3043E30D3093E18D3093E0426 :1002A400000000000000000000000000000000004A
:10029000D3093E44D3093E05D3093EE8D3093E01C4 :1002B400000000000000000000000000000000003A
:1002A000D3093E04D3093E02D3093E00D3093E03DD :1002C400000000000000000000000000000000002A
:1002B000D3093EC1D309C9F5D308CDDC02F1C97E0B :1002D400000000000000000000000000000000001A
:1002C000B72806CDB7022318F6C9210A03CDBF020D :1002E400000000000000000000000000000000000A
:1002D000C93E0ACDB7023E0DCDB702C9973CD3093E :1002F40000000000000000000000000000000000FA
:1002E000DB09CB4728F6C9F5C5D5CD5B0378CDB77B :1003040000000000000000000000000000000000E9
:1002F0000279CDB702D1C1F1CD1B0300AFD309DB29 :1003140000000000000000000000000000000000D9
:1003000009E601CD1203C8DB08C91B5B324A1B5B3F :1003240000000000000000000000000000000000C9
:1003100048003E05D3093E68D309C93E05D3093ECE :1003340000000000000000000000000000000000B9
:10032000EAD309C9E57ECD44033815CB27CB27CBCB :1003440000000000000000000000000000000000A9
:1003300027CB2757237ECD44033805B2E11E00C9E1 :100354000000000000000000000000000000000099
:100340001EFFE1C9D630EA5903FE0A3805D607EA8E :0D036400000000000000000000000000008C
:100350005903FE103003E60FC937C9F51F1F1F1FD1 :1000500031FFFFF33ECFD3F63EF7D3F63E03D3F6A0
:10036000CD6A0347F1CD6A034FC9E60FC630FE3AA6 :100060003204403205403E20320640CD9E002144FD
:10037000D8C607C9C978321A412210417E321441C9 :10007000001170030100407E022303E5ED52E1C24E
:10038000237E3215412BCD690478B1CA4B04ED436D :100080007700CDEA00216F1ECDDF00CDDD1CCDABAA
:100390001241030303030A321641030A5F030A579B :1000900014114000014800CD170DC3EB17763E4FF9
:1003A000ED531741030A3219412A1041CDB1043AE5 :1000A000D304DB01D3043E30D3093E18D3093E0408
:1003B0001641472A10417ECDE7022310F93E68CD51 :1000B000D3093E44D3093E05D3093EE8D3093E01A6
:1003C000B7023A1641473E0690473E20CDB7023E5F :1000C000D3093E04D3093E02D3093E00D3093E03BF
:1003D00020CDB70210F43E20CDB702E52A1741CD5B :1000D000D3093EC1D309C9F5D308CDFC00F1C97ECF
:1003E000BF023A1941B7CA48042A1241010800095C :1000E000B72806CDD7002318F6C9214A01CDDF0075
:1003F0003A1941477EFE01CCD704FE02CCFE04FE32 :1000F000C93E0ACDD7003E0DCDD700C9973CD309E4
:1004000003CC1B05FE04CC5705FE05CC6D05FE068E :10010000DB09CB4728F6C9F5C5D5CD9B0178CDD7FE
:10041000CC7A05FE07CC9405FE08CCA105FE09CCDC :100110000079CDD700D1C1F1C9C630CDD700C9CD46
:10042000B605FE10CCCB05FE11CCDB05FE12CCE3ED :100120005B0100AFD309DB09E601CD5201C8DB0852
:1004300005FE13CC1B06FE0ACCAD05FE80CC3A06A9 :10013000C9CD1F01CA3101CDD700DE30DA4701FE3B
:10044000FE81CC31062310ACE11810CDB1047ECD75 :100140000ACA4701E60FC93EFFC91B5B324A1B5B67
:10045000C90423E521860ECDBF02E1CDD1023A1AAF :1001500048003E05D3093E68D309C93E05D3093E90
:10046000413D321A41C27903C9E52184063A14415B :10016000EAD309C9E57ECD84013815CB27CB27CB4F
:100470004F7EFEFFCAAB04F523462B79A04FF1B99E :1001700027CB2757237ECD84013805B2E11E00C965
:10048000280B06000E07097E4F092318E023234E90 :100180001EFFE1C9D630EA9901FE0A3805D607EA12
:10049000233A154146A0B92B2B2B280B06000E073B :100190009901FE103003E60FC937C9F51F1F1F1F55
:1004A000097E4F092318C6444DE1C906000E00E13C :1001A000CDAA0147F1CDAA014FC9E60FC630FE3AEC
:1004B000C93E24CDB7027CCDE7027DCDE7023E6880 :1001B000D8C607C9C978321A412210417E3214418B
:1004C000CDB7023E20CDB702C9CDE7023E68CDB719 :1001C000237E3215412BCDA90278B1CA8B02ED43B3
:1004D000023E20CDB702C9E5ED5B1041131A6F1340 :1001D0001241030303030A321641030A5F030A575D
:1004E0001A673E24CDB7027CCDE7027DCDE7023E00 :1001E000ED531741030A3219412A1041CDF1023A69
:1004F00068CDB7023E20CDB702CD7506E1C9C5ED86 :1001F0001641472A10417ECD07012310F93E68CDF4
:100500005B10411A1F1FE60EE5218F0E06004F09F2 :10020000D7003A1641473E0690473E20CDD7003EE4
:10051000CDBF023E20CDB702E1C1C9ED5B10411352 :1002100020CDD70010F43E20CDD700E52A1741CDE0
:100520001AF5E680C23C053E24CDB7023E2BCDB77E :10022000DF003A1941B7CA88022A124101080009C1
:1005300002F1CDE7023E68CDB70218173E24CDB7D1 :100230003A1941477EFE01CC1703FE02CC3E03FE75
:10054000023E2DCDB702F1ED44CDE7023E68CDB7B6 :1002400003CC5B03FE04CC9703FE05CCAD03FE0696
:10055000021800CD7506C9ED5B1041131AFE4D2837 :10025000CCBA03FE07CCD403FE08CCE103FE09CCE4
:10056000063E4ECDB702C93E49CDB702C9C5ED5BC7 :10026000F603FE10CC0B04FE11CC1B04FE12CC23B3
:1005700010411AE638CDC904C1C9C5ED5B10411A56 :1002700004FE13CC5B04FE0ACCED03FE80CC7A04B2
:100580001F1F1FE607CD50063E20CDB7023E2CCDE3 :10028000FE81CC71042310ACE11810CDF1027ECDBB
:10059000B702C1C9C5ED5B10411AE607CD5006C1CF :10029000090323E521C60CCDDF00E1CDF1003A1AB8
:1005A000C9C5ED5B1041131ACDC904C1C9E5ED5BA6 :1002A000413D321A41C2B901C9E521C4043A1441A1
:1005B000104113131806E5ED5B1041131A6F131A5F :1002B0004F7EFEFFCAEB02F523462B79A04FF1B922
:1005C000677CCDE7027DCDE702E1C9C5ED5B104157 :1002C000280B06000E07097E4F092318E023234E52
:1005D0001A1F1F1FE607CD5006C1C9E5C5ED5B1008 :1002D000233A154146A0B92B2B2B280B06000E07FD
:1005E000411807E5C5ED5B1041131A1F1F1FE606F2 :1002E000097E4F092318C6444DE1C906000E00E1FE
:1005F000F52A10417EFEDD2809FEFD280A219F0E06 :1002F000C93E24CDD7007CCD07017DCD07013E68E6
:10060000180821A70E180321AF0EF106004F097E2E :10030000CDD7003E20CDD700C9CD07013E68CDD75F
:10061000CDB702237ECDB702C1E1C9E5C5ED5B10C0 :10031000003E20CDD700C9E5ED5B1041131A6F13E5
:10062000411A1F1F1FE606F52A10417E21B70E183A :100320001A673E24CDD7007CCD07017DCD07013E65
:10063000D9E5C52A174106021807E5C52A1741065C :1003300068CDD7003E20CDD700CDB504E1C9C5EDCD
:10064000017E23A720FB05C24106CDBF02C1E1C93F :100340005B10411A1F1FE60EE521CF0C06004F0976
:10065000E5FE062811FE072815219F0E06004F090A :10035000CDDF003E20CDD700E1C1C9ED5B104113D8
:100660007ECDB702E1C921BF0ECDBF02E1C93E4137 :100360001AF5E680C27C033E24CDD7003E2BCDD7C4
:10067000CDB702E1C978FE01C83E20CDB7023E2CBD :1003700000F1CD07013E68CDD70018173E24CDD738
:10068000CDB702C900FF000001DC0A0027FF00000F :10038000003E2DCDD700F1ED44CD07013E68CDD71D
:1006900001A70B002FFF000001AB0B00EDFF44FF93 :10039000001800CDB504C9ED5B1041131AFE4D28BD
:1006A00002AF0B003FFF000001B30B0037FF00005B :1003A000063E4ECDD700C93E49CDD700C9C5ED5B4D
:1006B00001B70B0076FF000001BB0B00F3FF000049 :1003B00010411AE638CD0903C1C9C5ED5B10411AD9
:1006C00001C00B00FBFF000001C30B00EDFF46FF64 :1003C0001F1F1FE607CD90043E20CDD7003E2CCD49
:1006D00002C60B00EDFF56FF02CB0B00EDFF5EFFE5 :1003D000D700C1C9C5ED5B10411AE607CD9004C135
:1006E00002D00B00EBFF000001D50B0008FF00005B :1003E000C9C5ED5B1041131ACD0903C1C9E5ED5B29
:1006F00001DF0B00D9FF000001EC0B00E3FF00005D :1003F000104113131806E5ED5B1041131A6F131A21
:1007000001F00B00DDFFE3FF02FC0B00FDFFE3FF48 :10040000677CCD07017DCD0701E1C9C5ED5B1041DA
:1007100002080C00EDFFA0FF02140C00EDFFB0FF7B :100410001A1F1F1FE607CD9004C1C9E5C5ED5B108B
:1007200002180C00EDFFA8FF021D0C00EDFFB8FF42 :10042000411807E5C5ED5B1041131A1F1F1FE606B3
:1007300002210C00EDFFA1FF02260C00EDFFB1FF2E :10043000F52A10417EFEDD2809FEFD280A21DF0C89
:10074000022A0C00EDFFA9FF022F0C00EDFFB9FFFC :10044000180821E70C180321EF0CF106004F097E74
:1007500002330C00C3FF000003E00A0101C2C7001E :10045000CDD700237ECDD700C1E1C9E5C5ED5B1046
:100760000003E00A0302800118FF000002E70A010B :10046000411A1F1F1FE606F52A10417E21F70C18BE
:100770000338FF000002EB0A010330FF000002F221 :10047000D9E5C52A174106021807E5C52A1741061E
:100780000A010328FF000002FA0A010320FF00000B :10048000017E23A720FB05C28104CDDF00C1E1C9A5
:1007900002010B0103E9FF000002090B00DDFFE984 :10049000E5FE062811FE07281521DF0C06004F098E
:1007A000FF02120B00FDFFE9FF021B0B0010FF0010 :1004A0007ECDD700E1C921FF0CCDDF00E1C93E417F
:1007B0000002240B0103CDFF0000032A0B0101C43A :1004B000CDD700E1C978FE01C83E20CDD7003E2C43
:1007C000C70000032A0B020201C9FF000001300B21 :1004C000CDD700C900FF0000011C090027FF000074
:1007D00000C0C7000001300B0102EDFF4DFF0235E4 :1004D00001E709002FFF000001EB0900EDFF44FFD9
:1007E0000B00EDFF45FF023A0B00C7C70000013FB9 :1004E00002EF09003FFF000001F3090037FF0000A1
:1007F0000B01050AFF000001440B001AFF00000175 :1004F00001F7090076FF000001FB0900F3FF00008F
:100800004E0B003AFF000003580B02098002FF0064 :1005000001000A00FBFF000001030A00EDFF46FFA7
:100810000001620B0012FF0000016D0B0032FF00AF :1005100002060A00EDFF56FF020B0A00EDFF5EFF28
:100820000003780B020980EDFF57FF02870B00EDF4 :1005200002100A00EBFF000001150A0008FF00009E
:10083000FF5FFF028F0B00EDFF47FF02970B00EDFC :10053000011F0A00D9FF0000012C0A00E3FF0000A0
:10084000FF4FFF029F0B0006C7000002830B02064A :1005400001300A00DDFFE3FF023C0A00FDFFE3FF8C
:100850000840C0000001830B02060780F800000179 :1005500002480A00EDFFA0FF02540A00EDFFB0FFC1
:10086000380C0107C6FF000002380C0108DDFF86C6 :1005600002580A00EDFFA8FF025D0A00EDFFB8FF88
:10087000FF03400C020880FDFF86FF034F0C0208B7 :1005700002610A00EDFFA1FF02660A00EDFFB1FF74
:1008800080C8F80000015E0C01078EF80000025ECF :10058000026A0A00EDFFA9FF026F0A00EDFFB9FF42
:100890000C0108DDFF8EFF03660C020880FDFF8E51 :1005900002730A00C3FF00000320090101C2C70063
:1008A000FF03750C02088090F8000001840C01071A :1005A000000320090302800118FF0000022709014F
:1008B000D6FF000002840C0108DDFF96FF03890CBF :1005B0000338FF0000022B09010330FF0000023264
:1008C000020880FDFF96FF03950C02088094F80053 :1005C00009010328FF0000023A09010320FF00008F
:1008D0000001A10C0107DEFF000002A10C0108DDF0 :1005D0000241090103E9FF000002490900DDFFE9CA
:1008E000FF9EFF03A90C020880FDFF9EFF03B70CCB :1005E000FF02520900FDFFE9FF025B090010FF0056
:1008F000020880A0F8000001C50C0107E6FF000017 :1005F000000264090103CDFF0000036A090101C480
:1009000002C50C0108DDFFA6FF03CA0C020880FD2A :10060000C70000036A09020201C9FF000001700966
:10091000FFA6FF03D60C020880B0F8000001E20C2D :1006100000C0C700000170090102EDFF4DFF027527
:100920000107F6FF000002E20C0108DDFFB6FF033D :100620000900EDFF45FF027A0900C7C70000017FFE
:10093000E60C020880FDFFB6FF03F10C020880A858 :100630000901050AFF0000018409001AFF000001FA
:10094000F8000001FC0C0107EEFF000002FC0C01A6 :100640008E09003AFF000003980902098002FF00AA
:1009500008DDFFAEFF03010D020880FDFFAEFF03BF :100650000001A2090012FF000001AD090032FF00F5
:100960000D0D020880B8F8000001190D0107FEFF07 :100660000003B809020980EDFF57FF02C70900ED3A
:10097000000002190D0108DDFFBEFF031D0D020876 :10067000FF5FFF02CF0900EDFF47FF02D70900ED42
:1009800080FDFFBEFF03280D02088004C7000001A0 :10068000FF4FFF02DF090006C7000002C309020690
:10099000330D0110DDFF34FF03380D020880FDFF29 :100690000840C0000001C30902060780F8000001FD
:1009A00034FF03440D02088005C7000001500D010B :1006A000780A0107C6FF000002780A0108DDFF860C
:1009B00010DDFF35FF03550D020880FDFF35FF03F5 :1006B000FF03800A020880FDFF86FF038F0A0208FD
:1009C000610D02088009CF0000016D0D0111EDFFDE :1006C00080C8F80000019E0A01078EF80000029E13
:1009D0004ACF02760D0112EDFF42CF027F0D0112C8 :1006D0000A0108DDFF8EFF03A60A020880FDFF8ED7
:1009E000DDFF09CF02880D0112FDFF09CF02910D35 :1006E000FF03B50A02088090F8000001C40A010760
:1009F000011203CF0000019A0D0111DDFF23FF0258 :1006F000D6FF000002C40A0108DDFF96FF03C90A05
:100A00009F0D00FDFF23FF02A80D000BCF0000018A :10070000020880FDFF96FF03D50A02088094F800D6
:100A1000B10D0111DDFF2BFF02B60D00FDFF2BFF15 :100710000001E10A0107DEFF000002E10A0108DD35
:100A200002BF0D0001CF000003C80D03118009DDD6 :10072000FF9EFF03E90A020880FDFF9EFF03F70A10
:100A3000FF21FF04CF0D010AFDFF21FF04D70D01A7 :10073000020880A0F8000001050B0107E6FF000099
:100A40000A2AFF000003DF0D020980EDFF4BCF04EF :1007400002050B0108DDFFA6FF030A0B020880FD6E
:100A5000EB0D0412800A81DDFF2AFF04F60D010A66 :10075000FFA6FF03160B020880B0F8000001220B71
:100A6000FDFF2AFF04020E010A22FF0000030E0E02 :100760000107F6FF000002220B0108DDFFB6FF03C0
:100A7000020A80EDFF43CF041A0E030A8012DDFF45 :10077000260B020880FDFFB6FF03310B020880A89C
:100A800022CF04240E020A80FDFF22CF04300E0282 :10078000F80000013C0B0107EEFF0000023C0B01EA
:100A90000A80F9FF0000013C0E00DDFFF9FF02466D :1007900008DDFFAEFF03410B020880FDFFAEFF0343
:100AA0000E00FDFFF9FF02500E00C5CF0000015AF5 :1007A0004D0B020880B8F8000001590B0107FEFF4D
:100AB0000E0113DDFFE5FF02600E00FDFFE5FF0202 :1007B000000002590B0108DDFFBEFF035D0B0208BC
:100AC000680E00C1CF000001700E0113DDFFE1FFD1 :1007C00080FDFFBEFF03680B02088004C700000124
:100AD00002760E00FDFFE1FF027E0E004E4F500039 :1007D000730B0110DDFF34FF03780B020880FDFF6F
:100AE0004A5020002C20004A5220004A5220432C19 :1007E00034FF03840B02088005C7000001900B0151
:100AF00020004A52204E432C20004A52205A2C20DB :1007F00010DDFF35FF03950B020880FDFF35FF0379
:100B0000004A52204E5A2C20004A502028484C2996 :10080000A10B02088009CF000001AD0B0111EDFF23
:100B100020004A50202849582920004A50202849BE :100810004ACF02B60B0112EDFF42CF02BF0B01120D
:100B200059292000444A4E5A200043414C4C200091 :10082000DDFF09CF02C80B0112FDFF09CF02D10B7A
:100B3000524554200052455449005245544E0052EB :10083000011203CF000001DA0B0111DDFF23FF02DB
:100B4000535420004C4420412C28424329004C445B :10084000DF0B00FDFF23FF02E80B000BCF000001D0
:100B500020412C28444529004C4420412C28006881 :10085000F10B0111DDFF2BFF02F60B00FDFF2BFF5B
:100B600029004C4420284243292C2041004C442099 :1008600002FF0B0001CF000003080C03118009DD1B
:100B7000284445292C2041004C4420280068292C79 :10087000FF21FF040F0C010AFDFF21FF04170C01EB
:100B80002041004C4420004C4420412C2049004C82 :100880000A2AFF0000031F0C020980EDFF4BCF0472
:100B90004420412C2052004C4420492C2041004C40 :100890002B0C0412800A81DDFF2AFF04360C010AAA
:100BA0004420522C2041004441410043504C004E0F :1008A000FDFF2AFF04420C010A22FF0000034E0C48
:100BB000454700434346005343460048414C5400D8 :1008B000020A80EDFF43CF045A0C030A8012DDFFC9
:100BC000444900454900494D203000494D2031003D :1008C00022CF04640C020A80FDFF22CF04700C02C8
:100BD000494D20320045582044452C20484C0045C2 :1008D0000A80F9FF0000017C0C00DDFFF9FF0286B1
:100BE000582041462C204146E280B200455858002A :1008E0000C00FDFFF9FF02900C00C5CF0000019A3B
:100BF000455820285350292C20484C00455820287F :1008F0000C0113DDFFE5FF02A00C00FDFFE5FF0288
:100C00005350292C20495800455820285350292C4E :10090000A80C00C1CF000001B00C0113DDFFE1FF16
:100C1000204959004C4449004C444952004C44443A :1009100002B60C00FDFFE1FF02BE0C004E4F50007E
:100C2000004C444452004350490043504952004351 :100920004A5020002C20004A5220004A5220432CDA
:100C3000504400435044520041444420412C200081 :1009300020004A52204E432C20004A52205A2C209C
:100C400041444420412C202849582B006829004168 :10094000004A52204E5A2C20004A502028484C2958
:100C5000444420412C202849592B00682900414454 :1009500020004A50202849582920004A5020284980
:100C60004320412C200041444320412C2028495856 :1009600059292000444A4E5A200043414C4C200053
:100C70002B0068290041444320412C202849592B4E :10097000524554200052455449005245544E0052AD
:100C800000682900535542200053554220284958F6 :10098000535420004C4420412C28424329004C441D
:100C90002B00682900535542202849592B00682908 :1009900020412C28444529004C4420412C28006843
:100CA0000053424320412C200053424320412C2832 :1009A00029004C4420284243292C2041004C44205B
:100CB00049582B0068290053424320412C284959A8 :1009B000284445292C2041004C4420280068292C3B
:100CC0002B00682900414E442000414E4420284911 :1009C0002041004C4420004C4420412C2049004C44
:100CD000582B00682900414E44202849592B0068B0 :1009D0004420412C2052004C4420492C2041004C02
:100CE00029004F5220004F52202849582B006829D4 :1009E0004420522C2041004441410043504C004ED1
:100CF000004F52202849592B00682900584F522094 :1009F000454700434346005343460048414C54009A
:100D000000584F52202849582B00682900584F524C :100A0000444900454900494D203000494D203100FE
:100D1000202849592B0068290043502000435020C7 :100A1000494D20320045582044452C20484C004583
:100D20002849582B006829004350202849592B0096 :100A2000582041462C204146E280B20045585800EB
:100D3000682900494E432000494E43202849582B3A :100A3000455820285350292C20484C004558202840
:100D400000682900494E43202849592B0068290092 :100A40005350292C20495800455820285350292C10
:100D50004445432000444543202849582B00682936 :100A5000204959004C4449004C444952004C4444FC
:100D600000444543202849592B0068290041444448 :100A6000004C444452004350490043504952004313
:100D700020484C2C200041444320484C2C20005358 :100A7000504400435044520041444420412C200043
:100D8000424320484C2C20004144442049582C2008 :100A800041444420412C202849582B00682900412A
:100D9000004144442049592C2000494E4320004939 :100A9000444420412C202849592B00682900414416
:100DA0004E432049582C2000494E432049592C20BD :100AA0004320412C200041444320412C2028495818
:100DB0000044454320004445432049582C2000442A :100AB0002B0068290041444320412C202849592B10
:100DC00045432049592C20004C4420002C20004C45 :100AC00000682900535542200053554220284958B8
:100DD000442049582C20004C442049592C20004CD8 :100AD0002B00682900535542202849592B006829CA
:100DE0004420484C2C2028006829004C4420002C2A :100AE0000053424320412C200053424320412C28F4
:100DF0002028006829004C442049582C20280068ED :100AF00049582B0068290053424320412C2849596A
:100E000029004C442049592C2028006829004C44D2 :100B00002B00682900414E442000414E44202849D2
:100E100020280068292C20484C004C4420280068D9 :100B1000582B00682900414E44202849592B006871
:100E2000292C20004C4420280068292C20495800F7 :100B200029004F5220004F52202849582B00682995
:100E30004C4420280068292C204959004C44205358 :100B3000004F52202849592B00682900584F522055
:100E4000502C20484C004C442053502C2049580032 :100B400000584F52202849582B00682900584F520E
:100E50004C442053502C20495900505553482000F1 :100B5000202849592B006829004350200043502089
:100E6000505553482049580050555348204959007F :100B60002849582B006829004350202849592B0058
:100E7000505553482000505553482049580050556C :100B7000682900494E432000494E43202849582BFC
:100E80005348204959002E3F2E0020202020004E9C :100B800000682900494E43202849592B0068290054
:100E90005A5A004E434300504F504550004D0042B7 :100B90004445432000444543202849582B006829F8
:100EA000434445484C5350424344454958535042AB :100BA00000444543202849592B006829004144440A
:100EB0004344454959535042434445484C414628D0 :100BB00020484C2C200041444320484C2C2000531A
:100EC000484C2900CDB702C9C5D5E5CDF802F5F1EA :100BC000424320484C2C20004144442049582C20CA
:100ED000E1D1C1C93E00C9F5C5D53E08D3F401280A :100BD000004144442049592C2000494E43200049FB
:100EE00000CDF70E3E00D3F4012400CDF70E1B7A9F :100BE0004E432049582C2000494E432049592C207F
:100EF000B320E7D1C1F1C9ED44ED44ED44ED440B1D :100BF0000044454320004445432049582C200044EC
:100F000079B0C2F70EC9CD12033EA7D3063E0ED369 :100C000045432049592C20004C4420002C20004C06
:100F1000063E00D30421E60F22044221000022FCF9 :100C1000442049582C20004C442049592C20004C99
:100F20004022FE403E42ED47ED5E216110CDBF0202 :100C20004420484C2C2028006829004C4420002CEB
:100F3000FBCD97103E43CD3710CD0A10DA340FFEAB :100C30002028006829004C442049582C20280068AE
:100F400004CA9D0FFE18CA340FFE01CA510FC3A573 :100C400029004C442049592C2028006829004C4494
:100F50000FCD0A10DA89104732FB40CD0A10DA892A :100C500020280068292C20484C004C44202800689B
:100F60001080FEFFC2A50F3D781FE67F67783D0F1A :100C6000292C20004C4420280068292C20495800B9
:100F7000E6806F1100441906800E00E5CD0A10DAF4 :100C70004C4420280068292C204959004C4420531A
:100F80008910E177230C05C27B0FCD0A10DA891096 :100C8000502C20484C004C442053502C20495800F4
:100F9000570CCD0A10DA89105F0CC37B103E06CDCA :100C90004C442053502C20495900505553482000B3
:100FA0003710C3DF0F3E18CD37103E18CD37103E37 :100CA0005055534820495800505553482049590041
:100FB00018CD37103E18CD37103E18CD37103E18DB :100CB000505553482000505553482049580050552E
:100FC000CD37103E18CD37103E18CD37103E18CD16 :100CC0005348204959002E3F2E0020202020004E5E
:100FD00037103E18CD37103E18214810CDBF02F310 :100CD0005A5A004E434300504F504550004D004279
:100FE000CDD102C39900F308D92AFC402322FC404A :100CE000434445484C53504243444549585350426D
:100FF000110404ED52C2051021000022FC402AFE1B :100CF0004344454959535042434445484C41462892
:10100000402322FE4008D9FBED4DF321000022FCD5 :100D0000484C2900CDD700C9C5D5E5CD1F01F5F167
:101010004022FE40FBCD1B032AFE407DFE03CA3565 :100D1000E1D1C1C93E00C9F5D53E08D3F4CD2F0DB0
:1010200010AFD309DB09E601CA1810DB08F5CD12B1 :100D20003E00D3F4CD2F0D1B7AB320EDD1F1C9C510
:1010300003F1373FC937C9D308CD3D10C9973CD319 :100D3000ED44ED440B79B0C2300DC1C93E80D333D0
:1010400009DB09CB4728F6C94572726F723A2075E1 :100D40003E80D33200AFD332C9F53E80D333F1D3E6
:101050006E657870656374656420627974650D0AE5 :100D50003078E61FD332F620D3320078E61FD33244
:1010600000417761697420786D6F64656D20636FEE :100D600000AFD332C93E92D33378E61FD332F64078
:101070006E6E656374696F6E0D0A003E06CD3710A3 :100D7000D33200F5F1F5F1F5F1F5F1DB30F5AFD354
:10108000CD0A10DA7B10C33F0F3E15CD3710CD0AC5 :100D800032F1C90EFF060FCD650DCB47C2040ECB65
:1010900010DA8910C33F0F21FF000101000000009A :100D90005F28F23E92D3333E08D332F640D332007E
:1010A00000ED42C818F73E80D3333E80D33200AF04 :100DA0000000DB317723DB30772379B7CAB20D0D32
:1010B000D332C9F53E80D333F1D33078E61FD33233 :100DB00018D3C90EFF1100101B7AB3CAEE0D060F2F
:1010C000F620D3320078E61FD33200AFD332C93EC8 :100DC000CD650DCB47C2040ECB5F28EC1100083E69
:1010D00092D33378E61FD332F640D33200F5F1F5E0 :100DD00092D3333E08D332F640D332000000DB30EA
:1010E000F1F5F1F5F1DB30F5AFD332F1C90EFF06C2 :100DE0007723DB31772379B7CAB20D0D18CA216694
:1010F0000FCDCF10CB47C26E11CB5F28F23E92D3FB :100DF0000ECDDF0079CD07013E0ACDD7003E0DCDE7
:10110000333E08D332F640D332000000DB31772380 :100E0000D700C9C921370ECDDF00060FCD650DCD46
:10111000DB30772379B7CA1C110D18D3C90EFF1124 :100E1000070121540ECDDF003A2C40CD0701215DA2
:1011200000101B7AB3CA5811060FCDCF10CB47C29F :100E20000ECDDF000609CD650DCD07013E0ACDD7F9
:101130006E11CB5F28EC1100083E92D3333E08D3EA :100E3000003E0DCDD700C90D0A4469736B20492FC0
:1011400032F640D332000000DB307723DB317723E7 :100E40004F206572726F722E205374617475733AFD
:1011500079B7CA1C110D18CA21D011CDBF0279CDA3 :100E500020307800204465763A20307800204572B2
:10116000E7023E0ACDB7023E0DCDB702C9C921A1A3 :100E6000723A203078000D0A4469736B20492F4F85
:1011700011CDBF02060FCDCF10CDE70221BE11CD9C :100E7000206572726F722E20446174612074696DF6
:10118000BF023A0050CDE70221C711CDBF020609C8 :100E8000656F75742040203078000000000000007D
:10119000CDCF10CDE7023E0ACDB7023E0DCDB7024E :100E90000000000000000000000000000000000052
:1011A000C90D0A4469736B20492F4F206572726F15 :100EA0000000000000000000000000000000000042
:1011B000722E205374617475733A20307800204485 :100EB0000000000000000000000000000000000032
:1011C00065763A20307800204572723A20307800F7 :100EC0000000000000000000000000000000000022
:1011D0000D0A4469736B20492F4F206572726F723C :100ED0000000000000000000000000000000000012
:1011E0002E20446174612074696D656F75742040B0 :100EE0000000000000000000000000000000000002
:1011F00020307800AF320050320150F3CDA61021DC :100EF00000000000000000000000000000000000F2
:101200008912CDBF0211FF1F060FCDCF10B7280BDB :100F000000000000000000000000000000000000E1
:10121000CB77200E1B7AB3280218ED21B312CDBF75 :100F100000000000000000000000000000000000D1
:1012200002C9219D12CDBF02060F3EECCDB31021A5 :100F200000000000000000000000000000000000C1
:101230004150CDED102155500614CD581321AA125E :100F300000000000000000000000000000000000B1
:10124000CDBF022177500628CD58133E0ACDB702F4 :100F400000000000000000000000000000000000A1
:101250003E0DCDB702C9060ACDB3107EE60FF6E00B :100F50000000000000000000000000000000000091
:10126000060ECDB310237E060DCDB310237E060CE3 :100F60000000000000000000000000000000000081
:10127000CDB310237E060BCDB310233E20060FCD39 :100F70000000000000000000000000000000000071
:10128000B310214150CD1D11C90D0A446574656329 :100F80000000000000000000000000000000000061
:1012900074696E67206472697665732000666F7585 :100F90000000000000000000000000000000000051
:1012A0006E64210D0A49443A20002020446573638E :100FA0000000000000000000000000000000000041
:1012B0003A20006E6F2064726976650D0A00E521A0 :100FB0000000000000000000000000000000000031
:1012C0001913CDBF02E178B7CA1813050E107CCDF3 :100FC0000000000000000000000000000000000021
:1012D000E7027DCDE7023E20CDB7027ECDE7023E9C :100FD0000000000000000000000000000000000011
:1012E00020CDB702230D20F3C5E506000E10ED4218 :100FE0000000000000000000000000000000000001
:1012F0007E23FE20DA0113FE7FD20113CDB7021840 :100FF00000000000000000000000000000000000F1
:10130000053E2ECDB7020DC2F012E1C13E0ACDB7A7 :1010000000000000000000000000000000000000E0
:10131000023E0DCDB70218AEC90D0A424153452019 :1010100000000000000000000000000000000000D0
:10132000302020312020322020332020342020354E :1010200000000000000000000000000000000000C0
:10133000202036202037202038202039202041202E :1010300000000000000000000000000000000000B0
:1013400020422020432020442020452020462020E9 :1010400000000000000000000000000000000000A0
:1013500041534349490D0A007E23CDB70210F9C914 :101050000000000000000000000000000000000090
:101360005A3843204D6F6E69746F72205632206276 :101060000000000000000000000000000000000080
:10137000792044656E6E69732047756E6961202817 :101070000000000000000000000000000000000070
:1013800032303232290073796E3F00636D643F0062 :101080000000000000000000000000000000000060
:10139000424153452030202031202032202033206C :101090000000000000000000000000000000000050
:1013A00020342020352020362020372020382020CF :1010A0000000000000000000000000000000000040
:1013B0003920204120204220204320204420204565 :1010B0000000000000000000000000000000000030
:0413C00020204600A3 :1010C0000000000000000000000000000000000020
:1010D0000000000000000000000000000000000010
:1010E0000000000000000000000000000000000000
:1010F00000000000000000000000000000000000F0
:1011000000000000000000000000000000000000DF
:1011100000000000000000000000000000000000CF
:1011200000000000000000000000000000000000BF
:1011300000000000000000000000000000000000AF
:10114000000000000000000000000000000000009F
:10115000000000000000000000000000000000008F
:10116000000000000000000000000000000000007F
:10117000000000000000000000000000000000006F
:10118000000000000000000000000000000000005F
:10119000000000000000000000000000000000004F
:1011A000000000000000000000000000000000003F
:1011B000000000000000000000000000000000002F
:1011C000000000000000000000000000000000001F
:1011D000000000000000000000000000000000000F
:1011E00000000000000000000000000000000000FF
:1011F00000000000000000000000000000000000EF
:1012000000000000000000000000000000000000DE
:1012100000000000000000000000000000000000CE
:1012200000000000000000000000000000000000BE
:1012300000000000000000000000000000000000AE
:10124000000000000000000000000000000000009E
:10125000000000000000000000000000000000008E
:10126000000000000000000000000000000000007E
:101270000000000000FF000000000000000000303F
:101280000077400000FF0000000000000000003078
:10129000019F400000FF000000000000000000402F
:1012A00000C7400000FF00000000000000000040F8
:1012B00001EF400000217512113640014000EDB0F1
:1012C0003E00327640AF327740329F4032C74032E4
:1012D000EF40C9CDF100211015CDDF0021364006C9
:1012E000003A7640B8CAEC123E2018023E2ACDD70A
:1012F0000078C645CDD7003E3ACDD7003E20CDD7A9
:1013000000E57EB7280EFE01280FFE022810FEFF22
:101310002811180F214815180D2153151808215EA2
:10132000151803216915CDDF00E1233E30CDD7002C
:101330003E78CDD7007ECD07013E20CDD70023E5F6
:10134000DDE12323232323232323DD7E03CD070194
:10135000DD7E02CD0701DD7E01CD0701DD7E00CD02
:1013600007013E20CDD700DD7E07CD0701DD7E06DB
:10137000CD0701DD7E05CD0701DD7E04CD07013EF1
:1013800020CDD7003E30CDD7003E78CDD7007ECDE2
:1013900007013E20CDD700237EE5B7CAA413217CE8
:1013A00015C3A713217415CDDF00E123C57E4F239C
:1013B0007E4723E56069CDDF00CDF100E1C1232345
:1013C0000478FE04C8C3E112CD9714CD3C0D01FF93
:1013D0005F060FCD650DB7280BCB77200C1B7AB3BA
:1013E000280218EDDD360001C9DD360002060F3E89
:1013F000ECCD490D211741CD830D214D41DD7E0CF2
:101400005FDD7E0D57012800EDB03E01060ACD4993
:101410000D3E01060BCD490D3E00060CCD490D3E9B
:1014200000060DCD490D3EA0060ECD490D3E20060D
:101430000FCD490D211741CDB30D06040E00FD213E
:10144000D542FD7E04B7C25414C34C14111000FDE4
:101450001910EFC9FD7E04DD7701FE0E20EEFD7E42
:1014600008DD7702FD7E09DD7703FD7E0ADD770466
:10147000FD7E0BDD7705DD360000FD7E0CDD770699
:10148000FD7E0DDD7707FD7E0EDD7708FD7E0FDD2D
:101490007709DD360000C9F5C53A7640070707062B
:1014A000004FDD213640DD09C1F1C921F014CDDF47
:1014B00000CDB512CDC813210815CDDF00C9060A2D
:1014C000CD490D7E060BCD490D237E060CCD490D71
:1014D000237E060DCD490D237EE60FF6E0060ECDE8
:1014E000490D3E20060FCD490D211741CDB30DC941
:1014F0000D0A446574656374696E67206472697669
:101500006573202E2E2E2000646F6E65210D0A005B
:1015100044525620537461747573202020205479EE
:101520007065204C42412020202020204C656E67B1
:101530007468202020506F7274204D2F532020207B
:10154000204E616D650A0D00417661696C20202096
:101550002020004E6F7420466F756E642000556E1B
:101560006B6F776E20465320004374726C2E2045BB
:10157000727220004D61737465722000536C617645
:1015800065202000CDE61579E6FECD7C16CD1C1633
:10159000B7C2A8157E23CD7C16CD1C16B7C2A815E0
:1015A00010F2CDFB153E00C9CDFB153E01C905CD9E
:1015B000E61579F601CD7C16CD1C16B7C2D715CD30
:1015C000A2167723CD421610F6CDA2167723CD5F53
:1015D00016CDFB153E00C9CDFB153E01C93ECFD34C
:1015E000F63EF0D3F6C93ECFD3F63EFCD3F63E022C
:1015F000D3F400003E00D3F40000C93ECFD3F63E42
:10160000FCD3F63E02D3F400003E03D3F400003EC8
:10161000CFD3F600003EF7D3F60000C93ECFD3F695
:101620003EFDD3F600003E00D3F40000EE02D3F4FA
:1016300000DBF40000F5E6FEEE02D3F40000F1E674
:1016400001C93ECFD3F63EFCD3F600003E00D3F4F2
:1016500000003E02D3F400003E00D3F40000C93E77
:10166000CFD3F63EFCD3F600003E02D3F400003E9A
:1016700003D3F400003E02D3F40000C9C54F3ECFAF
:10168000D3F63EFCD3F60608CB113E0017D3F40088
:1016900000EE02D3F40000EE02D3F4000010E9796A
:1016A000C1C9C53ECFD3F63EFDD3F606080E00AF46
:1016B000D3F400003E02D3F400DBF4001FCB11AFE3
:1016C000D3F4000010E979C1C9E5212417CDDF006A
:1016D000E178B7CA2317050E107CCD07017DCD0731
:1016E000013E20CDD7007ECD07013E20CDD700237F
:1016F0000D20F3C5E506000E10ED427E23FE20DA34
:101700000C17FE7FD20C17CDD70018053E2ECDD773
:10171000000DC2FB16E1C13E0ACDD7003E0DCDD76C
:101720000018AEC90D0A4241534520302020312017
:101730002032202033202034202035202036202045
:1017400037202038202039202041202042202043EB
:101750002020442020452020462020415343494951
:101760000D0A007E23CDD70010F9C96461746500AD
:10177000901A7365746461746500281C70696E202A
:1017800000A91964756D7020001819706F757420A8
:1017900000BF1969696E2000401A696F75742000D6
:1017A000E01963616C6C2000F818636C72008C1A8D
:1017B0006461736D200079196A702000DF187273FC
:1017C000740000006C7364736B00A11C73656C641F
:1017D000736B2000A51C2400DF186900A9196F0095
:1017E000BF19210048193F001819FFCDF1003E3EF6
:1017F000CDD700AF320040CD1F01CAF717FE0DCA8A
:101800004C18FE0ACAF717FE08CA2618F5212B4005
:1018100016003A00405F193C320040F177CDD70006
:1018200023AF77C3F7173A0040A7CAF7173D320036
:10183000405F1600212B4019AF773E08CDD7003E00
:1018400020CDD7003E08CDD700C3F717216B171165
:101850002B407EFEFFCA7E181A477EB0CA87181A30
:10186000477EA8B7CA6E187EB7CA87181805231313
:1018700018E6237EB7C27218232323C34F1821B85A
:1018800018CDDF00C3EB17E5C1030A6F030A67CD6C
:101890009518C3EB17E921A418CDDF00C921CC1896
:1018A000CDDF00C90A0D6E6F7420696D706C656DB7
:1018B000656E7465640A0D000A0D696E76616C6967
:1018C0006420636F6D6D616E640A0D000A0D696EB0
:1018D00076616C69642073796E7461780A0D00D545
:1018E000E1CD6401477BA7C29D182323CD64014F3E
:1018F0007BA7C29D186069E9D5E1CD6401477BA74C
:10190000C29D182323CD64014F7BA7C29D18606937
:10191000CD1719CDF100C9E9D5E1CD6401477BA709
:10192000C29D182323CD64014F7BA7C29D1823239A
:101930007EFE20C29D1823CD6401F57BA7C29D18B1
:10194000F1606947CDC916C9D5E1CD6401477BA7D0
:10195000C29D182323CD64014F7BA7C29D1823236A
:101960007EFE00C8FE20C29D1823CD6401027BA725
:10197000C29D18032323C36019D5E1CD6401477BC1
:10198000A7C29D182323CD64014F7BA7C29D1823B6
:10199000237EFE20C29D1823CD6401F57BA7C29D46
:1019A000186069F147CDB501C9D5E1CD64014F7B20
:1019B000A7C29D18ED78F5CDF100F1CD0701C9D58D
:1019C000E1CD64014F7BA7C29D1823237EFE20C278
:1019D0009D1823CD6401F57BA7C29D18F1ED79C94F
:1019E000D5E1CD6401320C407BA7C29D18232301B1
:1019F0000D40AF320B407EFE00CA121AFE20C29D7F
:101A00001823CD640102033A0B403C320B402323E0
:101A100018E4210D403A0B40473A0C404FCD841555
:101A2000B7C2251AC9212C1ACDDF00C90A0D62756B
:101A3000732D6572726F723A206E6F2041434B00B6
:101A4000D5E1CD64014F7BA7C29D1823237EFE20E4
:101A5000C29D1823CD640147C57BA7C29D18210BE9
:101A600040CDAE15C1B7C2251A217F1ACDDF0021A6
:101A70000B407ECD07013E20CDD7002310F4C90ACC
:101A80000D7265632D627566663A2000CDEA00C965
:101A9000CDF100214B1B06010ED0CD8415B7C22518
:101AA0001A210B4006080ED0CDAE15B7C2251A3A42
:101AB0000D40E6301F1F1F1FCD19013A0D40E60FE4
:101AC000CD19013E3ACDD7003A0C40E6701F1F1FDA
:101AD0001FCD19013A0C40E60FCD19013E3ACDD782
:101AE000003A0B40E6701F1F1F1FCD19013A0B4033
:101AF000E60FCD19013E20CDD7003A0F40E6301F4A
:101B00001F1F1FCD19013A0F40E60FCD19013E2EC0
:101B1000CDD7003A1040E6101F1F1F1FCD19013A04
:101B20001040E60FCD19013E2ECDD7003E32CDD765
:101B3000003E30CDD7003A1140E6F01F1F1F1FCDE9
:101B400019013A1140E60FCD1901C9000A0D456E81
:101B50007465722044617465202020202830302D67
:101B6000333129203A20000A0D456E746572204DEC
:101B70006F6E74682020202830302D313229203AB1
:101B800020000A0D456E746572205965617220202F
:101B900020202830302D393929203A20000A0D45DF
:101BA0006E74657220486F75727320202028303063
:101BB0002D323329203A20000A0D456E74657220BB
:101BC0004D696E75746573202830302D35392920A4
:101BD0003A20000A0D456E746572205365636F6E7E
:101BE0006473202830302D353929203A20002069AF
:101BF0006E7661696C6420696E7075742E20526512
:101C00007472792100E5CDDF00E1CD3101FEFFCA1C
:101C10001D1C47CD3101FEFFCA1D1C4FC9E521EE39
:101C20001BCDDF00E1C3051CAF320B40214C1BCDA7
:101C3000051C78CD9C1CE630B132104021671BCDCD
:101C4000051C78CD9C1CE610B132114021821BCDC1
:101C5000051C78CD9C1CE6F0B1321240219D1BCDB5
:101C6000051C78CD9C1CE630B1320E4021B81BCD4E
:101C7000051C78CD9C1CE670B1320D4021D31BCDE4
:101C8000051C78CD9C1CE670B1320C40130ED006BA
:101C900008210B40CD8415B7C2251AC907070707CD
:101CA000C9CDD312C9D5E17EDE453808FE04300423
:101CB000CD0080C921C41CCDDF00112000017000BF
:101CC000CD170DC90A0D496E76616C696420647286
:101CD000697665206C65747465720A0D00CDED1C23
:101CE000CD121DCD6A1DCD3D1DCD501DC921E11D5B
:101CF000CDDF00DBF6FE00C2061D3E0032094021AA
:101D00006A1ECDDF00C93EFF32094021321ECDDF01
:101D100000C921FC1DCDDF003EFFD3F80000DBF839
:101D2000FEFFC2311D3E00320A40216A1ECDDF0097
:101D3000C93EFF320A4021321ECDDF00C921AB1D52
:101D4000CDDF00DB30B7C2631D216A1ECDDF00C9C5
:101D500021C61DCDDF00DB40B7C2631D216A1ECD49
:101D6000DF00C921321ECDDF00C93E06320B402103
:101D7000171ECDDF00210B4006010ED0CD8415B714
:101D8000C29D1D210B4006010ED0CDAE153A0B4071
:101D9000B7CAA41D216A1ECDDF00C3931A21321ECB
:101DA000CDDF00C921401ECDDF00C90D0A436865A3
:101DB000636B204469736B6374726C2E40303330F4
:101DC000682E2E2E20000D0A436865636B2044693F
:101DD000736B6374726C2E40303430682E2E2E205C
:101DE000000D0A436865636B20494F2D436F6E7485
:101DF000726F6C6C6572202E2E2E20000D0A4368C7
:101E000065636B20414D44383931312041505520B4
:101E100020202E2E2E20000D0A436865636B20447F
:101E2000533133303720525443202020202E2E2E81
:101E300020006E6F742064657465637465642100AE
:101E40006E6F74207365742E20436865636B206227
:101E500061747465727920616E642072756E2027DA
:101E6000736574646174652721006F6B2120005ACB
:101E70003843204D6F6E69746F722056322E3120B8
:101E800062792044656E6E69732047756E696120C2
:0C1E900028323032322D3230323429003A
:00000001FF :00000001FF

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +1,30 @@
;This file is generated by the build script. ;This file is generated by the build script.
;Do not make any changes here! ;Do not make any changes here!
AY0_WRITE_REG equ 0x91 ADDR_RTC equ 0xD0
A_RTS_OFF equ 0x312 A_RTS_OFF equ 0x152
A_RTS_ON equ 0x31B A_RTS_ON equ 0x15B
CMD_DASM equ 0x239 BOOT_PHASE0 equ 0x50
CMD_EXEC equ 0x12F BOOT_PHASE1 equ 0x6E
CMD_IO_READ equ 0x21D BOOT_PHASE1_LOOP equ 0x77
CMD_IO_WRITE equ 0x1F4 BOOT_PHASE2 equ 0x82
CMD_SET equ 0x1B8 COMMAND equ 0x17EB
CMD_SET_END equ 0x1EE COMMAND_BACKSPACE equ 0x1826
CMD_SET_LOOP equ 0x1D3 COMMAND_LUT equ 0x176B
CMD_SYNTAX_ERROR equ 0x272 COMMAND_PROCESS equ 0x184C
CMD_VIEW equ 0x14E COMMAND_PROCESS_FOUND equ 0x1887
CMD_VIEW_END equ 0x1B2 COMMAND_PROCESS_LOOP equ 0x184F
CMD_VIEW_ROW equ 0x187 COMMAND_PROCESS_LOOP_STR1 equ 0x1858
CMD_VIEW_ROW_LOOP equ 0x199 COMMAND_PROCESS_LOOP_STR2 equ 0x186E
CONSOLE_INIT equ 0x27E COMMAND_PROCESS_NEXT_ENTRY equ 0x1873
CONSOLE_INIT_CTC equ 0x27E COMMAND_PROCESS_NEXT_ENTRYI equ 0x1872
CONSOLE_INIT_SIO equ 0x286 COMMAND_PROCESS_NOT_FOUND equ 0x187E
COMMAND_READ equ 0x17F7
CONSOLE_INIT equ 0x9E
CONSOLE_INIT_CTC equ 0x9E
CONSOLE_INIT_SIO equ 0xA6
CS_APU_CTRL equ 0xF9
CS_APU_DATA equ 0xF8
CS_BANK equ 0x00 CS_BANK equ 0x00
CS_CTC_0 equ 0x04 CS_CTC_0 equ 0x04
CS_CTC_1 equ 0x05 CS_CTC_1 equ 0x05
@@ -37,16 +43,18 @@ CS_SIO_A_C equ 0x09
CS_SIO_A_D equ 0x08 CS_SIO_A_D equ 0x08
CS_SIO_B_C equ 0x0B CS_SIO_B_C equ 0x0B
CS_SIO_B_D equ 0x0A CS_SIO_B_D equ 0x0A
DHEX_TO_BYTE equ 0x324 DHEX_TO_BYTE equ 0x164
DHEX_TO_BYTE_FAILED equ 0x340 DHEX_TO_BYTE_FAILED equ 0x180
EXEC_RST_08 equ 0xEC4 ERR_SYNTAX equ 0x189D
EXEC_RST_10 equ 0xEC8 EXEC_RST_08 equ 0xD04
EXEC_RST_18 equ 0xED4 EXEC_RST_10 equ 0xD08
HEX_TO_BIN equ 0x344 EXEC_RST_18 equ 0xD14
HEX_TO_BIN_2 equ 0x352 HEX_TO_BIN equ 0x184
HEX_TO_INVALID_2 equ 0x359 HEX_TO_BIN_2 equ 0x192
HEX_TO_INVALID_2 equ 0x199
IDE_CMD_IDENT equ 0xEC IDE_CMD_IDENT equ 0xEC
IDE_CMD_READSEC equ 0x20 IDE_CMD_READSEC equ 0x20
IDE_DEV_TABLE equ 0x1275
IDE_RD equ 0x40 IDE_RD equ 0x40
IDE_REG_ALTSTS equ 0x16 IDE_REG_ALTSTS equ 0x16
IDE_REG_CMDSTS equ 0x0F IDE_REG_CMDSTS equ 0x0F
@@ -55,12 +63,19 @@ IDE_REG_DRVADDR equ 0x17
IDE_REG_ERROR equ 0x09 IDE_REG_ERROR equ 0x09
IDE_REG_HCYL equ 0x0D IDE_REG_HCYL equ 0x0D
IDE_REG_HEAD equ 0x0E IDE_REG_HEAD equ 0x0E
IDE_REG_LBA0 equ 0x0B
IDE_REG_LBA1 equ 0x0C
IDE_REG_LBA2 equ 0x0D
IDE_REG_LBA3 equ 0x0E
IDE_REG_LCYL equ 0x0C IDE_REG_LCYL equ 0x0C
IDE_REG_SECTOR equ 0x0A IDE_REG_SECTOR equ 0x0A
IDE_REG_SSECTOR equ 0x0B IDE_REG_SSECTOR equ 0x0B
IDE_RST equ 0x80 IDE_RST equ 0x80
IDE_WR equ 0x20 IDE_WR equ 0x20
IIC_CLK equ 0x01
IIC_DATA equ 0x02
INT_VEC equ 0x1B INT_VEC equ 0x1B
IN_BUFFER equ 0x402B
IO_AY0_ADDR equ 0x40 IO_AY0_ADDR equ 0x40
IO_AY0_DATA equ 0x41 IO_AY0_DATA equ 0x41
IO_AY1_ADDR equ 0x42 IO_AY1_ADDR equ 0x42
@@ -82,277 +97,360 @@ IO_RTC_SEC1 equ 0x21
IO_RTC_WEEK equ 0x2C IO_RTC_WEEK equ 0x2C
IO_RTC_YEAR1 equ 0x2B IO_RTC_YEAR1 equ 0x2B
IO_RTC_YERR0 equ 0x2A IO_RTC_YERR0 equ 0x2A
Includes equ 0x27E MEM_IDE_BUFFER equ 0x4117
MEM_IDE_BASE equ 0x5000 MEM_IDE_DEVICE equ 0x402C
MEM_IDE_BUFFER equ 0x5041 MEM_IDE_DEV_TABLE equ 0x4036
MEM_IDE_DEVICE equ 0x5000 MEM_IDE_FSBUFFER equ 0x4317
MEM_IDE_PARTITION equ 0x5002 MEM_IDE_PARTITION equ 0x402E
MEM_IDE_POINTER equ 0x5006 MEM_IDE_POINTER equ 0x4032
MEM_IDE_STATUS equ 0x5001 MEM_IDE_SELECTED equ 0x4076
MEM_INT_VEC_T equ 0x40FE MEM_IDE_STATUS equ 0x402D
MEM_LOC_LOAD equ 0x4400 MEM_IDE_STRING_0 equ 0x4077
MEM_VAR_BLOCK equ 0x40FB MEM_IDE_STRING_1 equ 0x409F
MEM_VAR_TIMEA equ 0x40FC MEM_IDE_STRING_2 equ 0x40C7
MEM_VAR_TIMER equ 0x40FE MEM_IDE_STRING_3 equ 0x40EF
MSG_CLEAR equ 0x30A MSG_CLEAR equ 0x14A
MSG_ERROR equ 0x1048 NOT_IMPLEMENTED equ 0x1896
MSG_START equ 0x1061 OP_CALL equ 0x18F8
OP_CLR equ 0x1A8C
OP_DASM equ 0x1979
OP_DUMP equ 0x1918
OP_EXEC equ 0x18DF
OP_IIC_IN equ 0x1A40
OP_IIC_OUT equ 0x19E0
OP_IO_IN equ 0x19A9
OP_IO_OUT equ 0x19BF
OP_LSDSK equ 0x1CA1
OP_RTIME equ 0x1A90
OP_SELDSK equ 0x1CA5
OP_SET equ 0x1948
OP_STIME equ 0x1C28
POST_CHECK_APU equ 0x1D12
POST_CHECK_IDE_30 equ 0x1D3D
POST_CHECK_IDE_40 equ 0x1D50
POST_CHECK_PIO equ 0x1CED
POST_START equ 0x1CDD
POST_TEST_RTC equ 0x1D6A
PRG_RAM_START equ 0x4110 PRG_RAM_START equ 0x4110
PRG_RAM_TOP equ 0xFF00 PRG_RAM_TOP equ 0xFF00
PROG_MEM_START equ 0x4000 PROG_MEM_START equ 0x4000
PROG_ROM_START equ 0x100 PROG_ROM_START equ 0x100
PROMPT_BEGIN equ 0x99
PROMPT_BEGIN_READ_BACKSPACE equ 0xD6
PROMPT_BEGIN_READ_LOOP equ 0xA5
PROMPT_BEGIN_READ_PROCESS equ 0xFC
RST_00 equ 0x00 RST_00 equ 0x00
RST_08 equ 0x08 RST_08 equ 0x08
RST_10 equ 0x10 RST_10 equ 0x10
RST_18 equ 0x18 RST_18 equ 0x18
STACK_RAM_TOP equ 0xFFFF STACK_RAM_TOP equ 0xFFFF
START_ROM equ 0x00 START_ROM equ 0x00
STRCONV_BYTES_TO_HEX equ 0x35B STRCONV_BYTES_TO_HEX equ 0x19B
STRCONV_BYTES_TO_HEX_1 equ 0x36A STRCONV_BYTES_TO_HEX_1 equ 0x1AA
STRCONV_BYTES_TO_HEX_2 equ 0x374 STRCONV_BYTES_TO_HEX_2 equ 0x1B4
STR_Banner_Start equ 0x1360 STR_Banner_Start equ 0x1E6F
STR_HEXDUMP_HEADER equ 0x1390 STR_PD_HEADER equ 0x1724
STR_PD_HEADER equ 0x1319
STR_SyntaxError equ 0x1386
STR_Unknown equ 0x138B
SYM_ACK equ 0x06
SYM_C equ 0x43
SYM_CAN equ 0x18
SYM_EOT equ 0x04
SYM_ETB equ 0x17
SYM_NAK equ 0x15
SYM_SOH equ 0x01
SYS_BUF_START equ 0x4010 SYS_BUF_START equ 0x4010
SYS_RAM_START equ 0x4000 SYS_RAM_START equ 0x4000
VAR_CONSOLE_BAUD equ 0x18 VAR_CONSOLE_BAUD equ 0x18
VAR_CONSOLE_CONF equ 0x0F VAR_CONSOLE_CONF equ 0x0F
VDP_MEM equ 0x80 VDP_MEM equ 0x80
VDP_REG equ 0x81 VDP_REG equ 0x81
beep equ 0xED7 _COMMAND_PROCESS_FOUND equ 0x1895
beep_loop equ 0xEDA _OP_CALL equ 0x1917
beep_pause equ 0xEF7 _OP_IIC_ACK_ERR equ 0x1A25
dasm_00 equ 0xADC _OP_IIC_ACK_ERR_str equ 0x1A2C
dasm_01 equ 0xDC8 _OP_IIC_IN_LOOP equ 0x1A72
dasm_02 equ 0xB62 _OP_IIC_IN_LOOP_TEXT equ 0x1A7F
dasm_03 equ 0xD9A _OP_IIC_OUT_LOOP equ 0x19F6
dasm_08 equ 0xBDF _OP_IIC_OUT_SEND equ 0x1A12
dasm_09 equ 0xD6D _OP_RTIME_NN equ 0x1A93
dasm_0A equ 0xB44 _OP_RTIME_RD_CMD equ 0x1B4B
dasm_0B equ 0xDB1 _OP_SELDSK_INVALID equ 0x1CB4
dasm_10 equ 0xB24 _OP_SELDSK_INVALID_STR equ 0x1CC4
dasm_12 equ 0xB6D _OP_SET_LOOP equ 0x1960
dasm_18 equ 0xAE7 _OP_STIME_INVALID equ 0x1BEE
dasm_1A equ 0xB4E _OP_STIME_PROMPT equ 0x1C05
dasm_20 equ 0xB01 _OP_STIME_PROMPT_ERR equ 0x1C1D
dasm_22 equ 0xE0E _OP_STIME_STR_DAY equ 0x1B4C
dasm_27 equ 0xBA7 _OP_STIME_STR_HOUR equ 0x1B9D
dasm_28 equ 0xAFA _OP_STIME_STR_MIN equ 0x1BB8
dasm_2A equ 0xDDF _OP_STIME_STR_MON equ 0x1B67
dasm_2F equ 0xBAB _OP_STIME_STR_SEC equ 0x1BD3
dasm_30 equ 0xAF2 _OP_STIME_STR_YEAR equ 0x1B82
dasm_32 equ 0xB78 _POST_CHECK_APU_FAILED equ 0x1D31
dasm_37 equ 0xBB7 _POST_CHECK_IDE_FAILED equ 0x1D63
dasm_38 equ 0xAEB _POST_CHECK_PIO_FAILED equ 0x1D06
dasm_3A equ 0xB58 _POST_TEST_RTC_INVALID equ 0x1DA4
dasm_3F equ 0xBB3 _POST_TEST_RTC_NOTFOUND equ 0x1D9D
dasm_76 equ 0xBBB _STR_NOT_FOUND equ 0x18B8
dasm_80C6 equ 0xC38 _STR_NOT_IMPLEMENTED equ 0x18A4
dasm_BE equ 0xBD5 _STR_SYNTAX equ 0x18CC
dasm_C3 equ 0xAE0 _beep_pause_l1 equ 0xD30
dasm_C88E equ 0xC5E _ideif_init_drive_found equ 0x13E9
dasm_C9 equ 0xB30 _ideif_init_drive_loop equ 0x13D1
dasm_CD equ 0xB2A _ideif_init_drive_nodrv equ 0x13E4
dasm_D9 equ 0xBEC _ideif_init_drive_prt_fnd equ 0x1454
dasm_DD equ 0xB12 _ideif_init_drive_prt_l1 equ 0x1442
dasm_DD_01 equ 0xDCF _ideif_init_drive_prt_ln equ 0x144C
dasm_DD_09 equ 0xD88 _ideif_prnt_devtable_hdr equ 0x1510
dasm_DD_22 equ 0xE24 _ideif_prnt_devtable_l1 equ 0x12E1
dasm_DD_23 equ 0xD9F _ideif_prnt_devtable_l1_e2 equ 0x13A7
dasm_DD_2A equ 0xDF6 _ideif_prnt_devtable_l1_es equ 0x1326
dasm_DD_2B equ 0xDB6 _ideif_prnt_devtable_l1_ms equ 0x13A4
dasm_DD_34 equ 0xD38 _ideif_prnt_devtable_l1_nxt equ 0x12EE
dasm_DD_35 equ 0xD55 _ideif_prnt_devtable_l1_s00 equ 0x1314
dasm_DD_86 equ 0xC40 _ideif_prnt_devtable_l1_s01 equ 0x1319
dasm_DD_8E equ 0xC66 _ideif_prnt_devtable_l1_s02 equ 0x131E
dasm_DD_96 equ 0xC89 _ideif_prnt_devtable_l1_sFF equ 0x1323
dasm_DD_9E equ 0xCA9 _ideif_prnt_devtable_l1_sel equ 0x12EC
dasm_DD_A6 equ 0xCCA _ideif_prnt_devtable_master equ 0x1574
dasm_DD_AE equ 0xD01 _ideif_prnt_devtable_s00 equ 0x1548
dasm_DD_B6 equ 0xCE6 _ideif_prnt_devtable_s01 equ 0x1553
dasm_DD_BE equ 0xD1D _ideif_prnt_devtable_s02 equ 0x155E
dasm_DD_E1 equ 0xE76 _ideif_prnt_devtable_sFF equ 0x1569
dasm_DD_E3 equ 0xBFC _ideif_prnt_devtable_slave equ 0x157C
dasm_DD_E5 equ 0xE60 _read_bcd_invalid equ 0x147
dasm_DD_F9 equ 0xE46 _shift4 equ 0x1C9C
dasm_E1 equ 0xE70 beep equ 0xD17
dasm_E3 equ 0xBF0 beep_loop equ 0xD19
dasm_E5 equ 0xE5A beep_pause equ 0xD2F
dasm_E9 equ 0xB09 dasm_00 equ 0x91C
dasm_ED_42 equ 0xD7F dasm_01 equ 0xC08
dasm_ED_43 equ 0xE1A dasm_02 equ 0x9A2
dasm_ED_44 equ 0xBAF dasm_03 equ 0xBDA
dasm_ED_45 equ 0xB3A dasm_08 equ 0xA1F
dasm_ED_46 equ 0xBC6 dasm_09 equ 0xBAD
dasm_ED_4A equ 0xD76 dasm_0A equ 0x984
dasm_ED_4B equ 0xDEB dasm_0B equ 0xBF1
dasm_ED_4D equ 0xB35 dasm_10 equ 0x964
dasm_ED_56 equ 0xBCB dasm_12 equ 0x9AD
dasm_ED_5E equ 0xBD0 dasm_18 equ 0x927
dasm_ED_A0 equ 0xC14 dasm_1A equ 0x98E
dasm_ED_A1 equ 0xC26 dasm_20 equ 0x941
dasm_ED_A8 equ 0xC1D dasm_22 equ 0xC4E
dasm_ED_A9 equ 0xC2F dasm_27 equ 0x9E7
dasm_ED_B0 equ 0xC18 dasm_28 equ 0x93A
dasm_ED_B1 equ 0xC2A dasm_2A equ 0xC1F
dasm_ED_B8 equ 0xC21 dasm_2F equ 0x9EB
dasm_ED_B9 equ 0xC33 dasm_30 equ 0x932
dasm_F3 equ 0xBC0 dasm_32 equ 0x9B8
dasm_F9 equ 0xE3C dasm_37 equ 0x9F7
dasm_FB equ 0xBC3 dasm_38 equ 0x92B
dasm_FD equ 0xB1B dasm_3A equ 0x998
dasm_FD_01 equ 0xDD7 dasm_3F equ 0x9F3
dasm_FD_09 equ 0xD91 dasm_76 equ 0x9FB
dasm_FD_22 equ 0xE30 dasm_80C6 equ 0xA78
dasm_FD_23 equ 0xDA8 dasm_BE equ 0xA15
dasm_FD_2A equ 0xE02 dasm_C3 equ 0x920
dasm_FD_2B equ 0xDBF dasm_C88E equ 0xA9E
dasm_FD_34 equ 0xD44 dasm_C9 equ 0x970
dasm_FD_35 equ 0xD61 dasm_CD equ 0x96A
dasm_FD_86 equ 0xC4F dasm_D9 equ 0xA2C
dasm_FD_8E equ 0xC75 dasm_DD equ 0x952
dasm_FD_96 equ 0xC95 dasm_DD_01 equ 0xC0F
dasm_FD_9E equ 0xCB7 dasm_DD_09 equ 0xBC8
dasm_FD_A6 equ 0xCD6 dasm_DD_22 equ 0xC64
dasm_FD_AE equ 0xD0D dasm_DD_23 equ 0xBDF
dasm_FD_B6 equ 0xCF1 dasm_DD_2A equ 0xC36
dasm_FD_BE equ 0xD28 dasm_DD_2B equ 0xBF6
dasm_FD_E1 equ 0xE7E dasm_DD_34 equ 0xB78
dasm_FD_E3 equ 0xC08 dasm_DD_35 equ 0xB95
dasm_FD_E5 equ 0xE68 dasm_DD_86 equ 0xA80
dasm_FD_F9 equ 0xE50 dasm_DD_8E equ 0xAA6
dasm_FF equ 0xB3F dasm_DD_96 equ 0xAC9
dasm_UU equ 0xE86 dasm_DD_9E equ 0xAE9
dasm_UW equ 0xE8A dasm_DD_A6 equ 0xB0A
dasm__AND equ 0xCC5 dasm_DD_AE equ 0xB41
dasm__CP equ 0xD19 dasm_DD_B6 equ 0xB26
dasm__DEC equ 0xD50 dasm_DD_BE equ 0xB5D
dasm__ED_47 equ 0xB97 dasm_DD_E1 equ 0xCB6
dasm__ED_4F equ 0xB9F dasm_DD_E3 equ 0xA3C
dasm__ED_57 equ 0xB87 dasm_DD_E5 equ 0xCA0
dasm__ED_5F equ 0xB8F dasm_DD_F9 equ 0xC86
dasm__INC equ 0xD33 dasm_E1 equ 0xCB0
dasm__LD equ 0xB83 dasm_E3 equ 0xA30
dasm__OR equ 0xCE2 dasm_E5 equ 0xC9A
dasm__SBC equ 0xCA1 dasm_E9 equ 0x949
dasm__SUB equ 0xC84 dasm_ED_42 equ 0xBBF
dasm__XOR equ 0xCFC dasm_ED_43 equ 0xC5A
dasm_opcode_table equ 0x684 dasm_ED_44 equ 0x9EF
dasm_print16hex_addr equ 0x4B1 dasm_ED_45 equ 0x97A
dasm_print8hex equ 0x4C9 dasm_ED_46 equ 0xA06
dasm_printFlags_table equ 0xE8F dasm_ED_4A equ 0xBB6
dasm_printRegister8_table equ 0xE9F dasm_ED_4B equ 0xC2B
dasm_printRegister8_table_HL equ 0xEBF dasm_ED_4D equ 0x975
dasm_printRegisterIX_table equ 0xEA7 dasm_ED_56 equ 0xA0B
dasm_printRegisterIY_table equ 0xEAF dasm_ED_5E equ 0xA10
dasm_printRegisterSP_table equ 0xEB7 dasm_ED_A0 equ 0xA54
disassemble equ 0x375 dasm_ED_A1 equ 0xA66
disassemble_continue equ 0x45B dasm_ED_A8 equ 0xA5D
disassemble_err equ 0x44B dasm_ED_A9 equ 0xA6F
disassemble_next equ 0x379 dasm_ED_B0 equ 0xA58
disassemble_print_opcode_params_end equ 0x448 dasm_ED_B1 equ 0xA6A
disassemble_print_opcode_params_loop equ 0x3F4 dasm_ED_B8 equ 0xA61
disassemble_print_opcode_raw equ 0x3B6 dasm_ED_B9 equ 0xA73
disassemble_print_opcode_raw_fill equ 0x3CA dasm_F3 equ 0xA00
disassemble_table_first_match equ 0x48D dasm_F9 equ 0xC7C
disassemble_table_found equ 0x4A7 dasm_FB equ 0xA03
disassemble_table_notfound equ 0x4AB dasm_FD equ 0x95B
disassemble_table_seek equ 0x469 dasm_FD_01 equ 0xC17
disassemble_table_seek_loop equ 0x46D dasm_FD_09 equ 0xBD1
dump_pretty equ 0x12BE dasm_FD_22 equ 0xC70
dump_pretty_ascii equ 0x12E8 dasm_FD_23 equ 0xBE8
dump_pretty_ascii_cont equ 0x1306 dasm_FD_2A equ 0xC42
dump_pretty_ascii_loop equ 0x12F0 dasm_FD_2B equ 0xBFF
dump_pretty_ascii_none equ 0x1301 dasm_FD_34 equ 0xB84
dump_pretty_col equ 0x12DB dasm_FD_35 equ 0xBA1
dump_pretty_end equ 0x1318 dasm_FD_86 equ 0xA8F
dump_pretty_nextrow equ 0x130C dasm_FD_8E equ 0xAB5
dump_pretty_row equ 0x12C6 dasm_FD_96 equ 0xAD5
ide_printerror equ 0x116E dasm_FD_9E equ 0xAF7
ide_readsector_256 equ 0x10ED dasm_FD_A6 equ 0xB16
ide_readsector_256_done equ 0x111C dasm_FD_AE equ 0xB4D
ide_readsector_256_waitloop equ 0x10EF dasm_FD_B6 equ 0xB31
ide_readsector_512_inv equ 0x111D dasm_FD_BE equ 0xB68
ide_readsector_512_inv_waitloop equ 0x1122 dasm_FD_E1 equ 0xCBE
ide_readsector_timeout equ 0x1158 dasm_FD_E3 equ 0xA48
ide_regread_8 equ 0x10CF dasm_FD_E5 equ 0xCA8
ide_regwrite_8 equ 0x10B3 dasm_FD_F9 equ 0xC90
ide_reset equ 0x10A6 dasm_FF equ 0x97F
ide_writesector_256 equ 0x116D dasm_UU equ 0xCC6
ideif_init_drive equ 0x11F4 dasm_UW equ 0xCCA
ideif_init_drive_detected equ 0x1222 dasm__AND equ 0xB05
ideif_init_drive_loop1 equ 0x1208 dasm__CP equ 0xB59
ideif_init_drive_nodrv equ 0x121B dasm__DEC equ 0xB90
mon_start_complete equ 0x7B dasm__ED_47 equ 0x9D7
mon_start_init_ctc equ 0x50 dasm__ED_4F equ 0x9DF
mon_start_init_serial equ 0x64 dasm__ED_57 equ 0x9C7
mon_start_init_sound equ 0x50 dasm__ED_5F equ 0x9CF
mon_start_ram equ 0x67 dasm__INC equ 0xB73
mon_start_ram_loop equ 0x70 dasm__LD equ 0x9C3
dasm__OR equ 0xB22
dasm__SBC equ 0xAE1
dasm__SUB equ 0xAC4
dasm__XOR equ 0xB3C
dasm_opcode_table equ 0x4C4
dasm_print16hex_addr equ 0x2F1
dasm_print8hex equ 0x309
dasm_printFlags_table equ 0xCCF
dasm_printRegister8_table equ 0xCDF
dasm_printRegister8_table_HL equ 0xCFF
dasm_printRegisterIX_table equ 0xCE7
dasm_printRegisterIY_table equ 0xCEF
dasm_printRegisterSP_table equ 0xCF7
disassemble equ 0x1B5
disassemble_continue equ 0x29B
disassemble_err equ 0x28B
disassemble_next equ 0x1B9
disassemble_print_opcode_params_end equ 0x288
disassemble_print_opcode_params_loop equ 0x234
disassemble_print_opcode_raw equ 0x1F6
disassemble_print_opcode_raw_fill equ 0x20A
disassemble_table_first_match equ 0x2CD
disassemble_table_found equ 0x2E7
disassemble_table_notfound equ 0x2EB
disassemble_table_seek equ 0x2A9
disassemble_table_seek_loop equ 0x2AD
dump_pretty equ 0x16C9
dump_pretty_ascii equ 0x16F3
dump_pretty_ascii_cont equ 0x1711
dump_pretty_ascii_loop equ 0x16FB
dump_pretty_ascii_none equ 0x170C
dump_pretty_col equ 0x16E6
dump_pretty_end equ 0x1723
dump_pretty_nextrow equ 0x1717
dump_pretty_row equ 0x16D1
ide_printerror equ 0xE04
ide_readsector_256 equ 0xD83
ide_readsector_256_done equ 0xDB2
ide_readsector_256_waitloop equ 0xD85
ide_readsector_512_inv equ 0xDB3
ide_readsector_512_inv_waitloop equ 0xDB8
ide_readsector_timeout equ 0xDEE
ide_regread_8 equ 0xD65
ide_regwrite_8 equ 0xD49
ide_reset equ 0xD3C
ide_writesector_256 equ 0xE03
ideif_get_drv_pointer equ 0x1497
ideif_init_all equ 0x14AB
ideif_init_devtable equ 0x12B5
ideif_init_drive equ 0x13C8
ideif_prnt_devtable equ 0x12D3
iic_init equ 0x15DD
iic_read_ack equ 0x161C
iic_receive_buffer equ 0x15AE
iic_receive_buffer_done equ 0x15D1
iic_receive_buffer_err equ 0x15D7
iic_receive_buffer_loop equ 0x15BF
iic_receive_byte equ 0x16A2
iic_receive_byte_loop equ 0x16AF
iic_send_ack equ 0x1642
iic_send_buffer equ 0x1584
iic_send_buffer_done equ 0x15A2
iic_send_buffer_err equ 0x15A8
iic_send_buffer_loop equ 0x1594
iic_send_byte equ 0x167C
iic_send_byte_loop equ 0x1688
iic_send_ebit equ 0x15FB
iic_send_nack equ 0x165F
iic_send_sbit equ 0x15E6
mon_var_template equ 0x44 mon_var_template equ 0x44
mon_var_template_end equ 0x6E mon_var_template_end equ 0x370
param_01 equ 0x4D7 param_01 equ 0x317
param_02 equ 0x4FE param_02 equ 0x33E
param_03 equ 0x51B param_03 equ 0x35B
param_03_done equ 0x553 param_03_done equ 0x393
param_03_neg equ 0x53C param_03_neg equ 0x37C
param_04 equ 0x557 param_04 equ 0x397
param_04_i equ 0x567 param_04_i equ 0x3A7
param_05 equ 0x56D param_05 equ 0x3AD
param_06 equ 0x57A param_06 equ 0x3BA
param_07 equ 0x594 param_07 equ 0x3D4
param_08 equ 0x5A1 param_08 equ 0x3E1
param_09 equ 0x5B6 param_09 equ 0x3F6
param_09_0A equ 0x5BC param_09_0A equ 0x3FC
param_0A equ 0x5AD param_0A equ 0x3ED
param_10 equ 0x5CB param_10 equ 0x40B
param_11 equ 0x5DB param_11 equ 0x41B
param_11_12 equ 0x5EA param_11_12 equ 0x42A
param_11_12_all equ 0x60A param_11_12_all equ 0x44A
param_11_12_def equ 0x5FD param_11_12_def equ 0x43D
param_11_12_ix equ 0x602 param_11_12_ix equ 0x442
param_11_12_iy equ 0x607 param_11_12_iy equ 0x447
param_12 equ 0x5E3 param_12 equ 0x423
param_13 equ 0x61B param_13 equ 0x45B
param_80 equ 0x63A param_80 equ 0x47A
param_80_seek equ 0x641 param_80_seek equ 0x481
param_81 equ 0x631 param_81 equ 0x471
param_comma equ 0x675 param_comma equ 0x4B5
param_printRegister equ 0x650 param_printRegister equ 0x490
param_printRegisterA equ 0x66E param_printRegisterA equ 0x4AE
param_printRegisterHL equ 0x666 param_printRegisterHL equ 0x4A6
print_a_hex equ 0x2E7 print_a_hex equ 0x107
print_char equ 0x2B7 print_bcd equ 0x119
print_clear equ 0x2CA print_char equ 0xD7
print_newLine equ 0x2D1 print_clear equ 0xEA
print_str equ 0x2BF print_newLine equ 0xF1
print_str_end equ 0x2C9 print_str equ 0xDF
print_str_fixed equ 0x1358 print_str_end equ 0xE9
print_wait_out equ 0x2DC print_str_fixed equ 0x1763
read_char equ 0x2F8 print_wait_out equ 0xFC
read_lba_sector equ 0x1256 read_bcd equ 0x131
str_dev_notfound equ 0x12B3 read_char equ 0x11F
str_dev_ready equ 0x129D read_lba_sector equ 0x14BE
str_dev_ready2 equ 0x12AA str_dev_done equ 0x1508
str_dev_waitready equ 0x1289 str_dev_waitready equ 0x14F0
str_error_start equ 0x11A1 str_error_start equ 0xE37
str_error_start1 equ 0x11BE str_error_start1 equ 0xE54
str_error_start2 equ 0x11C7 str_error_start2 equ 0xE5D
str_error_time equ 0x11D0 str_error_time equ 0xE66
var_buffer equ 0x4029 str_post_apu equ 0x1DFC
str_post_ide_30 equ 0x1DAB
str_post_ide_40 equ 0x1DC6
str_post_nd equ 0x1E32
str_post_ok equ 0x1E6A
str_post_pio equ 0x1DE1
str_post_rtc equ 0x1E17
str_post_rtc_iv equ 0x1E40
var_apu_present equ 0x400A
var_buffer equ 0x402B
var_buffer_len equ 0x4000 var_buffer_len equ 0x4000
var_bytes_count equ 0x411A var_bytes_count equ 0x411A
var_curserchar equ 0x4006 var_curserchar equ 0x4006
@@ -361,6 +459,7 @@ var_curseron equ 0x4005
var_curserstate equ 0x4004 var_curserstate equ 0x4004
var_curserx equ 0x4002 var_curserx equ 0x4002
var_cursery equ 0x4003 var_cursery equ 0x4003
var_idebuffer equ 0x402C
var_last_char equ 0x4001 var_last_char equ 0x4001
var_opcode equ 0x4114 var_opcode equ 0x4114
var_opcode_length equ 0x4116 var_opcode_length equ 0x4116
@@ -369,26 +468,6 @@ var_opcode_start equ 0x4110
var_opcode_string equ 0x4117 var_opcode_string equ 0x4117
var_opcode_table equ 0x4112 var_opcode_table equ 0x4112
var_opcode_x equ 0x4115 var_opcode_x equ 0x4115
var_ps2mem equ 0x4019 var_pio_present equ 0x4009
var_scratch equ 0x4009 var_ps2mem equ 0x401B
xmodem_ack equ 0x107B var_scratch equ 0x400B
xmodem_await_conn equ 0xF34
xmodem_end equ 0xFDF
xmodem_err equ 0xFA5
xmodem_init equ 0xF06
xmodem_int equ 0xFE6
xmodem_int_cont equ 0x1005
xmodem_nak equ 0x1089
xmodem_out equ 0x1037
xmodem_packet equ 0xF3F
xmodem_packet_EOT equ 0xF9D
xmodem_packet_get equ 0xF51
xmodem_packet_get_crc equ 0xF8A
xmodem_packet_get_data equ 0xF7B
xmodem_read_timeount equ 0x03
xmodem_read_wait equ 0x100A
xmodem_read_wait_loop equ 0x1018
xmodem_read_wait_timeout equ 0x1035
xmodem_wait equ 0x1097
xmodem_wait_1 equ 0x109D
xmodem_wait_out equ 0x103D

View File

@@ -1,21 +1,55 @@
; VARS ; VARS
MEM_FAT_RESERVED .EQU MEM_IDE_BASE + 10 ; Reserved sectors (2byte) phase MEM_IDE_FSBUFFER
MEM_FAT_AMOUNT .EQU MEM_IDE_BASE + 12 ; Amount of FATs (1byte) MEM_FAT_RESERVED: ; Reserved sectors (2byte)
MEM_FAT_SECTORS .EQU MEM_IDE_BASE + 13 ; Length of FAT (2byte) defs 2
MEM_FAT_AMOUNT: ; Amount of FATs (1byte)
defs 1
MEM_FAT_SECTORS: ; Length of FAT (2byte)
defs 2
MEM_FAT_COUNT1: ; Counter Var for reading FAT (2byte)
defs 1
MEM_FAT_TMPPOINTER: ; Temporary working pointer
defs 4
MEM_FAT_TMPPOINTER1: ; Temporary working pointer
defs 4
MEM_FAT_TMPFNAME: ; Temporary filename
defs 16
MEM_FAT_COUNT1 .EQU MEM_IDE_BASE + 15 ;Counter Var for reading FAT (2byte) MEM_FAT_OF0_CCLUST: ;Current cluster of file
defw 0
MEM_FAT_OF0_FATSEC: ;Current sector in FAT
defs 4
MEM_FAT_OF0_DATSEC: ;Current sector in Data
defs 4
MEM_FAT_OF0_DATREM: ;Remaining sector in Data
defs 2
dephase
;------------------------------------- ;-------------------------------------
; Get FAT Root-Table position ; Get FAT Root-Table position
;------------------------------------- ;-------------------------------------
fat_get_root_table: fat_get_root_table:
call fat_reset_pointer ;reset fat pointer call fat_reset_pointer ;reset fat pointer
;call fat_print_dbg
; Load first sector on active partition ; Load first sector on active partition
LD HL, MEM_IDE_PARTITION ; pointer to LBA address LD HL, MEM_IDE_POINTER ; pointer to LBA address
LD A,1 ;read 1 sector LD A,1 ;read 1 sector
call read_lba_sector call read_lba_sector
; check for valid Boot sector
ld a,(MEM_IDE_BUFFER)
cp 0xEB ;first byte should be 0xEB
jp nz, _fat_get_root_table_invalid
;debug sector
;ld hl, MEM_IDE_BUFFER
;ld b,20
;call dump_pretty
; Read and store FS Properties ; Read and store FS Properties
LD IX,MEM_IDE_BUFFER LD IX,MEM_IDE_BUFFER
LD A,(IX+0x0E) LD A,(IX+0x0E)
@@ -53,14 +87,17 @@ _fat_get_root_table_loop: ; multiply
call _fat_math_sector_add_16 call _fat_math_sector_add_16
ret ret
_fat_get_root_table_invalid:
call PRINTINLINE
db 10,13,"Cannot find boot sector.",10,13,0
call ideif_get_drv_pointer
ld (ix+0),0x02
ret
;------------------------------------- ;-------------------------------------
; Print current fat directory of MEM_IDE_POINTER ; Print current fat directory of MEM_IDE_POINTER
;------------------------------------- ;-------------------------------------
fat_print_directory: fat_print_directory:
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
LD DE,(MEM_FAT_SECTORS) LD DE,(MEM_FAT_SECTORS)
LD (MEM_FAT_COUNT1),DE LD (MEM_FAT_COUNT1),DE
@@ -68,20 +105,36 @@ fat_print_directory:
LD B,1 LD B,1
call read_lba_sector call read_lba_sector
call PRINTINLINE
db 10,13," Filename Cluster Size",10,13,0
LD HL, MEM_IDE_BUFFER ;set buffer start LD HL, MEM_IDE_BUFFER ;set buffer start
LD C,16 ;set entries counter LD C,16 ;set entries counter
_fat_print_directory_loop: ;loop over each entry (32byte) _fat_print_directory_loop: ;loop over each entry (32byte)
LD A,(HL) ; check first byte LD A,(HL) ; check first byte
PUSH HL ;backup start of entry PUSH HL ;backup start of entry
POP IX
PUSH HL
;ignore unwanted entries ;ignore unwanted entries
CP 0x41 ;skip invisible CP 0x41 ;skip invisible
JR Z, _fat_print_directory_loop_next JP Z, _fat_print_directory_loop_next
CP 0xE5 ;skip deleted CP 0xE5 ;skip deleted
JR Z, _fat_print_directory_loop_next JP Z, _fat_print_directory_loop_next
CP 0x00 ;reached end CP 0x00 ;reached end
JP Z, _fat_print_directory_loop_break JP Z, _fat_print_directory_loop_break
;check file attribute
ld a,(IX+0x0B)
cp 0x10 ;if subdirectors
jp z, _fat_print_directory_dir ;print dir
;else print file
_fat_print_directory_loop_file
;print filename ;print filename
ld a,' '
call print_char
ld a,' '
call print_char
LD B,8 LD B,8
call print_str_fixed call print_str_fixed
ld A,'.' ld A,'.'
@@ -89,14 +142,49 @@ _fat_print_directory_loop: ;loop over each entry (32byte)
LD B,3 LD B,3
call print_str_fixed call print_str_fixed
LD A,(HL) ; print attribute call PRINTINLINE
call print_char db " 0x",0
;first cluster number
ld a,(ix+0x1B)
call print_a_hex
ld a,(ix+0x1A)
call print_a_hex
call PRINTINLINE
db " 0x",0
ld a,(ix+0x1F)
call print_a_hex
ld a,(ix+0x1E)
call print_a_hex
ld a,(ix+0x1D)
call print_a_hex
ld a,(ix+0x1C)
call print_a_hex
LD A,10 ;New line LD A,10 ;New line
CALL print_char CALL print_char
LD A,13 LD A,13
CALL print_char CALL print_char
jr _fat_print_directory_loop_next
_fat_print_directory_dir
ld a,'D'
call print_char
ld a,' '
call print_char
LD B,8
call print_str_fixed
call PRINTINLINE
db " 0x",0
;first cluster number
ld a,(ix+0x1B)
call print_a_hex
ld a,(ix+0x1A)
call print_a_hex
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
jr _fat_print_directory_loop_next
_fat_print_directory_loop_next: ; read next entry _fat_print_directory_loop_next: ; read next entry
DEC C ;next sector after 32 entries DEC C ;next sector after 32 entries
@@ -130,12 +218,12 @@ _fat_print_directory_loop_next_sector: ; end fo sector. read next sector from d
_fat_print_directory_loop_break _fat_print_directory_loop_break
POP HL POP HL
_fat_print_directory_loop_break_dirty _fat_print_directory_loop_break_dirty
ld hl, [str_sum] ; ld hl, [str_sum]
call print_str ;print ; call print_str ;print
ld a,c ; ld a,c
call print_a_hex ; call print_a_hex
ld hl, [str_files] ; ld hl, [str_files]
call print_str ;print ; call print_str ;print
ret ret
;------------------------------------- ;-------------------------------------
@@ -145,7 +233,7 @@ _fat_print_directory_loop_break_dirty
;------------------------------------- ;-------------------------------------
fat_lfs: fat_lfs:
PUSH DE PUSH DE
LD HL,MEM_IDE_BASE + 17 ; prepare filename LD HL,[MEM_FAT_TMPFNAME] ; prepare filename
CALL format_filename_fat16 CALL format_filename_fat16
LD A,16 ;init counter for FAT sectors LD A,16 ;init counter for FAT sectors
@@ -216,27 +304,79 @@ _fat_lfs_loop_compare_match:
; 32 Bit addition to pointer ; 32 Bit addition to pointer
; HL has value ; HL has value
_fat_math_sector_add_16: _fat_math_sector_add_16:
LD IX,MEM_IDE_POINTER; LOAD IX to sector pointer in memory ld (MEM_FAT_TMPPOINTER), hl
LD A,L xor a
ADD A,(IX+3) ld (MEM_FAT_TMPPOINTER+2),a
LD (IX+3),A ld (MEM_FAT_TMPPOINTER+3),a
JR NC, _fat_math_sector_add_16_2 ;if no carry, continue
LD A,1
ADD A,(IX+2)
_fat_math_sector_add_16_2:
LD A,h
ADD A,(IX+2)
LD (IX+2),A
RET NC ;done when no carry
LD A,1
ADD A,(IX+1)
LD (IX+1),A
RET
; reset LBA pointer to first sector in partition ld de,[MEM_FAT_TMPPOINTER]
ld bc,[MEM_IDE_POINTER]
call _fat_math_add32
ret
;bc contains pointer to a (also result)
;de contains pointer to b
_fat_math_add32
push hl
push bc
push de
ld a,(de) ; load lower 16bit for B int from (DE) to HL
ld l,a
inc de
ld a,(de)
ld h,a
inc de
; HL, DE dirty
ld a,(bc) ; load lower 16bit for A int from (BC) to DE
ld e,a
inc bc
ld a,(bc)
ld d,a
; HL now contains A, DE now contains D
add hl,de ;add lower bytes, store carry
pop de ;restore pointers
pop bc ;both now cointain first byte of long-value
ld a,l ;store lower result in (bc)
ld (bc),a
inc bc
ld a,h
ld (bc),a
inc bc
inc de ;also increment de to next byte
inc de
; DE and HL now start at the upper byte
push bc
push de
ld a,(de) ; load upper 16bit for B
ld l,a
inc de
ld a,(de)
ld h,a
inc de
ld a,(bc) ; load upper 16bit for A
ld e,a
inc bc
ld a,(bc)
ld d,a
adc hl,de ;add upper bytes, store carry
pop de
pop bc
ld a,l ;store lower result in (bc)
ld(bc),a
inc bc
ld a,h
ld(bc),a
pop hl
ret
; reset LBA pointer to first sector in selected partition
fat_reset_pointer: fat_reset_pointer:
LD HL,MEM_IDE_PARTITION call ideif_get_drv_pointer
LD DE,MEM_IDE_POINTER inc ix
inc ix
push ix
pop hl ;copy poiter to hl
ld de, MEM_IDE_POINTER
jr fat_copy_lba_pointer jr fat_copy_lba_pointer
; resets LBA pointer (4-byte) to partition start ; resets LBA pointer (4-byte) to partition start

View File

@@ -0,0 +1,69 @@
;1. find sector for given cluster
;2. read sector
;3. store first data sector to MEM_FAT_OF0_DATSEC
;4. set MEM_FAT_OF0_DATREM to amount uf sectors per cluster
;5. find next cluster in FAt and update MEM_FAT_OF0_CCLUST
; gets sector in FAT table for the cluster stored in MEM_FAT_OF0_CCLUST
; store result in MEM_FAT_OF0_FATSEC
; stores next cluster in MEM_FAT_OF0_CCLUST
fat_getfatsec:
ld HL,(MEM_FAT_OF0_CCLUST) ;load cluster
;each sector contains 256 clusters
;first 8bits are not needed (/256)
ld a,h ;divide by 256
ld l,a
xor a
ld h,a
ld bc,(MEM_FAT_RESERVED) ;add reserved sectors
add hl,bc
ld(MEM_FAT_OF0_FATSEC+0),hl;store sector to MEM_FAT_TMPPOINTER1
xor a
ld(MEM_FAT_OF0_FATSEC+2),a
ld(MEM_FAT_OF0_FATSEC+3),a
call ideif_get_drv_pointer
inc ix
inc ix
push ix
pop de ;copy poiter to hl
ld bc,[MEM_FAT_OF0_FATSEC]
call _fat_math_add32 ;MEM_FAT_OF0_FATSEC now contains the correct sector
;in the FAT
call fat_print_dbg
;read FAT sector
ld hl,MEM_FAT_OF0_FATSEC ;read next sector
ld b,1
call read_lba_sector
ld hl, MEM_IDE_BUFFER
ld b,20
call dump_pretty
;calculate offset address
ld a,(MEM_FAT_OF0_CCLUST)
RLA ;shift to left (x2)
ld l, a
ld a,0
RLA ;shift in carry flag
ld h,a
ld de,MEM_IDE_BUFFER
add hl,de
;copy pointer
ld de,MEM_FAT_OF0_CCLUST
ldi ;copy byte for next cluster from FAT
ldi
call fat_print_dbg
ret
;store data

View File

@@ -1,141 +1,170 @@
.include "extern_symbols.s" ;include monitor symbols. .include "extern_symbols.s" ;include monitor symbols.
org 0xB000 org 0x8000
;Testing code
;LD HL,MEM_IDE_BUFFER sel_dsk:
;LD B,32 call ideif_drv_sel
;call dump_pretty call fat_print_dbg
call find_partition ret
;call fat_get_root_table
;call fat_print_directory
call fat_get_root_table org 0x8010
LD DE, [str1] call fat_print_dbg
CALL fat_lfs ret
JP PROMPT_BEGIN org 0x8020
call fat_print_directory
ret
str1: org 0x8030
db "ILLUSION.PSG",0 ld hl,0x0006
str2: ld (MEM_FAT_OF0_CCLUST),hl
db "HALLOWLT.TXT",0 call fat_getfatsec
str3: ret
db "TEST",0
str4:
db ".ORG",0
delay_small: fat_print_dbg:
PUSH AF call PRINTINLINE
POP AF db 10,13,"PTR.MEM_IDE_POINTER: 0x",0
ld ix,MEM_IDE_POINTER
call print_32_hex
call PRINTINLINE
db " | PTR.MEM_IDE_PARTITION: 0x",0
ld ix,MEM_IDE_PARTITION
call print_32_hex
call PRINTINLINE
db 10,13,"PTR.MEM_FAT_TMPPOINTER: 0x",0
ld ix,MEM_FAT_TMPPOINTER
call print_32_hex
call PRINTINLINE
db " | PTR.MEM_FAT_TMPPOINTER1: 0x",0
ld ix,MEM_FAT_TMPPOINTER1
call print_32_hex
call PRINTINLINE
db 10,13,"VAL.MEM_FAT_RESERVED: 0x",0
ld ix,MEM_FAT_RESERVED
call print_16_hex
call PRINTINLINE
db " | VAL.MEM_FAT_AMOUNT: 0x",0
ld a,(MEM_FAT_AMOUNT)
call print_a_hex
call PRINTINLINE
db 10,13,"VAL.MEM_FAT_SECTORS: 0x",0
ld ix,MEM_FAT_SECTORS
call print_16_hex
call PRINTINLINE
db " | VAL.MEM_FAT_COUNT1: 0x",0
ld a,(MEM_FAT_COUNT1)
call print_a_hex
call PRINTINLINE
db 10,13,"VAL.MEM_FAT_OF0_CCLUST: 0x",0
ld ix,MEM_FAT_OF0_CCLUST
call print_16_hex
call PRINTINLINE
db " | PTR.MEM_FAT_OF0_FATSEC: 0x",0
ld ix,MEM_FAT_OF0_FATSEC
call print_32_hex
call PRINTINLINE
db 10,13,"VAL.MEM_FAT_OF0_DATSEC: 0x",0
ld ix,MEM_FAT_OF0_DATSEC
call print_32_hex
call PRINTINLINE
db " | PTR.MEM_FAT_OF0_DATREM: 0x",0
ld ix,MEM_FAT_OF0_DATREM
call print_16_hex
call print_newLine
ret
print_32_hex:
ld a,(ix+3)
call print_a_hex
ld a,(ix+2)
call print_a_hex
ld a,(ix+1)
call print_a_hex
ld a,(ix+0)
call print_a_hex
ret
print_16_hex:
ld a,(ix+1)
call print_a_hex
ld a,(ix+0)
call print_a_hex
ret
; a contains drive to select
; populate fs vars as well
ideif_drv_sel:
ld (MEM_IDE_SELECTED),a
push af
call ideif_get_drv_pointer ;test if drive is marked as available
ld a,(ix+0)
or a
jp nz, _ideif_drv_sel_fail ;if not-> fail
call fat_get_root_table ;else get root table
;backup tmp pointer
ld hl,(MEM_IDE_POINTER)
ld de,(MEM_IDE_PARTITION) ;use MEM_IDE_PARTITION to backup the pointer
call fat_copy_lba_pointer
ld hl,[_ideif_drv_sel_pstr] ;print success message
call print_str
pop af
add 69
call print_char
ld hl,[_ideif_drv_sel_sstr0]
call print_str
ret
_ideif_drv_sel_fail:
ld hl,[_ideif_drv_sel_pstr]
call print_str
pop af
add 69
call print_char
ld hl,[_ideif_drv_sel_fstr0]
call print_str
LD DE,0x20
LD BC,0x70
CALL beep
ret
_ideif_drv_sel_pstr:
db 10,13,"Drive ",0
_ideif_drv_sel_fstr0:
db ": not ready",10,13,0
_ideif_drv_sel_sstr0:
db ": selected",10,13,0
_ideif_drv_sel_syn:
db 10,13,"Invalid drive letter",10,13,0
.include "fat16.s" ;include monitor symbols.
.include "fat16_file.s" ;include monitor symbols.
;------------------------------------------------------------------------------
; PRINTINLINE
;
; String output function
;
; Prints in-line data (bytes immediately following the PRINTINLINE call)
; until a string terminator is encountered (0 - null char).
;------------------------------------------------------------------------------
PRINTINLINE:
EX (SP),HL ; PUSH HL and put RET ADDress into HL
PUSH AF PUSH AF
PUSH BC
nxtILC:
LD A,(HL)
CP 0
JR Z,endPrint
CALL print_char
INC HL
JR nxtILC
endPrint:
INC HL ; Get past "null" terminator
POP BC
POP AF POP AF
EX (SP),HL ; PUSH new RET ADDress on stack and restore HL
RET RET
find_partition:
;read bootsector
LD A,1 ;read 1 sector
LD B,IDE_REG_SECTOR
CALL ide_regwrite_8
LD A,1 ;read sector 0
LD B,IDE_REG_SSECTOR
CALL ide_regwrite_8
LD A,0 ;read cylinder 0
LD B,IDE_REG_LCYL
CALL ide_regwrite_8
LD A,0
LD B,IDE_REG_HCYL
CALL ide_regwrite_8
LD A,10100000b ;read head 0
LD B,IDE_REG_HEAD
CALL ide_regwrite_8
LD A,IDE_CMD_READSEC ;send read command
LD B,IDE_REG_CMDSTS
CALL ide_regwrite_8
LD HL,MEM_IDE_BUFFER ;set read/write buffer start address
call ide_readsector_512_inv ;read 256 words from device
LD B,4 ;Partition table length
LD C,0 ;Partition ID counter
LD IX,MEM_IDE_BUFFER+446 ;Load offest of first partition table entry
find_partition_loop:
LD A,(IX+4) ;load status byte
OR A
JP NZ, find_partition_process ;If not zero, jump to print function
jp find_partition_next
find_partition_next:
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
LD DE,16
ADD IX,DE
DJNZ find_partition_loop
RET
find_partition_process: ; process table entry
ld hl, [str_part_seek_1]
call print_str ;print
LD A,(IX+0x04) ;load type
call print_a_hex
LD A,(IX+0x04) ;load type
CP 0x0E
JR NZ, find_partition_next
ld hl, [str_part_seek_2]
call print_str ;print
ld hl, [str_part_seek_3]
call print_str ;print
LD A,(IX+0x08) ;load start LBA
LD (MEM_IDE_PARTITION+3),A
LD A,(IX+0x09) ;load start LBA
LD (MEM_IDE_PARTITION+2),A
LD A,(IX+0x0A) ;load start LBA
LD (MEM_IDE_PARTITION+1),A
LD A,(IX+0x0B) ;load start LBA
LD (MEM_IDE_PARTITION+0),A
LD A,(MEM_IDE_PARTITION+3)
call print_a_hex
LD A,(MEM_IDE_PARTITION+2)
call print_a_hex
LD A,(MEM_IDE_PARTITION+1)
call print_a_hex
LD A,(MEM_IDE_PARTITION+0)
call print_a_hex
ld hl, [str_part_seek_4]
call print_str ;print
LD A,(IX+0x0C) ;load count LBA
call print_a_hex
LD A,(IX+0x0D) ;load count LBA
call print_a_hex
LD A,(IX+0x0E) ;load count LBA
call print_a_hex
LD A,(IX+0x0F) ;load count LBA
call print_a_hex
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
RET
str_part_seek_1:
db "- Type: 0x",0
str_part_seek_2:
db " State: ",0
str_part_seek_3:
db " LBA: 0x",0
str_part_seek_4:
db " Len: 0x",0
str_sum:
db "------------",10,13,0
str_files:
db " Files",10,13,0
.include "include/fat16.s"

View File

@@ -0,0 +1,141 @@
.include "extern_symbols.s" ;include monitor symbols.
org 0xB000
;Testing code
;LD HL,MEM_IDE_BUFFER
;LD B,32
;call dump_pretty
call find_partition
;call fat_get_root_table
;call fat_print_directory
call fat_get_root_table
LD DE, [str1]
CALL fat_lfs
JP PROMPT_BEGIN
str1:
db "ILLUSION.PSG",0
str2:
db "HALLOWLT.TXT",0
str3:
db "TEST",0
str4:
db ".ORG",0
delay_small:
PUSH AF
POP AF
PUSH AF
POP AF
RET
find_partition:
;read bootsector
LD A,1 ;read 1 sector
LD B,IDE_REG_SECTOR
CALL ide_regwrite_8
LD A,1 ;read sector 0
LD B,IDE_REG_SSECTOR
CALL ide_regwrite_8
LD A,0 ;read cylinder 0
LD B,IDE_REG_LCYL
CALL ide_regwrite_8
LD A,0
LD B,IDE_REG_HCYL
CALL ide_regwrite_8
LD A,10100000b ;read head 0
LD B,IDE_REG_HEAD
CALL ide_regwrite_8
LD A,IDE_CMD_READSEC ;send read command
LD B,IDE_REG_CMDSTS
CALL ide_regwrite_8
LD HL,MEM_IDE_BUFFER ;set read/write buffer start address
call ide_readsector_512_inv ;read 256 words from device
LD B,4 ;Partition table length
LD C,0 ;Partition ID counter
LD IX,MEM_IDE_BUFFER+446 ;Load offest of first partition table entry
find_partition_loop:
LD A,(IX+4) ;load status byte
OR A
JP NZ, find_partition_process ;If not zero, jump to print function
jp find_partition_next
find_partition_next:
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
LD DE,16
ADD IX,DE
DJNZ find_partition_loop
RET
find_partition_process: ; process table entry
ld hl, [str_part_seek_1]
call print_str ;print
LD A,(IX+0x04) ;load type
call print_a_hex
LD A,(IX+0x04) ;load type
CP 0x0E
JR NZ, find_partition_next
ld hl, [str_part_seek_2]
call print_str ;print
ld hl, [str_part_seek_3]
call print_str ;print
LD A,(IX+0x08) ;load start LBA
LD (MEM_IDE_PARTITION+3),A
LD A,(IX+0x09) ;load start LBA
LD (MEM_IDE_PARTITION+2),A
LD A,(IX+0x0A) ;load start LBA
LD (MEM_IDE_PARTITION+1),A
LD A,(IX+0x0B) ;load start LBA
LD (MEM_IDE_PARTITION+0),A
LD A,(MEM_IDE_PARTITION+3)
call print_a_hex
LD A,(MEM_IDE_PARTITION+2)
call print_a_hex
LD A,(MEM_IDE_PARTITION+1)
call print_a_hex
LD A,(MEM_IDE_PARTITION+0)
call print_a_hex
ld hl, [str_part_seek_4]
call print_str ;print
LD A,(IX+0x0C) ;load count LBA
call print_a_hex
LD A,(IX+0x0D) ;load count LBA
call print_a_hex
LD A,(IX+0x0E) ;load count LBA
call print_a_hex
LD A,(IX+0x0F) ;load count LBA
call print_a_hex
LD A,10 ;New line
CALL print_char
LD A,13
CALL print_char
RET
str_part_seek_1:
db "- Type: 0x",0
str_part_seek_2:
db " State: ",0
str_part_seek_3:
db " LBA: 0x",0
str_part_seek_4:
db " Len: 0x",0
str_sum:
db "------------",10,13,0
str_files:
db " Files",10,13,0
.include "include/fat16.s"

View File

@@ -1,51 +1,99 @@
:10B00000CD38B0CD42B1110FB0CD1AB2C3990049BD :07800000CD5A82CD3A80C980
:10B010004C4C5553494F4E2E5053470048414C4CD1 :04801000CD3A80C91C
:10B020004F574C542E5458540054455354002E4FEF :04802000CD8583C9BE
:10B03000524700F5F1F5F1C93E01060ACDB3103EC5 :10803000210600223543CDBB85C9CD0C860A0D50E3
:10B0400001060BCDB3103E00060CCDB3103E00063A :1080400054522E4D454D5F4944455F504F494E5463
:10B050000DCDB3103EA0060ECDB3103E20060FCD91 :1080500045523A20202020307800DD213240CD34B6
:10B06000B310214150CD1D1106040E00DD21FF510A :1080600082CD0C8620207C20205054522E4D454D30
:10B07000DD7E04B7C28CB0C37AB03E0ACDB7023EC3 :108070005F4944455F504152544954494F4E3A205C
:10B080000DCDB702111000DD1910E5C92104B1CDB5 :108080002020307800DD212E40CD3482CD0C860AB0
:10B09000BF02DD7E04CDE702DD7E04FE0E20DB2153 :108090000D5054522E4D454D5F4641545F544D5046
:10B0A0000FB1CDBF022118B1CDBF02DD7E08320540 :1080A000504F494E5445523A20307800DD211D434F
:10B0B00050DD7E09320450DD7E0A320350DD7E0B06 :1080B000CD3482CD0C8620207C20205054522E4D71
:10B0C0003202503A0550CDE7023A0450CDE7023A39 :1080C000454D5F4641545F544D50504F494E5445C5
:10B0D0000350CDE7023A0250CDE7022121B1CDBFA6 :1080D00052313A20307800DD212143CD3482CD0C5D
:10B0E00002DD7E0CCDE702DD7E0DCDE702DD7E0EBA :1080E000860A0D56414C2E4D454D5F4641545F5218
:10B0F000CDE702DD7E0FCDE7023E0ACDB7023E0D61 :1080F000455345525645443A202020307800DD2132
:10B10000CDB702C92D20547970653A2030780020DF :108100001743CD4D82CD0C862020202020207C20BE
:10B1100053746174653A2000204C42413A203078E3 :108110002056414C2E4D454D5F4641545F414D4FD9
:10B1200000204C656E3A203078002D2D2D2D2D2DD0 :10812000554E543A2020202020203078003A194320
:10B130002D2D2D2D2D2D0A0D002046696C65730ACD :10813000CD0701CD0C860A0D56414C2E4D454D5FA5
:10B140000D00CDA7B22102503E01CD5612DD2141A6 :108140004641545F534543544F52533A2020202018
:10B1500050DD7E0E320A50DD7E0F320B50DD7E1048 :10815000307800DD211A43CD4D82CD0C86202020C1
:10B16000320C50DD7E16320D50DD7E17320E503A15 :108160002020207C202056414C2E4D454D5F46411D
:10B170000E50573A0D505FAF676F3A0C5047191099 :10817000545F434F554E54313A2020202020203068
:10B18000FD16003A0A505F19CD84B2C93E0ACDB708 :1081800078003A1C43CD0701CD0C860A0D56414CB0
:10B19000023E0DCDB702ED5B0D50ED530F50210671 :108190002E4D454D5F4641545F4F46305F43434C43
:10B1A000500601CD56122141500E107EE5FE412879 :1081A0005553543A20307800DD213543CD4D82CDF2
:10B1B00026FEE52822FE00CA08B20608CD58133E36 :1081B0000C862020202020207C20205054522E4D40
:10B1C0002ECDB7020603CD58137ECDB7023E0ACD71 :1081C000454D5F4641545F4F46305F4641545345ED
:10B1D000B7023E0DCDB7020D2808E111200019C3BA :1081D000433A2020307800DD213743CD3482CD0C66
:10B1E000ABB1E126002E01CD84B2ED5B0F501BED1B :1081E000860A0D56414C2E4D454D5F4641545F4F1A
:10B1F000530F507AB3CA09B22106500601CD561238 :1081F00046305F4441545345433A20307800DD21F6
:10B200002141500E10C3ABB1E1212AB1CDBF02796B :108200003B43CD3482CD0C8620207C20205054521C
:10B21000CDE7022139B1CDBF02C9D5211150CDCE24 :108210002E4D454D5F4641545F4F46305F444154BB
:10B22000B23E10320F502106500601CD5612214178 :1082200052454D3A2020307800DD213F43CD4D822C
:10B23000500E10D1D5CDB8B238330D2807112000EB :10823000CDF100C9DD7E03CD0701DD7E02CD070152
:10B2400019C333B226002E01CD84B23A0F503D32DD :10824000DD7E01CD0701DD7E00CD0701C9DD7E01A8
:10B250000F50CA65B22106500601CD561221415049 :10825000CD0701DD7E00CD0701C9327640F5CD970F
:10B260000E10C333B2D121F3B2CDBF02C9D106084B :1082600014DD7E00B7C28882CD0B832A3240ED5BDD
:10B27000CD58133E2ECDB7020603CD58132105B38A :108270002E40CD548521A482CDDF00F1C645CDD757
:10B28000CDBF02C9DD2106507DDD8603DD770330A9 :108280000021BB82CDDF00C921A482CDDF00F1C671
:10B29000053E01DD86027CDD8602DD7702D03E01BF :1082900045CDD70021AD82CDDF0011200001700057
:10B2A000DD8601DD7701C92102501106501800C565 :1082A000CD170DC90A0D447269766520003A206E1B
:10B2B00006000E04EDB0C1C9E5C5060B1A4F7EA904 :1082B0006F742072656164790A0D003A2073656CF1
:10B2C00020070520F7C1E137C9C1E1373FC9060BA7 :1082C00065637465640A0D000A0D496E76616C6918
:10B2D000E5AF772310FCE1060D1AB7C805C8FE2EAE :1082D00064206472697665206C65747465720A0D39
:10B2E000200A1378FE0538F1230518F71A7723137F :1082E000000000000000000000000000000000008E
:10B2F000C3D9B246696C65206E6F7420666F756E37 :1082F000000000000000000000000000000000007E
:10B3000064210D0A002046696C65206C6F636174CE :108300000000000000000000000000CD4585213283
:06B310006564210D0A0036 :10831000403E01CDBE143A1741FEEBC25D83DD2124
:108320001741DD7E0E321743DD7E0F321843DD7EAE
:1083300010321943DD7E16321A43DD7E17321B439D
:108340003A1B43573A1A435FAF676F3A19434719CD
:1083500010FD16003A17435F19CD0085C9CD0C8674
:108360000A0D43616E6E6F742066696E6420626FE1
:108370006F7420736563746F722E0A0D00CD9714AD
:10838000DD360002C9ED5B1A43ED531C4321324038
:108390000601CDBE14CD0C860A0D202046696C6501
:1083A0006E616D652020202020436C7573746572AA
:1083B0002053697A650A0D002117410E107EE5DD14
:1083C000E1E5FE41CA6384FEE5CA6384FE00CA9407
:1083D00084DD7E0BFE10CA31843E20CDD7003E20C6
:1083E000CDD7000608CD63173E2ECDD7000603CDAE
:1083F0006317CD0C8620307800DD7E1BCD0701DDB4
:108400007E1ACD0701CD0C862020307800DD7E1F3E
:10841000CD0701DD7E1ECD0701DD7E1DCD0701DD0F
:108420007E1CCD07013E0ACDD7003E0DCDD70018EA
:10843000323E44CDD7003E20CDD7000608CD63178D
:10844000CD0C862020202020307800DD7E1BCD073B
:1084500001DD7E1ACD07013E0ACDD7003E0DCDD7F6
:108460000018000D2808E111200019C3BD83E12682
:10847000002E01CD0085ED5B1C431BED531C437AA0
:10848000B3CA95842132400601CDBE142117410E96
:1084900010C3BD83E1C9D5212543CD73853E10327C
:1084A0001C432132400601CDBE142117410E10D1CC
:1084B000D5CD5D8538330D280711200019C3AF8451
:1084C00026002E01CD00853A1C433D321C43CAE1F3
:1084D000842132400601CDBE142117410E10C3AFD6
:1084E00084D1219885CDDF00C9D10608CD63173E20
:1084F0002ECDD7000603CD631721AA85CDDF00C995
:10850000221D43AF321F43322043111D430132402D
:10851000CD1485C9E5C5D51A6F131A67130A5F0311
:108520000A5719D1C17D02037C02031313C5D51A62
:108530006F131A67130A5F030A57ED5AD1C17D0200
:10854000037C02E1C9CD9714DD23DD23DDE5E111D4
:1085500032401800C506000E04EDB0C1C9E5C506DD
:108560000B1A4F7EA920070520F7C1E137C9C1E1E9
:10857000373FC9060BE5AF772310FCE1060D1AB7AC
:10858000C805C8FE2E200A1378FE0538F123051809
:10859000F71A772313C37E8546696C65206E6F7466
:1085A00020666F756E64210D0A002046696C652097
:1085B0006C6F6361746564210D0A002A35437C6F1A
:1085C000AF67ED4B174309223743AF323943323A95
:1085D00043CD9714DD23DD23DDE5D1013743CD14F1
:1085E00085CD3A802137430601CDBE1421174106BF
:1085F00014CDC9163A3543176F3E0017671117415E
:1086000019113543EDA0EDA0CD3A80C9E3F5C57E43
:0F861000FE002806CDD7002318F523C1F1E3C9DA
:00000001FF :00000001FF

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +1,98 @@
!B000 CD 38 B0 CD 42 B1 11 0F B0 CD 1A B2 C3 99 00 49 !8000 CD 5A 82 CD 3A 80 C9
!B010 4C 4C 55 53 49 4F 4E 2E 50 53 47 00 48 41 4C 4C !8010 CD 3A 80 C9
!B020 4F 57 4C 54 2E 54 58 54 00 54 45 53 54 00 2E 4F !8020 CD 85 83 C9
!B030 52 47 00 F5 F1 F5 F1 C9 3E 01 06 0A CD B3 10 3E !8030 21 06 00 22 35 43 CD BB 85 C9 CD 0C 86 0A 0D 50
!B040 01 06 0B CD B3 10 3E 00 06 0C CD B3 10 3E 00 06 !8040 54 52 2E 4D 45 4D 5F 49 44 45 5F 50 4F 49 4E 54
!B050 0D CD B3 10 3E A0 06 0E CD B3 10 3E 20 06 0F CD !8050 45 52 3A 20 20 20 20 30 78 00 DD 21 32 40 CD 34
!B060 B3 10 21 41 50 CD 1D 11 06 04 0E 00 DD 21 FF 51 !8060 82 CD 0C 86 20 20 7C 20 20 50 54 52 2E 4D 45 4D
!B070 DD 7E 04 B7 C2 8C B0 C3 7A B0 3E 0A CD B7 02 3E !8070 5F 49 44 45 5F 50 41 52 54 49 54 49 4F 4E 3A 20
!B080 0D CD B7 02 11 10 00 DD 19 10 E5 C9 21 04 B1 CD !8080 20 20 30 78 00 DD 21 2E 40 CD 34 82 CD 0C 86 0A
!B090 BF 02 DD 7E 04 CD E7 02 DD 7E 04 FE 0E 20 DB 21 !8090 0D 50 54 52 2E 4D 45 4D 5F 46 41 54 5F 54 4D 50
!B0A0 0F B1 CD BF 02 21 18 B1 CD BF 02 DD 7E 08 32 05 !80A0 50 4F 49 4E 54 45 52 3A 20 30 78 00 DD 21 1D 43
!B0B0 50 DD 7E 09 32 04 50 DD 7E 0A 32 03 50 DD 7E 0B !80B0 CD 34 82 CD 0C 86 20 20 7C 20 20 50 54 52 2E 4D
!B0C0 32 02 50 3A 05 50 CD E7 02 3A 04 50 CD E7 02 3A !80C0 45 4D 5F 46 41 54 5F 54 4D 50 50 4F 49 4E 54 45
!B0D0 03 50 CD E7 02 3A 02 50 CD E7 02 21 21 B1 CD BF !80D0 52 31 3A 20 30 78 00 DD 21 21 43 CD 34 82 CD 0C
!B0E0 02 DD 7E 0C CD E7 02 DD 7E 0D CD E7 02 DD 7E 0E !80E0 86 0A 0D 56 41 4C 2E 4D 45 4D 5F 46 41 54 5F 52
!B0F0 CD E7 02 DD 7E 0F CD E7 02 3E 0A CD B7 02 3E 0D !80F0 45 53 45 52 56 45 44 3A 20 20 20 30 78 00 DD 21
!B100 CD B7 02 C9 2D 20 54 79 70 65 3A 20 30 78 00 20 !8100 17 43 CD 4D 82 CD 0C 86 20 20 20 20 20 20 7C 20
!B110 53 74 61 74 65 3A 20 00 20 4C 42 41 3A 20 30 78 !8110 20 56 41 4C 2E 4D 45 4D 5F 46 41 54 5F 41 4D 4F
!B120 00 20 4C 65 6E 3A 20 30 78 00 2D 2D 2D 2D 2D 2D !8120 55 4E 54 3A 20 20 20 20 20 20 30 78 00 3A 19 43
!B130 2D 2D 2D 2D 2D 2D 0A 0D 00 20 46 69 6C 65 73 0A !8130 CD 07 01 CD 0C 86 0A 0D 56 41 4C 2E 4D 45 4D 5F
!B140 0D 00 CD A7 B2 21 02 50 3E 01 CD 56 12 DD 21 41 !8140 46 41 54 5F 53 45 43 54 4F 52 53 3A 20 20 20 20
!B150 50 DD 7E 0E 32 0A 50 DD 7E 0F 32 0B 50 DD 7E 10 !8150 30 78 00 DD 21 1A 43 CD 4D 82 CD 0C 86 20 20 20
!B160 32 0C 50 DD 7E 16 32 0D 50 DD 7E 17 32 0E 50 3A !8160 20 20 20 7C 20 20 56 41 4C 2E 4D 45 4D 5F 46 41
!B170 0E 50 57 3A 0D 50 5F AF 67 6F 3A 0C 50 47 19 10 !8170 54 5F 43 4F 55 4E 54 31 3A 20 20 20 20 20 20 30
!B180 FD 16 00 3A 0A 50 5F 19 CD 84 B2 C9 3E 0A CD B7 !8180 78 00 3A 1C 43 CD 07 01 CD 0C 86 0A 0D 56 41 4C
!B190 02 3E 0D CD B7 02 ED 5B 0D 50 ED 53 0F 50 21 06 !8190 2E 4D 45 4D 5F 46 41 54 5F 4F 46 30 5F 43 43 4C
!B1A0 50 06 01 CD 56 12 21 41 50 0E 10 7E E5 FE 41 28 !81A0 55 53 54 3A 20 30 78 00 DD 21 35 43 CD 4D 82 CD
!B1B0 26 FE E5 28 22 FE 00 CA 08 B2 06 08 CD 58 13 3E !81B0 0C 86 20 20 20 20 20 20 7C 20 20 50 54 52 2E 4D
!B1C0 2E CD B7 02 06 03 CD 58 13 7E CD B7 02 3E 0A CD !81C0 45 4D 5F 46 41 54 5F 4F 46 30 5F 46 41 54 53 45
!B1D0 B7 02 3E 0D CD B7 02 0D 28 08 E1 11 20 00 19 C3 !81D0 43 3A 20 20 30 78 00 DD 21 37 43 CD 34 82 CD 0C
!B1E0 AB B1 E1 26 00 2E 01 CD 84 B2 ED 5B 0F 50 1B ED !81E0 86 0A 0D 56 41 4C 2E 4D 45 4D 5F 46 41 54 5F 4F
!B1F0 53 0F 50 7A B3 CA 09 B2 21 06 50 06 01 CD 56 12 !81F0 46 30 5F 44 41 54 53 45 43 3A 20 30 78 00 DD 21
!B200 21 41 50 0E 10 C3 AB B1 E1 21 2A B1 CD BF 02 79 !8200 3B 43 CD 34 82 CD 0C 86 20 20 7C 20 20 50 54 52
!B210 CD E7 02 21 39 B1 CD BF 02 C9 D5 21 11 50 CD CE !8210 2E 4D 45 4D 5F 46 41 54 5F 4F 46 30 5F 44 41 54
!B220 B2 3E 10 32 0F 50 21 06 50 06 01 CD 56 12 21 41 !8220 52 45 4D 3A 20 20 30 78 00 DD 21 3F 43 CD 4D 82
!B230 50 0E 10 D1 D5 CD B8 B2 38 33 0D 28 07 11 20 00 !8230 CD F1 00 C9 DD 7E 03 CD 07 01 DD 7E 02 CD 07 01
!B240 19 C3 33 B2 26 00 2E 01 CD 84 B2 3A 0F 50 3D 32 !8240 DD 7E 01 CD 07 01 DD 7E 00 CD 07 01 C9 DD 7E 01
!B250 0F 50 CA 65 B2 21 06 50 06 01 CD 56 12 21 41 50 !8250 CD 07 01 DD 7E 00 CD 07 01 C9 32 76 40 F5 CD 97
!B260 0E 10 C3 33 B2 D1 21 F3 B2 CD BF 02 C9 D1 06 08 !8260 14 DD 7E 00 B7 C2 88 82 CD 0B 83 2A 32 40 ED 5B
!B270 CD 58 13 3E 2E CD B7 02 06 03 CD 58 13 21 05 B3 !8270 2E 40 CD 54 85 21 A4 82 CD DF 00 F1 C6 45 CD D7
!B280 CD BF 02 C9 DD 21 06 50 7D DD 86 03 DD 77 03 30 !8280 00 21 BB 82 CD DF 00 C9 21 A4 82 CD DF 00 F1 C6
!B290 05 3E 01 DD 86 02 7C DD 86 02 DD 77 02 D0 3E 01 !8290 45 CD D7 00 21 AD 82 CD DF 00 11 20 00 01 70 00
!B2A0 DD 86 01 DD 77 01 C9 21 02 50 11 06 50 18 00 C5 !82A0 CD 17 0D C9 0A 0D 44 72 69 76 65 20 00 3A 20 6E
!B2B0 06 00 0E 04 ED B0 C1 C9 E5 C5 06 0B 1A 4F 7E A9 !82B0 6F 74 20 72 65 61 64 79 0A 0D 00 3A 20 73 65 6C
!B2C0 20 07 05 20 F7 C1 E1 37 C9 C1 E1 37 3F C9 06 0B !82C0 65 63 74 65 64 0A 0D 00 0A 0D 49 6E 76 61 6C 69
!B2D0 E5 AF 77 23 10 FC E1 06 0D 1A B7 C8 05 C8 FE 2E !82D0 64 20 64 72 69 76 65 20 6C 65 74 74 65 72 0A 0D
!B2E0 20 0A 13 78 FE 05 38 F1 23 05 18 F7 1A 77 23 13 !82E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
!B2F0 C3 D9 B2 46 69 6C 65 20 6E 6F 74 20 66 6F 75 6E !82F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
!B300 64 21 0D 0A 00 20 46 69 6C 65 20 6C 6F 63 61 74 !8300 00 00 00 00 00 00 00 00 00 00 00 CD 45 85 21 32
!B310 65 64 21 0D 0A 00 !8310 40 3E 01 CD BE 14 3A 17 41 FE EB C2 5D 83 DD 21
!8320 17 41 DD 7E 0E 32 17 43 DD 7E 0F 32 18 43 DD 7E
!8330 10 32 19 43 DD 7E 16 32 1A 43 DD 7E 17 32 1B 43
!8340 3A 1B 43 57 3A 1A 43 5F AF 67 6F 3A 19 43 47 19
!8350 10 FD 16 00 3A 17 43 5F 19 CD 00 85 C9 CD 0C 86
!8360 0A 0D 43 61 6E 6E 6F 74 20 66 69 6E 64 20 62 6F
!8370 6F 74 20 73 65 63 74 6F 72 2E 0A 0D 00 CD 97 14
!8380 DD 36 00 02 C9 ED 5B 1A 43 ED 53 1C 43 21 32 40
!8390 06 01 CD BE 14 CD 0C 86 0A 0D 20 20 46 69 6C 65
!83A0 6E 61 6D 65 20 20 20 20 20 43 6C 75 73 74 65 72
!83B0 20 53 69 7A 65 0A 0D 00 21 17 41 0E 10 7E E5 DD
!83C0 E1 E5 FE 41 CA 63 84 FE E5 CA 63 84 FE 00 CA 94
!83D0 84 DD 7E 0B FE 10 CA 31 84 3E 20 CD D7 00 3E 20
!83E0 CD D7 00 06 08 CD 63 17 3E 2E CD D7 00 06 03 CD
!83F0 63 17 CD 0C 86 20 30 78 00 DD 7E 1B CD 07 01 DD
!8400 7E 1A CD 07 01 CD 0C 86 20 20 30 78 00 DD 7E 1F
!8410 CD 07 01 DD 7E 1E CD 07 01 DD 7E 1D CD 07 01 DD
!8420 7E 1C CD 07 01 3E 0A CD D7 00 3E 0D CD D7 00 18
!8430 32 3E 44 CD D7 00 3E 20 CD D7 00 06 08 CD 63 17
!8440 CD 0C 86 20 20 20 20 20 30 78 00 DD 7E 1B CD 07
!8450 01 DD 7E 1A CD 07 01 3E 0A CD D7 00 3E 0D CD D7
!8460 00 18 00 0D 28 08 E1 11 20 00 19 C3 BD 83 E1 26
!8470 00 2E 01 CD 00 85 ED 5B 1C 43 1B ED 53 1C 43 7A
!8480 B3 CA 95 84 21 32 40 06 01 CD BE 14 21 17 41 0E
!8490 10 C3 BD 83 E1 C9 D5 21 25 43 CD 73 85 3E 10 32
!84A0 1C 43 21 32 40 06 01 CD BE 14 21 17 41 0E 10 D1
!84B0 D5 CD 5D 85 38 33 0D 28 07 11 20 00 19 C3 AF 84
!84C0 26 00 2E 01 CD 00 85 3A 1C 43 3D 32 1C 43 CA E1
!84D0 84 21 32 40 06 01 CD BE 14 21 17 41 0E 10 C3 AF
!84E0 84 D1 21 98 85 CD DF 00 C9 D1 06 08 CD 63 17 3E
!84F0 2E CD D7 00 06 03 CD 63 17 21 AA 85 CD DF 00 C9
!8500 22 1D 43 AF 32 1F 43 32 20 43 11 1D 43 01 32 40
!8510 CD 14 85 C9 E5 C5 D5 1A 6F 13 1A 67 13 0A 5F 03
!8520 0A 57 19 D1 C1 7D 02 03 7C 02 03 13 13 C5 D5 1A
!8530 6F 13 1A 67 13 0A 5F 03 0A 57 ED 5A D1 C1 7D 02
!8540 03 7C 02 E1 C9 CD 97 14 DD 23 DD 23 DD E5 E1 11
!8550 32 40 18 00 C5 06 00 0E 04 ED B0 C1 C9 E5 C5 06
!8560 0B 1A 4F 7E A9 20 07 05 20 F7 C1 E1 37 C9 C1 E1
!8570 37 3F C9 06 0B E5 AF 77 23 10 FC E1 06 0D 1A B7
!8580 C8 05 C8 FE 2E 20 0A 13 78 FE 05 38 F1 23 05 18
!8590 F7 1A 77 23 13 C3 7E 85 46 69 6C 65 20 6E 6F 74
!85A0 20 66 6F 75 6E 64 21 0D 0A 00 20 46 69 6C 65 20
!85B0 6C 6F 63 61 74 65 64 21 0D 0A 00 2A 35 43 7C 6F
!85C0 AF 67 ED 4B 17 43 09 22 37 43 AF 32 39 43 32 3A
!85D0 43 CD 97 14 DD 23 DD 23 DD E5 D1 01 37 43 CD 14
!85E0 85 CD 3A 80 21 37 43 06 01 CD BE 14 21 17 41 06
!85F0 14 CD C9 16 3A 35 43 17 6F 3E 00 17 67 11 17 41
!8600 19 11 35 43 ED A0 ED A0 CD 3A 80 C9 E3 F5 C5 7E
!8610 FE 00 28 06 CD D7 00 23 18 F5 23 C1 F1 E3 C9