You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

3599 lines
65 KiB

; rz (receive Zmodem) is a disassembly of CP/M 3 binaries by Wilfried Schmitten released in 1992.
; this file is an attempt to reconstruct the Z80 assembler source code which has been lost
; credit to Wilfried Schmitten for writing this program initially
;
; +-----------------------------------------------------------------+
; | This file is generated by The Interactive Disassembler (IDA) FW |
; | Copyright (c) 1997 by DataRescue sprl, <ida@datarescue.com> |
; | Professional version of IDA is at http://www.idapro.com |
; +-----------------------------------------------------------------+
;
; File Name C:\RZ.COM
; Format COM File
; Base Address: 0000h Range: 0100h - 1800h Loaded length: 1700h
; Processor: z80
; Target assembler: Table Driven Assembler (TASM) by Speech Technology Inc.
bdos .equ 0005h
A_READ .equ 3
A_STATIN .equ 7
C_WRITESTR .equ 9
S_BDOSVER .equ 12
DRV_SET .equ 14
F_USERNUM .equ 32
S_SYSVAR .equ 49
;----------------------------------------------------------------------------
.org 100h
start: ld sp, nstack ; Setup local stack
ld c,S_BDOSVER
call bdos ; Return CP/M version #
cp '0' ; Get CP/M vers. #
jp c,err_vern ; CP/M 2 or less?
ld de,str_welc
ld c,C_WRITESTR ;yes
call bdos ;"RZ for ..."; Output string
call sub_195 ;print string
ld hl,(word_179E)
xor a
ld b,14h
call sub_1786
ld a,(80h)
or a
jr z,loc_174
ld (hl),2
ld de,82h
ex de,hl
ld a,0FFh
call sub_172E
jp nz, err_exit
ld hl,(word_179E)
inc hl
ld a,(hl)
or a
jp z,loc_174
inc hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld a,(de)
cp 2Dh
jr nz,loc_152
call sub_39A
ld e,(hl)
inc hl
ld d,(hl)
ld a,d
or e
jr z,loc_174
loc_152: ld hl,byte_17A3 ; CODE XREF: start+46j
ex de,hl
call sub_1492
ld hl,byte_17A3
xor a
or (hl)
jr nz,loc_164
ld a,(byte_17A1)
ld (hl),a
loc_164: ld bc,0Dh ; CODE XREF: start+5Ej
add hl,bc
dec de
ldi
ld de,byte_17A3
call sub_1B0
call sub_3C9
loc_174: ld de,str_sxfr ; CODE XREF: start+25j start+3Bj
ld c,C_WRITESTR
call bdos ; Output string
call sub_3EF
call sub_8D1
call sub_451
smod_b_186: .equ $+1
loc_185: ld bc,0 ; DATA XREF: sub_195+17w
ld (word_17A2),bc
ld de,byte_17A3
call sub_1B0
jp 0
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_195: ld a,(4) ; CODE XREF: start+15p
ld b,a
rlca
rlca
rlca
rlca
and 0Fh
ld (byte_17A0),a
ld a,b
and 0Fh
inc a
ld (byte_17A1),a
ld hl,(byte_17A0)
ld (smod_b_186),hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1B0: ld a,(de) ; CODE XREF: start+6Ep start+8Fp
push af
dec de
ld a,(de)
ld e, a
ld c,F_USERNUM
call bdos ; get/set user number
pop af
dec a
ld e, a
ld c,DRV_SET
jp 5 ; Select disc
;----------------------------------------------------------------------------
err_vern: ld de,str_cpm3 ; Display version
ld c,C_WRITESTR ; error and exit
call bdos
err_exit: ld de,str_info ; Display usage
ld c,C_WRITESTR ; and exit to
call bdos ; CP/M
jp 0
;----------------------------------------------------------------------------
str_welc: .text "RZ for CP/M 3 V 1.04\r\n"
.text "(C) 92 wshbg\r\n\n$"
str_sxfr: .text "start your local X/Y/ZModem sending program\r\n\n$"
str_cpm3: .text "sorry, CP/M 3 Tool\r\n$"
str_info: .text "usage: rz [-?pbcrxyz] [du:fn]\r\n\n"
.text " options for ZModem:\r\n"
.text " ? this help\r\n"
.text " p protect File\r\n"
.text " b receive binary\r\n"
.text " c convert to local linefeed\r\n"
.text " r resume transmission\r\n"
.text " x,y,z Protokoll\r\n"
.text " du:fn defaults to XModem\r\n\n"
.text "these values override options from sender\r\n$"
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_39A: push hl ; CODE XREF: start+48p
push de
loc_39C: inc de ; CODE XREF: sub_39A+12j
ld a,(de)
or a
jr z,loc_3AE
ld hl,loc_3B1
ld bc,8
cpir
call z,sub_67F
jr loc_39C
loc_3AE: pop de ; CODE XREF: sub_39A+5j
pop hl
ret
;----------------------------------------------------------------------------
loc_3B1: .text "?PBCXYZR"
.dw sub_3E9
.dw sub_3D1
.dw sub_3CD
.dw sub_3C9
.dw sub_3E3
.dw sub_3DD
.dw sub_3D7
.dw err_exit
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_3C9: ld a,1 ; CODE XREF: start+71p
jr loc_3D3
sub_3CD: ld a,3
jr loc_3D3
sub_3D1: ld a,4
loc_3D3: ld (byte_8AF),a
ret
;----------------------------------------------------------------------------
sub_3D7: ld a,$ff
ld (byte_8B0),a
ret
sub_3DD: ld a,$ff
ld (byte_8B2),a
ret
sub_3E3: ld a,$ff
ld (byte_8B1),a
ret
sub_3E9: ld a,$ff
ld (byte_8B3),a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_3EF: xor a ; CODE XREF: start+7Cp
ld (byte_460),a
ld (byte_464),a
ld c,S_SYSVAR
ld de,45Fh
call bdos ; Access the system variables
ld a,h
cpl
ld h,a
ld a,l
cpl
ld l, a
ld (word_46F),hl
ld c,S_SYSVAR
ld de,byte_463
call bdos ; Access the system variables
ld (word_46B),hl
ld de,(word_46F)
ld a,h
and d
ld h,a
ld a,l
and e
ld l, a
ld (word_465),hl
ld c,S_SYSVAR
ld de,byte_467
call bdos ; Access the system variables
ld (word_46D),hl
ld de,(word_46F)
ld a,h
and d
ld h,a
ld a,l
and e
ld l, a
ld (word_469),hl
loc_437: ld a,0FEh ; CODE XREF: sub_451+Cj
ld (byte_464),a
ld de,byte_463
ld c,S_SYSVAR
call bdos ; Access the system variables
ld a,0FEh
ld (byte_468),a
ld de,byte_467
ld c,S_SYSVAR
jp 5 ; Access the System Control Block
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_451: ld hl,(word_46B) ; CODE XREF: start+82p
ld (word_465),hl
ld hl,(word_46D)
ld (word_469),hl
jr loc_437
;----------------------------------------------------------------------------
.db 28h ; (
byte_460: .db 0 ; DATA XREF: sub_3EF+1w
.db 0 ;
.db 0 ;
byte_463: .db 24h ; $
byte_464: .db 0 ; DATA XREF: sub_3EF+4w sub_3EF+4Aw
word_465: .dw 0 ; DATA XREF: sub_3EF+2Dw
byte_467: .db 22h ; "
byte_468: .db 0 ; DATA XREF: sub_3EF+57w
word_469: .dw 0 ; DATA XREF: sub_3EF+45w
word_46B: .dw 0 ; DATA XREF: sub_3EF+20w
word_46D: .dw 0 ; DATA XREF: sub_3EF+38w
word_46F: .dw 0 ; DATA XREF: sub_3EF+15w
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_471: call bdos ; CODE XREF: sub_961+92p
or a ; seg000:0A29p ...
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_476: push af ; CODE XREF: sub_4A4+37p
loc_477: push bc ; CODE XREF: sub_476+8j
xor a
ld b,a
ld c,a
cpir
pop bc
djnz loc_477
pop af
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_482: ld a,(byte_2D04) ; CODE XREF: sub_1289+122p
ld de,text495h ; Update error string with errors
call sub_16E7
ld de,text493h
ld c,C_WRITESTR
jp 5 ; Output string
;----------------------------------------------------------------------------
text493h: .text "\r\n"
text495h: .db 0,0,0
.text " error(s)\r\n$"
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_4A4: ld de,byte_17A3 ; CODE XREF: sub_961+82p
ld hl,byte_4F8
ld (hl),3Ah
inc hl
xor a
ld b,0Dh
call sub_1786
inc de
call sub_16C4
dec de
ld a,(de)
add a,40h
ld (byte_4F4),a
dec de
ld a,(de)
ld de,byte_4F5
call sub_16E7
ld a,24h
ld (byte_507),a
ld de,text4F2h
ld c,C_WRITESTR
call bdos ; Output string
ld hl,(byte_2CD4)
ld a,h
or l
ret z
ld b,1
call sub_476
dec hl
ld (hl),24h
ld de,(byte_2CD4)
ld c,C_WRITESTR
call bdos ; Output string
ld de,text508h
ld c,C_WRITESTR
jp 5 ; Output string
;----------------------------------------------------------------------------
text4F2h: .text "\r\n"
byte_4F4: .db 0 ; DATA XREF: sub_4A4+17w
byte_4F5: .db 0 ;
.db 0 ;
.db 0 ;
byte_4F8: .db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 20h ;
byte_507: .db 0 ; DATA XREF: sub_4A4+24w
text508h: .text "\r\n$"
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_50B: ld hl,loc_2CAB ; CODE XREF: sub_D0Ep sub_D30+30p
ld de,loc_51F
call loc_774
ld (hl),24h
ld de,text51Eh
ld c,C_WRITESTR
jp 5 ; Output string
;----------------------------------------------------------------------------
text51Eh:
.db 0Dh ;
loc_51F: .db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
.db 0 ;
loc_529: ld hl,str_busy
ld a,0
inc a
and 3
ld (052Dh),a
ld e,a
ld d,0
add hl,de
ld a,(hl)
ld (0549h),a
ld de,0548h
ld c,9
jp bdos
str_busy: .text "|/-\\ |\b\b$"
ld de,0569h
jr sub_555
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_552: ld de,text55Ah
sub_555: ld c,C_WRITESTR
jp bdos ; Output string
;----------------------------------------------------------------------------
text55Ah: .text "File skipped\r\n$"
text569h: .text "can't open any file\r\n$"
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_57F: ; CODE XREF: sub_DE7+Dp
ld hl,byte_586
ld (hl),a
inc hl
ld (hl),c
ret
; End of function sub_57F
;----------------------------------------------------------------------------
byte_586: .db 0 ;
byte_587: .db 0 ; DATA XREF: sub_5B4r
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_588: ; CODE XREF: sub_588+1Fj
; sub_5D4+4p ...
or a
ld hl,(word_1808)
ld de,1000h
sbc hl,de
jr z,loc_5A9
ld c,A_STATIN
call bdos ; Auxiliary Input status
or a
jr z,loc_5A9
ld c,A_READ
call bdos ; Auxiliary (Reader) input
ld c,a
ld hl,1808h
call sub_61C
jr sub_588
;----------------------------------------------------------------------------
loc_5A9: ; CODE XREF: sub_588+9j sub_588+11j
ld hl,587h
or (hl)
ret nz
ld hl,(1808h)
ld a,h
or l
ret
; End of function sub_588
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_5B4: ; CODE XREF: sub_5D4+12p
ld a,(byte_587)
or a
ld hl,1808h
jp z,loc_5F7
push af
ld hl,587h
dec (hl)
dec hl
pop af
ld a,(hl)
ret
; End of function sub_5B4
;----------------------------------------------------------------------------
loc_5C7: LD C,4 ; punch out
LD E,A
JP bdos
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_5CD: ld c,8 ; CODE XREF: seg000:1462p
call bdos ; BDOS function 8 (A_STATOUT) - Auxiliary Output status
or a
ret
; End of function sub_5CD
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_5D4: ; CODE XREF: sub_DE7+11p
push bc
ld b,5Fh
loc_5D7: ; CODE XREF: sub_5D4+Dj
push bc
call sub_588
pop bc
jr nz,loc_5E6
call sub_5EB
djnz loc_5D7
call sub_588
loc_5E6: ; CODE XREF: sub_5D4+8j
call nz,sub_5B4
pop bc
ret
; End of function sub_5D4
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_5EB: ; CODE XREF: sub_5D4+Ap
push bc
ld a,4
ld b,0
loc_5F0: ; CODE XREF: sub_5EB+5j sub_5EB+8j
djnz loc_5F0
dec a
jr nz,loc_5F0
pop bc
ret
; End of function sub_5EB
;----------------------------------------------------------------------------
loc_5F7: ; CODE XREF: sub_5B4+7j
ld e,(hl)
inc hl
ld d,(hl)
ld a,d
or e
ret z
dec de
ld (hl),d
dec hl
ld (hl),e
ld de,4
add hl,de
push hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
add hl,de
ex (sp),hl
inc de
ld a,e
and 0FFh
ld (hl),a
inc hl
ld a,d
and 0Fh
ld (hl),a
pop hl
ld a,1
or a
ld a,(hl)
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_61C: ; CODE XREF: sub_588+1Cp
or a
push hl
ld e,(hl)
inc hl
ld d,(hl)
ld hl,1000h
sbc hl,de
pop hl
ret z
inc de
ld (hl),e
inc hl
ld (hl),d
inc hl
push hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
inc hl
inc hl
add hl,de
ex (sp),hl
inc de
ld a,e
and 0FFh
ld (hl),a
inc hl
ld a,d
and 0Fh
ld (hl),a
pop hl
ld (hl),c
ret
; End of function sub_61C
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_643: ; CODE XREF: sub_961+54p
; sub_11FA+69p
ld hl,17A2h
ld b,25h
jr loc_650
; End of function sub_643
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_64A: ; CODE XREF: sub_961+9Ep
; seg000:0A63p
ld b,3
jr loc_650
; End of function sub_64A
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_64E: ; CODE XREF: sub_8D1+Cp sub_BD3+2Fp
ld b,6
loc_650: ; CODE XREF: sub_643+5j sub_64A+2j
xor a
jp sub_1786
; End of function sub_64E
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_654: ; CODE XREF: seg000:0AAEp
xor a
or (hl)
ret z
dec (hl)
inc hl
inc hl
ld e,(hl)
ld d,0
ld a,e
inc a
and 7Fh
ld (hl),a
inc hl
adc hl,de
ld a,(hl)
ret nc
ccf
ret
; End of function sub_654
;----------------------------------------------------------------------------
sub_669: LD A,80H
SUB (HL)
RET Z
INC (HL)
INC HL
LD E,(HL)
LD D,0
LD A,E
INC A
AND 7FH
LD (HL),A
INC HL
INC HL
ADC HL,DE
LD (HL),C
RET NC
CCF
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_67F: ; CODE XREF: sub_39A+Fp sub_BD3+42j
add hl,bc
sla c
add hl,bc
ld c,(hl)
inc hl
ld h,(hl)
ld l, c
jp (hl)
; End of function sub_67F
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_688: ; CODE XREF: seg000:0726p sub_BD3+13p
xor a
push bc
push de
push hl
ld (hl),a
ld d,h
ld e, l
inc de
jr loc_697
; End of function sub_688
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_692: push bc ; CODE XREF: seg000:077Bp seg000:07ADp
push de
push hl
ldi
loc_697: ldi ; CODE XREF: sub_688+8j
ldi
ldi
pop hl
pop de
pop bc
ret
;----------------------------------------------------------------------------
loc_6A1: PUSH HL ;unref. ?
POP IX ;unref. ?
PUSH DE ;unref. ?
POP IY ;unref. ?
LD A,(IX+3) ;unref. ?
XOR (IY+3) ;unref. ?
JP P,loc_6B6 ;unref. ?
XOR (IX+3) ;unref. ?
loc_6B3: RET M ;unref. ?
CCF ;unref. ?
RET ;unref. ?
loc_6B6: XOR (IX+3) ;unref. ?
JP P,loc_6C2 ;unref. ?
CALL loc_6C2 ;unref. ?
SCF ;unref. ?
JR loc_6B3 ;unref. ?
loc_6C2: PUSH BC
PUSH DE ;unref. ?
PUSH HL ;unref. ?
EX DE,HL ;unref. ?
OR A ;unref. ?
LD B,4 ;unref. ?
loc_6C9: LD A,(DE) ;unref. ?
SBC A,(HL) ;unref. ?
INC DE ;unref. ?
INC HL ;unref. ?
DJNZ loc_6C9 ;unref. ?
POP HL ;unref. ?
POP DE ;unref. ?
POP BC ;unref. ?
RET ;unref. ?
sub_6D3: PUSH BC
PUSH DE
PUSH HL
LD B,4
loc_6D8: LD A,(DE)
XOR (HL)
JR NZ,loc_6E0
INC DE
INC HL
DJNZ loc_6D8
loc_6E0: POP HL
POP DE
POP BC
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_6E4: push bc ; CODE XREF: sub_11FA+4Bp
push de
push hl
or a
ex af, af'
ld a,4
loc_6EB: ex af, af' ; CODE XREF: sub_6E4+10j
ld a,(de)
adc a,(hl)
ld (bc),a
inc bc
inc de
inc hl
ex af, af'
dec a
jr nz,loc_6EB
pop hl
pop de
pop bc
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_6FA: push bc ; CODE XREF: seg000:0799p
push de
push hl
ex de,hl
or a
ex af, af'
ld a,4
loc_702: ex af, af' ; CODE XREF: sub_6FA+11j
ld a,(de)
sbc a,(hl)
ld (bc),a
inc bc
inc hl
inc de
ex af, af'
dec a
jr nz,loc_702
ex af, af'
pop hl
pop de
pop bc
ret
;----------------------------------------------------------------------------
loc_712: PUSH BC
PUSH HL
LD A,1
ADD A,(HL)
LD (HL),A
JR NC,loc_723
LD B,3
loc_71C: INC HL
LD A,0
ADC A,(HL)
LD (HL),A
DJNZ loc_71C
loc_723: POP HL
POP BC
RET
;----------------------------------------------------------------------------
loc_726: call sub_688 ; CODE XREF: sub_8A0+Cj
sub_729: push bc ; CODE XREF: seg000:0A77p
push hl
ld a,(hl)
sub 1
ld (hl),a
ld b,3
loc_731: inc hl ; CODE XREF: sub_729+Dj
ld a,(hl)
sbc a,0
ld (hl),a
djnz loc_731
pop hl
pop bc
ret
;----------------------------------------------------------------------------
loc_73B: PUSH BC
PUSH DE
PUSH HL
EX DE,HL
LD A,004H
loc_741: PUSH AF
LD A,(DE)
AND (HL)
LD (BC),A
INC BC
INC DE
INC HL
POP AF
DEC A
JR NZ,loc_741
POP HL
POP DE
POP BC
RET
;----------------------------------------------------------------------------
loc_750: .db 0, 0CAh,9Ah,3Bh
.db 0, 0E1h,0F5h, 5
.db 80h, 96h, 98h, 0
.db 40h, 42h, 0Fh, 0
.db 0A0h, 86h, 1, 0
.db 10h, 27h, 0, 0
.db 0E8h, 3, 0, 0
.db 64h, 0, 0, 0
.db 0Ah, 0, 0, 0
loc_774: ld (smod_w_7BF),de; CODE XREF: sub_50B+6p
ld de,byte_2891
call sub_692
ld c,+(loc_774-loc_750)/4
ld de,loc_750-4
xor a
ld (smod_b_7BA),a
loc_787: ld a,30h
ld (smod_b_7B4),a
inc de
inc de
inc de
inc de
ld b,0Ah
loc_792: push bc ; CODE XREF: seg000:07B1j
ld hl,byte_2891
ld bc,loc_2895
call sub_6FA
pop bc
jr c,loc_7B3
push de
ld a,(smod_b_7B4)
inc a
ld (smod_b_7B4),a
ld de,byte_2891
ld hl,loc_2895
call sub_692
pop de
djnz loc_792
smod_b_7B4: .EQU $+1
loc_7B3: LD A,30H ; self modifying
CP 30H
JR NZ,loc_7BE
smod_b_7BA: .EQU $+1
LD A,0
OR A
JR Z,loc_7CB
smod_w_7BF: .EQU $+1
loc_7BE: LD HL,0
LD (HL),A
INC HL
LD (smod_w_7BF),HL
LD A,30H
LD (smod_b_7BA),A
loc_7CB: DEC C
JR NZ,loc_787
LD A,(byte_2891)
AND 0FH
ADD A,30H
LD HL,(smod_w_7BF)
LD (HL),A
INC HL
LD (HL),0
RET
sub_7DD: PUSH AF
smod_b_7DF: .EQU $+1
ADD A,0
LD (smod_b_7DF),A
POP AF
RET
loc_7E5: .db 20h ;
.db 83h ; ?
.db 0B8h ; ¸
.db 0EDh ; í
loc_7E9: .db 0E3h ; ã
.db 20h ;
.db 0BBh ; »
.db 0DEh ; Þ
sub_7ED: PUSH AF
smod_w_7F0: .EQU $+2
LD IY,loc_289D
LD IX,loc_2899
XOR (ix+0)
LD H,0
LD L,A
ADD HL,HL
ADD HL,HL
LD B,H
LD C,L
ADD IY,BC
LD A,(IY)
XOR (IX+1)
LD (ix+0),A
LD A,(IY+1)
XOR (IX+2)
LD (IX+1),A
LD A,(IY+2)
XOR (IX+3)
LD (IX+2),A
LD A,(IY+3)
LD (IX+3),A
POP AF
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_825: push de ; CODE XREF: sub_8D1+Fp
push hl
ld hl,(smod_w_7F0)
ld bc,3FFh
add hl,bc
push hl
pop iy
ld ix, loc_7E5
xor a
loc_836: push af ; CODE XREF: sub_825+5Bj
ld hl,0FFFFh
ld de,0FFFFh
xor e
ld e, a
ld b,8
loc_841: scf ; CODE XREF: sub_825+3Bj
rr h
rr l
rr d
rr e
jr nc,loc_860
ld a,e
xor (ix+0)
ld e, a
ld a,d
xor (ix+1)
ld d,a
ld a,l
xor (ix+2)
ld l, a
ld a,h
xor (ix+3)
ld h,a
loc_860: djnz loc_841 ; CODE XREF: sub_825+25j
ld a,h
cpl
ld (iy+0), a
dec iy
ld a,l
cpl
ld (iy+0), a
dec iy
ld a,d
cpl
ld (iy+0), a
dec iy
ld a,e
cpl
ld (iy+0), a
dec iy
pop af
inc a
jr nz,loc_836
pop hl
pop de
ret
;----------------------------------------------------------------------------
sub_885: PUSH AF ; CODE XREF: sub_13BA+Fp
smod_w_887: .equ $+1 ; self modifying
LD HL,0
LD DE,1021H
XOR H
LD H,A
LD B,8
loc_890: ADD HL,HL
JR NC,loc_899
LD A,H
XOR D
LD H,A
LD A,L
XOR E
LD L,A
loc_899: DJNZ loc_890
LD (smod_w_887),HL
POP AF
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_8A0: xor a ; CODE XREF: sub_13BA+9p
ld h,a
ld l, a
ld (smod_b_7DF),a
ld (smod_w_887),hl
ld hl,loc_2899
jp loc_726
;----------------------------------------------------------------------------
byte_8AF: .db 4 ; DATA XREF: sub_3C9+Aw sub_8D1+34r
byte_8B0: .db 0 ; DATA XREF: sub_8D1+23r
byte_8B1: .db 0 ; DATA XREF: sub_961r
byte_8B2: .db 0 ; DATA XREF: sub_961+14r
byte_8B3: .db 0 ; DATA XREF: seg000:0A3Cr
word_8B4: .dw 0 ; DATA XREF: sub_8B6+17w
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_8B6: xor a ; CODE XREF: sub_8D1+20p
ld c,a
ld b,8
ld a,h
loc_8BB: rlca ; CODE XREF: sub_8B6+Cj
set 7, c
jr c,loc_8C4
rr c
djnz loc_8BB
loc_8C4: ld a,h ; CODE XREF: sub_8B6+8j
and c
ld h,a
ld l, 0
ld (word_2CEB),hl
dec hl
ld (word_8B4),hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_8D1: xor a ; CODE XREF: start+7Fp
ld hl,byte_2C9D
ld b,61h
call sub_1786
ld hl,1808h
call sub_64E
call sub_825
ld hl,(word_179E)
ld (word_2CE9),hl
ld de,(6)
ex de,hl
or a
sbc hl,de
call sub_8B6
ld a,(byte_8B0)
cp 0
jr z,loc_8FD
ld a,7
loc_8FD: ld (byte_2CA4),a ; CODE XREF: sub_8D1+28j
ld a,10h
ld (byte_2C9E),a
ld a,(byte_8AF)
cp 3
jr c,loc_947
ld a,1
ld (smod_b_B0A),a
call loc_ACF
jp c,loc_954
or a
jr z,loc_92B
cp 4
jr z,loc_924
cp 0Fh
jr nz,loc_924
jr locret_953
loc_924: call sub_BB4 ; CODE XREF: sub_8D1+4Bj
jr c,loc_954 ; sub_8D1+4Fj
jr locret_953
;----------------------------------------------------------------------------
loc_92B: ld a,3 ; CODE XREF: sub_8D1+47j
ld (byte_8AF),a ; sub_8D1+74j
xor a
ld (byte_2D04),a
call sub_11C1
jr c,loc_954
call sub_961
jr c,loc_954
jr z,locret_953
call sub_11FA
jr c,loc_954
jr loc_92B
;----------------------------------------------------------------------------
loc_947: call sub_961 ; CODE XREF: sub_8D1+39j
jr c,loc_954
jr z,locret_953
call sub_11FA
jr c,loc_954
locret_953: ret ; CODE XREF: sub_8D1+51j
;----------------------------------------------------------------------------
loc_954: call sub_DD9 ; CODE XREF: sub_8D1+43j
ld a,(byte_2CA5) ; sub_8D1+56j
cp 0FFh
call z,sub_D0E
jr locret_953
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_961: ; CODE XREF: sub_8D1+68p
; sub_8D1+76p ...
ld a,(byte_8B1)
cpl
ld hl,8B2h
or (hl)
ld (byte_2CA3),a
ld a,(byte_2CA4)
or a
jr z,loc_975
ld (byte_2CA1),a
loc_975: ; CODE XREF: sub_961+Fj
ld a,(byte_8B2)
cp 0FFh
jr z,loc_988
ld a,(byte_2CA2)
cp 2
jr nz,loc_988
ld a,0
ld (byte_2CA3),a
loc_988: ; CODE XREF: sub_961+19j
; sub_961+20j
ld a,(byte_2CA2)
cp 1
jr nz,loc_994
ld a,0FFh
ld (byte_2CA3),a
loc_994: ; CODE XREF: sub_961+2Cj
ld a,(byte_2CA1)
cp 7
jr z,loc_9AE
ld a,(byte_2CA1)
cp 3
jr nz,loc_9AE
ld a,(byte_2CA3)
cp 0FFh
jr nz,loc_9AE
ld a,7
ld (byte_2CA1),a
loc_9AE: ; CODE XREF: sub_961+38j
; sub_961+3Fj ...
ld a,(byte_8AF)
cp 3
jr c,loc_9E3
call sub_643
ld hl,(word_2CE9)
xor a
or (hl)
scf
ret z
push hl
ld b,1
call sub_476
dec hl
ld (hl),20h
pop hl
ld de,loc_2CD0
ld a,7
ld (de),a
ld a,0FFh
call sub_172E
ld hl,(word_2CD2)
ld de,byte_17A3
call sub_1492
ld hl,(byte_17A0)
ld (word_17A2),hl
loc_9E3: call sub_4A4 ; CODE XREF: sub_961+52j
ld de,byte_17A3 ; seg000:0A2Cj
call sub_169E
jr nz,loc_A11
ld de,byte_17A3
ld c,16h
call sub_471
ret c
ld a,0FFh
ld (byte_2CA5),a
ld hl,byte_280E
call sub_64A
ld a,(byte_2CD1)
cp 2
jr c,loc_A0D
sub_A09: ld de,(byte_2CD4) ; CODE XREF: seg000:0A11p
loc_A0D: ld a,1 ; CODE XREF: sub_961+A6j
or a
ret
;----------------------------------------------------------------------------
loc_A11: call sub_A09 ; CODE XREF: sub_961+8Bj
ld a,(byte_8AF)
cp 4
jr nz,loc_A24
ld a,(byte_2CA1)
cp 7
jr nz,loc_A35
jr loc_A2E
;----------------------------------------------------------------------------
loc_A24: ; CODE XREF: seg000:0A19j seg000:0A41j
ld de,byte_17A3
ld c,13h
call sub_471
jr nc,loc_9E3
loc_A2E: ; CODE XREF: seg000:0A22j
call sub_552
ld a,5
scf
ret
;----------------------------------------------------------------------------
loc_A35: ; CODE XREF: seg000:0A20j
ld a,(byte_2CA1)
cp 3
jr z,loc_A43
ld a,(byte_8B3)
cp 0FFh
jr nz,loc_A24
loc_A43: ; CODE XREF: seg000:0A3Aj
ld de,2811h
ld c,1Ah
call bdos ; BDOS function 26 (F_DMAOFF) - Set DMA address
ld e, 1
ld c,2Ch
call bdos ; BDOS function 44 (F_MULTISEC) - Set number of records to read/write at once
ld de,byte_17A3
ld c,0Fh
call sub_471
ret c
ld a,0FFh
ld (byte_2CA5),a
ld hl,byte_280E
call sub_64A
ld de,byte_17A3
ld c,23h
call sub_471
ret c
ld hl,17C7h
ld (hl),0
ld hl,17C4h
call sub_729
ld de,loc_2CAB
call sub_692
ex de,hl
ld b,7
loc_A83: ; CODE XREF: seg000:0A90j
push hl
sla (hl)
inc hl
rl (hl)
inc hl
rl (hl)
inc hl
rl (hl)
pop hl
djnz loc_A83
ld de,byte_17A3
ld c,21h
call sub_471
ret c
ld a,(byte_2CA1)
cp 3
jr z,loc_AA6
ld a,9
or a
ret
;----------------------------------------------------------------------------
loc_AA6: ; CODE XREF: seg000:0AA0j
ld a,80h
ld (byte_280E),a
loc_AAB: ; CODE XREF: seg000:0AB5j
ld hl,byte_280E
call sub_654
jr z,loc_AC6
cp 1Ah
jr nz,loc_AAB
ld a,(2810h)
dec a
ld (280Fh),a
ld hl,byte_280E
ld a,7Fh
sub (hl)
jr loc_AC8
;----------------------------------------------------------------------------
loc_AC6: ; CODE XREF: seg000:0AB1j
ld a,80h
loc_AC8: ; CODE XREF: seg000:0AC4j
ld (byte_280E),a
ld a,1
or a
ret
;----------------------------------------------------------------------------
loc_ACF: ; CODE XREF: sub_8D1+40p
; sub_BB4+Ep
xor a
ld (byte_2D04),a
ld a,4
ld hl,8AFh
cp (hl)
ld a,0
ret nz
ld hl,word_2CED
ld b,11h
xor a
call sub_1786
call sub_FAA
ld a,(byte_2CA6)
cp 0FFh
ld b,5
jr z,loc_AF3
ld b,0Ah
loc_AF3: push bc
ld ix,loc_2CE0 ; CODE XREF: seg000:0AEFj
ld (ix+3), 20h
ld (ix+2), 0
ld hl,(word_2CEB)
ld (ix+0), l
ld (ix+1), h
smod_b_B0A: .equ $+1 ; DATA XREF: sub_8D1+3Dw
ld a,1 ; self modifying value
CALL sub_13BA
LD A,(smod_b_B0A)
CP 5
JR NZ,0B1AH
LD A,1
LD (smod_b_B0A),A
loc_B1A: CALL 0FD1H
LD HL,loc_B96
LD BC,0AH
CPIR
JP Z,sub_67F
loc_B28: LD HL,byte_2D04
INC (HL)
CALL sub_482
loc_B2F: POP BC
DJNZ loc_AF3
XOR A
RET
loc_B34: POP BC
LD A,0FFH
SCF
RET
loc_B39: POP BC
CALL 0D9BH
LD A,0FH
RET
loc_B40: LD HL,loc_2CE0
CALL sub_688
JR loc_B68
loc_B48: LD IX,loc_2CA7
LD A,(IX+3)
AND 40H
LD (byte_2C9D),A
CALL loc_EC7
CP 0EBH
LD A,6
JR NZ,loc_B6A
LD HL,(word_2CE9)
LD DE,loc_2CAF
LD BC,20H
LDIR
loc_B68: LD A,3
loc_B6A: PUSH AF
LD HL,loc_2CE0
CALL sub_688
POP AF
CALL sub_13BA
CALL sub_FC9
JP loc_B28
loc_B7B: LD HL,loc_2CA7
LD DE,loc_2C9F
CALL sub_692
LD A,1
LD (smod_b_B0A),A
CALL loc_EC7
CP 0EBH
LD A,6
JR NZ,loc_B6A
POP BC
LD A,4
RET
loc_B96: .db 0 ;
.db 0Bh ;
.db 0FEh ; þ
.db 4 ;
.db 2 ;
.db 11h ;
.db 12h ;
.db 0Fh ;
.db 8 ;
.db 10h ;
loc_BA0: .dw loc_B34
.dw loc_B39
.dw loc_B1A
.dw loc_B34
.dw loc_B40
.dw loc_B48
.dw loc_B7B
.dw loc_B28
.dw loc_B2F
.dw loc_B2F
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_BB4: call sub_BD3 ; CODE XREF: sub_8D1+53p
ret c ; sub_BB4+14j
cp 0Bh
jr z,loc_BC2
cp 5
jr z,loc_BC2
or a
ret
;----------------------------------------------------------------------------
loc_BC2: call loc_ACF ; CODE XREF: sub_BB4+6j sub_BB4+Aj
ret c
cp 4
jr z,sub_BB4
cp 0Fh
ld a,0
ret z
ld a,0FFh
scf
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_BD3: call sub_961 ; CODE XREF: sub_BB4p
jr nc,loc_BDF
ld a,5
ld (smod_b_B0A),a
or a
ret
loc_BDF: cp 9 ; CODE XREF: sub_BD3+3j
jr z,loc_BE9
ld hl,loc_2CAB
call sub_688
loc_BE9: xor a ; CODE XREF: sub_BD3+Ej
ld (byte_2D04),a
call sub_FAA
loc_BF0: call sub_FC9
call sub_D30
ld hl,loc_2CAB
ld de,loc_2CE0
call sub_692
ld hl,word_1808
call sub_64E
ld a,9
call sub_13BA
loc_C0A: call sub_FD1
ld hl,stab_CE4
ld bc,7
cpir
jp z,sub_67F
ld a,0FFh
scf
ret
;----------------------------------------------------------------------------
loc_C1C: LD HL,byte_2D04
INC (HL)
CALL sub_482
LD HL,byte_2D04
LD A,0AH
CP (HL)
JP NZ,loc_BF0
LD A,0FFH
SCF
RET
loc_C30: CALL loc_EC7
JP loc_BF0
loc_C36: LD DE,loc_2CA7
LD HL,loc_2CAB
CALL sub_6D3
JP NZ,loc_BF0
CALL sub_D0E
JR Z,loc_C50
loc_C47: LD A,0CH
LD (smod_b_B0A),A
LD A,0FFH
SCF
RET
loc_C50: CALL sub_643
LD A,0BH
OR A
RET
loc_C57: LD HL,byte_2D04
INC (HL)
CALL sub_482
LD HL,byte_2D04
LD A,0AH
CP (HL)
JR NZ,loc_C6A
LD A,0FFH
SCF
RET
loc_C6A: LD HL,loc_2CAF
CALL sub_DDC
JP loc_BF0
loc_C73: LD DE,loc_2CA7
LD HL,loc_2CAB
CALL sub_6D3
JP NZ,0C57H
loc_C7F: CALL loc_529
CALL loc_EC7
LD HL,stab_CF9
LD BC,7
CPIR
JP Z,sub_67F
JP loc_C1C
loc_C93: LD A,0FFH
SCF
RET
sub_C97: XOR A
LD (byte_2D04),A
LD DE,loc_2CF9
LD HL,loc_2CAB
LD BC,loc_2CAB
CALL sub_6E4
JP sub_FBA
loc_CAA: CALL sub_C97
JP loc_C0A
loc_CB0: CALL sub_C97
JP loc_C7F
loc_CB6: CALL sub_C97
LD HL,loc_2CAB
LD DE,loc_2CE0
CALL sub_692
LD A,3
CALL sub_13BA
JP loc_C7F
loc_CCA: CALL sub_C97
CALL sub_D30
JP C,loc_C47
LD HL,loc_2CAB
LD DE,loc_2CE0
CALL sub_692
LD A,3
CALL sub_13BA
JP loc_C0A
stab_CE4: .db 6
.db 0FEh
.db 4
.db 0Bh
.db 0FFh
.db 0Ah
.db 0FCh
.dw loc_C1C
.dw loc_C73
.dw loc_C57
.dw loc_C36
.dw loc_C30
.dw loc_C1C
.dw loc_C1C
stab_CF9: .db 0EBh
.db 0EAh
.db 0E9h
.db 0E8h
.db 0FFh
.db 0FEh
.db 010h
.dw loc_C93
.dw loc_C1C
.dw loc_C57
.dw loc_CAA
.dw loc_CB0
.dw loc_CB6
.dw loc_CCA
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_D0E: call sub_50B ; CODE XREF: sub_8D1+8Bp
call sub_D30 ; sub_11FA+64p
ret c
loc_D15: ld a,1Ah ; CODE XREF: sub_D0E+13j
call loc_D68
ret c
ld hl,byte_280E
ld a,1
cp (hl)
jr nz,loc_D15
ld a,0
ld (byte_2CA5),a
ld c,10h
ld de,byte_17A3
jp sub_471
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_D30: ld bc,(word_2CF5) ; CODE XREF: sub_BD3+20p
ld a,b ; sub_D0E+3p ...
or c
ret z
ld hl,(word_2CE9)
loc_D3A: ld a,(byte_2CA3) ; CODE XREF: sub_D30+2Ej
cp 0FFh
jr z,loc_D52
smod_b_D41: .equ $+1
loc_D41: ld a,0 ; DATA XREF: sub_D30+23w
cp 0Dh
jr z,loc_D52
ld a,(hl)
cp 0Ah
jr nz,loc_D52
ld a,0Dh
call loc_D68
ret c
loc_D52: ld a,(hl) ; CODE XREF: sub_D30+Fj sub_D30+15j
ld (smod_b_D41),a
inc hl
dec bc
call loc_D68
ret c
ld a,b
or c
jr nz,loc_D3A
call sub_50B
call sub_FAA
xor a
ret
;----------------------------------------------------------------------------
loc_D68: ld (byte_D6F),a ; CODE XREF: sub_D0E+9p sub_D30+1Ep
push bc
push de
push hl
byte_D6F: .equ $+1
loc_D6E: LD C,0
LD HL,byte_280E
CALL sub_669
JR NZ,loc_0D97
LD HL,byte_280E
CALL sub_64A
LD C,1AH ;set dma
LD DE,2811H
CALL bdos
LD C,2CH ;???
LD E,1
CALL bdos
LD C,15H ;wr. seq.
LD DE,byte_17A3
CALL sub_471
JR NC,loc_D6E
loc_0D97: POP HL
POP DE
POP BC
RET
sub_D9B: LD HL,loc_2CE0
CALL sub_688
LD B,4
loc_0DA3: PUSH BC
LD A,8
CALL 13BAH
LD B,64H
CALL sub_DE7
JR C,loc_DB8
CP 4FH
JR Z,loc_DBC
CP 0FDH
JR Z,loc_DBC
loc_DB8: POP BC
DJNZ loc_0DA3
PUSH BC
loc_DBC: POP BC
LD B,1
CALL sub_DE7
XOR A
RET
stab_DC4: .db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 18h ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 8 ;
.db 0 ;
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_DD9: ld hl,stab_DC4 ; CODE XREF: sub_8D1+83p
sub_DDC: ld a,(hl) ; CODE XREF: sub_DDC+9j sub_13BA+6p
inc hl
or a
ret z
push hl
call loc_145C
pop hl
jr sub_DDC
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_DE7: push bc ; CODE XREF: sub_FD1+11p
call sub_16AA ; sub_11C1+2Dp ...
call nz,sub_16A5
cp 1Bh
ld a,18h
ld c,0Ah
call z,sub_57F
pop bc
loc_DF8: call sub_5D4 ; CODE XREF: sub_DE7+16j
jr nz,loc_E03
djnz loc_DF8
ld a,0FEh
scf
ret
loc_E03: or a ; CODE XREF: sub_DE7+14j
ret
;----------------------------------------------------------------------------
loc_E05: LD B,64H
CALL sub_DE7
RET C
AND 7FH
LD HL,loc_E2A
LD BC,2
CPIR
JR Z,loc_E05
LD BC,3
CPIR
RET Z
LD B,A
AND 60H
JR NZ,loc_E28
LD A,(byte_2C9D)
OR A
JR NZ,loc_E05
loc_E28: LD A,B
RET
loc_E2A: .db 11h ; dc1
.db 13h ; dc3
.db 0dh ; cr
.db 0ah ; lf
.db 18h ; can
sub_E2F: ld b,64H
CALL sub_DE7
RET C
LD E,A
loc_E36: AND 60H
LD A,E
RET NZ
CP 18H
JR Z,loc_E50
LD HL,loc_EA2
LD BC,4
CPIR
JR Z,sub_E2F
LD A,(byte_2C9D)
OR A
JR NZ,sub_E2F
LD A,E
RET
loc_E50: LD B,64H
CALL sub_DE7
RET C
CP 18H
JR NZ,loc_0E74
LD B,64h
CALL sub_DE7
RET C
CP 18H
JR NZ,loc_0E74
LD B,64H
CALL sub_DE7
RET C
CP 18H
JR NZ,loc_0E74
LD B,64H
CALL sub_DE7
RET C
loc_0E74: LD HL,loc_EA6
LD BC,0BH
CPIR
JP Z,sub_67F
LD L,A
LD A,(byte_2C9D)
OR A
JR Z,loc_E8B
LD A,L
AND 60H
JR Z,loc_E50
loc_E8B: LD A,L
AND 60H
CP 40H
JR NZ,loc_E9C
LD A,L
XOR 40H
RET
loc_E96: LD A,7FH
RET
loc_E99: LD A,0FFH
RET
loc_E9C: LD A,0FFH
loc_E9E: OR 80H
SCF
RET
loc_EA2: .db 11h ;
.db 91h ; ?
.db 13h ;
.db 93h ; ?
loc_EA6: .db 11h ;
.db 91h ; ?
.db 13h ;
.db 93h ; ?
.db 18h ;
.db 68h ; h
.db 69h ; i
.db 6Ah ; j
.db 6Bh ; k
.db 6Ch ; l
.db 6Dh ; m
.dw loc_E99
.dw loc_E96
.dw loc_E9E
.dw loc_E9E
.dw loc_E9E
.dw loc_E9E
.dw loc_E9E
.dw loc_E50
.dw loc_E50
.dw loc_E50
.dw loc_E50
loc_EC7: OR A
LD HL,(word_2CEB)
LD DE,(word_2CEF)
SBC HL,DE
JP C,sub_F4E
CALL sub_8A0
LD HL,0
LD (loc_2CF9),HL
loc_EDD: CALL sub_E2F
JP C,loc_F38
CALL sub_FA2
CALL Z,sub_7ED
CALL NZ,sub_885
LD HL,(word_2CEB)
LD BC,(word_2CEF)
SBC HL,BC
JP Z,sub_F4E
INC BC
LD (word_2CEF),BC
LD HL,(loc_2CF9)
INC HL
LD (loc_2CF9),HL
LD HL,(word_2CED)
LD (HL),A
INC HL
LD (word_2CED),HL
JR loc_EDD
sub_F0E: .db 0E8h ; è
.db 0E9h ; é
.db 0EAh ; ê
.db 0EBh ; ë
.db 98h ; ?
.db 0FFh ; ÿ
.db 0FEh ; þ
.dw sub_F52
.dw sub_F4E
.dw sub_F54
.dw sub_F58
.dw sub_F58
.dw sub_F58
.dw sub_F58
stab_F23: .db 0E8h ; è
.db 0E9h ; é
.db 0EAh ; ê
.db 0EBh ; ë
.db 98h ; ?
.db 0FFh ; ÿ
.db 0FEh ; þ
.dw sub_F52
.dw sub_F4E
.dw sub_F54
.dw sub_F7C
.dw sub_F7C
.dw sub_F7C
.dw sub_F7C
loc_F38: LD HL,stab_F23
LD BC,7
CALL sub_FA2
JR Z,loc_F49
LD HL,sub_F0E
LD BC,7
loc_F49: CPIR
JP Z,sub_67F
sub_F4E: LD A,0FFH
SCF
RET
sub_F52: SCF
RET
sub_F54: LD A,10H
SCF
RET
sub_F58: LD (byte_2CFD),A
AND 7FH
CALL sub_885
LD B,2
loc_F62: PUSH BC
CALL sub_E2F
CALL sub_885
POP BC
JP C,loc_F38
DJNZ loc_F62
LD A,H
OR L
JR Z,loc_F77
loc_F73: LD A,0FFH
SCF
RET
loc_F77: LD A,(byte_2CFD)
OR A
RET
sub_F7C: LD (byte_2CFD),A
AND 7FH
CALL sub_7ED
LD B,4
loc_F86: PUSH BC
CALL sub_E2F
CALL sub_7ED
POP BC
JP C,loc_F38
DJNZ loc_F86
LD HL,loc_2899
LD DE,loc_7E9
CALL sub_6D3
JP Z,loc_F77
JP loc_F73
sub_FA2: LD E,A
LD A,(byte_2C9E)
CP 20H
LD A,E
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_FAA: ld hl,word_2CE9 ; CODE XREF: seg000:0AE5p sub_BD3+1Ap
ld de,word_2CED
ldi
ldi
ld hl,0
ld (word_2CEF),hl
sub_FBA: ld hl,word_2CED ; CODE XREF: sub_11FA+4Ep
ld de,loc_2CF3
loc_FC0: ldi ; CODE XREF: sub_FC9+6j
ldi
ldi
ldi
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_FC9: ld hl,loc_2CF3 ; CODE XREF: sub_BD3+1Dp
ld de,word_2CED ; sub_11FA+56p ...
jr loc_FC0
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_FD1: xor a ; CODE XREF: sub_BD3+37p
ld (byte_2D01),a
ld hl,400h
ld (word_2CFE),hl
loc_FDB: ld a,5 ; CODE XREF: sub_FD1+61j
ld (byte_2D00),a
loc_FE0: ld b,64h
call sub_DE7
jp c,loc_108A
ld hl,stab_109E
ld bc,3
cpir
jp z,sub_67F
jr loc_1024
;----------------------------------------------------------------------------
LD HL,byte_2D00
DEC (HL)
LD A,10H
JP Z,loc_108A
LD B,0AH
CALL sub_DE7
JR C,loc_FE0
LD HL,stab_10A7
LD BC,2
CPIR
JP Z,sub_67F
JR loc_1024
LD HL,byte_2D00
DEC (HL)
LD A,10H
JP Z,loc_108A
JR loc_FE0
LD B,0AH
CALL sub_DE7
JR C,loc_1035
loc_1024: ld hl,(word_2CFE) ; CODE XREF: sub_FD1+22j
dec hl
ld (word_2CFE),hl
ld a,h
or l
ld a,0FCh
jp z,loc_108A
jp loc_FDB
;----------------------------------------------------------------------------
loc_1035: LD A,0FFH
JP loc_108A
LD A,5
LD (byte_2D00),A
CALL loc_E05
JR C,loc_108A
LD HL,stab_10AD
LD BC,2
CPIR
JP Z,sub_67F
JR loc_1024
CALL loc_E05
JR C,loc_108A
LD HL,stab_10B3
LD BC,4
CPIR
JP Z,sub_67F
JR loc_1024
LD A,10H
LD (byte_2C9E),A
CALL sub_113F
JR loc_107F
LD A,10H
LD (byte_2C9E),A
CALL sub_1100
JR loc_107F
LD A,20H
LD (byte_2C9E),A
CALL sub_10C5
loc_107F: PUSH AF
LD HL,loc_2CA7
LD DE,loc_2CE4
CALL sub_692
POP AF
loc_108A: ld hl,stab_10BF ; CODE XREF: sub_FD1+14j
ld bc,6 ; sub_FD1+5Ej
cpir
jr nz,loc_109C
cp 98h
jr nz,loc_109A
ld a,10h
loc_109A: scf ; CODE XREF: sub_FD1+C5j
ret
loc_109C: or a ; CODE XREF: sub_FD1+C1j
ret
;----------------------------------------------------------------------------
stab_109E: .db 18h ;
.db 0AAh ; ª
.db 2Ah ; *
.db 3Ah ; :
.db 10h ;
.db 3Ah ; :
.db 10h ;
.db 0F5h ; õ
.db 0Fh ;
stab_10A7: .db 6Bh ; k
.db 18h ;
.db 12h ;
.db 10h ;
.db 1Dh ;
.db 10h ;
stab_10AD: .db 2Ah ; *
.db 18h ;
.db 51h ; Q
.db 10h ;
.db 3Fh ; ?
.db 10h ;
stab_10B3: .db 43h ; C
.db 41h ; A
.db 42h ; B
.db 18h ;
.db 0F5h ; õ
.db 0Fh ;
.db 63h ; c
.db 10h ;
.db 6Dh ; m
.db 10h ;
.db 77h ; w
.db 10h ;
stab_10BF: .db 98h ; ?
.db 6 ;
.db 10h ;
.db 0FFh ; ÿ
.db 0FEh ; þ
.db 0FCh ; ü
sub_10C5: CALL sub_8A0
CALL sub_E2F
RET C
LD (byte_2D01),A
CALL sub_7ED
LD HL,loc_2CA7
LD B,4
loc_10D7: PUSH BC
PUSH HL
CALL sub_E2F
CALL sub_7ED
POP HL
POP BC
LD (HL),A
INC HL
RET C
DJNZ loc_10D7
LD B,4
loc_10E8: PUSH BC
CALL sub_E2F
CALL sub_7ED
POP BC
RET C
DJNZ loc_10E8
LD HL,loc_2899
LD DE,loc_7E9
CALL sub_6D3
JR Z,loc_1132
JR loc_113B
sub_1100: CALL sub_8A0
CALL sub_E2F
RET C
LD (byte_2D01),A
CALL sub_885
LD HL,loc_2CA7
LD B,4
loc_1112: PUSH BC
PUSH HL
CALL sub_E2F
CALL sub_885
POP HL
POP BC
LD (HL),A
INC HL
RET C
DJNZ loc_1112
LD B,2
loc_1123: PUSH BC
CALL sub_E2F
CALL sub_885
POP BC
RET C
DJNZ loc_1123
LD A,H
OR L
JR NZ,loc_113B
loc_1132: LD A,0FFH
LD (byte_2CA6),A
LD A,(byte_2D01)
RET
loc_113B: LD A,0FFH
SCF
RET
sub_113F: CALL sub_8A0
CALL sub_1194
RET C
LD (byte_2D01),A
CALL sub_885
LD HL,loc_2CA7
LD B,4
loc_1151: PUSH BC
PUSH HL
CALL sub_1194
JR NC,loc_115B
POP HL
POP BC
RET
loc_115B: CALL sub_885
POP HL
POP BC
LD (HL),A
INC HL
DJNZ loc_1151
LD B,2
loc_1166: PUSH BC
CALL sub_1194
JR NC,loc_116E
POP BC
RET
loc_116E: CALL sub_885
POP BC
DJNZ loc_1166
LD A,H
OR L
JR NZ,loc_1190
LD B,0AH
CALL sub_DE7
CP 0DH
JR NZ,loc_1186
LD B,0AH
CALL sub_DE7
loc_1186: OR A
LD A,0FFH
LD (byte_2CA6),A
LD A,(byte_2D01)
RET
loc_1190: LD A,0FFH
SCF
RET
sub_1194: CALL loc_E05
RET C
CALL sub_11B3
JR NZ,loc_11AF
RLCA
RLCA
RLCA
RLCA
LD B,A
PUSH BC
CALL loc_E05
POP BC
RET C
CALL sub_11B3
JR NZ,loc_11AF
OR B
RET
loc_11AF: LD A,0FFH
SCF
RET
sub_11B3: LD L,A
SUB 30H
CP 0AH
JR C,loc_11BC
SUB 27H
loc_11BC: LD L,A
AND 0F0H
LD A,L
RET
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_11C1: ld a,0FFh ; CODE XREF: sub_8D1+63p
ld (byte_2D02),a ; sub_11C1+30j
call sub_FAA
ld a,(byte_2C9E)
cp 10h
ld a,43h
jr z,loc_11D4
ld a,15h
loc_11D4: call loc_145C ; CODE XREF: sub_11C1+Fj
ld b,64h
call sub_1289
or a
jr z,loc_11F3
cp 0F6h
jr z,loc_11E7
ld a,0FFh
scf
ret
;----------------------------------------------------------------------------
loc_11E7: ld a,6 ; CODE XREF: sub_11C1+20j
call loc_145C
ld b,0Ah
call sub_DE7
jr sub_11C1
;----------------------------------------------------------------------------
loc_11F3: ld a,6 ; CODE XREF: sub_11C1+1Cj
call loc_145C
xor a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_11FA: ld a,0FFh ; CODE XREF: sub_8D1+6Fp
ld (byte_2D02),a ; sub_8D1+7Dp ...
ld (byte_2CA3),a
xor a
ld (byte_2D07),a
call sub_FAA
ld hl,loc_2CAB
call sub_688
ld a,(byte_2C9E)
cp 10h
ld a,43h
jr z,loc_121A
ld a,15h
loc_121A: call loc_145C ; CODE XREF: sub_11FA+1Cj
loc_121D: ld a,(byte_2D07) ; CODE XREF: sub_11FA+5Ej
or a
ld b,82h
jr z,loc_1227
ld b,32h
loc_1227: call sub_1289 ; CODE XREF: sub_11FA+29j
jr c,loc_125A
push af
call sub_50B
pop af
ld hl,byte_2D07
cp (hl)
jr z,loc_1250
dec a
cp (hl)
jr nz,loc_126D
inc (hl)
ld de,word_2CEF
ld hl,loc_2CAB
ld bc,loc_2CAB
call sub_6E4
call sub_FBA
call sub_D30
jr c,loc_1285
loc_1250: call sub_FC9 ; CODE XREF: sub_11FA+3Bj
ld a,6
call loc_145C
jr loc_121D
loc_125A: cp 0F6h ; CODE XREF: sub_11FA+30j
jr nz,loc_126D
call sub_D0E
jr c,loc_1285
call sub_643
ld a,6
call loc_145C
xor a
ret
;----------------------------------------------------------------------------
loc_126D: cp 0FFh ; CODE XREF: sub_11FA+3Fj
jr nz,loc_1285 ; sub_11FA+62j
ld a,(byte_2D02)
cp 0FFh
jr nz,loc_1285
ld a,(byte_2C9E)
or a
jr z,loc_1285
xor a
ld (byte_2C9E),a
jp sub_11FA
loc_1285: ld a,0FFh ; CODE XREF: sub_11FA+54j
scf ; sub_11FA+67j ...
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1289: ld a,b ; CODE XREF: sub_11C1+18p
ld (byte_2D03),a ; sub_11FA+2Dp
xor a
ld (byte_2D04),a
ld a,0
ld (byte_2D09),a
loc_1296: ld a,(byte_2D03) ; CODE XREF: sub_1289+12Aj
ld b,a
call sub_DE7
ld (byte_2D08),a
ld hl,loc_12AE
ld bc,4
cpir
jp z,sub_67F
jp loc_137A
;----------------------------------------------------------------------------
loc_12AE: .db 2 ;
.db 1 ;
.db 4 ;
.db 18h ;
.dw loc_136A
.dw loc_135F
.dw loc_12BF
.dw loc_12BA
loc_12BA: LD HL,400H
JR 12C2H
loc_12BF: LD HL,80H
LD (word_2D05),HL
ld b,0ah
call sub_DE7
ld (smod_b_12D9),A
jp c,loc_137A
ld b,0ah
call sub_DE7
jp c,loc_137A
smod_b_12D9: .equ $+1
add a,0
cp 0ffh
jp nz,loc_137A
call sub_8A0
ld ix,(word_2CED)
loc_12E6: LD B,0AH
PUSH IX
CALL sub_DE7
POP IX
LD (byte_2D08),A
JP C,loc_137A
LD (IX),A
INC IX
CALL sub_7DD
CALL sub_885
LD BC,(word_2CEF)
INC BC
LD (word_2CEF),BC
LD DE,(word_2D05)
DEC DE
LD (word_2D05),DE
LD A,D
OR E
JR NZ,loc_12E6
LD (word_2CED),IX
LD B,0AH
CALL sub_DE7
LD (byte_2D08),A
JP C,loc_137A
LD A,(byte_2C9E)
CP 10H
JR NZ,loc_1352
LD A,(byte_2D08)
CALL sub_885
LD B,0AH
CALL sub_DE7
LD (byte_2D08),A
JP C,loc_137A
CALL sub_885
LD A,H
OR L
JP NZ,loc_137A
loc_1345: XOR A
LD (byte_2D04),A
LD A,0
LD (byte_2D02),A
LD A,(smod_b_12D9)
RET
loc_1352: ld a,(byte_2D08)
ld l,a
ld a,(smod_b_7DF)
sub l
jr z,loc_1345
jp loc_137A
loc_135F: ld b,0ah
call sub_DE7
ld a,0f6h
ret c
jp loc_137A
loc_136A: ld a,0ffh
ld hl,byte_2D09
cp (hl)
jr nz,loc_1376
ld a,0ffh
scf
ret
loc_1376: ld (hl),a
jp loc_13A4
;----------------------------------------------------------------------------
loc_137A: ld a,0 ; CODE XREF: sub_1289+22j
ld (byte_2D09),a
loc_137F: ld b,0Ah ; CODE XREF: sub_1289+FBj
call sub_DE7
jr nc,loc_137F
ld a,(byte_2D02)
cp 0FFh
jr nz,loc_139A
ld a,(byte_2C9E)
cp 10h
ld a,43h
jr z,loc_13A1
ld a,15h
jr loc_13A1
loc_139A: ld a,28h ; CODE XREF: sub_1289+102j
ld (byte_2D03),a
ld a,15h
loc_13A1: call loc_145C ; CODE XREF: sub_1289+10Bj
loc_13A4: call sub_FC9 ; sub_1289+10Fj
ld hl,byte_2D04
inc (hl)
call sub_482
ld a,(byte_2D04)
cp 5
jp nz,loc_1296
ld a,0FFh
scf
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_13BA: ld (byte_2CE8),a ; CODE XREF: sub_BD3+34p
ld hl,loc_1403
call sub_DDC
call sub_8A0
ld a,(byte_2CE8)
call sub_885
call sub_1418
ld hl,loc_2CE0
ld b,4
loc_13D4: push bc ; CODE XREF: sub_13BA+26j
ld a,(hl)
inc hl
push hl
call sub_885
call sub_1418
pop hl
pop bc
djnz loc_13D4
ld a,(smod_w_887+1)
call sub_1418
ld a,(smod_w_887)
call sub_1418
ld a,0Dh
call loc_145C
ld a,0Ah
call loc_145C
ld a,(byte_2CE8)
cp 8
ret z
ld a,11h
jp loc_145C
;----------------------------------------------------------------------------
loc_1403: .db 2Ah ; *
.db 2Ah ; *
.db 18h ;
.db 42h ; B
.db 0 ;
loc_1408: .text "0123456789abcdef"
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1418: push af ; CODE XREF: sub_13BA+12p
ld hl,loc_1408 ; sub_13BA+21p ...
ld b,0
rra
rra
rra
rra
and 0Fh
ld c,a
add hl,bc
ld a,(hl)
call loc_145C
pop af
ld hl,loc_1408
ld b,0
and 0Fh
ld c,a
add hl,bc
ld a,(hl)
jp loc_145C
;----------------------------------------------------------------------------
loc_1438: LD (smod_b_145B),A
LD BC,+(loc_1480-stab_7B3)
LD HL,stab_7B3
CPIR
JP Z,sub_67F
AND 60H
JR NZ,loc_145A
LD A,(byte_2C9D)
OR A
JR Z,loc_145A
loc_1450: LD HL,smod_b_145B
SET 6,(HL)
LD A,18H
CALL loc_145C
smod_b_145B: .equ $+1
loc_145A: LD A,0
loc_145C: LD (smod_b_1468),A
loc_145F: CALL sub_588
CALL sub_5CD
JR Z,loc_145F
smod_b_1468: .equ $+1
LD A,0
JP loc_5C7
loc_146C: LD A,(smod_b_1468)
AND 7FH
CP 40H
JR NZ,loc_145A
JR loc_1450
stab_7B3: .db 18h
.db 0Dh
.db 8Dh
.db 10h
.db 90h
.db 11h
.db 91h
.db 13h
.db 93h
loc_1480: .dw loc_1450
.dw loc_1450
.dw loc_1450
.dw loc_1450
.dw loc_1450
.dw loc_1450
.dw loc_146C
.dw loc_146C
.dw loc_1450
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1492: push bc ; CODE XREF: start+56p sub_961+79p
ld (byte_2D0A),a
call sub_171E
push de
call sub_162C
ld (de),a
pop de
push de
call sub_14A7
pop de
pop bc
jr loc_151D
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_14A7: xor a ; CODE XREF: sub_1492+Ep
ld (de),a
ld (byte_2D0D),a
ld (byte_2D0C),a
call sub_1687
ld a,c
ld (byte_2D0E),a
push de
ld a,(hl)
cp 3Ah
jr nz,loc_14BD
inc hl
loc_14BD: ld b,8 ; CODE XREF: sub_14A7+13j
call sub_1522
pop de
ld a,(hl)
ld (byte_2D0B),a
cp 3Ah
jr nz,loc_14FE
inc hl
ld a,(byte_2D0A)
or a
jr z,loc_14D7
call sub_154A
jr z,loc_14E5
loc_14D7: call sub_159D ; CODE XREF: sub_14A7+29j
jr z,loc_14E5
ld a,(byte_2D0A)
or a
jr nz,loc_14E5
call sub_154A
loc_14E5: ld a,(byte_2D0D); CODE XREF: sub_14A7+2Ej
ld (de),a ; sub_14A7+33j ...
push de
inc de
call sub_1632
pop de
xor a
ld (byte_2D0C),a
push de
ld b,8
call sub_1522
pop de
ld a,(hl)
ld (byte_2D0B),a
loc_14FE: ld a,(byte_2D0B); CODE XREF: sub_14A7+22j
ex de,hl
ld bc,8
add hl,bc
ex de,hl
ld b,3
cp 2Eh
jr nz,loc_1513
inc hl
push de
call sub_1522
pop de
loc_1513: ex de,hl ; CODE XREF: sub_14A7+64j
ld bc,5
add hl,bc
ex de,hl
ld a,(byte_2D0E)
ld (de),a
loc_151D: ld a,(byte_2D0C); CODE XREF: sub_1492+13j
or a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1522: call sub_15D9 ; CODE XREF: sub_14A7+18p
ret z ; sub_14A7+4Fp ...
inc de
cp 2Ah
jr nz,loc_1533
ld a,3Fh
ld (de),a
call sub_1543
jr loc_153A
loc_1533: ld (de),a ; CODE XREF: sub_1522+7j
inc hl
cp 3Fh
call z,sub_1543
loc_153A: djnz sub_1522 ; CODE XREF: sub_1522+Fj
loc_153C: call sub_15D9 ; CODE XREF: sub_1522+1Fj
ret z
inc hl
jr loc_153C
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1543: push hl ; CODE XREF: sub_1522+Cp
ld hl,byte_2D0C ; sub_1522+15p
inc (hl)
pop hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_154A: push hl ; CODE XREF: sub_14A7+2Bp
push de ; sub_14A7+3Bp
call sub_1552
pop de
pop hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1552: call sub_164A ; CODE XREF: sub_154A+2p
jr z,loc_15CA
ex de,hl
inc hl
call sub_1652
ld b,a
inc b
ld a,(hl)
cp 41h
jr c,loc_1574
sub 40h
cp b
jr nc,loc_15CA
ld (byte_2D0D),a
inc hl
ld a,(hl)
cp 20h
ret z
call sub_1625
ret c
loc_1574: push hl ; CODE XREF: sub_1552+Fj
ld b,2
loc_1577: ld a,(hl) ; CODE XREF: sub_1552+30j
cp 20h
jr z,loc_1589
call sub_1625
jr c,loc_159A
inc hl
djnz loc_1577
ld a,(hl)
cp 20h
jr nz,loc_159A
loc_1589: pop hl ; CODE XREF: sub_1552+28j
call sub_165A
ld c,a
inc c
call sub_15FA
cp c
jr nc,loc_15CA
ld (byte_2D0E),a
xor a
ret
loc_159A: pop hl ; CODE XREF: sub_1552+2Dj
jr loc_15CA ; sub_1552+35j
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_159D: push hl ; CODE XREF: sub_14A7+30p
push de
call sub_15A5
pop de
pop hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_15A5: call sub_1662 ; CODE XREF: sub_159D+2p
jr z,loc_15CA
ex de,hl
inc hl
loc_15AC: ld a,(de) ; CODE XREF: sub_15A5+23j
or a
jr z,loc_15CA
inc de
inc de
push hl
push de
ld b,8
loc_15B6: ld a,(de) ; CODE XREF: sub_15A5+17j
cp (hl)
jr nz,loc_15BE
inc hl
inc de
djnz loc_15B6
loc_15BE: pop de ; CODE XREF: sub_15A5+13j
pop hl
jr z,loc_15CD
ex de,hl
ld bc,10h
add hl,bc
ex de,hl
jr loc_15AC
loc_15CA: or 0FFh ; CODE XREF: sub_1552+3j
ret ; sub_1552+14j ...
loc_15CD: dec de ; CODE XREF: sub_15A5+1Bj
ld a,(de)
ld (byte_2D0E),a
dec de
ld a,(de)
ld (byte_2D0D),a
xor a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_15D9: ld a,(hl) ; CODE XREF: sub_1522p sub_1522+1Ap
cp 21h
jr c,loc_15F8
cp 3Dh
ret z
cp 5Fh
ret z
cp 2Eh
ret z
cp 3Ah
ret z
cp 2Ch
ret z
cp 3Ch
ret z
cp 3Eh
ret z
or a
ret z
cp 3Bh
ret
loc_15F8: xor a ; CODE XREF: sub_15D9+3j
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_15FA: push bc ; CODE XREF: sub_1552+3Dp
ld bc,1100h
loc_15FE: ld a,(hl) ; CODE XREF: sub_15FA+22j
call sub_15D9
jr z,loc_161E
inc hl
call sub_1625
jr c,loc_1622
ld d,a
ld a,c
rlca
jr c,loc_1622
rlca
jr c,loc_1622
add a,c
jr c,loc_1622
rlca
jr c,loc_1622
add a,d
jr c,loc_1622
ld c,a
djnz loc_15FE
loc_161E: ld a,c ; CODE XREF: sub_15FA+8j
pop bc
or a
ret
;
loc_1622: pop bc ; CODE XREF: sub_15FA+Ej
scf ; sub_15FA+13j ...
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1625: sub 30h ; CODE XREF: sub_1552+1Ep
ret c ; sub_1552+2Ap ...
cp 0Ah
ccf
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_162C: xor a ; CODE XREF: sub_1492+8p
ld (de),a
inc de
call sub_1632
sub_1632: ld b,0Bh ; CODE XREF: sub_14A7+44p
ld a,20h
call sub_1645
xor a
ld (de),a
inc de
call sub_1687
ld a,c
ld (de),a
inc de
ld b,3
xor a
sub_1645: ld (de),a ; CODE XREF: sub_1632+4p
inc de ; sub_1645+2j
djnz sub_1645
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_164A: push hl ; CODE XREF: sub_1552p
push de
ld de,2Eh
jp loc_1669
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1652: push hl ; CODE XREF: sub_1552+7p
push de
ld de,2Ch
jp loc_1669
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_165A: push hl ; CODE XREF: sub_1552+38p
push de
ld de,2Dh
jp loc_1669
;
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1662: push de ; CODE XREF: sub_15A5p
ld de,15h
jp loc_1676
;----------------------------------------------------------------------------
loc_1669: ld hl,(word_2D0F) ; CODE XREF: sub_164A+5j
ld a,h ; sub_1652+5j ...
or l
jr z,loc_1671
add hl,de
loc_1671: ld a,(hl) ; CODE XREF: sub_1662+Cj
pop de
pop hl
or a
ret
;----------------------------------------------------------------------------
loc_1676: ld hl,(word_2D0F) ; CODE XREF: sub_1662+4j
add hl,de
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld a,(hl)
ex de,hl
pop de
or a
ret
;----------------------------------------------------------------------------
loc_1683: ld (word_2D0F),hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1687: push af ; CODE XREF: sub_14A7+8p
push de ; sub_1632+Ap
push hl
ld c,19h
call sub_16AF
push af
ld e, 0FFh
ld c,F_USERNUM
call sub_16AF
ld c,a
pop af
ld b,a
pop hl
pop de
pop af
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_169E: ld a,11h ; CODE XREF: sub_961+88p
call sub_16B8
inc a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16A5: ld a,1 ; CODE XREF: sub_DE7+4p
jp sub_16B8
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16AA: ld a,0Bh ; CODE XREF: sub_DE7+1p
jp sub_16B8
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16AF: push de ; CODE XREF: sub_1687+5p
push bc ; sub_1687+Dp
call bdos
pop bc
pop de
or a
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16B8: push hl ; CODE XREF: sub_169E+2p
push de ; sub_16A5+2j ...
push bc
ld c,a
call bdos
or a
pop bc
pop de
pop hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16C4: push bc ; CODE XREF: sub_4A4+10p
push hl
push de
push af
ld b,8
call sub_16DA
ld (hl),2Eh
inc hl
ld b,3
call sub_16DA
pop af
pop de
pop hl
pop bc
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16DA: ld a,(de) ; CODE XREF: sub_16C4+6p
and 7Fh ; sub_16C4+Ep ...
cp 20h
jr z,loc_16E3
ld (hl),a
inc hl
loc_16E3: inc de ; CODE XREF: sub_16DA+5j
djnz sub_16DA
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_16E7: push bc ; CODE XREF: sub_482+6p sub_4A4+1Fp
ld b,0
jp loc_16F0
sub_16ED: PUSH BC
LD B,0FFH
loc_16F0: push hl ; CODE XREF: sub_16E7+3j
push af
ld h,64h
call sub_1703
ld h,0Ah
call sub_1703
call sub_1717
pop af
pop hl
pop bc
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1703: ld l, 0FFh ; CODE XREF: sub_16E7+Dp
loc_1705: sub h ; CODE XREF: sub_1703+4j
inc l
jr nc,loc_1705
add a,h
ld h,a
ld a,l
or a
jr nz,sub_1717
or b
ld a,h
ret m
ld a,20h
jr z,loc_171A
xor a
sub_1717: add a,30h ; CODE XREF: sub_16E7+15p
ld b,a
loc_171A: ld (de),a ; CODE XREF: sub_1703+11j
inc de
ld a,h
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_171E: push af ; CODE XREF: sub_1492+4p
push hl
loc_1720: ld a,(hl)
or a
jr z,loc_172B
call sub_1793
ld (hl),a
inc hl
jr loc_1720
loc_172B: pop hl
pop af
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_172E: push bc ; CODE XREF: start+2Fp sub_961+70p
push de
push hl
ld c,a
ex de,hl
ld b,(hl)
push hl
inc hl
inc hl
loc_1737: call sub_176B ; CODE XREF: sub_172E+25j
or a
jr z,loc_1760
ld (hl),e
inc hl
ld (hl),d
inc hl
dec b
jr z,loc_1755
call sub_1779
or a
jr z,loc_1760
ld a,c
or a
jr z,loc_1751
xor a
ld (de),a
inc de
loc_1751: ld a,b ; CODE XREF: sub_172E+1Ej
or a
jr nz,loc_1737
loc_1755: call sub_1779 ; CODE XREF: sub_172E+14j
call sub_176B
or a
jr z,loc_1760
or 0FFh
loc_1760: pop hl ; CODE XREF: sub_172E+Dj
push af ; sub_172E+1Aj ...
ld a,(hl)
sub b
inc hl
ld (hl),a
pop af
pop hl
pop de
pop bc
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_176B: ld a,(de) ; CODE XREF: sub_172E+9p
and 7Fh ; sub_172E+2Ap ...
inc de
cp 20h
jr z,sub_176B
cp 9
jr z,sub_176B
dec de
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1779: ld a,(de) ; CODE XREF: sub_172E+16p
and 7Fh ; sub_172E+27p ...
ret z
cp 20h
ret z
cp 9
ret z
inc de
jr sub_1779
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1786: push hl ; CODE XREF: start+1Ep sub_4A4+Cp
call sub_178C
pop hl
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_178C: push bc ; CODE XREF: sub_1786+1p
loc_178D: ld (hl),a ; CODE XREF: sub_178C+3j
inc hl
djnz loc_178D
pop bc
ret
;----------------------------------------------------------------------------
; S u b r o u t i n e
sub_1793: and 7Fh ; CODE XREF: sub_171E+6p
cp 61h
ret c
cp 7Bh
ret nc
and 5Fh
ret
;----------------------------------------------------------------------------
word_179E: .dw loc_end ; DATA XREF: start+18r start+35r
byte_17A0: .db 0 ; DATA XREF: sub_195+Aw sub_195+14r
byte_17A1: .db 0 ; DATA XREF: start+60r sub_195+11w
word_17A2: .db 0 ; DATA XREF: start+88w sub_961+7Fw
byte_17A3: .db 0
.fill $1800-$,0
.ds 8
nstack:
word_1808: .ds 2
.ds 1004h
byte_280E: .ds 1
.ds 82h
byte_2891: .ds 1
.ds 3
loc_2895: .ds 4
loc_2899: .ds 4
loc_289D: .ds 400h
byte_2C9D: .ds 1
byte_2C9E: .ds 1
loc_2C9F: .ds 1
.ds 1
byte_2CA1: .ds 1
byte_2CA2: .ds 1
byte_2CA3: .ds 1
byte_2CA4: .ds 1
byte_2CA5: .ds 1
byte_2CA6: .ds 1
loc_2CA7: .ds 4
loc_2CAB: .ds 4
loc_2CAF: .ds 21h
loc_2CD0: .ds 1
byte_2CD1: .ds 1
word_2CD2: .ds 2
byte_2CD4: .ds 1
.ds 0Bh
loc_2CE0: .ds 4
loc_2CE4: .ds 4
byte_2CE8: .ds 1
word_2CE9: .ds 2
word_2CEB: .ds 2
word_2CED: .ds 2
word_2CEF: .ds 2
.ds 2
loc_2CF3: .ds 2
word_2CF5: .ds 2
.ds 2
loc_2CF9: .ds 4
byte_2CFD: .ds 1
word_2CFE: .ds 2
byte_2D00: .ds 1
byte_2D01: .ds 1
byte_2D02: .ds 1
byte_2D03: .ds 1
byte_2D04: .ds 1
word_2D05: .ds 2
byte_2D07: .ds 1
byte_2D08: .ds 1
byte_2D09: .ds 1
byte_2D0A: .ds 1
byte_2D0B: .ds 1
byte_2D0C: .ds 1
byte_2D0D: .ds 1
byte_2D0E: .ds 1
word_2D0F: .ds 2
loc_end .equ $
.end ; start