Blame |
Last modification |
View Log
| Download
| RSS feed
| ?url?
;LAST UPDATE: 10.12.2013 savelij
;¢¥àá¨ï TR-DOS 6.12E
;§ ®á®¢ã ¢§ïâë ¨á室¨ª¨ TR-DOS 5.03
;⥪áâ "Found RAMDISK memory" § ¬¥¥ ⥪áâ "PentEvo edition 2013"
;¢ ¯®á«¥¤¨å 8 ¡ ©â å ¤®¡ ¢«¥ áâ ¤ àâë© ®¬¥à ¢¥àᨨ ¢¢¨¤¥ "TRD612" ¨ ¤ â ª®¬¯¨«ï樨
;¯® ¤à¥áã 0x1D0C 室¨âáï ¨§¬¥ë© ª®¤ ¤«ï ¯à ¢¨«ì®£® ¢ë室 ¯® RETURN ¢ ¡¥©á¨ª
;¬¥«ª¨¥ ¨§¬¥¥¨ï ¢¥á¥ë ¥¯®á।á⢥® ¢ ®á®¢®© ¨á室¨ª
;¢á¥ ¤à¥á ®¡à 饨© ¢® ¢áâ ¢ª å § ¬¥¥ë ᮮ⢥áâ¢ãî騥 ¬¥âª¨
;¨ ®â¬¥ç¥ë ;***-> ;***<-
;¢á¥ ®á⠫쮥 ¢áâ ¢«ï¥âáï ¯à¨ ª®¬¯¨«ï樨 ª®¬ ¤®© INCLUDE ¨ ¢ ¨å
;ᤥ« ë ¬¨¨¬ «ìë¥ ¨§¬¥¥¨ï ¤«ï ª®¬¯«ï樨
;®¬¥à áâà ¨æë à ¬¤¨áª ¡¥à¥âáï ¨§ ¯¥à¥¬¥®© PAGE_DATARAMD § ¤ ®© ¢ ä ©«¥ global_vars.a80
include ../../macros.a80
include ../../global_vars.a80
include bas_trd_vars.a80
include vars_trdos_v6.a80
ORG 0
di
ld de,0FFFFh
ld a,7
jr loc_9
RST_8 nop
loc_9 out (0FEh), a
ld a,3Fh
jr loc_13
nop
RST_10 jp PRINT_A_
loc_13 ld i,a
jp loc_1B
RST_18 jp PRINT_MSG ;
loc_1B nop
nop
nop
jr loc_24
RST_20 jp CALL2BASIC
ret
loc_24 ld h,d
ld l,e
jr loc_2B
RST_28 jp ADR_OPEN_CHAN
loc_2B
;***->
XOR A
LD B,A
LD C,A
LD SP,HL
; ld (hl),2
; dec hl
; cp h
; jr nz,loc_2B
;***<-
jr loc_3A
DUPL 0X0038-$,0FFh
RST_38 ei
ret
loc_3A
;***->
REPT 8
PUSH BC
ENDM
LD HL,-0X5B00
ADD HL,SP
JR C,0X3A
; or a
; sbc hl,de
; add hl,de
; inc hl
; jr nc,loc_47
; dec (hl)
; jr z,loc_47
; dec (hl)
; jr z,loc_3A
;loc_47 dec hl
;***<-
loc_48 ld (P_RAMT),hl
ld de,3EAFh ;
UDG 48
ld bc,0A8h
ld a,e
ex de,hl
ld sp,6000h
ld (TRD_5F00),hl
ld hl,loc_79
push hl
ld hl,loc_3D2F
push hl
ld hl,0B8EDh ; LDDR
jr EXECUTECOM2HL
jp MAGIC
EXECUTECOM2HL ld (TRD_5F10),hl
push af
ld a,0C9h
ld (TRD_5F12),a
pop af
ld hl,(TRD_5F00)
jp TRD_5F10
loc_79 ex de,hl
inc hl
ld (UDG),hl
dec hl
;***->
;LD BC,0X1E40
LD BC,0X0540 ;PIP:¨á¯à.§¢ãª ª« ¢ë
; ld bc,1E40h
;***<-
ld (RASP), bc
ld (RAMTOP),hl
ld hl,3C00h ;
48
ld (CHARS),hl
ld hl,(RAMTOP)
ld (hl),3Eh
dec hl
ld sp,hl
dec hl
dec hl
ld (ERR_SP),hl
ld de,1303h
push de
im 1
ld iy,ERR_NR
ld hl,TRD_5CB6 ;
INTERFACE1
ld (CHANS),hl
ld de,15AFh
ld bc,15h
ex de,hl
call COPY_BAS2VARS
ex de,hl
dec hl
ld (DATADD),hl
inc hl
ld (PROG),hl
loc_BE ld (VARS),hl
ld (hl),80h
inc hl
ld (E_LINE),hl ;
ld (hl),0Dh
inc hl
ld (hl),80h
inc hl
ld (WORKSP),hl
ld (STKBOT),hl
ld (STKEND),hl
ld a,38h
ld (ATTR_P),a
ld (ATTR_T),a
ld (BORDCR),a
;***->
;LD HL,0X0523
LD HL,0X0223 ;REPPER:¨á¯à.â®à¬®§ ¢â®¯®¢â®à
; ld hl,523h
;***<-
ld (REPDEL),hl
dec (iy-3Ah)
dec (iy-36h)
ld hl,15C6h
ld de,STRMS
ld bc,0Eh
call COPY_BAS2VARS
set 1,(iy+1)
ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
ld (hl),0C9h
rst 20h
dw 0EDFh ; ®ç¨á⪠¡ãä¥à ¯à¨â¥à
ld hl,DF_SZ
ld (hl),2
ld hl,128Bh
push hl
ld a,0AAh
;***->
; ¤à¥á à §¬¥é¥¨ï ¯à¨§ ª RUN boot ¯®á«¥ á¡à®á
;LD (0X5B00),A
IF madrom=1; IFN madrom
LD (0X5B00),A
ELSE
LD (NOT_USED),A
ENDIF
; ld (SWAP),a
;***<-
ei
jp IN_DOS_15616
COPY_BAS2VARS ld (TRD_5F00),hl
ld hl,loc_3D2F
push hl
ld hl,0B0EDh ; LDIR
ld (TRD_5F10),hl
ld hl,(TRD_5F00)
jp TRD_5F10
WORK4AUTORUN call DELETE_BUF ;
call CLEAR_SCREEN ;
ld hl,(E_LINE) ;
inc hl
ld e,(hl)
inc hl
ld d,(hl)
ld a,d
or e
ex de,hl
jr z,loc_140
xor a
ld (TRD_5D10),a ;
loc_140 push hl
call RESTORE_SP ;
pop hl
ld (NEWPPC),hl
xor a
ld (NSPPS),a
rst 20h
dw 16B0h ; ãáâ ®¢ª ®¡« á⨠। ªâ¨à®¢ ¨ï ¤® ¬¨¨¬ã¬
ld hl,(PROG)
dec hl
ld (DATADD),hl
ld sp,(ERR_SP)
ld a,(TRD_5D10) ;
or a
ld hl,1B76h
jr z,loc_166
rst 20h
dw 1BB0h ; á®®¡é¥¨¥ "Ok"
loc_166 push hl
ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
push hl
ret
loc_16C call CP_INTERFACE1 ;
INTERFACE1
call CREATE_BUF ;
ld a,0FFh
ld (TRD_5D15),a ;
0,
TR-DOS.
xor a
ld (TRD_5CF7),a
ld a,0AAh
ld (TRD_5D17),a ;
,
#AA
ld hl,CP_ERROR ;
ld (TRD_5D1A),hl ;
ld hl,0
add hl,sp
ld (TRD_5D1C),hl ;
SP
dec hl
dec hl
ld sp,hl
call MARK_SP ;
ld hl,(RAMTOP)
ld de,(CH_ADD)
sbc hl,de
ex de,hl
jr nc,loc_1A5
or a
ld de,257
sbc hl,de
loc_1A5 ld (CH_ADD),hl
loc_1A8 call CP_0D_OR_80
loc_1AB jp z,END_COMAND
cp 0EAh ; REM
inc hl
jr nz,loc_1A8
call CP_0D_OR_80
jr z,loc_1AB
cp ':'
jp nz,END_COMAND
inc hl
call SAE2_HL_
ld hl,(TRD_5D11) ;
TR_DOS
jp loc_30A
CP_0D_OR_80 ld a,(hl)
cp 0Dh
ret z
cp 80h
ret z
or a
ret
call REWRITE_9SEC ;
END_COMAND ld hl,0
ld (TRD_5CF8),hl ;
2
call DELETE_BUF
call CLEAR_WORKSPACE
ld hl,TRD_5D17 ;
,
#AA
ld (hl),0AAh
ld hl,TRD_5D1F
ld a,(hl)
or a
ld (hl),0
jr nz,loc_1F3
call DEL_5BYTES
call FIND_ENDSTR ;
loc_1F3 ld sp,(TRD_5D1C) ;
SP
ld hl,(TRD_5D1A) ;
ld bc,(TRD_5D0F) ;
TR-DOS
ld b,0
jp (hl)
CP_ERROR call RESTORE_SP ;
bit 7,(iy+0)
ret nz
ld de,TRD_5CC2 ;
#C9.
TR-DOS BASIC
ld sp,(ERR_SP)
push de
ret
;
FIND_ENDSTR call GET_SYMSTR
cp 0Dh
ret z
call GET_NEXT_SYM
jr FIND_ENDSTR ;
;
MARK_SP ld hl,(ERR_SP)
ld (TRD_5D13),hl ; ERR_SP
ld hl,(TRD_5D1C) ;
SP
dec hl
dec hl
ld (ERR_SP),hl
ld de,loc_3D16
ld (hl),e
inc hl
ld (hl),d
ret
;
RESTORE_SP ld hl,(TRD_5D13) ; ERR_SP
loc_235 ld (ERR_SP),hl
ret
IN_COMMAND_CPU ld hl,0 ;
ld (TRD_5CF7),hl
add hl,sp
ld (TRD_5D1C),hl ;
SP
dec hl
dec hl
ld sp,hl
;***->
;CALL 0X21D ;ãáâ ®¢ª ¤à¥á ¯/¯ ®¡à ¡®âª¨ ®è¨¡®ª
CALL SETERRAD;0X321C
; call MARK_SP ;
;***<-
ld hl,TRD_5D17 ;
,
#AA
ld a,(hl)
cp 0AAh
ld a,0
ld (TRD_5D0F),a ;
TR-DOS
jp z,COMMAND_CPU
ld (hl),0AAh
call CLEAR_SCREEN ;
call OPEN_CHAN_2 ;
2
ld hl,ZASTAVKA ; FIX
;
rst 18h
;***->
;CALL 0X106E ;¢ë¢®¤ 梥âëå ¯®«®á
;LD A,(0X5CB6)
;CP 0XF4
;JR Z,$+6
;LD HL,0X1000 ;"I/F one fitted"
;RST 0X18
CALL TCH4;0X399C
NOP
CALL TEST_R;0X3837
EI
JR NZ,loc_271
LD HL,TfndRD;0X1000 ;"Found R/D"
RST 0X18
; call OUT_COLOR_LINE ;
; ld a,(TRD_5CB6) ;
INTERFACE1
; cp 0F4h
; jr z,loc_271 ;
#AA
; ld hl,TXT_INTERFACE1 ;
INTERFACE1
; rst 18h
;***<-
loc_271
;***->
; ¤à¥á ¯à¨§ ª RUN boot (¯®á«¥ ¢ë¢®¤ § áâ ¢ª¨)
;LD A,(0X5B00)
IF madrom=1; IFN madrom
LD A,(0X5B00)
ELSE
LD A,(NOT_USED)
ENDIF
; ld a,(SWAP) ;
#AA
;***<-
cp 0AAh
jr nz,COMMAND_CPU ;
#AA,
call CP_INTERFACE1 ;
BOOT
loc_27B ld hl,(E_LINE) ;
ld a,0FEh
ld (TRD_5D0E),a ; #FE-
BASIC,
TR-DOS
ld (hl),0F7h
inc hl
ld (hl),'"'
inc hl
ld (hl),'b'
inc hl
ld (hl),'o'
inc hl
ld (hl),'o'
inc hl
ld (hl),'t'
inc hl
ld (hl),'"'
inc hl
ld (K_CUR),hl
ld (hl),0Dh
inc hl
ld (hl),80h
inc hl
ld (WORKSP),hl
ld (STKBOT),hl
ld (STKEND),hl
set 3,(iy+1)
jr GO2RUNBOOT
;
3
LDI3_HL2DE ld b,3
loc_2B2 ld a,(hl)
ld (de),a
inc hl
inc de
djnz loc_2B2
ret
; FIX
;
STOP_MOTOR ld b,20h
loc_2BB push bc
xor 8
out (0FFh),a
push af
ld a,5
call PAUSE_C_A
pop af
pop bc
djnz loc_2BB
ret
COMMAND_CPU ld hl,(TRD_5D1C) ;
SP
dec hl
dec hl
ld sp,hl
call CP_INTERFACE1 ;
INTERFACE1
call OPEN_CHAN_0 ;
0
ld a,(TRD_5D16) ;
( #FF)
or 3
call STOP_MOTOR ; FIX
;
ld a,(TRD_5D16) ;
( #FF)
call STOP_MOTOR ; FIX
;
xor a
ld (TRD_5D15),a ;
0,
TR-DOS.
call GET_COMMAND ;
call SAE2E_LINE
GO2RUNBOOT call CLEAR_DOWN_SCR ;
ld hl,COMMAND_CPU
ld (TRD_5D1A),hl ;
xor a
ld (TRD_5D0F),a ;
TR-DOS
ld hl,(E_LINE) ;
push hl
ld de,TRD_5D20 ;
3
call LDI3_HL2DE ;
3
pop hl
ld (TRD_5D11),hl ;
TR_DOS
loc_30A ld a,(hl)
ld b,a
and 80h
ld a,b
jr z,loc_31A
cp 0FEh ; RETURN
jr z,loc_31A
push af
call ACTIV_DEF_DSK ;
pop af
loc_31A ld hl,CODE_BYTE_COM ;
TR-DOS
; CAT
dec hl
ld c,0
loc_320 inc c
ld d,a
ld a,15h
cp c
jp c,END_COMAND
ld a,d
inc hl
cp (hl)
jr nz,loc_320
cp 0FEh ; RETURN
call nz,CREATE_BUF ;
ld a,9
ld (TRD_5D06),a ;
xor a
ld (TRD_5D0F),a ;
TR-DOS
ld (TRD_5CD6),a ; #FF-
ld (TRD_5D10),a ;
ld hl,FLAGS
res 7,(hl)
ld b,0
ld hl,SPIS_ADR_COM ;
dec c
sla c
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
push hl
ld de,END_COM
push de
jp (hl)
END_COM ld hl,FLAGS
set 7,(hl)
pop hl
jp (hl)
; FIX
;
ZASTAVKA
;***->
DB 0X16,0X1,0X5
DB "* TR-DOS Ver "
;DB "5.04T*"
DB "6.12E*"
DB 0XD,0XD
;DB " 1986 Technology Research Ltd."
DB "1999 CompoWellcome, 2006 Alone."
DB 0X16,0X5,0XB
;DB "(U.K.)"
DB "Ryazan"
DB 0X16,0X7,5
;DB "BETA 128"
DB "BETA1024"
DB 0
; db 16h,1,5,"* TR-DOS Ver 5.03 *",0Dh,0Dh,7Fh
; DB " 1986 Technology Research Ltd."
; db 16h,5,0Bh,"(U.K.)",16h,7,5,"BETA 128",0
;***<-
END_OUT_DIR call READ_9SEC ;
9
call PRINT_0D
call PRINT_0D
loc_3B5 ld bc,(TRD_5E0A)
call PRINT_CHISLO ;
ld hl,TXT_FREE_ ; " Free"
rst 18h
GOTO_END jp END_COMAND
;
PRINT_ERROR push af
ld a,(TRD_5D0E) ; #FE-
BASIC,
TR-DOS
cp 0FEh
jr nz,CP4PRINT_HEAD
pop af
ret
CP4PRINT_HEAD pop af
ld (TRD_5D0F),a ;
TR-DOS
ld a,(TRD_5D15) ;
0,
TR-DOS.
or a
call z,PRINT_MSG ;
ret
ERR_NOFILES ld hl,TXT_NOFILES_
ld a,1
jp PRINT_TXTERR
ERR_OK ld hl,TXT_OK_ ; "O.K."
xor a
jp PRINT_TXTERR
;
0
RD_0SEC2BUF xor a
ld (TRD_5CCC),a ;
;
READ_NUM_SEC ld de,(TRD_5CCC) ;
ld d,0
READ_SEC4NEM call CREATE_BUF ;
ld hl,TRD_5D25
ld b,1
jp COM_05 ;
;
9
READ_9SEC call CREATE_BUF ;
ld de,8
jr READ_SEC4NEM
;
COM_18 call READ_9SEC ;
9
ld a,(TRD_5E0C)
cp 10h
jr z,CP_TYPE_DSK
LL040F ld hl,TXT_DISCERROR_
rst 18h
jr GOTO_END
CP_TYPE_DSK call GET_TYPE_DSK ;
res 0,(hl)
res 1,(hl)
ld a,(TRD_5E08)
bit 0,a
jr nz,loc_425
set 0,(hl)
loc_425 bit 3,a
ret nz
set 1,(hl)
ret
;
CP_SECOND_SYM ld hl,(TRD_5D11) ;
TR_DOS
inc hl
ld a,(hl)
cp 0Dh
ret
CAT call CP_SECOND_SYM ;
CAT
ld bc,2
ld (TRD_5CDB),bc
jr z,loc_46A
cp "#"
jr nz,CODES
ld (CH_ADD),hl
call SET_NUM_CHAN
call GET_SYMSTR
cp 0Dh
jr z,loc_46A
cp ","
jp nz,SINTAX_ERROR
call GET_NEXT_SYM
call PUT_NUMDSK_STK
jr loc_460
CODES call SET_AND_PUT
loc_460 call EXIT_IF_SINTAX ;
,
call GET_STKBOT_
ex de,hl
call SETUP_DSK
loc_46A call EXIT_IF_SINTAX ;
,
ld a,(TRD_5CF6) ;
ld (TRD_5CF9),a ;
2
call COM_18 ;
ld a,(TRD_5CDB)
loc_479 cp 2
push af
call z,CLEAR_SCREEN ;
pop af
cp 11h
jp nc,SINTAX_ERROR
call OPENSTREAM
ld a,0FFh
ld (TRD_5CF8),a ;
2
ld hl,TXT_TITLE_ ; "Title:"
rst 18h
ld hl,TRD_5E1A
rst 18h
call PRINT_0D
ld a,(TRD_5E09)
ld hl,TRD_5E19
sub (hl)
push hl
call PRINT_CHISLO_A_
ld hl,TXT_FILES_ ; " File(s)"
rst 18h
pop hl
ld c,(hl)
call CONV2_2BYTES
ld hl,TXT_DELFILE_ ; " Del. File"
rst 18h
call RD_0SEC2BUF ;
0
ld hl,TRD_5D25
loc_4B6 call CP_END_DIR ;
call PRINT_0D
ld a,(TRD_5CF6) ;
add a,"A"
rst 10h
ld b,2
loc_4C4 call CP_END_DIR ;
push bc
ld a,":"
rst 10h
push hl
call PRINT_FILENAME ;
ld bc,0Dh
pop hl
push hl
add hl,bc
ld c,(hl)
push bc
ld a,c
ld b,2
cp 10
jr c,loc_4DF
dec b
loc_4DF cp 100
jr nc,loc_4E8
loc_4E3 ld a," "
rst 10h
djnz loc_4E3
loc_4E8 pop bc
call PRINT_CHISLO ;
pop hl
pop bc
ld de,10h
add hl,de
djnz loc_4C4
jr loc_4B6
;
CP_END_DIR push hl
push bc
ld a,(TRD_5CF9) ;
2
ld hl,TRD_5CF6 ;
cp (hl)
call nz,COM_01 ;
pop bc
pop hl
jp CP_END_CAT
ADD_10 ld de,10h
add hl,de
ret
;
CP_END_BUF push hl
push bc
ld bc,0A1DBh
add hl,bc
jr c,READ_SEC2BUF
pop bc
pop hl
ret
READ_SEC2BUF ld hl,TRD_5CCC ;
inc (hl)
call READ_NUM_SEC ;
pop bc
pop hl
ld hl,TRD_5D25
ret
NUMDSK2BYTE and 0DFh
sbc a,"A"
jp c,SINTAX_ERROR
cp 4
jp nc,SINTAX_ERROR
ret
CP_ON_STKBOT call GET_STKBOT_
ld a,c
cp b ; OR B
jp z,SINTAX_ERROR
ret
NEW
;***->
;CALL 0X1DCD
JP NEWER;0X37D8 ;¯¥à¥å¢ â NEW
L53D
; call INP_STR2STKBOT
;***<-
call EXIT_IF_SINTAX ;
,
call INP_EXTFILENAME ;
call SET_CP_FILENAME
ld a,(TRD_5CF6) ;
ld (TRD_5CF8),a ;
2
jp nz,ERR_NOFILES
push bc
call RDHEAD_FILENAME ;
call SET_CP_FILENAME
push af
ld a,(TRD_5CF8) ;
2
ld hl,TRD_5CF6 ;
cp (hl)
jp nz,SINTAX_ERROR
call COM_18 ;
pop af
jp z,FILE_EXISTS
pop bc
loc_569 call SETHEADFILENAME
call REWRITE_9SEC ;
9
jp ERR_OK
CP_HIGH_ERR ld a,(TRD_5D10) ;
or a
ret
CP_ERASED_FILES ld a,(TRD_5D07) ;
or a
jp z,ERR_NOFILES
jp ERR_OK
;
GET_OVERWRITE_ push bc
call CLEAR_SCREEN ;
ld a,(TRD_5CF6) ;
add a,"A"
call PRINT_A_
ld a,":"
call PRINT_A_
ld hl,TRD_5CDD ;
call PRINT_FILENAME ;
ld hl,TXT_FILEEXIST ; "File exists"
call PRINT_MSG ;
call GET_KEYS ;
cp "Y"
push af
call CLEAR_SCREEN ;
pop af
pop bc
ret nz
push bc
call CLEAR_SCREEN ;
pop bc
call ERASE_FILE ;
xor a
ret
CP_EXT_SHARP ld a,(TRD_5CE5) ;
cp "#"
jr z,FINDFILENAME_0A
xor a
ret
FINDFILENAME_0A ld a,0Ah
ld (TRD_5D06),a ;
call FIND_FILENAME ;
ld a,9
ld (TRD_5D06),a ;
ret
COPY_STAR_STAR ld a,(TRD_5CDD) ;
COPY *,*
cp "*"
jp nz,ERR_NOFILES
call GET_STKBOT_
ex de,hl
call SETUP_DSK
ld a,(hl)
cp "*"
jp nz,SINTAX_ERROR
ld a,(TRD_5CF6) ;
ld (TRD_5CF9),a ;
2
ld a,(TRD_5CF9) ;
2
call COM_01 ;
call COM_18 ;
ld a,0FFh
ld (TRD_5D0D),a
loc_5F4 ld a,(TRD_5CF8) ;
2
call COM_01 ;
call COM_18 ;
ld a,(TRD_5D0D)
inc a
ld (TRD_5D0D),a
ld c,a
call RDHEAD_FILENAME ;
ld a,(TRD_5CDD) ;
cp 0
jp z,ERR_OK
cp 1
jr z,loc_5F4
ld hl,TRD_5CE6 ; <C>-
, <B>-
ld de,TRD_5CED ;
ld bc,7
ldir
ld a,(TRD_5CF9) ;
2
call COM_01 ;
call FIND_FILENAME ;
jr nz,loc_634
call CP_EXT_SHARP
jr nz,loc_634
call GET_OVERWRITE_ ;
jr nz,loc_5F4
loc_634 call COPYFILE_ON2DSK ;
2
call REWRITE_9SEC ;
9
jr loc_5F4
;
2
COPYFILE_ON2DSK call READ_9SEC ;
9
ld a,(TRD_5E09)
cp 80h
jp z,ERR_DIRFULL;loc_1C45 ;
0X2723
ld hl,TRD_5CED ;
ld de,TRD_5CE6 ; <C>-
, <B>-
ld bc,7
ldir
ld de,(TRD_5CEA) ;
ld d,0
or a
ld hl,(TRD_5E0A)
sbc hl,de
jp c,loc_1C45
ld (TRD_5E0A),hl
ld hl,(TRD_5E06)
ld (TRD_5CEB),hl ;
push hl
call COPY_FILE ;
2
pop hl
ld (TRD_5CEB),hl ;
ld hl,(TRD_5CF4)
ld (TRD_5E06),hl
ld hl,TRD_5E09
inc (hl)
ld c,(hl)
dec c
ld b,0
push bc
ld de,9
ld (TRD_5CF4),de
call REWRITE_9SEC ;
9
pop bc
call SETHEADFILENAME
ret
COPY ld hl,(TRD_5D11) ;
TR_DOS
inc hl
ld a,(hl)
and 0DFh
cp "S"
jp z,COPY_S
cp "B"
jp z,COPY_B
call INP_STR2STKBOT
call EXIT_IF_SINTAX ;
,
call RESERVED_RAM
call INP_EXTFILENAME ;
call SET_CP_FILENAME
ld a,(TRD_5CF6) ;
ld (TRD_5CF8),a ;
2
jp nz,COPY_STAR_STAR ;
COPY *,*
call RDHEAD_FILENAME ;
ld hl,TRD_5CE6 ; <C>-
, <B>-
ld de,TRD_5CED ;
ld bc,7
ldir
call SET_CP_FILENAME
push af
push bc
ld a,(TRD_5CF6) ;
ld (TRD_5CF9),a ;
2
ld a,(TRD_5CF8) ;
2
call COM_01 ;
call COM_18 ;
ld a,(TRD_5CF9) ;
2
call COM_01 ;
call COM_18 ;
pop bc
pop af
jr nz,loc_6F3
call CP_EXT_SHARP
jr nz,loc_6F3
call GET_OVERWRITE_ ;
jp nz,ERR_OK
loc_6F3 call COPYFILE_ON2DSK ;
2
call REWRITE_9SEC ;
9
ld a,(TRD_5CE5) ;
cp "#"
jp nz,ERR_OK
ld a,10
ld (TRD_5D06),a ;
ld hl,TRD_5CE6 ; <C>-
, <B>-
inc (hl)
ld a,(TRD_5CF8) ;
2
call COM_01 ;
call CP_EXT_SHARP
jp nz,ERR_OK
call RDHEAD_FILENAME ;
ld hl,TRD_5CE6 ; <C>-
, <B>-
ld de,TRD_5CED ;
ld bc,7
ldir
ld a,(TRD_5CF9) ;
2
call COM_01 ;
call COM_18 ;
jr loc_6F3
;
2
COPY_FILE ld a,(TRD_5CF1)
or a
ret z
push hl
ld hl,TRD_5D23
sub (hl)
pop hl
jr nc,loc_775
ld a,(TRD_5CF1)
ld b,a
xor a
ld (TRD_5CF1),a
loc_744 push bc
ld a,(TRD_5CF8) ;
2
call COM_01 ;
pop bc
push bc
ld hl,(TRD_5CCF) ;
WORK_SP
push hl
ld de,(TRD_5CF2)
call COM_05 ;
ld hl,(TRD_5CF4)
ld (TRD_5CF2),hl
ld a,(TRD_5CF9) ;
2
call COM_01 ;
pop hl
pop bc
ld de,(TRD_5CEB) ;
call COM_06 ;
ld hl,(TRD_5CF4)
ld (TRD_5CEB),hl ;
jr COPY_FILE ;
2
loc_775 ld (TRD_5CF1),a
push hl
ld hl,TRD_5D23
ld b,(hl)
pop hl
xor a
jr loc_744
;
ERASE_FILE xor a
ld (TRD_5D07),a ;
jr ERASE_FILES ;
ERASE call SET_AND_PUT
call EXIT_IF_SINTAX ;
,
call INP_EXTFILENAME ;
xor a
ld (TRD_5D07),a ;
call FIND_FILE ;
call ERASE_FILES ;
jp nz,CP_ERASED_FILES
jp ERR_OK
ERASE_FILES ld a,(TRD_5CDD) ;
ld (TRD_5D08),a ;
ret nz
ld hl,TRD_5D07 ;
inc (hl)
push bc
call READ_9SEC ;
9
ld a,(TRD_5E09)
pop bc
inc c
cp c
jr nz,loc_7BC
dec a
ld (TRD_5E09),a
xor a
loc_7BC push af
jr z,loc_7C3
ld hl,TRD_5E19
inc (hl)
loc_7C3 push bc
call REWRITE_9SEC ;
9
pop bc
dec c
call RDHEAD_FILENAME ;
pop af
jp z,loc_7D2
ld a,1
loc_7D2 ld (TRD_5CDD),a ;
push af
call WRHEAD_FILENAME ;
ld a,(TRD_5D08) ;
ld (TRD_5CDD),a ;
pop af
jr z,WR_NEW_FREE_SEC
call FIND_FILENAME ;
jr ERASE_FILES ;
WR_NEW_FREE_SEC call READ_9SEC ;
9
ld hl,(TRD_5CEB) ;
ld (TRD_5E06),hl
ld de,(TRD_5CEA) ;
ld hl,(TRD_5E0A)
ld d,0
add hl,de
ld (TRD_5E0A),hl
jp REWRITE_9SEC ;
9
LOC_800 AND 0XFC
JP COM2VG_WAIT
include dosinst_1.a80
DUPL 0X1000-$,0FFh
;
INTERFACE1
TXT_INTERFACE1
;***->
; db 16h,9,5,"Interface one fitted",0
TfndRD DB 0X16,0X9,0X5
;DB "Interface one fitted",0
; DB "Found RAMDISK memory",0
DZ "PentEvo edition 2013"
;***<-
COM_STAR call SET_AND_PUT
call EXIT_IF_SINTAX ;
,
call CP_ON_STKBOT
ld a,(de)
call NUMDSK2BYTE
ld (TRD_5D19),a ;
call COM_01 ;
jp ERR_OK
;
INP_EXTFILENAME ld b,"C"
ld a,(TRD_5CD6) ; #FF-
or a
jr nz,loc_104D
call GET_SYMSTR
cp 0AFh ; CODE
ld b,"C"
jr z,loc_104D
cp 0E4h ; DATA
ld b,"D"
jr z,loc_104D
cp "#"
ld b,"#"
jr z,loc_104D
ld b,"B"
loc_104D ld hl,TRD_5CE5 ;
ld (hl),b
ret
;
GET_KEYS di
push hl
push bc
push de
loc_1056 rst 20h
dw 28Eh ; ᪠¨à®¢ ¨¥ ª« ¢¨ âãàë
ld c,0
jr nz,loc_1056
rst 20h
dw 31Eh ; ¯à®¢¥àª § ç¥¨ï ¦ ⮩ ª« ¢¨è¨
jr nc,loc_1056
dec d
ld e,a
rst 20h
dw 333h ; ¤¥ª®¤¨à®¢ ¨¥ ª« ¢¨ âãàë
pop de
pop bc
pop hl
and 0DFh
ei
ret
;
OUT_COLOR_LINE ld hl,58E5h
ld b,0Ah
loc_1073 ld (hl),7
inc hl
djnz loc_1073
ld (hl),2
inc hl
ld (hl),16h
inc hl
ld (hl),34h
inc hl
ld (hl),25h
inc hl
ld (hl),28h
inc hl
ld (hl),7
ld hl,40EEh
ld b,8
xor a
loc_108F push bc
scf
rla
push hl
push af
ld b,5
loc_1096 inc hl
ld (hl),a
djnz loc_1096
pop af
pop hl
pop bc
ld de,100h
add hl,de
djnz loc_108F
ret
ret
TXT_DELFILES DB " Del."
TXT_FILE_S_ DB " File(s)",0
TXT_TITLE DC "Title: "
TXT_DISKDRIVE db 17h,11h," Disk Drive: ",0
TXT_1SPACE db 17h,10h,20h,0
TXT_40TRK_SS db 17h,10h," 40 Track S. Side",0
TXT_80TRK_SS db 17h,10h," 80 Track S. Side",0
TXT_40TRK_DS db 17h,10h," 40 Track D. Side",0
TXT_80TRK_DS db 17h,10h," 80 Track D. Side",0
TXT_FREESECS db 17h,10h," Free Sector ",0
TXT_FILENAME db 0Dh,0Dh," File Name Start Length Line",0
;
0X222
CREATE_222BYTES ld hl,(WORKSP)
ld (TRD_5CCF),hl ;
WORK_SP
ld bc,222h ;
jp CREATE_FREERAM
PRINT_HL_CHISLO xor a
ld de,10000
loc_1161 sbc hl,de
jr c,loc_1168
inc a
jr loc_1161
loc_1168 add a,"0"
call PRINT_A_CHISLO
add hl,de
xor a
ld de,1000
loc_1172 sbc hl,de
jr c,loc_1179
inc a
jr loc_1172
loc_1179 add a,"0"
call PRINT_A_CHISLO
add hl,de
xor a
ld de,100
loc_1183 sbc hl,de
jr c,loc_118A
inc a
jr loc_1183
loc_118A add a,"0"
call PRINT_A_CHISLO
add hl,de
xor a
ld de,10
loc_1194 sbc hl,de
jr c,loc_119B
inc a
jr loc_1194
loc_119B add a,"0"
call PRINT_A_CHISLO
add hl,de
ld a,l
add a,"0"
call PRINT_A_CHISLO
ret
PRINT_A_CHISLO push hl
push de
call PRINT_A_
pop de
pop hl
ret
FIND_END_BUFDIR push hl
push bc
ld a,(TRD_5CF9) ;
2
ld hl,TRD_5CF6 ;
cp (hl)
call nz,COM_01 ;
pop bc
pop hl
call CP_END_BUF ;
ld a,(hl)
or a
jp z,END_COMAND
cp 1
call z,ADD_10
ret nz
jr FIND_END_BUFDIR
LIST call CP_SECOND_SYM ;
ld bc,2
ld (TRD_5CDB),bc
jr z,loc_1205
cp "#"
jr nz,LIST4CODES
ld (CH_ADD),hl
call SET_NUM_CHAN
call GET_SYMSTR
cp 0Dh
jr z,loc_1205
cp ","
jp nz,SINTAX_ERROR
call GET_NEXT_SYM
call PUT_NUMDSK_STK
jr loc_11FB
LIST4CODES call SET_AND_PUT
loc_11FB call EXIT_IF_SINTAX ;
,
call GET_STKBOT_
ex de,hl
call SETUP_DSK
loc_1205 call EXIT_IF_SINTAX ;
,
ld a,(TRD_5CF6) ;
ld (TRD_5CF9),a ;
2
call COM_18 ;
ld a,(TRD_5CDB)
cp 2
push af
call z,CLEAR_SCREEN ;
pop af
cp 11h
jp nc,SINTAX_ERROR
call OPENSTREAM
ld a,0FFh
ld (TRD_5CF8),a ;
2
call CREATE_222BYTES ;
0X222
ld hl,TRD_5E06
ld de,(TRD_5CCF) ;
WORK_SP
ld bc,20h
ldir
call RD_0SEC2BUF ;
0
ld hl,TRD_5D25
push hl
loc_123E ld hl,TXT_TITLE ; "Title:"
push bc
rst 18h
ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,14h
add hl,bc
rst 18h
ld hl,TXT_DISKDRIVE
rst 18h
ld a,(TRD_5CF6) ;
add a,"A"
call PRINT_A_
call PRINT_0D
ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,3
add hl,bc
ld a,(hl)
ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,13h
add hl,bc
sub (hl)
push hl
call PRINT_CHISLO_A_
ld hl,TXT_FILE_S_ ; " File(s)"
rst 18h
ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,2
add hl,bc
ld a,(hl)
ld hl,TXT_40TRK_SS
cp 19h
jr z,loc_1292
ld hl,TXT_80TRK_SS
cp 18h
jr z,loc_1292
ld hl,TXT_40TRK_DS
cp 17h
jr z,loc_1292
ld hl,TXT_80TRK_DS
loc_1292 rst 18h
pop hl
ld c,(hl)
call CONV2_2BYTES
ld hl,TXT_DELFILES ; " Del."
rst 18h
ld hl,TXT_FREESECS
rst 18h
ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,4
add hl,bc
ld c,(hl)
inc hl
ld b,(hl)
call PRINT_CHISLO ;
ld hl,TXT_FILENAME
rst 18h
pop bc
pop hl
ld b,10h
loc_12B5 call FIND_END_BUFDIR
call PRINT_0D
push bc
push hl
call PRINT_FILENAME ;
ld bc,0Dh
pop hl
push hl
add hl,bc
ld c,(hl)
push bc
ld a,c
ld b,2
cp 10
jr c,loc_12D0
dec b
loc_12D0 cp 100
jr nc,loc_12D9
loc_12D4 ld a," "
rst 10h
djnz loc_12D4
loc_12D9 pop bc
call PRINT_CHISLO ;
ld hl,TXT_1SPACE
rst 18h
pop hl
push hl
ld bc,9
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
push hl
ex de,hl
call PRINT_HL_CHISLO
ld a," "
call PRINT_A_
pop hl
inc hl
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
call PRINT_HL_CHISLO
pop hl
push hl
ld bc,8
add hl,bc
ld a,(hl)
cp "B"
call z,PRN_ADR_ASTART
pop hl
pop bc
ld de,10h
add hl,de
djnz loc_12B5
push hl
call PRINT_0D
call PRINT_0D
jp loc_123E
PRN_ADR_ASTART ld bc,5
add hl,bc
ld b,(hl)
inc hl
ld e,(hl)
inc hl
ld d,(hl)
dec b
jr z,loc_1335
dec b
jr z,loc_1335
ld a,10h
loc_132C inc e
cp e
jr nz,loc_1333
ld e,0
inc d
loc_1333 djnz loc_132C
loc_1335 ld hl,(TRD_5CCF) ;
WORK_SP
ld bc,21h
add hl,bc
ld b,2
push hl
call COM_05 ;
ld a,80h
pop hl
ld bc,200h
cpir
ld a,(hl)
cp 0AAh
ret nz
inc hl
ld c,(hl)
inc hl
ld b,(hl)
ld a,b
or c
ret z
push bc
ld a," "
call PRINT_A_
pop bc
call PRINT_CHISLO ;
ret
COPY_S call SET_CH_ADD ; CH_ADD
call GET_NEXT_SYM
call PUT_NUMDSK_STK
call EXIT_IF_SINTAX ;
,
call RESERVED_RAM
ld hl,TXT_INS_SRC ; "Insert Source disk then press Y"
call PRINT_MSG ;
loc_1375 call GET_KEYS ;
cp "Y"
jr nz,loc_1375
call CLEAR_DOWN_SCR ;
call INP_EXTFILENAME ;
call SET_CP_FILENAME
jp nz,ERR_NOFILES
call COPY_ON1DSK
ld a,(TRD_5CE5) ;
cp "#"
jp nz,ERR_OK
loc_1393 ld a,10
ld (TRD_5D06),a ;
ld hl,TRD_5CE6 ; <C>-
, <B>-
inc (hl)
call CLEAR_SCREEN ;
ld hl,TXT_INS_SRC ; "Insert Source disk then press Y"
call PRINT_MSG ;
loc_13A5 call GET_KEYS ;
cp "Y"
jr nz,loc_13A5
call FIND_FILENAME ;
jp nz,ERR_OK
call COPY_ON1DSK
jr loc_1393
COPY_ON1DSK call RDHEAD_FILENAME ;
ld hl,TRD_5CE6 ; <C>-
, <B>-
ld de,TRD_5CED ;
ld bc,7
ldir
ld a,(TRD_5CF1)
ld (TRD_5D10),a ;
call COM_18 ;
call GET_TYPE_DSK ;
ld (TRD_5CD9),a ;
<B> <C>
ld a,0FFh
ld (TRD_5D21),a
call COPY_ON1DSK_
ld hl,(TRD_5D1F)
ld (TRD_5CEB),hl ;
ld hl,(TRD_5CF4)
ld (TRD_5E06),hl
ld hl,TRD_5E09
inc (hl)
ld c,(hl)
dec c
ld b,0
push bc
ld de,9
ld (TRD_5CF4),de
call REWRITE_9SEC ;
9
pop bc
call SETHEADFILENAME
call REWRITE_9SEC ;
9
ret
CP_FREESEC xor a
ld (TRD_5D21),a
call COM_18 ;
call GET_TYPE_DSK ;
ld (TRD_5CDA),a
call FIND_FILENAME ;
jp z,FILE_EXISTS
call READ_9SEC ;
9
ld a,(TRD_5E09)
cp 80h
jp z,ERR_DIRFULL
ld hl,TRD_5CED ;
ld de,TRD_5CE6 ; <C>-
, <B>-
ld bc,7
ldir
call READ_9SEC ;
9
ld a,(TRD_5D10) ;
ld (TRD_5CEA),a ;
ld de,(TRD_5CEA) ;
ld d,0
or a
ld hl,(TRD_5E0A)
sbc hl,de
jp c,loc_1C45
ld (TRD_5E0A),hl
ld hl,(TRD_5E06)
ld (TRD_5CEB),hl ;
ld (TRD_5D1F),hl
ret
COPY_ON1DSK_ ld a,(TRD_5CF1)
or a
ret z
ld a,(TRD_5D21)
or a
jr nz,loc_146F
call CLEAR_SCREEN ;
ld hl,TXT_INS_SRC ; "Insert Source disk then press Y"
call PRINT_MSG ;
loc_1465 call GET_KEYS ;
cp "Y"
jr nz,loc_1465
call CLEAR_DOWN_SCR ;
loc_146F ld a,(TRD_5CF1)
or a
ret z
push hl
ld hl,TRD_5D23
sub (hl)
pop hl
jr nc,loc_14CB
ld a,(TRD_5CF1)
ld b,a
xor a
ld (TRD_5CF1),a
loc_1484 push bc
ld (TRD_5CCE),a ; #00-
,#FF-
ld hl,(TRD_5CCF) ;
WORK_SP
push hl
ld de,(TRD_5CF2)
call SET_DSK_SOURCE
call COM_05 ;
ld hl,(TRD_5CF4)
ld (TRD_5CF2),hl
call CLEAR_SCREEN ;
ld hl,TXT_INS_DEST ; "Insert Destination disk"
call PRINT_MSG ;
loc_14A5 call GET_KEYS ;
cp "Y"
jr nz,loc_14A5
call CLEAR_DOWN_SCR ;
ld a,(TRD_5D21)
or a
call nz,CP_FREESEC
pop hl
pop bc
ld de,(TRD_5CEB) ;
call SETUP_DSK_DEST
call COM_06 ;
ld hl,(TRD_5CF4)
ld (TRD_5CEB),hl ;
jp COPY_ON1DSK_
loc_14CB ld (TRD_5CF1),a
push hl
ld hl,TRD_5D23
ld b,(hl)
pop hl
xor a
jp loc_1484
SET_DSK_SOURCE push hl
push de
call GET_TYPE_DSK ;
ld a,(TRD_5CD9) ;
<B> <C>
ld (hl),a
pop de
pop hl
ret
SETUP_DSK_DEST push hl
push de
call GET_TYPE_DSK ;
ld a,(TRD_5CDA)
ld (hl),a
pop de
pop hl
ret
CP_FREE_DEST xor a
ld (TRD_5D21),a
call COM_18 ;
call GET_TYPE_DSK ;
ld (TRD_5CDA),a
ld a,(TRD_5E08)
ld (TRD_5CE6+1),a ; <C>-
, <B>-
ld hl,640
cp 19h ; 40
1
jr z,SAVE_SECS_DEST
ld hl,1280
cp 18h ; 80
1
jr z,SAVE_SECS_DEST
cp 17h ; 40
2
jr z,SAVE_SECS_DEST
ld hl,2560
cp 16h ; 80
2
jr z,SAVE_SECS_DEST
jp SINTAX_ERROR
SAVE_SECS_DEST ld (TRD_5CDD),hl ;
ld bc,(TRD_5CDF)
sbc hl,bc
jp c,loc_1C45
ret
COPY_B call EXIT_IF_SINTAX ;
,
call RESERVED_RAM
ld hl,TXT_BACKUPDISK ; "BACKUP DISK"
call PRINT_MSG ;
ld hl,TXT_INS_SRC ; "Insert Source disk then press Y"
call PRINT_MSG ;
loc_153E call GET_KEYS ;
cp "Y"
jr nz,loc_153E
call CLEAR_DOWN_SCR ;
ld a,0FFh
ld (TRD_5D21),a
call COM_18 ;
call GET_TYPE_DSK ;
ld (TRD_5CD9),a ;
<B> <C>
ld a,(TRD_5E08)
cp 19h ; 40
1
ld hl,640
jr z,loc_1575
ld hl,1280
cp 18h ; 80
1
jr z,loc_1575
cp 17h ; 40
2
jr z,loc_1575
ld hl,2560
cp 16h ; 80
2
jr z,loc_1575
;***->
;ª®£¤ ¤¨áª ¥ ¯à¨ ¤«¥¦¨â 4 áâ ¤ àâë¬ â¨¯ ¬
;JP 0X1D1A ;"*ERROR*"
JP LL040F ;"Disk Error"
; jp SINTAX_ERROR
;***<-
loc_1575 ld bc,(TRD_5E0A)
sbc hl,bc
ld (TRD_5CE5),hl ;
ld (TRD_5CDF),hl
ld hl,0
ld (TRD_5CE1),hl
ld (TRD_5CE3),hl
call COPY_SECTORS
call COM_18 ;
ld a,(TRD_5CE6+1) ; <C>-
, <B>-
ld (TRD_5E08),a
ld hl,(TRD_5CDD) ;
ld bc,(TRD_5CDF)
sbc hl,bc
ld (TRD_5E0A),hl
call SETUP_DSK_DEST
ld de,9
ld (TRD_5CF4),de
call REWRITE_9SEC ;
9
jp ERR_OK
CP_COPY_SECS ld hl,(TRD_5CE5) ;
ld a,h
or l
ret
COPY_SECTORS call CP_COPY_SECS
ret z
ld a,(TRD_5D21)
or a
jr nz,loc_15DB
call CLEAR_SCREEN ;
ld hl,TXT_BACKUPDISK ; "BACKUP DISK"
call PRINT_MSG ;
ld hl,TXT_INS_SRC ; "Insert Source disk then press Y"
call PRINT_MSG ;
loc_15D1 call GET_KEYS ;
cp "Y"
jr nz,loc_15D1
call CLEAR_DOWN_SCR ;
loc_15DB call CP_COPY_SECS
ret z
push bc
push hl
ld hl,TRD_5D23
ld c,(hl)
ld b,0
pop hl
sbc hl,bc
pop bc
jp nc,loc_1644
ld bc,(TRD_5CE5) ;
ld hl,0
ld (TRD_5CE5),hl ;
loc_15F8 push bc
ld hl,(TRD_5CCF) ;
WORK_SP
push hl
call SET_DSK_SOURCE
ld de,(TRD_5CE1)
ld b,c
call COM_05 ;
ld hl,(TRD_5CF4)
ld (TRD_5CE1),hl
call CLEAR_SCREEN ;
ld hl,TXT_BACKUPDISK ; "BACKUP DISK"
call PRINT_MSG ;
ld hl,TXT_INS_DEST ; "Insert Destination disk"
call PRINT_MSG ;
loc_161D call GET_KEYS ;
cp "Y"
jr nz,loc_161D
call CLEAR_DOWN_SCR ;
ld a,(TRD_5D21)
or a
call nz,CP_FREE_DEST
pop hl
pop bc
ld de,(TRD_5CE3)
ld b,c
call SETUP_DSK_DEST
call COM_06 ;
ld hl,(TRD_5CF4)
ld (TRD_5CE3),hl
jp COPY_SECTORS
loc_1644 ld (TRD_5CE5),hl ;
push hl
ld hl,TRD_5D23
ld c,(hl)
ld b,0
pop hl
xor a
jp loc_15F8
CP_ERASED_FILE call RDHEAD_FILENAME ;
ld a,(TRD_5CDD) ;
cp 1
ret
COM_08 ld c,a ;
#5CDD
;
RDHEAD_FILENAME xor a
loc_165E push bc
call RD_HEAD_COPY
pop bc
ret
COM_09 ld c,a ;
call SETHEADFILENAME
jp REWRITE_9SEC ;
9
SETHEADFILENAME ld a,0FFh
jr loc_165E
RESERVED_RAM ld a,0FFh
ld (TRD_5D0E),a ; #FE-
BASIC,
TR-DOS
call CP_FREE_SECS
ld hl,(WORKSP)
ld (TRD_5CCF),hl ;
WORK_SP
jp CREATE_FREERAM
CP_FREE_SECS rst 20h
dw 1F1Ah ; ¯à®¢¥àª à §¬¥à ᢮¡®¤®© ¯ ¬ïâ¨
ld hl,0FFFFh
sbc hl,bc
ld a,h
cp 10h
jr nc,loc_168F
ld a,11h
loc_168F dec a
ld (TRD_5D23),a
ld b,a
ld c,0
ret
ADD_FILESIZE ld (TRD_5CD7),hl ;
-
;
ld (TRD_5CDB),hl
ld de,(TRD_5CEA) ;
ld hl,(TRD_5CD9) ;
<B> <C>
ld d,0
add hl,de
ld (TRD_5CD9),hl ;
<B> <C>
ret
MOVE
;***->
;¡ëáâ஥ MOVE
;DS 3 ¯®ç¥¬ã-â® ¥ ¨á¯à ¢«ï¥â ¥á®¢¬¥á⨬®áâì ( « ᬠ¥ ¬®¢¨â)
CALL CP_SECOND_SYM;0X042B ;¯à®¢¥àª 2-£® ᨬ¢®« ª®¬áâப¨
;¥á®¢¬¥á⨬®áâì:íâ â®çª ,㪠§ ï ¥¤¨ë¬,⥯¥àì âॡã¥â Z
JP NZ,LL1775 ;¥ ENTER ( § 祬 íâ ¢¥âª ???)
CALL EXIT_IF_SINTAX;0X1D75 ;¢ë©â¨,¥á«¨ ¯à®¢¥àª á¨â ªá¨á
CALL RESERVED_RAM;0X166F ;१¥à¢¨à®¢ ¨¥ ¯ ¬ï⨠¢ WORKSP
LD HL,(TRD_5CCF) ;
LD (TRD_5CE1),HL ;
LD DE,0X0900
ADD HL,DE
LD (TRD_5CCF),HL
LD A,(TRD_5D23) ;
;SUB 0X09
SUB D
LD (TRD_5D23),A
LD HL,(TRD_5CE1) ;
;LD DE,0X0000
;LD B,0X09
LD B,D
LD D,E
CALL COM_05;0X1E3D ;LOAD SECTORS
LD HL,(TRD_5CE1)
LD (TRD_5CDF),HL ;
LD HL,0X0100
LD (TRD_5CD7),HL ;
LD (TRD_5CDD),HL ;???
XOR A
LD (TRD_5CE3),HL ;
LD (TRD_5CE4),A ;
CALL MOVEPP;0X3B00
;LD DE,(0X5CE1)
;LD HL,(0X5CDF)
;EXD
LD HL,(TRD_5CE1)
LD DE,(TRD_5CDF)
LD BC,0X0800
ADD HL,BC
;AND A
SCF
SBC HL,DE
;DEC HL
LD C,L
LD B,H
;EXD
;LD D,H
;LD E,L
LD H,D
LD L,E
INC DE
LD (HL),0X00
LDIR
LD HL,(TRD_5CE1)
LD DE,0X08E1
ADD HL,DE
LD E,(HL)
INC HL
LD D,(HL)
LD BC,(TRD_5CD7)
LD (HL),B
DEC HL
LD (HL),C
INC HL
INC HL
INC HL
INC HL
LD C,(HL)
INC HL
LD B,(HL)
EX DE,HL; EXD
LD A,L
AND 0X0F
LD L,H
LD H,0X00
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD A,L
LD L,A
ADD HL,BC
LD BC,(TRD_5CD7)
LD (TRD_5CD7),HL
LD L,B
LD H,0X00
ADD HL,HL
ADD HL,HL
ADD HL,HL
ADD HL,HL
LD A,C
AND 0X0F
ADD A,L
LD C,A
LD B,H
LD HL,(TRD_5CD7)
AND A
SBC HL,BC
EX DE,HL; EXD
LD (HL),D
DEC HL
LD (HL),E
DEC HL
LD A,(TRD_5CE3)
LD (HL),A
LD DE,0X0010
ADD HL,DE
;LD (HL),0X00
LD (HL),D
LD HL,(TRD_5CE1)
;LD DE,0X0000
LD E,D
LD B,0X09
CALL COM_06;0X1E4D
LD A,(TRD_5D23)
ADD A,0X09
LD B,A
LD C,0X00
LD HL,(TRD_5CCF)
CALL DEL_WORKRAM;0X1E2E ;㤠«¥¨¥ ®¡«.¯ ¬ï⨠HL=beg,BC=len
JP ERR_OK;0X03E1 ;"O.K."
LL1775
;MOVE á ¯ à ¬¥â஬ (¨¬ï ¤¨áª )
CALL SET_AND_PUT;0X1DDF ;ãáâ.CH_ADD ¨ ¯®¬¥é.áâப¨ á⥪ ª «ìª-à
CALL EXIT_IF_SINTAX;0X1D75 ;¢ë©â¨,¥á«¨ ¯à®¢¥àª á¨â ªá¨á
CALL SET_FILENAME;0X1C57 ;ãáâ ®¢ª ¨¬¥¨ ä ©«
CALL READ_9SEC;0X03FD ;§ £à㧪 t0s8 ¢ ¡ãä¥à
LD HL,TRD_5CDD
LD DE,TRD_5E1A
LD BC,0X0008
LDIR ;ª®¯¨à㥬 ¨¬ï ¤¨áª
CALL REWRITE_9SEC;0X1E43 ;§ ¯¨áì ⮫쪮 çâ® î§ ®£® ᥪâ®à ¨§ ¡ãä¥à
JP ERR_OK;0X03E1 ;"O.K."
; call EXIT_IF_SINTAX ;
,
; call RESERVED_RAM
; call COM_18 ;
; ld a,(TRD_5E19)
; or a
; jp z,ERR_OK
; ld hl,0
; ld (TRD_5CD9),hl ;
<B> <C>
; ld c,0FFh
;loc_16C3 inc c
; call CP_ERASED_FILE
; jr nz,loc_16C3
; ld a,c
; ld (TRD_5CD4),a
; ld hl,(TRD_5CEB) ;
; ld (TRD_5CD5),hl
; call ADD_FILESIZE
;loc_16D6 inc c
; call CP_ERASED_FILE
; jr z,loc_16D6
; cp 0
; jp nz,loc_1710
; ld a,(TRD_5CD4)
; ld c,a
;loc_16E5 inc c
; call CP_ERASED_FILE
; cp 0
; jr z,REINIT_9SEC
; xor a
; ld (TRD_5CDD),a ;
; call WRHEAD_FILENAME ;
; call ADD_FILESIZE
; jr loc_16E5
; DUPL 0X1710-$,0FFh
;loc_1710 ld a,(TRD_5CEA) ;
; ld (TRD_5CD3),a
; ld (TRD_5CD1),a
; ld hl,(TRD_5CEB) ;
; ld (TRD_5CD5),hl
; push bc
; call MOVE_FILE
; pop bc
; ld hl,(TRD_5CF4)
; ld (TRD_5CD5),hl
; ld (TRD_5CEB),hl ;
; xor a
; ld (TRD_5CEA),a ;
; ld a,(TRD_5CDD) ;
; push af
; ld a,1
; ld (TRD_5CDD),a ;
; call WRHEAD_FILENAME ;
; pop af
; ld (TRD_5CDD),a ;
; ld a,(TRD_5CD4)
; ld c,a
; ld hl,(TRD_5CDB)
; ld (TRD_5CEB),hl ;
; ld a,(TRD_5CD1)
; ld (TRD_5CEA),a ;
; call WRHEAD_FILENAME ;
; ld a,(TRD_5CD4)
; inc a
; ld c,a
; call RDHEAD_FILENAME ;
; ld hl,(TRD_5CD5)
; ld (TRD_5CEB),hl ;
; call WRHEAD_FILENAME ;
; ld a,(TRD_5CD4)
; ld c,a
; jp loc_16C3
;REINIT_9SEC ld hl,(TRD_5CCF) ;
WORK_SP
; ld bc,1000h
; call DEL_WORKRAM
; call READ_9SEC ;
9
; ld hl,(TRD_5E0A)
; ld de,(TRD_5CD9) ;
<B> <C>
; add hl,de
; ld (TRD_5E0A),hl
; ld a,(TRD_5E09)
; ld hl,TRD_5E19
; sub (hl)
; ld (TRD_5E09),a
; ld (hl),0
; ld hl,(TRD_5CD5)
; ld (TRD_5E06),hl
; push af
; call REWRITE_9SEC ;
9
; pop af
; ld c,a
; call RDHEAD_FILENAME ;
; xor a
; ld (TRD_5CDD),a ;
; jp loc_569
DUPL 0X17A5-$,0XFF
;***<-
MOVE_FILE ld a,(TRD_5CD3)
or a
ret z
push hl
ld hl,TRD_5D23
sub (hl)
pop hl
jr nc,loc_17DD
ld a,(TRD_5CD3)
ld b,a
xor a
ld (TRD_5CD3),a
loc_17BA push bc
ld hl,(TRD_5CCF) ;
WORK_SP
push hl
ld de,(TRD_5CD5)
call COM_05 ;
ld hl,(TRD_5CF4)
ld (TRD_5CD5),hl
pop hl
pop bc
ld de,(TRD_5CD7) ;
-
;
call COM_06 ;
ld hl,(TRD_5CF4)
ld (TRD_5CD7),hl ;
-
;
jr MOVE_FILE
loc_17DD ld (TRD_5CD3),a
push hl
ld hl,TRD_5D23
ld b,(hl)
pop hl
xor a
jr loc_17BA
RD_HEAD_COPY push af
ld hl,TRD_5CCC ;
ld (hl),0
ld a,c
loc_17F0 sub 10h
jr c,loc_17F7
inc (hl)
jr loc_17F0
loc_17F7 add a,10h
ld c,a
push bc
call READ_NUM_SEC ;
pop bc
pop af
call FIND_HEAD_BUF
ld de,TRD_5CDD ;
ld bc,10h
or a
jr z,loc_180D ; FIX
ex de,hl
loc_180D ldir ; FIX
ret
VERIFY ld a,0FFh
ld (TRD_5CF9),a ;
2
LOAD call ZERO2HIGH_ERR
loc_1818 call LOAD_FILE
call EXIT_IF_SINTAX ;
,
ld a,0FFh
ld (TRD_5D10),a ;
ld a,(TRD_5CF9) ;
2
cp 0FFh
jp z,ERR_OK
ld a,(TRD_5CE5) ;
cp "B"
jp z,WORK4AUTORUN ;
jp ERR_OK
LOAD_FILE call GET_PARAMS
call EXIT_IF_SINTAX ;
,
call CP_PARAMS ;
jp RD_FILE
;
,
GET_LOAD_CODE ld hl,(CH_ADD)
inc hl
ld a,(hl)
cp 0Dh ;
"ENTER"?
ret z ;
, -
ld a,1
ld (TRD_5CD6),a ; #FF-
call INPUT_PARAMS ;
ZERO2HIGH_ERR xor a
ld (TRD_5D10),a ;
ret
sub_1857 call INP_EXTFILENAME ;
ld a,"B"
cp b
jr nz,loc_1866
ld hl,(CH_ADD)
dec hl
ld (CH_ADD),hl
loc_1866 call INPUT_PARAMS
ld hl,(TRD_5CD9) ;
<B> <C>
ld (TRD_5CD7),hl ;
-
;
ld hl,(TRD_5CDB)
ld (TRD_5CD9),hl ;
<B> <C>
xor a
ld (TRD_5CD6),a ; #FF-
ret
GET_PARAMS call CP_SECOND_SYM ;
jp z,loc_27B
call SET_AND_PUT
call CP_HIGH_ERR
call nz,sub_1857
call GET_SYMSTR
cp 0AFh ; CODE
call z,GET_LOAD_CODE ;
,
cp 0E4h ; DATA
push af
call CP_HIGH_ERR
call z,INP_EXTFILENAME ;
pop af
call z,READ_MASSIV
call EXIT_IF_SINTAX ;
,
call FIND_FILE ;
FIND_RD_HEAD jp nz,ERR_NOFILES
call RDHEAD_FILENAME ;
ret
;
CP_PARAMS
;***->
;®¡à ¡®âª ¯ à ¬¥â஢ § £à㧪¨ ä ©«
;LD A,(0X5CD6) ; ¤à¥á § £à㧪¨
CALL PARAMZAG;0X33CE
; ld a,(TRD_5CD6) ; #FF-
;***<-
or a
ld hl,(TRD_5CE6) ; <C>-
, <B>-
jr z,loc_18B7
ld hl,(TRD_5CD9) ;
<B> <C>
loc_18B7 ld de,(TRD_5CEB) ;
cp 3
ld a,(TRD_5CEA) ;
push de
ld de,(TRD_5CE8) ;
jr nz,loc_18CB
ld de,(TRD_5CDB)
loc_18CB ld b,a
ld (TRD_5CDB),de
ld a,(TRD_5CE5) ;
cp "C"
ld a,b
jr nz,loc_18FD
ld a,b
cp d
jr z,loc_18F6
dec a
cp d
ld a,b
jr z,loc_18F6
ld a,(TRD_5CD6) ; #FF-
cp 3
ld a,b
jr z,loc_18F6
xor a
ld (TRD_5CD6),a ; #FF-
ld d,b
ld e,0
ld (TRD_5CDB),de
jr loc_18F9
loc_18F6 call LOAD_FULLFILE
loc_18F9 ld a,b
call KOLWO_SECS
loc_18FD ld b,a
ld a,(TRD_5CE5) ;
cp "C"
pop de
ret z
push de
cp "B"
push af
call z,LOAD4BASIC
pop af
cp "D"
call z,LOAD4DATA
call LOAD_FULLFILE
ld a,(TRD_5CDC)
ld b,a
pop de
ret
LOAD_FULLFILE ld a,3
ld (TRD_5CD6),a ; #FF-
ret
RD_FILE call CP_HIGH_ERR
jr z,loc_192D
push af
call NUM_SEC_FILE
pop af
cp 0FFh
loc_192D push af
call z,RD_SECTORS
pop af
jr z,loc_1937
jp COM_06 ;
loc_1937 ld a,(TRD_5CD6) ; #FF-
cp 3
call z,RD_OR_VERIFY
ld hl,(E_LINE) ;
dec hl
ld (hl),80h
ret
RD_OR_VERIFY ld a,(TRD_5CF9) ;
2
cp 0FFh
jp nz,LOAD_END_FILE
ld a,(TRD_5CDB)
or a
ret z
ld c,a
ld b,1
ld de,(TRD_5CF4)
jr loc_196A
RD_SECTORS ld a,(TRD_5CF9) ;
2
cp 0FFh
jp nz,COM_05 ;
ld (TRD_5CF4),de
ld c,0
loc_196A ld a,b
or a
ret z
ld (TRD_5CD7),hl ;
-
;
ld (TRD_5CD9),de ;
<B> <C>
loc_1974 push bc
ld b,1
ld de,(TRD_5CD9) ;
<B> <C>
ld hl,TRD_5D25
call COM_05 ;
ld hl,(TRD_5CF4)
ld (TRD_5CD9),hl ;
<B> <C>
pop bc
ld hl,(TRD_5CD7) ;
-
;
ld de,TRD_5D25
loc_198E ld a,(de)
cp (hl)
jr nz,loc_199D
inc hl
inc de
dec c
jr nz,loc_198E
ld (TRD_5CD7),hl ;
-
;
djnz loc_1974
ret
loc_199D ld hl,TXT_VERIFYERR ; "Verify Error."
ld a,0Dh
jp PRINT_TXTERR
PEEK ld a,0FFh
jr loc_19AB
POKE ld a,0EEh
loc_19AB ld (TRD_5D10),a ;
jp loc_1818
MERGE ld a,0FFh
;***->
;¨á¯à.MERGE ¯® ¥¤¨ã
;LD (0X5D1F),A ;¡ë« ªà¨¢®© ¤à¥á
LD (TRD_5D15),A ;ä« £ á®áâ.à ¡.®¡« áâ¨
; ld (TRD_5D1F),a
;***<-
call GET_PARAMS
call EXIT_IF_SINTAX ;
,
ld a,(TRD_5CE5) ;
cp "B"
jp nz,SINTAX_ERROR
ld bc,(TRD_5CE6) ; <C>-
, <B>-
ld (TRD_5CDB),bc
push bc
inc bc
rst 20h
dw 30h ; ᮧ¤ ¨¥ ᢮¡®¤®£® ¬¥áâ
ld (hl),80h
ex de,hl
pop de
push hl
ld de,(TRD_5CEB) ;
call LOAD_FULLFILE
ld a,(TRD_5CDC)
ld b,a
call ZERO2HIGH_ERR
call RD_FILE
pop hl
ld de,(PROG)
rst 20h
dw 8D2h ; à ¡®â á® áâப ¬¨ ¯à®£à ¬¬ë ¥©á¨ª¥
jp ERR_OK
CP_FREE4PROG ex de,hl
scf
sbc hl,de
ret c
ld de,0Ah
add hl,de
ld b,h
ld c,l
CP_FREE_RAM rst 20h
dw 1F05h ; ¯à®¢¥àª ᢮¡®¤®© ¯ ¬ïâ¨
ret
LOAD4BASIC ld de,(PROG)
ld hl,(E_LINE) ;
dec hl
push hl
push de
sbc hl,de
ld de,(TRD_5CE6) ; <C>-
, <B>-
push de
push hl
ld hl,0
ld a,(TRD_5CF9) ;
2
cp 0FFh
jr z,loc_1A20
ld hl,5
loc_1A20 add hl,de
ld (TRD_5CDB),hl
pop hl
ld a,(TRD_5CF9) ;
2
cp 0FFh
jr nz,loc_1A31
pop de
pop de
pop hl
jr loc_1A48
loc_1A31 call CP_FREE4PROG
pop bc
pop de
pop hl
push bc
rst 20h
dw 19E5h ; ¢®ááâ ®¢«¥¨¥
pop bc
call RESERV_RAM
inc hl
ld bc,(TRD_5CE8) ;
add hl,bc
ld (VARS),hl
loc_1A48 ld hl,(PROG)
ret
LOAD4DATA ld de,(TRD_5CE8) ;
ld (TRD_5CDB),de
ld hl,(TRD_5CD7) ;
-
;
ld a,(TRD_5CF9) ;
2
cp 0FFh
ret z
ld hl,(TRD_5CD9) ;
<B> <C>
push hl
call CP_FREE4PROG
pop hl
ld a,h
or l
jr z,loc_1A79
ld hl,(TRD_5CD7) ;
-
;
dec hl
dec hl
dec hl
ld bc,(TRD_5CD9) ;
<B> <C>
inc bc
inc bc
inc bc
call DEL_WORKRAM
loc_1A79 ld hl,(E_LINE) ;
dec hl
ld bc,(TRD_5CE8) ;
push bc
inc bc
inc bc
inc bc
call RESERV_RAM
inc hl
ld a,(TRD_5CD2)
ld (hl),a
inc hl
pop de
ld (hl),e
inc hl
ld (hl),d
inc hl
ret
NUM_SEC_FILE ld a,(TRD_5CD9) ;
<B> <C>
ld c,b
ld b,a
ld a,c
cp b
jr c,loc_1AB6
ld a,b
or a
jp z,SINTAX_ERROR
dec b
jr z,loc_1AB0
ld a,10h
loc_1AA7 inc e
cp e
jr nz,loc_1AAE
ld e,0
inc d
loc_1AAE djnz loc_1AA7
loc_1AB0 ld b,1
ld hl,(TRD_5CD7) ;
-
;
ret
loc_1AB6 ld hl,TXT_R_O
ld a,5
jp PRINT_TXTERR
CP_FILE_FREE call FIND_FILE ;
;***->
;¢ ¯à®¢¥àª¥ «¨ç¨ï ä ©« ¨ ¬¥áâ ¢ ª â «®£¥
;JP Z,0X1C50 ;"FILE EXISTS"
CALL Z,LL3343 ;¯¥à¥®á ®¯¨á.¨§ ¡ãä.¢ ¯ ¬.¨ ¢ª«.Overwr=ON
; jp z,FILE_EXISTS
;***<-
CP_FREE_ON_DSK call READ_9SEC ;
ld a,(TRD_5E09)
cp 80h
jp z,ERR_DIRFULL
ret
SAVE call ZERO2HIGH_ERR
ld hl,0
ld (TRD_5CD1),hl
call SET_AND_PUT
call GET_SYMSTR
cp 0AFh ; CODE
jr z,loc_1B39
cp 0CAh ; LINE
jr nz,loc_1AF8 ; SCREEN$
call SET_NUM_CHAN
call EXIT_IF_SINTAX ;
,
ld hl,(TRD_5CDB)
ld (TRD_5CD1),hl
ld hl,TRD_5CE5 ;
jr loc_1B1F
loc_1AF8 cp 0AAh ; SCREEN$
jr nz,loc_1B0D
ld hl,4000h
ld (TRD_5CD7),hl ;
-
;
ld hl,1B00h
ld (TRD_5CD9),hl ;
<B> <C>
ld (TRD_5CDB),hl
jr loc_1B48
loc_1B0D call EXIT_IF_SINTAX ;
,
call GET_SYMSTR
ld hl,TRD_5CE5 ;
cp 0E4h ; DATA
jr z,loc_1B2C
cp 0Dh
jp nz,SINTAX_ERROR
loc_1B1F ld (hl),"B"
call CP_FILE_FREE
call DEL_5BYTES
loc_1B27 call SET_START_SIZE
jr loc_1B53
loc_1B2C ld (hl),"D"
call CP_FILE_FREE
call CP_MASSIV
jr nc,loc_1B53
jp c,SINTAX_ERROR
loc_1B39 call GET_START_SIZE
ld hl,(TRD_5CD9) ;
<B> <C>
ld (TRD_5CD7),hl ;
-
;
ld hl,(TRD_5CDB)
ld (TRD_5CD9),hl ;
<B> <C>
loc_1B48 call EXIT_IF_SINTAX ;
,
ld a,"C"
ld (TRD_5CE5),a ;
call CP_FILE_FREE
loc_1B53
;***->
;¢ SAVE
;CALL 0X1B59 ;§ ¯¨áì ä ©«
CALL SAVER;0X33F5
; call SAVE_FILE
;***<-
jp loc_569
SAVE_FILE ld hl,(TRD_5CD7) ;
-
;
ld (TRD_5CE6),hl ; <C>-
, <B>-
ex de,hl
ld hl,(TRD_5CD9) ;
<B> <C>
ld a,l
or h
jp z,SINTAX_ERROR
ld a,l
or a
jr z,loc_1B6D
inc h
loc_1B6D ld a,h
ld (TRD_5CEA),a ;
ld e,a
ld d,0
ld hl,(TRD_5E0A)
sbc hl,de
jp c,loc_1C45
push hl
ld hl,(E_LINE) ;
ld (hl),0AAh ; SCREEN$
inc hl
ld de,(TRD_5CD1)
ld (hl),e
inc hl
ld (hl),d
ld hl,(TRD_5CDB)
ld (TRD_5CE8),hl ;
ld hl,(TRD_5E06)
ld (TRD_5CEB),hl ;
ex de,hl
ld hl,(TRD_5CE6) ; <C>-
, <B>-
ld a,(TRD_5CEA) ;
ld b,a
call COM_06 ;
ld hl,(TRD_5CF4)
push hl
call READ_9SEC ;
9
pop hl
ld (TRD_5E06),hl
pop hl
ld (TRD_5E0A),hl
ld hl,TRD_5E09
ld a,(hl)
ld (TRD_5D1E),a
inc (hl)
push hl
call REWRITE_9SEC ;
9
pop hl
ld c,(hl)
dec c
ld a,(TRD_5CE5) ;
cp "B"
call z,SET_HEAD_STSZ
ret
SET_HEAD_STSZ ld hl,(E_LINE) ;
ld de,(PROG)
scf
sbc hl,de
ld (TRD_5CE6),hl ; <C>-
, <B>-
ld hl,(VARS)
sbc hl,de
ld (TRD_5CE8),hl ;
ret
SET_START_SIZE ld hl,(VARS)
ld de,(PROG)
sbc hl,de
ld (TRD_5CDB),hl
ld hl,(PROG)
ld (TRD_5CD7),hl ;
-
;
ld hl,(E_LINE) ;
inc hl
inc hl
inc hl
sbc hl,de
ld (TRD_5CD9),hl ;
<B> <C>
ret
READ_MASSIV call FIND_MASSIV
ret nc
ld hl,0
ld (TRD_5CD9),hl ;
<B> <C>
ld a,(TRD_5CF9) ;
2
cp 0FFh
ret nz
jp loc_1C13
CP_MASSIV call FIND_MASSIV
ret nc
loc_1C13 ld a,0Eh
ld hl,TXT_ARRAYNOT ; "Array not found"
jp PRINT_TXTERR
FIND_MASSIV call GET_NEXT_SYM
call LOOK_VARS
set 7,c
ld a,c
ld (TRD_5CD2),a
jr nc,loc_1C2B
loc_1C29 scf
ret
loc_1C2B jr nz,loc_1C29
inc hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (TRD_5CD7),hl ;
-
;
ld (TRD_5CDB),de
ld (TRD_5CD9),de ;
<B> <C>
call GET_NEXT_SYM
cp ")"
jr nz,loc_1C2B
ret
loc_1C45 ld hl,TXT_NOSPACE_
ld a,3
PRINT_TXTERR call PRINT_ERROR ;
jp END_COMAND
FILE_EXISTS ld hl,TXT_FILEEXISTS_
ld a,2
jr PRINT_TXTERR
;
#5CDD
SET_FILENAME ld hl,TRD_5CDD ;
ld b,8
loc_1C5C ld (hl)," "
inc hl
djnz loc_1C5C
call CP_ON_STKBOT
ex de,hl
call SETUP_DSK
ld a,c
;***->
;¨á¯à.¯à®¢¥àª¨ ¤«¨ë áâப¨ filename ¯® ¥¤¨ã
;OR A
OR B ;¯à®¢¥àª BC=0
; or a
;***<-
jp z,SINTAX_ERROR
cp 9
jr c,loc_1C73
ld c,8
loc_1C73 ld a,(hl)
cp " "
jp c,SINTAX_ERROR
ld de,TRD_5CDD ;
push bc
ldir
pop bc
ret
SETUP_DSK inc hl
ld a,(hl)
cp ":"
jr nz,loc_1C98
dec hl
ld a,(hl)
call NUMDSK2BYTE
push bc
push hl
call COM_01 ;
pop hl
pop bc
dec bc
dec bc
inc hl
inc hl
ret
loc_1C98 dec hl
ld a,(TRD_5D19) ;
push bc
push hl
call COM_01 ;
pop hl
pop bc
ret
FIND_HEAD_BUF ld l,c
ld h,0
add hl,hl
add hl,hl
add hl,hl
add hl,hl
ld bc,TRD_5D25
add hl,bc
ret
SET_CP_FILENAME call SET_FILENAME ;
#5CDD
;
FIND_FILENAME call RD_0SEC2BUF ;
0
ld b,80h
ld c,0
loc_1CBA push bc
call FIND_HEAD_BUF
call CP_END_BUF ;
pop bc
push bc
ld a,c
cp 10h
jr nz,loc_1CCD
pop bc
ld c,0
jr loc_1CBA
loc_1CCD ld de,TRD_5CDD ;
ld a,(TRD_5D06) ;
ld b,a
xor a
cp (hl)
jr nz,loc_1CDB
pop bc
jr loc_1CE4
loc_1CDB call COMPARE_B_SYM
pop bc
jr z,loc_1CE7
inc c
djnz loc_1CBA
loc_1CE4 or 0FFh
ret
loc_1CE7 ld a,80h
sub b
ld c,a
ld (TRD_5D1E),a
xor a
ret z
COM_0A call FIND_FILENAME ;
ld hl,TRD_5D0F ;
TR-DOS
ld (hl),c
ret z
ld (hl),0FFh
ret
RETURN call EXIT_IF_SINTAX ;
,
call DELETE_BUF
res 3,(iy+1)
call RESTORE_SP ;
ld sp,(TRD_5D1C) ;
SP
exx
ld hl,2758h
exx
dec hl
ld a,12h
cp (hl)
ret nz
dec hl
jp loc_235
SINTAX_ERROR bit 7,(iy+0)
jr z,loc_1D25
ld a,0Bh
ld (ERR_NR),a
loc_1D25 inc a
ld hl,TXT_ERROR_
PRT_TEXT_ERROR call PRINT_ERROR ;
jp END_COMAND
loc_1D2F ld a,(ERR_NR)
ld hl,TXT_BREAK ; "*BREAK*"
cp 14h
jr z,PRT_TEXT_ERROR
cp 0Ch
jr z,PRT_TEXT_ERROR
ld hl,TXT_OUTRAM ; "Out of RAM"
cp 3
jr z,PRT_TEXT_ERROR
ld hl,TXT_ARRAYNOT ; "Array not found"
cp 1
jr z,PRT_TEXT_ERROR
jr SINTAX_ERROR
RUN call ZERO2HIGH_ERR
call LOAD_FILE
call EXIT_IF_SINTAX ;
,
ld hl,(TRD_5CE6) ; <C>-
, <B>-
ld a,(TRD_5CE5) ;
cp "B"
jp z,WORK4AUTORUN ;
push hl
ret
CLEAR_WORKSPACE ld hl,TRD_5D0E ; #FE-
BASIC,
TR-DOS
ld a,(hl)
loc_1D67 cp 0FFh
ld (hl),0
ret nz
rst 20h
dw 16BFh ; ®ç¨áâª à ¡®ç¥© ®¡« á⨠¨ á⥪ ª «ìªã«ïâ®à
ret
CP_SINTAX bit 7,(iy+1)
ret
;
,
EXIT_IF_SINTAX call CP_SINTAX
ret nz
pop hl
ret
;
CHISLO2STKBOT call GET_NEXT_SYM
call BC2STKBOT
jr CP_SINTAX
;
0
OPEN_CHAN_0 xor a
OPENSTREAM rst 20h
dw 1601h ; ®âªàë⨥ ª «
ret
;
2
OPEN_CHAN_2 ld a,2
jr OPENSTREAM
GET_SYMSTR rst 20h
dw 18h ; ¢ë¡®àª ᨬ¢®« ¨§ (CH_ADD)
ret
CALL2BASEDIT call OPEN_CHAN_0 ;
0
rst 20h
dw 0F2Ch ; । ªâ®à ª®¬ ¤®© áâப¨
ret
;
CLEAR_SCREEN rst 20h
dw 0D6Bh ; ®ç¨á⪠íªà
ret
LOOK_VARS rst 20h
dw 28B2h ; Look-Vars. 䨣 § ¥â ç¥ ¤¥« ¥â
ret
;
CLEAR_DOWN_SCR rst 20h
dw 0D6Eh ; ®ç¨á⪠¨¦¥© ç á⨠íªà
ret
PRINT_CHISLO_A_ ld c,a
CONV2_2BYTES ld b,0
jp PRINT_CHISLO
PRINT_CHISLO push bc ;
call CP_INTERFACE1 ;
INTERFACE1
pop bc
rst 20h
dw 1A1Bh ; ¯¥ç âì á®®¡é¥¨© ¨ ®¬¥à®¢ áâப
call CP_INTERFACE1 ;
INTERFACE1
ret
GET_STKBOT_ rst 20h
dw 2BF1h ; ç⥨¥ ¤ á⥪ ª «ìªã«ïâ®à
ret
FIND_LAST rst 20h
dw 1E99h ; ¯®¨áª ¯®á«¥¤¥£® 楫®£® ç¨á«
ret
PUT_NUMDSK_STK rst 20h
dw 1C8Ch
ret
BC2STKBOT rst 20h
dw 1C82h
ret
; CH_ADD
SET_CH_ADD ld hl,(TRD_5D11) ;
TR_DOS
inc hl
ld (CH_ADD),hl
ret
INP_STR2STKBOT call SET_AND_PUT
loc_1DD0 call GET_SYMSTR
cp ","
jp nz,SINTAX_ERROR
call GET_NEXT_SYM
call PUT_NUMDSK_STK
ret
SET_AND_PUT call SET_CH_ADD ; CH_ADD
jp PUT_NUMDSK_STK
GET_START_SIZE call GET_SYMSTR
cp 0AFh ; CODE
ret nz
INPUT_PARAMS call CHISLO2STKBOT ;
jr z,loc_1DFB
call FIND_LAST
ld (TRD_5CD9),bc ;
<B> <C>
ld (TRD_5CDB),bc
loc_1DFB call GET_SYMSTR
cp ","
jr z,SET_NUM_CHAN
cp 0Dh
jp nz,SINTAX_ERROR
call EXIT_IF_SINTAX ;
,
ret
SET_NUM_CHAN call CHISLO2STKBOT ;
ret z
call FIND_LAST
ld (TRD_5CDB),bc
ld a,3
ld (TRD_5CD6),a ; #FF-
ret
DEL_5BYTES ld hl,(TRD_5D11) ;
TR_DOS
rst 20h
dw 11A7h ; 㤠«¥¨¥ ¨§ ª®¬ ¤®© áâp®ª¨ ¯ï⨡ ©âëå ç¨á¥«
ret
CREATE_FREERAM ld hl,(WORKSP)
rst 20h
dw 30h ; ᮧ¤ ¨¥ ᢮¡®¤®£® ¬¥áâ
ret
GET_NEXT_SYM rst 20h
dw 20h ;
ret
DEL_WORKRAM rst 20h
dw 19E8h ; ¤ «¥¨¥ ®¡« á⨠¯ ¬ïâ¨
ret
RESERV_RAM rst 20h
dw 1655h
ret
WR_NUM_TRACK call GET_NUM_TRACK
ld a,h
out (3Fh),a
ret
;
COM_05 xor a
jr loc_1E64
WRHEAD_FILENAME call SETHEADFILENAME ;
REWRITE_9SEC ld de,(TRD_5CF4) ;
9
dec de
ld b,1
ld hl,TRD_5D25
COM_06 push hl ;
push de
call GET_TYPE_DSK ;
bit 7,(hl)
jr z,loc_1E60
bit 0,(hl)
jr nz,loc_1E60
ld hl,READ_ONLY
jp PRT_TEXT_ERROR
loc_1E60 pop de
pop hl
SAVE_SECTORS ld a,0FFh
loc_1E64 ld (TRD_5CCE),a ; #00-
,#FF-
loc_1E67 ld (TRD_5CF4),de
push bc
push hl
;***->
;¢ ¯/¯ § ¯¨á¨ ¨äë ® ä ©«¥
;CALL 0X1E36 ;ç⥨¥ ¨¤¥ªá®© ®¡«.¤®à®¦ª¨
JP TCH1;0X3800
TCH1Q
; call WR_NUM_TRACK
;***<-
pop hl
pop bc
xor a
or b
ret z
loc_1E75 push bc
push hl
call COM_04 ;
ld a,(TRD_5CF4)
call COM_03 ;
ld a,(TRD_5CF5)
call COM_02 ;
ld a,(TRD_5CCE) ; #00-
,#FF-
or a
push af
call z,LOAD_SECTOR
pop af
call nz,SAVE_SECTOR
pop hl
ld de,100h
add hl,de
push hl
ld a,10h
ld hl,TRD_5CF4
inc (hl)
cp (hl)
jr nz,loc_1EA7
ld (hl),0
ld hl,TRD_5CF5
inc (hl)
loc_1EA7 pop hl
pop bc
djnz loc_1E75
ret
KOLWO_SECS push hl
ld h,a
ld l,0
push hl
sbc hl,de
call c,LOAD_FILLFILE
pop hl
ld a,h
pop hl
ret c
ld a,d
ret
LOAD_FILLFILE xor a
ld (TRD_5CD6),a ; #FF-
scf
ret
FORMAT ld hl,0FFFFh
ld (TRD_5CD7),hl ;
-
;
ld (TRD_5CD9),hl ;
<B> <C>
ld (TRD_5CD1),hl
call CP_SECOND_SYM ;
jp z,SINTAX_ERROR
call SET_AND_PUT
call EXIT_IF_SINTAX ;
,
;***->
;¢ FORMAT
;CALL 0X1C57 ;ãáâ ®¢ª ¨¬¥¨ ¤¨áª
;CALL 0X3200 ;¢ë¡®à ¡ëáâண® ¨«¨ ®¡ë箣® ä®à¬ â
CALL TCH3;0X3921
wFORMAT CALL SELFORMAT;0X3378
; call SET_FILENAME ;
#5CDD
; call GET_TYPE_DSK ;
;***<-
and 80h
ld a,40 ; 40
jr z,loc_1EE8
ld a,80 ; 80
loc_1EE8 ld (TRD_5CD7),a ;
-
;
call COM_00 ;
93
call COM_17 ; 1
call PAUSE_3_C_A
;***->
;¢ FORMAT
;LD E,0X01
;CALL 0X1FFD
;CALL 0X1FEB
;LD E,0X00
;CALL 0X1FFD
;LD A,(0X5CDD)
;CP 0X24
;JR Z,0X9F1B
;CALL 0X1FF6
;CALL 0X3EA0
;CALL 0X3EB5
;LD A,H
;CP 0X01
;JR NZ,0X9F1B
CALL LOAD_FILLFILE;0X1EBC ;SCF:(23766),0(ª®¬ ¤ ¥ ¯à¨ïâ «¨§-஬)
LD A,(TRD_5CDD)
CP 0X24
JR Z,loc_1F1B;0X1F1B
JR loc_1F16
; ld e,1
; call FORMAT_TREK ;
; call COM_16 ; 0
; ld e,0
; call FORMAT_TREK ;
; ld a,(TRD_5CDD) ;
; cp "$"
; jr z,loc_1F1B
; call COM_17 ; 1
; call PAUSE_3_C_A
; call loc_3EB5
; ld a,h
; cp 1
; jr nz,loc_1F1B
DUPL 0X1F16-$,0XFF
;***<-
loc_1F16
ld a,80h
ld (TRD_5CDA),a
loc_1F1B
;***->
;CALL 0X20BD ;ä®à¬ â¨à®¢ ¨¥ ¤¨áª
CALL FORMDISK;0X334C
; call FORMAT_DISK
;***<-
ld hl,TRD_5D25
ld (hl),0
ld de,TRD_5D26
ld bc,0FFh
ldir
ld bc,TRD_5CD7 ;
-
;
ld de,TRD_5CDA
ld a,(bc)
cp 50h
jr z,loc_1F49
ld a,(de)
cp 80h
jr z,loc_1F42 ; 80
1
ld a,19h ; 40
1
ld hl,624 ;
jr loc_1F55
loc_1F42 ld a,17h ; 80
1
loc_1F44 ld hl,1264 ;
jr loc_1F55
loc_1F49 ld a,(de)
cp 80h
ld a,18h ; 40
2
jr nz,loc_1F44 ;
ld a,16h ; 80
2
ld hl,2544 ;
loc_1F55 ld (TRD_5E08),a
ld (TRD_5E0A),hl
ld a,1
ld (TRD_5E07),a
ld a,10h
ld (TRD_5E0C),a
ld hl,TRD_5E0F
ld de,TRD_5E10
ld bc,8
ld (hl)," "
ldir
ld hl,TRD_5CDD ;
ld de,TRD_5E1A
ld bc,8
ldir
call COM_16 ; 0
ld b,1
ld de,8
ld hl,TRD_5D25
call SAVE_SECTORS
ld a,(TRD_5CD6) ; #FF-
push af
xor a
ld (TRD_5CE5),a ;
ld hl,(TRD_5E0A)
ld (TRD_5CD7),hl ;
-
;
ld hl,TRD_5CDD ;
rst 18h
ld a,0Dh
rst 10h
ld hl,(TRD_5CD7) ;
-
;
pop af
push hl
ld d,0
ld e,a
sbc hl,de
ld b,h
ld c,l
call PRINT_CHISLO ;
ld a,"/"
rst 10h
pop bc
call PRINT_CHISLO ;
;***->
;JP 0X326B ;§ ¯à®á ¯®¢â®à ä®à¬ â¨à®¢ ¨ï
JP ASKREPFORM;0X833
; jp END_COMAND
;***<-
TABL_SECTORS db 1,9,2,0Ah,3,0Bh,4,0Ch,5,0Dh,6,0Eh,7,0Fh,8,10h,1
CP_DSK_TRACK call GET_TIME_HEAD ;
or 11h
ld b,a
ld a,32h
call HEAD_POSITION
ld a,2
call HEAD_POSITION
call PAUSE725779T
in a,(1Fh)
and 4
ld a,80 ; 80
jr z,loc_1FE7
ld a,40 ; 40
loc_1FE7 ld (TRD_5CD7),a ;
-
;
ret
; 0
COM_16 ld a,(TRD_5D16) ;
( #FF)
or 3Ch
SET_REG_FF: ; CODE XREF: COM_17+5j
ld (TRD_5D16),a ;
#FF
out (0FFh),a
ret
; 1
COM_17 ld a,(TRD_5D16) ;
( #FF)
and 6Fh
jr SET_REG_FF ;
#FF
;
FORMAT_TREK di
ld a,0F4h
out (1Fh),a
;***->
ld hl,(TRD_5CE6);TABL_SECTORS
;***<-
ld c,7Fh
loc_2007 ld b,0Ah
ld d,4Eh
call WRITE_C_D_B
ld b,0Ch
ld d,0
call WRITE_C_D_B
ld b,3
ld d,0F5h
call WRITE_C_D_B
ld d,0FEh
call WRITE_C_D_1
ld d,e
call WRITE_C_D_1
ld d,0
call WRITE_C_D_1
ld d,(hl)
call WRITE_C_D_1
ld d,1
call WRITE_C_D_1
ld d,0F7h
call WRITE_C_D_1
ld b,16h
ld d,4Eh
call WRITE_C_D_B
ld b,0Ch
ld d,0
call WRITE_C_D_B
ld b,3
ld d,0F5h
call WRITE_C_D_B
ld d,0FBh
call WRITE_C_D_1
ld b,0
ld d,0
call WRITE_C_D_B
ld d,0F7h
call WRITE_C_D_1
ld b,32h
ld d,4Eh
call WRITE_C_D_B
ld a,(hl)
inc hl
cp 10h
jr nz,loc_2007
ld b,0
call WRITE_C_D_B
jp m,loc_2076
call WRITE_C_D_B
loc_2076 in a,(1Fh)
and 40h
jp nz,loc_3F39 ; Read Only
CP_NUM_TRACK ld a,(TRD_5CD7+1) ;
-
;
or a
ret nz
ld c,7Fh
ld a,e
out (3Fh),a
;***->
;¯à®¢¥àª ¤®à®¦ª¨
;LD HL,(0X5CE8) ; ¤à¥á â ¡«.ᥪâ®à®¢ ¤«ï ¯à®¢¥àª¨
CALL SUB14;0X33BE ;HL=HL-14 (???)
; ld hl, TABL_SECTORS+1
;***<-
loc_208A ld b,3
ld a,(hl)
out (5Fh),a
push hl
loc_2090 di
ld a,80h
out (1Fh),a
push bc
call RD_DATAPORT
in a,(1Fh)
and 7Fh
pop bc
jr z,loc_20A6
djnz loc_2090
ld hl,TRD_5CD6 ; #FF-
inc (hl)
loc_20A6 pop hl
ld a,(hl)
inc hl
cp 1
jr nz,loc_208A
ei
ret
WRITE_C_D_1 ld b,1
WRITE_C_D_B in a,(0FFh)
and 0C0h
jr z,WRITE_C_D_B
ret m
out (c),d
djnz WRITE_C_D_B
ret
FORMAT_DISK ld hl,TRD_5CD7 ;
-
;
ld b,(hl)
;***->
;¢ ä®à¬ â¨à®¢ ¨¨ ¤¨áª
;XOR A ;¤®à®¦ª¨ ¯à®¢¥àïâì
;INC HL
;LD (HL),A ;0X5CD8
CALL CHECKON;0X32EA ;XOR A:(+HL)=(0X5CE8)
; xor a
; inc hl
; ld (hl),a
;***<-
ld e,0FFh
loc_20C6 push bc
inc e
ld a,e
ld b,1Bh
;***->
;CALL 0X3E44 ;¯®§¨æ¨®¨à®¢ ¨¥
CALL POSIT;0X3224
; call HEAD_POSITION
;***<-
call COM_16 ; 0
;***->
;CALL 0X32DD ;¯¥ç.®¬¥à ¤®à®¦ª¨ ¨ ä®à¬ â¨à®¢ ¨¥ ¥¥
CALL PRHD0;0X32F6
; call FORMAT_TREK ;
;***<-
ld a,(TRD_5CDA)
cp 80h
jr nz,loc_20E1
call COM_17 ; 1
;***->
;CALL 0X330F ;¯¥ç.®¬.¨¦.¤®à.¨ ä®à¬.¥¥
CALL PRHD1;0X32F1
; call FORMAT_TREK ;
;***<-
loc_20E1 pop bc
djnz loc_20C6
ret
DELETE_BUF push af
ld a,(TRD_5CF8) ;
2
cp 0FFh
jr z,loc_211C
pop af
call DEL_BUF ;
,
;
INTERFACE1
CP_INTERFACE1 push af
ld a,(TRD_5CB6) ;
INTERFACE1
cp 0F4h
jr z,loc_211C
xor a
ld hl,TRD_5D18
or (hl)
ld (hl),0FFh
jr z,loc_211C
ld a,(TRD_5D0C)
or a
ld hl,TRD_5CC3
ld de,TRD_5D33
jr nz,loc_2111
ld de,TRD_5E34
loc_2111 ld b,2Dh
loc_2113 ld c,(hl)
ld a,(de)
ld (hl),a
ld a,c
ld (de),a
inc hl
inc de
djnz loc_2113
loc_211C pop af
ret
CLRBUF_EDITOR ld hl,(E_LINE) ;
ld (hl),0Dh
ld (K_CUR),hl
inc hl
ld (hl),80h
ret
RESTORE_COMSTR ld de,(E_LINE) ;
ld hl,TRD_5D20 ;
3
call LDI3_HL2DE ;
3
ret
;
GET_COMMAND ld a,(TRD_5D0F) ;
TR-DOS
or a
push af
call nz,RESTORE_COMSTR
pop af
call z,CLRBUF_EDITOR
ld hl,(E_LINE) ;
call PRINT_0D
ld a,(TRD_5D19) ;
add a,"A"
rst 10h
ld a,">"
rst 10h
;***->
;¢ ¯à¨ï⨨ ª®¬ ¤ë
;LD HL,23610
;LD (HL),0XFF
;JP 0X1D90 ;¢¢®¤ ª®¬ ¤ë ¨ ¢®§¢à â
LD (IY),0XFF
EI
JP GETCOM;0X3B80
; ld hl,ERR_NR
; ld (hl),0FFh
; jp CALL2BASEDIT
;***<-
sub_2158 call GET_NEXT_SYM
call GET_SYMSTR
cp ","
jp nz,SINTAX_ERROR
ld hl,(TRD_5CDB)
ld (TRD_5CD9),hl ;
<B> <C>
call SET_NUM_CHAN
call EXIT_IF_SINTAX ;
,
ld hl,(TRD_5CDB)
ld a,h
or a
jp nz,SINTAX_ERROR
inc hl
ld (TRD_5CD7),hl ;
-
;
ld hl,(TRD_5CD9) ;
<B> <C>
ld (TRD_5CDB),hl
ret
OPEN ld hl,(TRD_5D11) ;
TR_DOS
ld (CH_ADD),hl
call SET_NUM_CHAN
call loc_1DD0
loc_218E call GET_SYMSTR
cp "A"
jr nc,loc_219A
call GET_NEXT_SYM
jr loc_218E
loc_219A cp 0A5h
push af
call z,sub_2158
pop af
jr z,loc_21AE
and 0DFh
cp "R"
jr z,loc_21AE
cp "W"
jp nz,SINTAX_ERROR
loc_21AE ld (TRD_5D09),a
call EXIT_IF_SINTAX ;
,
ld a,"#"
ld (TRD_5CE5),a ;
ld a,0
ld (TRD_5CE6),a ; <C>-
, <B>-
call FIND_ENDFILE
push af
call CP_STREAMS
pop af
push af
call nz,CREATE_BLOCK0
pop af
call OPEN_STREAM
ld hl,(TRD_5D11) ;
TR_DOS
ld bc,124h
add hl,bc
ld (TRD_5D11),hl ;
TR_DOS
jp END_COMAND
FIND_ENDFILE ld a,0Ah
ld (TRD_5D06),a ;
call SET_CP_FILENAME
push af
call COM_18 ;
pop af
jr nz,loc_2206
ld a,(TRD_5D09)
cp "R"
jr z,loc_2201
loc_21F1 ld hl,TRD_5CE6 ; <C>-
, <B>-
inc (hl)
call FIND_FILENAME ;
jr z,loc_21F1
ld hl,TRD_5CE6 ; <C>-
, <B>-
dec (hl)
call FIND_FILENAME ;
loc_2201 call RDHEAD_FILENAME ;
xor a
ret
loc_2206 ld a,(TRD_5D09)
cp "R"
ret nz
jp ERR_NOFILES
CP_STREAMS ld a,(TRD_5CDB)
rst 20h
dw 1727h
ld a,b
or c
jp nz,loc_221B
ret
loc_221B ld a,19h
ld (ERR_NR),a
ld hl,TXT_STREAMOPEN ; "Stream opened"
ld a,0Ah
loc_2225 jp PRINT_TXTERR
loc_2228 ld a,0Bh
ld hl,TXT_NODISKFILE ; "Not disk file"
jr loc_2225
INITFREEACCESS push hl
ld c,20h
rst 28h
ld a,(TRD_5CD7) ;
-
;
ld (hl),a
inc hl
xor a
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
ld a,7Fh
pop hl
ret
OPEN_STREAM push af
call CP_STREAMS
ex de,hl
ld hl,(PROG)
ld bc,(CHANS)
sbc hl,bc
ex de,hl
ld (hl),e
inc hl
ld (hl),d
call CREATE_HEADCHAN
ld a,(TRD_5D09)
cp 0A5h
call z,INITFREEACCESS
jr z,loc_226B
ld a,(TRD_5D09)
cp "R"
ld a,0FFh
jr nz,loc_226B
xor a
loc_226B ld (hl),a
pop af
jp loc_2270
loc_2270 push af
ld bc,14h
add hl,bc
push hl
call GET_TEKSECFILE
pop hl
inc hl
ld b,1
pop af
or a
push af
call nz,COM_06 ;
pop af
call z,COM_05 ;
ret
CREATE_BLOCK0 ld hl,(TRD_5CD7) ;
-
;
push hl
ld hl,2000h
ld (TRD_5CD7),hl ;
-
;
call CREATE_BLOCK
pop hl
ld (TRD_5CD7),hl ;
-
;
ret
CREATE_BLOCK ld hl,1000h
ld (TRD_5CD9),hl ;
<B> <C>
call CP_FREE_ON_DSK ;
call SAVE_FILE
ld hl,0
ld (TRD_5CE8),hl ;
call SETHEADFILENAME
jp REWRITE_9SEC ;
9
CREATE_HEADCHAN ld hl,(PROG)
dec hl
ld (CURCHL),hl
push hl
ld bc,124h
call RESERV_RAM
ld a,0
ld b,0
loc_22C4 ld (de),a
dec de
djnz loc_22C4
pop hl
push hl
ld de,loc_3D0E
ld (hl),e
inc hl
ld (hl),d
inc hl
ld de,loc_3D06
ld (hl),e
inc hl
ld (hl),d
inc hl
ld (hl),"D"
inc hl
inc hl
inc hl
inc hl
inc hl
ld (hl),"$"
inc hl
ld (hl),1
inc hl
ld a,(TRD_5CF6) ;
ld (hl),a
inc hl
ld a,(TRD_5D1E)
ld (hl),a
inc hl
ld a,(TRD_5D09)
cp "R"
ld (hl),0
jr z,loc_22FC
ld a,(TRD_5CE8) ;
ld (hl),a
loc_22FC inc hl
ld (hl),b
jr z,loc_2304
ld a,(TRD_5CE8+1) ;
ld (hl),a
loc_2304 inc hl
ex de,hl
pop hl
push de
ld de,10h
add hl,de
ex de,hl
ld hl,TRD_5CDD ;
ld bc,10h
ldir
pop hl
ret
GET_ADRTEKSYM ld c,0Dh
rst 28h
ld c,(hl)
rst 28h
ld bc,24h
add hl,bc
ret
GET_ADRTEKFRG ld c,24h
ADR_OPEN_CHAN ld b,0
ld hl,(CURCHL)
add hl,bc
ret
CP_ENDOFSECTOR ld c,0Dh
rst 28h
inc (hl)
ret nz
push hl
call SET_DSK
call SAVE_1_SECTOR ;
pop hl
inc hl
inc (hl)
push hl
call LOAD_1_SECTOR
pop hl
ld a,10h
cp (hl)
ret nz
push hl
ld c,0Fh
rst 28h
ld a,(hl)
cp 7Fh
pop hl
jr z,loc_2358
ld hl,(CURCHL)
call SAVE_HEAD_BLK
ld c,0Eh
rst 28h
jp loc_2379
loc_2358 call FIND_NEXT_BLK
push af
call z,LOAD_1_SECTOR
ld c,0Eh
rst 28h
pop af
call nz,CREATE_NEWBLOCK
ret
sub_2367 ld (hl),0
ld c,19h
rst 28h
ld d,20h
ld e,(hl)
ret
CREATE_NEWBLOCK call sub_2367
ld (TRD_5CD7),de ;
-
;
jr CREATE_BLK
loc_2379 call sub_2367
inc e
ld (TRD_5CD7),de ;
-
;
CREATE_BLK call CREATE_BLOCK
call DEL_BUF ;
,
ld c,10h
rst 28h
ex de,hl
ld hl,TRD_5CDD ;
ld bc,10h
ldir
ld c,0Ch
rst 28h
ld a,(TRD_5D1E)
ld (hl),a
ret
FIND_END_SEC ld c,0Dh
rst 28h
inc (hl)
ret nz
inc hl
inc (hl)
push hl
call SET_DSK
ld c,23h
rst 28h
ld a,(hl)
or a
jr z,loc_23B6
pop hl
push hl
dec (hl)
call SAVE_1_SECTOR ;
pop hl
push hl
inc (hl)
loc_23B6 call LOAD_1_SECTOR
pop hl
ld a,10h
cp (hl)
call z,OPEN_NEXT_BLK
ret
OPEN_NEXT_BLK call FIND_NEXT_BLK
push af
call DEL_BUF ;
,
pop af
jp nz,ERR_ENDOFFILE
jp LOAD_1_SECTOR
FIND_NEXT_BLK ld (hl),0
ld c,19h
rst 28h
inc (hl)
ld c,10h
rst 28h
ld de,TRD_5CDD ;
ld bc,10h
ldir
call FIND_FILENAME ;
ret nz
OPEN_BLK call RDHEAD_FILENAME ;
ld c,10h
rst 28h
ex de,hl
ld hl,TRD_5CDD ;
ld bc,10h
ldir
ld c,0Ch
rst 28h
ld a,(TRD_5D1E)
ld (hl),a
xor a
ret
;
SAVE_1_SECTOR call GET_TEKSECFILE
call GET_ADRTEKFRG
ld b,1
call COM_06 ;
ld c,0Fh
rst 28h
ld a,(hl)
cp 7Fh
ret z
call GET_ADRTEKFRG
xor a
ld b,a
loc_2413 ld (hl),a
inc hl
djnz loc_2413
ret
LOAD_1_SECTOR call GET_TEKSECFILE
call GET_ADRTEKFRG
ld b,1
jp COM_05 ;
GET_TEKSECFILE ld hl,(CURCHL)
ld bc,1Eh
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
ld c,0Eh
rst 28h
ld b,(hl)
dec b
inc b
push af
ld a,10h
jr z,loc_2441
loc_2438 inc e
cp e
jr nz,loc_243F
ld e,0
inc d
loc_243F djnz loc_2438
loc_2441 pop af
ret
SET_DSK ld c,0Bh
rst 28h
ld a,(hl)
jp COM_01 ;
OUT_SYM2FILE ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
push hl
ld hl,CP_INTERFACE1 ;
INTERFACE1
push hl
push af
call CP_INTERFACE1 ;
INTERFACE1
ld a,0Ah
ld (TRD_5D06),a ;
pop af
call WORK4FREEACCESS
push af
call CP_FILE_OPENED
jp z,ERR_INVALID_IO
pop af
call GET_ADRTEKSYM
ld (hl),a
jp CP_ENDOFSECTOR
CP_END_BLK ld c,0Dh
rst 28h
ld a,(hl)
ld bc,0Eh
add hl,bc
cp (hl)
ret nz
ld c,0Eh
rst 28h
ld a,(hl)
ld bc,0Eh
add hl,bc
cp (hl)
ret nz
ld hl,TRD_5CB6 ;
INTERFACE1
ld a,(hl)
cp 0F4h
jr z,ERR_ENDOFFILE
bit 4,(hl)
jr z,ERR_ENDOFFILE
or 1
pop hl
ret
ERR_ENDOFFILE ld a,7
loc_2494 ld (ERR_NR),a
call DELETE_BUF
rst 20h
dw 58h
ret
ERR_INVALID_IO ld a,17h
jr loc_2494
WORK4FREEACCESS ld d,a
ld c,0Fh
rst 28h
ld a,(hl)
cp 7Fh
ld a,d
ret nz
ld bc,13h
add hl,bc
ld a,(hl)
or a
ld a,d
jr nz,loc_24D5
dec hl
ld a,(hl)
or a
jr nz,loc_24C2
push bc
push hl
push de
call W16B2WORKSP
pop de
pop hl
pop bc
loc_24C2 ld c,(hl)
ld a,d
ex de,hl
ld hl,(TRD_5CCF) ;
WORK_SP
add hl,bc
cp 6
ld (hl),a
call z,WORK_NUMSAVE
ld c,21h
rst 28h
inc (hl)
pop hl
ret
loc_24D5 dec hl
ld a,(hl)
dec hl
inc a
cp (hl)
inc hl
inc (hl)
push hl
push af
ld c,23h
rst 28h
ld (hl),0FFh
pop af
pop hl
jr c,loc_24EE
ld a,d
cp 0Dh
jr z,loc_24F2
pop bc
ret
loc_24EE ld a,d
cp 0Dh
ret nz
loc_24F2 xor a
ld (hl),a
inc hl
ld (hl),a
ld a,d
ret
W16B2WORKSP ld hl,(WORKSP)
ld (TRD_5CCF),hl ;
WORK_SP
ld bc,10h
jp CREATE_FREERAM
WORK_NUMSAVE ld (hl),0Dh
ld hl,(CH_ADD)
ld (TRD_5CD7),hl ;
-
;
ld hl,(TRD_5CCF) ;
WORK_SP
ld (CH_ADD),hl
ld hl,FLAGS
res 7,(hl)
call BC2STKBOT
ld hl,FLAGS
set 7,(hl)
ld hl,(TRD_5CCF) ;
WORK_SP
ld (CH_ADD),hl
call BC2STKBOT
call FIND_LAST
push bc
pop de
ld c,20h
rst 28h
ld b,(hl)
xor a
ld hl,0
ld (TRD_5CDB),hl
loc_2538 add hl,de
jr nc,loc_2544
push hl
ld hl,(TRD_5CDB)
inc hl
ld (TRD_5CDB),hl
pop hl
loc_2544 djnz loc_2538
ld (TRD_5CD9),hl ;
<B> <C>
ld a,(TRD_5CDB)
ld hl,TRD_5CDA
rrd
and 0Fh
ld (TRD_5CDB),a
ld hl,(TRD_5CD7) ;
-
;
ld (CH_ADD),hl
call OPEN_SAVED
ld c,21h
rst 28h
ld a,0FFh
ld (hl),a
inc hl
ld (hl),a
ret
OPEN_SAVED ld c,19h
rst 28h
ld a,(TRD_5CDA)
cp (hl)
jp nz,loc_2584
ld c,0Eh
rst 28h
ld a,(TRD_5CDB)
cp (hl)
jp nz,loc_25A7
loc_257C ld c,0Dh
rst 28h
ld a,(TRD_5CD9) ;
<B> <C>
ld (hl),a
ret
loc_2584 call CPANDZERO23
call nz,SAVE_TEK_SEC
ld a,(TRD_5CDA)
ld c,19h
rst 28h
ld (hl),a
ld c,10h
rst 28h
ld de,TRD_5CDD ;
ld bc,10h
ldir
call FIND_FILENAME ;
jp nz,loc_25D2
call OPEN_BLK
jr loc_25AD
loc_25A7 call CPANDZERO23
call nz,SAVE_TEK_SEC
loc_25AD ld a,(TRD_5CDB)
ld c,0Eh
rst 28h
ld (hl),a
push hl
call SET_DSK
call LOAD_1_SECTOR
pop hl
dec hl
ld a,(TRD_5CD9) ;
<B> <C>
ld (hl),a
jr loc_257C
SAVE_TEK_SEC call SET_DSK
call SAVE_1_SECTOR ;
ret
CPANDZERO23 ld c,23h
rst 28h
ld a,(hl)
or a
ld (hl),0
ret
loc_25D2 ld hl,(TRD_5CDA)
ld h,20h
ld (TRD_5CD7),hl ;
-
;
ld hl,(TRD_5CD9) ;
<B> <C>
push hl
ld hl,(TRD_5CDB)
push hl
call CREATE_BLK
pop hl
ld (TRD_5CDB),hl
pop hl
ld (TRD_5CD9),hl ;
<B> <C>
jr loc_25AD
INPUTDATAFILE call CP_INTERFACE1 ;
INTERFACE1
ld hl,TV_FLAG
res 3,(hl)
ld hl,(ERR_SP)
ld e,(hl)
inc hl
ld d,(hl)
or a
ld hl,107Fh
sbc hl,de
jr nz,loc_2626
ld sp,(ERR_SP)
pop de
pop de
ld (ERR_SP),de
loc_260F call INPUT_SYM_FILE
jr c,loc_261D
loc_2614 ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
push hl
ld hl,DELETE_BUF
push hl
ret
loc_261D cp 0Dh
jr z,loc_2614
rst 20h
dw 0F85h
jr loc_260F
loc_2626 call INPUT_SYM_FILE
jr loc_2614
INPUT_SYM_FILE ld a,0Ah
ld (TRD_5D06),a ;
call CP_FILE_OPENED
jr z,loc_2642
cp 7Fh
jp nz,ERR_INVALID_IO
ld bc,13h
add hl,bc
ld (hl),0
jr loc_2645
loc_2642 call CP_END_BLK
loc_2645 call GET_ADRTEKSYM
ld a,(hl)
push af
call FIND_END_SEC
pop af
scf
ret
CP_FILE_OPENED ld c,0Fh
rst 28h
ld a,(hl)
or a
ret
CLOSE ld hl,(TRD_5D11) ;
TR_DOS
ld (CH_ADD),hl
call SET_NUM_CHAN
call EXIT_IF_SINTAX ;
,
ld a,(TRD_5CDB)
rst 20h
dw 1727h
ld a,b
or c
jp z,END_COMAND
push hl
ld hl,(CHANS)
add hl,bc
ld a,(hl)
ld hl,loc_3D0E
cp h
pop hl
jp nz,loc_2228
ld (hl),0
inc hl
ld (hl),0
ld (TRD_5CD9),bc ;
<B> <C>
ld hl,(CHANS)
add hl,bc
dec hl
ld (TRD_5CD7),hl ;
-
;
call sub_26CE
ld hl,(TRD_5CD7) ;
-
;
ld bc,124h
call DEL_WORKRAM
ld hl,STRMS
ld b,10h
loc_269D push bc
ld bc,(TRD_5CD9) ;
<B> <C>
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
sbc hl,bc
ex de,hl
jr c,loc_26BC
ld d,(hl)
dec hl
ld e,(hl)
inc hl
push hl
ex de,hl
ld bc,124h
sbc hl,bc
ex de,hl
pop hl
ld (hl),d
dec hl
ld (hl),e
inc hl
loc_26BC inc hl
pop bc
djnz loc_269D
ld hl,(TRD_5D11) ;
TR_DOS
ld bc,124h
sbc hl,bc
ld (TRD_5D11),hl ;
TR_DOS
jp END_COMAND
sub_26CE ld bc,0Fh
add hl,bc
ld a,(hl)
or a
ret z
ld hl,(TRD_5CD7) ;
-
;
ld (CURCHL),hl
call SAVE_HEAD_BLK
jp SAVE_1_SECTOR ;
SAVE_HEAD_BLK ld bc,0Dh
add hl,bc
ld e,(hl)
inc hl
ld d,(hl)
ld bc,0Dh
add hl,bc
ld (hl),e
inc hl
ld (hl),d
ld c,10h
rst 28h
ld de,TRD_5CDD ;
ld bc,10h
ldir
call SET_DSK
ld c,0Ch
rst 28h
ld c,(hl)
call SETHEADFILENAME
jp REWRITE_9SEC ;
9
;
PRINT_MSG ld a,(hl)
or a
ret z
and 7Fh
rst 10h
bit 7,(hl)
ret nz
inc hl
jr PRINT_MSG ;
COMPARE_B_SYM ld a,(de)
cp (hl)
ret nz
inc de
inc hl
djnz COMPARE_B_SYM
ret
loc_271B ld hl,TXT_NODISK_ ; "No disk"
ld a,6
jp PRINT_TXTERR
ERR_DIRFULL ld hl,TXT_DIRFULL ; "Directory full"
ld a,4
jp PRINT_TXTERR
SET_TAPELDERR ld a,1Ah
jr SET_NUM_ERR
ld a,12h
SET_NUM_ERR ld (ERR_NR),a
ret
ld a,3
jr SET_NUM_ERR
COM_15 xor a ;
ld (TRD_5CD7+1),a ;
-
;
ld (TRD_5CD6),a ; #FF-
in a,(1Fh)
ld (TRD_5CCD),a ; #80-
ld e,d
push de
ld a,e
out (7Fh),a
ld a,18h
call COM2VG_WAIT
ld a,(TRD_5CCD) ; #80-
and 80h
call nz,PAUSE_3_C_A
pop de
call CP_NUM_TRACK
ld a,(TRD_5CD6) ; #FF-
or a
ret z
ld a,7
ld (TRD_5D0F),a ;
TR-DOS
ret
TXT_OK_ DB "O.K.",0
TXT_VERIFYERR DB "Verify Error.",8Dh
TXT_BACKUPDISK DB "BACKUP DISK",8Dh
TXT_INS_DEST DB "Insert Destination disk",0Dh,"then press Y",0
TXT_INS_SRC DB "Insert Source disk then press Y",0
TXT_BREAK DB "*BREAK*",8Dh
TXT_OUTRAM DB "Out of RAM",8Dh
TXT_ARRAYNOT DB "Array not found",8Dh
TXT_DIRFULL DB "Directory full",8Dh
TXT_NODISK_ DB "No disk",8Dh
TXT_STREAMOPEN DB "Stream opened",8Dh
TXT_NODISKFILE DB "Not disk file",8Dh
TXT_FILEEXIST DB "File exists",0Dh
DC "Over write?(Y/N)"
CALL_3D13 push af
push bc
ld (TRD_5D04),de
ld (TRD_5D02),hl
call CP_INTERFACE1 ;
INTERFACE1
ld a,0FFh
ld (TRD_5D15),a ;
0,
TR-DOS.
ld (TRD_5D1F),a
pop bc
pop af
ld hl,CP_ERROR ; ¤à¥á § ¢¥àè¥¨ï ¨â¥à¯à¥â â®à
ld (TRD_5D1A),hl ;
ld hl,0
add hl,sp
ld (TRD_5D1C),hl ; á®åà ¥¨¥ ⥪ã饣® á⥪
dec hl
dec hl
ld sp,hl
push af
call MARK_SP ;
ld hl,COMAND_TBL
loc_2869 ld a,(hl)
cp c
jr nz,loc_287F
pop af
inc hl
ld e,(hl)
inc hl
ld d,(hl)
ld hl,END_COMAND
push hl
push de
ld hl,(TRD_5D02)
ld de,(TRD_5D04)
ret
loc_287F cp 0FFh
jr nz,loc_2887
pop af
jp END_COMAND
loc_2887 inc hl
inc hl
inc hl
jr loc_2869
COMAND_TBL db 0
dw COM_00 ;
93
db 1
dw COM_01 ;
db 2
dw COM_02 ;
db 3
dw COM_03 ;
db 4
dw COM_04 ;
db 5
dw COM_05 ;
db 6
dw COM_06 ;
db 7
dw COM_07 ;
db 8
dw COM_08 ;
#5CDD
db 9
dw COM_09 ;
db 0Ah
dw COM_0A ;
db 0Bh
dw COM_0B ;
db 0Ch
dw COM_0C ;
db 0Dh
;***->
;
ã¦ë í⨠à¥áâ àâë?
;ª ª®© ¨¤¨®â ¡ã¤¥â ¨á¯®«ì§®¢ âì ¨å ¢ ¯à®£à ¬¬¥???
; ORG 0X28B4
;0X3D130XD
;DW 0X1D3 ;¯/¯ § ¢¥à襨ï
DW OUTDE;0X3C10 ;OUT (D),E
; dw END_COMAND
;***<-
db 0Eh
dw COM_0E ;
db 0Fh
;***->
;0X3D130XF
;DW 0X1D3 ;¯/¯ § ¢¥à襨ï
DW INED;0X3C14 ;IN E,(D)
; dw END_COMAND
;***<-
db 10h
;***->
;0X3D130X10
;DW 0X1D3 ;¯/¯ § ¢¥à襨ï
DW JPWRITE;0X3C18 ;C=0X7F:16314(WRITE)
; dw END_COMAND
;***<-
db 11h
;***->
;0X3D130X11
;DW 0X1D3 ;¯/¯ § ¢¥à襨ï
DW JPREAD;0X3C1D ;C=0X7F:16341(READ)
; dw END_COMAND
;***<-
db 12h
dw COM_12 ;
db 13h
dw COM_13 ;
#5CDD
db 14h
dw COM_14 ;
#5CDD
db 15h
dw COM_15 ;
db 16h
dw COM_16 ; 0
db 17h
dw COM_17 ; 1
db 18h
dw COM_18 ;
db 0FFh
COM_07 push af ;
call COM_18 ;
pop af
jp loc_479
COM_13 xor a ;
#5CDD
jr loc_28E5
COM_14 ld a,0FFh ;
#5CDD
loc_28E5 ld de,TRD_5CDD ;
ld bc,10h
or a
jr z,loc_28EF ; FIX
ex de,hl
loc_28EF ldir ; FIX
ret
COM_0C call COM_18 ;
call CP_FREE_ON_DSK ;
jp loc_1B27
COM_0B ld (TRD_5CD7),hl ;
ld (TRD_5CD9),de ;
<B> <C>
ld (TRD_5CDB),de
;***->
;¢ § ¯¨á¨ ä ©« 3D130XB
;CALL 0X405 ; áâனª ¤¨áª
;CALL 0X1AC4 ;¯à®¢¥àª ᢮¡.¬¥áâ ¢ ª â «®£¥
;JP 0X1B53 ;§ ¯¨áì ä ©«
JP SVNASTRDSK;0X33E6
CALL CP_FREE_ON_DSK;0X1AC4
JP SAVEFIL
; call COM_18 ;
; call CP_FREE_ON_DSK ;
; jp loc_1B53
;***<-
COM_0E or a ;
ld (TRD_5CD6),a ; #FF-
ld (TRD_5CD9),hl ;
<B> <C>
ld (TRD_5CDB),de
call FIND_FILENAME ;
call FIND_RD_HEAD
call CP_PARAMS ;
jp RD_FILE
COM_12 call COM_18 ;
call FIND_FILENAME ;
jp ERASE_FILES ;
;
FIND_FILE call SET_FILENAME ;
#5CDD
call COM_18 ;
jp FIND_FILENAME ;
;
PRINT_FILENAME push bc
ld b,8
loc_293B ld a,(hl)
rst 10h
inc hl
djnz loc_293B
ld a,"<"
rst 10h
ld a,(hl)
rst 10h
ld a,">"
rst 10h
pop bc
ret
;
CREATE_BUF push hl
push de
push bc
push af
ld hl,TRD_5D0C
ld a,(hl)
or a
jr z,loc_2992
push hl
ld bc,257 ;
push bc
call CP_FREE_RAM
pop bc
pop hl
ld (hl),0
ld hl,TRD_5D25
call RESERV_RAM
ld hl,(TRD_5D11) ;
TR_DOS
ld bc,257 ;
add hl,bc
jr loc_298F
;
,
DEL_BUF push hl
push de
push bc
push af
ld hl,TRD_5D0C
ld a,(hl)
or a
jr nz,loc_2992
ld (hl),0FFh
ld hl,TRD_5D25
ld bc,257 ;
call DEL_WORKRAM
or a
ld bc,257 ;
ld hl,(TRD_5D11) ;
TR_DOS
sbc hl,bc
loc_298F ld (TRD_5D11),hl ;
TR_DOS
loc_2992 pop af
pop bc
pop de
pop hl
ret
COM_40 xor a
loc_2998 ld (TRD_5CD7),a ;
-
;
call EXIT_IF_SINTAX ;
,
call CP_SECOND_SYM ;
jp z,SINTAX_ERROR
call GET_TYPE_DSK ;
ld a,(TRD_5CD7) ;
-
;
ld (hl),a
jp ERR_OK
COM_80 ld a,80h
jr loc_2998
TXT_ERROR_ db 0Dh,"*ERROR*",8Dh
TXT_NOSPACE_ db 0Dh,"No space",8Dh
TXT_FILEEXISTS_ db 0Dh,"File exists",8Dh
TXT_FREE_ DB " Free",8Dh
READ_ONLY db 0Dh
DC "Read Only"
TXT_DISCERROR_ db 0Dh
DC "Disk Error"
TXT_R_O db 0Dh
DC "Rec. O/F"
TXT_TITLE_ DC "Title: "
TXT_RIA_ db 0Dh,"Retry,Abort,Ignore?",0
TXT_TRK_ db 0Dh
DC "Trk "
TXT_SEC_ DC " sec "
TXT_DELFILE_ DB " Del. File",8Dh
TXT_NOFILES_ db 0Dh
TXT_NOFILES DB "No"
TXT_FILES_ DB " File(s)",8Dh,0
sub_2A35 ld hl,loc_2A41
ld de,4080h
ld bc,20h
ldir ; FIX
ret
loc_2A41 ld a,(loc_3B5)
cp 0F3h
ld a,10h
jr z,loc_2A4B
xor a
loc_2A4B ld (KSTATE1),a
ld bc,7FFDh
ld a,10h
out (c),a
ret
MAGIC
;***->
;MAGIC(jp ¨§ 0X66)
;PUSH AF,BC,DE
JP MAGICER;0XA1A
L2A59
; push af
; push bc
; push de
;***<-
push hl
push ix
push iy
exx
push bc
push de
push hl
ex af,af'
push af
ld a,i
push af
ld a,r
push af
ld hl,0
add hl,sp
push hl
;***->
;LD A,0X3C
;OUT (0XFF),A
CALL MAGSTOPDISK;0XA01 ;â ¬ ¥é¥ OUT (0X1F),0XD0
NOP
; ld a,3Ch
; out (0FFh),a
;***<-
ld a,3Fh
ld i,a
in a,(1Fh)
and 80h
rrca
rrca
rrca
ld (KSTATE1),a
call sub_2F65
call PAUSE_3_C_A
call PAUSE_3_C_A
ld de,0Ah
ld hl,4000h
push hl
call sub_2D73
ld hl,4100h
ld de,0Bh
call sub_2D73
pop hl
push hl
ld de,8
call sub_2F1B
ld hl,40E3h
ld a,(hl)
ld (KSTATE0),a
inc hl
ld a,(hl)
inc (hl)
inc hl
ld e,(hl)
inc hl
ld d,(hl)
or a
ex de,hl
ld de,0C0h
sbc hl,de
ld (40E5h),hl
ld hl,4000h
ld de,8
call sub_2D73
pop hl
ld de,(40E1h)
push de
ld de,0Ah
call sub_2F1B
pop de
call sub_2D4C
push de
ld a,3Ch
out (0FFh),a
call sub_2F65
ld hl,4000h
ld de,8
ld b,1
call sub_2F1B
pop de
ld hl,(40E1h)
ld (40E1h),de
push hl
ld hl,4000h
ld de,8
ld b,1
call sub_2D73
ld a,(40E4h)
dec a
call sub_2CE5
ld (hl),"@"
inc hl
ld b,7
loc_2B09 ld (hl)," "
inc hl
djnz loc_2B09
ld (hl),"C"
pop de
pop bc
inc hl
ld (hl),c
inc hl
ld (hl),b
inc hl
inc hl
inc hl
ld (hl),0C0h
inc hl
ld (hl),e
inc hl
ld (hl),d
ld hl,4000h
ld de,0
in a,(5Fh)
dec a
ld e,a
ld b,1
call sub_2D73
ld hl,0
add hl,sp
ld (4140h),hl
ld sp,41FFh
call sub_2A35
ld hl,0C000h
xor a
loc_2B3F add a,(hl)
inc hl
ld b,a
ld a,h
or a
ld a,b
jr nz,loc_2B3F
ld hl,4100h
ld (hl),a
push hl
ld hl,loc_2B58
push hl
ld hl,loc_3D2F
push hl
di
jp 4080h
loc_2B58 pop hl
ld bc,7FFDh
ld a,0AAh
ld (4130h),a
ld d,5
ld a,(KSTATE1)
or d
ld d,a
out (c),d
ld a,(0C130h)
cp 0AAh
jp nz,loc_2C1B
ld a,d
and 0F8h
ld d,a
inc hl
LL2b77
;***->
;¯®¨áª ⥪.áâà.¢ MAGIC
;¨á¯à ¢«¥®:0X7FFD ¢¬¥áâ® 0X0xFD
;checksum 8bit -
!!!
;LD B,8
; ld b,8
;***<-
loc_2B79 ld (hl),d
out (c),d
xor a
ld hl,0C000h
loc_2B80 add a,(hl)
inc hl
ld e,a
ld a,h
or a
ld a,e
jr nz,loc_2B80
ld hl,4100h
cp (hl)
inc hl
jr z,loc_2B93
inc d
;***->
BIT 3,D
JR Z,LL2b77
; djnz loc_2B79
;***<-
dec d
loc_2B93 ld b,8
loc_2B95 push bc
call sub_2C37
pop bc
djnz loc_2B95
ld c,0
call sub_2F3A
call sub_2D2A
ld a,(40E4h)
ld (4102h),a
inc a
ld (40E4h),a
ld hl,(40E5h)
ld de,1
sbc hl,de
ld (40E5h),hl
ret c
ld hl,(40E1h)
ld (411Eh),hl
call sub_2D1E
ld a,38h
ld (4111h),a
ld a,1
ld (411Dh),a
ld hl,4100h
ld (4119h),hl
ld hl,100h
ld (411Bh),hl
ld de,(40E1h)
call sub_2F65
ld c,d
call sub_2F3A
ld hl,4100h
ld b,1
call loc_2D58
ld (40E1h),de
ld c,0
call sub_2F3A
call sub_2D34
ld a,(4102h)
call sub_2CE5
ld de,4110h
ld bc,10h
ex de,hl
ldir
in a,(5Fh)
dec a
ld e,a
ld d,0
ld hl,4000h
call sub_2D73
ld bc,7FFDh
ld a,(4101h)
out (c),a
loc_2C1B ld hl,(4140h)
ld sp,hl
ld hl,4000h
ld de,0Ah
call sub_2F1B
ld hl,4100h
ld de,0Bh
call sub_2F1B
ld a,3Ch
push af
jp loc_2EBC
sub_2C37 ld a,b
dec a
ld (4103h),a
ld b,a
ld a,(4101h)
and 7
cp b
ret z
ld a,2
cp b
ret z
ld a,(4101h)
and 8
jr z,loc_2C55
ld a,b
cp 7
ret z
jr loc_2C59
loc_2C55 ld a,b
cp 5
ret z
loc_2C59 call sub_2C5D
ret
sub_2C5D ld hl,4101h
ld a,(hl)
and 0F8h
ld c,a
ld a,b
or c
push bc
ld bc,7FFDh
out (c),a
pop bc
ld hl,0C000h
loc_2C70 ld a,(hl)
or a
jr nz,loc_2C7A
inc hl
ld a,h
or a
jr nz,loc_2C70
ret
loc_2C7A call sub_2C7E
ret
sub_2C7E ld c,0
call sub_2F3A
call sub_2D2A
ld a,(40E4h)
ld (4102h),a
inc a
ld (40E4h),a
ld hl,(40E5h)
ld de,40h
sbc hl,de
ld (40E5h),hl
ret c
ld hl,(40E1h)
ld (411Eh),hl
call sub_2D1E
ld a,40h
ld (411Dh),a
ld hl,0C000h
ld (4119h),hl
ld hl,4000h
ld (411Bh),hl
ld de,(40E1h)
call sub_2D3E
ld (40E1h),de
ld c,0
call sub_2F3A
call sub_2D34
ld a,(4102h)
call sub_2CE5
ld de,4110h
ld bc,10h
ex de,hl
ldir
in a,(5Fh)
dec a
ld e,a
ld d,0
ld hl,4000h
call sub_2D73
ret
sub_2CE5 ld c,a
and 0F0h
rrca
rrca
rrca
rrca
ld b,a
push bc
ld e,b
ld d,0
ld hl,4000h
push de
call sub_2F1B
pop de
pop bc
ld b,0
ld a,c
and 0Fh
rlca
rlca
rlca
rlca
ld hl,4000h
add a,l
ld l,a
ret
sub_2D09 ld hl,4110h
ld b,9
loc_2D0E ld (hl)," "
inc hl
djnz loc_2D0E
ld a,"@"
ld (4110h),a
ld a,"C"
ld (4118h),a
ret
sub_2D1E call sub_2D09
ld a,(4103h)
add a,"0"
ld (4111h),a
ret
sub_2D2A ld hl,4000h
ld de,8
call sub_2F1B
ret
sub_2D34 ld hl,4000h
ld de,8
call sub_2D73
ret
sub_2D3E call sub_2F65
ld c,d
call sub_2F3A
ld hl,0C000h
ld b,40h
jr loc_2D58
sub_2D4C call sub_2F65
ld c,d
call sub_2F3A
ld hl,4000h
ld b,0C0h
loc_2D58 push bc
push de
call sub_2D73
ld de,100h
add hl,de
pop de
inc e
ld a,e
cp 10h
jr nz,loc_2D6F
ld e,0
inc d
ld c,d
call sub_2F3A
loc_2D6F pop bc
djnz loc_2D58
ret
sub_2D73 ld a,e
inc a
out (5Fh),a
push hl
ld d,14h
push de
loc_2D7B di
ld c,7Fh
ld a,0A0h
out (1Fh),a
call WR_DATAPORT
pop de
pop hl
in a,(1Fh)
and 7Fh
ret z
dec d
push hl
push de
jr nz,loc_2D7B
halt
loc_2D92 ld hl,(TRD_5CE6) ; <C>-
, <B>-
ld de,(TRD_5CEB) ;
ld a,(TRD_5CEA) ;
ld b,a
call COM_05 ;
ret
GOTO call SET_AND_PUT
call EXIT_IF_SINTAX ;
,
call INP_EXTFILENAME ;
call SET_FILENAME ;
#5CDD
ld (4020h),bc
ld a,c
cp 8
jr nc,loc_2DD2
call COM_18 ;
call FIND_FILENAME ;
jp nz,ERR_NOFILES
ld hl,TRD_5CDD ;
ld bc,(4020h)
add hl,bc
ld (hl),"8"
push hl
call FIND_FILENAME ;
pop hl
jr z,loc_2DD8
ld (hl)," "
loc_2DD2 call FIND_FILENAME ;
jp loc_2E33
loc_2DD8 call RDHEAD_FILENAME ;
call loc_2D92
ld sp,40FFh
ld b,8
loc_2DE3 push bc
ld a,b
ld bc,7FFDh
dec a
push af
or 10h
out (c),a
pop af
add a,30h
ld hl,TRD_5CDD ;
ld bc,(4020h)
add hl,bc
ld (hl),a
call FIND_FILENAME ;
jr nz,loc_2E05
call RDHEAD_FILENAME ;
call loc_2D92
loc_2E05 pop bc
djnz loc_2DE3
ld a,20h
ld hl,TRD_5CDD ;
ld bc,(4020h)
add hl,bc
ld (hl),a
call FIND_FILENAME ;
call RDHEAD_FILENAME ;
push bc
push af
ld bc,7FFDh
ld a,(4101h)
out (c),a
pop af
pop bc
jr loc_2E39
call SET_AND_PUT
call EXIT_IF_SINTAX ;
,
call INP_EXTFILENAME ;
call FIND_FILE ;
loc_2E33 jp nz,ERR_NOFILES
call RDHEAD_FILENAME ;
loc_2E39 ld a,(TRD_5CDD) ;
cp "$"
di
jr nz,loc_2E43
im 2
loc_2E43 ld sp,40F0h
call GET_TYPE_DSK ;
ld (4010h),a
ld a,(TRD_5D16) ;
( #FF)
ld (4011h),a
ld hl,(TRD_5CE6) ; <C>-
, <B>-
push hl
ld de,(TRD_5CEB) ;
push de
inc e
ld a,e
cp 10h
jr nz,loc_2E64
ld e,0
inc d
loc_2E64 ld c,d
call sub_2F07
ld a,(4010h)
and 2
call nz,sub_2F0F
ld a,c
call loc_2F50
ld hl,4100h
ld b,0BFh
loc_2E79 push bc
push de
call sub_2F1B
ld de,100h
add hl,de
pop de
inc e
ld a,e
cp 10h
jr nz,loc_2E9C
ld e,0
inc d
ld c,d
call sub_2F07
ld a,(4010h)
and 2
call nz,sub_2F0F
ld a,c
call loc_2F50
loc_2E9C pop bc
djnz loc_2E79
pop de
pop hl
ld sp,hl
ld a,(4011h)
push af
ld c,d
call sub_2F07
ld a,(4010h)
and 2
call nz,sub_2F0F
ld a,c
call loc_2F50
ld hl,4000h
call sub_2F1B
loc_2EBC pop af
ex af,af'
pop af
;***->
;LD R,A
;POP AF
JP MAGregR;0XA0A ;LD (0X5C01),A:POP AF
L2EC2
; ld r,a
; pop af
;***<-
ld i,a
di
ld a,0FFh
jp po,loc_2ECC
ld a,0
loc_2ECC ld (KSTATE0),a
pop af
pop hl
pop de
pop bc
exx
ex af,af'
pop iy
pop ix
pop hl
pop de
pop bc
ld a,(BORDCR)
and 38h
rrca
rrca
rrca
out (0FEh),a
ld a,(SWAP_8)
cp 0EEh
jr nz,loc_2EF7
push bc
ld bc,7FFDh
ld a,(BANKM)
out (c),a
pop bc
loc_2EF7 ld a,(KSTATE0)
or a
ld a,0C9h
ld (KSTATE0),a
jr nz,loc_2F03
ei
loc_2F03
;***->
;POP AF
;JP 0X5C00
JP MAGsetR;0XA11 ;R=(0X5C01)
NOP
; pop af
; jp KSTATE0
;***<-
sub_2F07 ld a,(4011h)
or 3Ch
loc_2F0C out (0FFh),a
ret
sub_2F0F ld a,c
or a
rra
ld c,a
ret nc
ld a,(4011h)
and 6Fh
jr loc_2F0C
sub_2F1B ld a,e
inc a
out (5Fh),a
push hl
ld d,14h
push de
loc_2F23 di
ld c,7Fh
ld a,80h
out (1Fh),a
call RD_DATAPORT
pop de
pop hl
in a,(1Fh)
and 7Fh
ret z
dec d
push hl
push de
jr nz,loc_2F23
halt
sub_2F3A ld a,3Ch
out (0FFh),a
ld a,(KSTATE0)
and 8
jr nz,loc_2F4F
ld a,c
or a
rra
ld c,a
jr nc,loc_2F4F
ld a,2Ch
out (0FFh),a
loc_2F4F ld a,c
loc_2F50 out (7Fh),a
;***->
;§ ¤¥à¦ª ¯¥à¥¤ ¯®§¨æ¨®¨à®¢ ¨¥¬ ¢ GO TO
;CALL 0X3DFD ;wait 725779t
CALL LOC_3D30 ;RET
; call PAUSE725779T
;***<-
ld a,18h
loc_2F57 out (1Fh),a
loc_2F59 in a,(0FFh)
and 80h
jr z,loc_2F59
push bc
call PAUSE725779T
pop bc
ret
sub_2F65 ld a,08h
jr loc_2F57
WORK4ERROR ld hl,(TRD_5D1C) ;
SP
dec hl
dec hl
ld sp,hl
jp loc_1D2F
CALL2BASIC ld (TRD_5D02),hl
ld (TRD_5D04),de
pop hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
push hl
ld hl,loc_3D2F
push hl
push de
ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
push hl
ld hl,(TRD_5D02)
ld de,(TRD_5D04)
ret
SET_VARS ld hl,0FFFFh
ld (TRD_5CFA),hl ;
A
ld (TRD_5CFC),hl ;
C
ld (TRD_5CC8),hl ;
A
ld (TRD_5CCA),hl ;
C
xor a
ld (TRD_5D17),a ;
,
#AA
ld (TRD_5D19),a ;
ld (TRD_5D18),a
ld (TRD_5D0F),a ;
TR-DOS
ld (TRD_5D1F),a
ld a,0FFh
out (0FFh),a
ld (ERR_NR),a
ld (TRD_5D16),a ;
( #FF)
ld (TRD_5D0C),a
ld a,0C9h
ld (TRD_5CC2),a ;
#C9.
TR-DOS BASIC
ld a,0D0h
out (1Fh),a
ret
CP_END_CAT call CP_END_BUF ;
ld a,(hl)
or a
jp z,END_OUT_DIR
cp 1
call z,ADD_10
ret nz
jr CP_END_CAT
LOAD_SEC2BUF ld b,1
ld hl,TRD_5D25
jp loc_1E67
LOAD_END_FILE push hl
ld de,(TRD_5CF4)
call LOAD_SEC2BUF
ld a,(TRD_5CDB)
pop de
or a
ret z
ld c,a
ld hl,TRD_5D25
ldir ; FIX
ret
;
TR-DOS
CODE_BYTE_COM db 0CFh ; CAT
db "*"
db 0D0h ; FORMAT
db 0D1h ; MOVE
db 0E6h ; NEW
db 0D2h ; ERASE
db 0EFh ; LOAD
db 0F8h ; SAVE
db 0FEh ; RETURN
db 0BEh ; PEEK
db 0F4h ; POKE
db 0D5h ; MERGE
db 0F7h ; RUN
db 0D3h ; OPEN
db 0D4h ; CLOSE
db 0FFh ; COPY
db "4" ; 40
db 0ECh ; GOTO
db "8" ; 80
db 0F0h ; LIST
db 0D6h ; VERIFY
;
SPIS_ADR_COM dw CAT
dw COM_STAR
dw FORMAT
dw MOVE
dw NEW
dw ERASE
dw LOAD
dw SAVE
dw RETURN
dw PEEK
dw POKE
dw MERGE
dw RUN
dw OPEN
dw CLOSE
dw COPY
;***->
; ¤à¥á ¢ë¯®«ï«ª¨ ª®¬ ¤ë "4"
;DW 0X2997
DW KILLREZ;0X31FD
; dw COM_40
;***<-
dw GOTO
;***->
; ¤à¥á ¢ë¯®«ï«ª¨ ª®¬ ¤ë "8"
DW 0X29AE
;DW BOOTER;0X3ADB
; dw COM_80
;***<-
dw LIST
dw VERIFY
SAE2E_LINE ld hl,(E_LINE) ;
ld (TRD_5D11),hl ;
TR_DOS
ld (TRD_5CD9),hl ;
<B> <C>
ld a,0FFh
ld (TRD_5CD6),a ; #FF-
ld hl,TRD_5CDB
ld (TRD_5CD7),hl ;
-
;
jr loc_3057
SAE2_HL_ ld (TRD_5D11),hl ;
TR_DOS
ld (TRD_5CD9),hl ;
<B> <C>
call CP_ADR_STR
ret nz
inc hl
inc hl
ld (TRD_5CD7),hl ;
-
;
loc_3057 call FIND_KEYWORD
jr nz,loc_3087
ex de,hl
inc de
ld b,0
ld hl,BYTES_COM ; SAVE
add hl,bc
ld a,(hl)
ld hl,(TRD_5CD9) ;
<B> <C>
ld (hl),a
inc hl
ex de,hl
rst 20h
dw 19DDh
push bc
rst 20h
dw 19E8h
pop bc
ld a,(TRD_5CD6) ; #FF-
or a
jr nz,loc_3087
ld hl,(TRD_5CD7) ;
-
;
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
or a
sbc hl,bc
ex de,hl
ld (hl),d
dec hl
ld (hl),e
loc_3087 ld hl,(TRD_5CD9) ;
<B> <C>
ld a,(hl)
cp 0Dh
ret z
inc hl
ld (TRD_5CD9),hl ;
<B> <C>
ld a,(hl)
cp 0Dh
ret z
cp 22h
jr nz,loc_3057
loc_309A inc hl
ld a,(hl)
cp 0Dh
ret z
cp 22h
jr nz,loc_309A
inc hl
ld (TRD_5CD9),hl ;
<B> <C>
jr loc_3057
FIND_KEYWORD ld hl,(TRD_5CD9) ;
<B> <C>
ld de,TBL_KEYWORD ; "SAVE"
ld c,0
loc_30B1 ld a,(hl)
and 0DFh
ld b,a
or a
jr nz,loc_30BB
inc hl
jr loc_30B1
loc_30BB ld a,(de)
and 80h
jr nz,loc_30C8
ld a,(de)
cp b
jr nz,loc_30D9
inc hl
inc de
jr loc_30B1
loc_30C8 ld a,(de)
and 7Fh
cp b
ret z
loc_30CD inc c
ld hl,(TRD_5CD9) ;
<B> <C>
inc de
ld a,(de)
cp 0FFh
jr nz,loc_30B1
or a
ret
loc_30D9 inc de
ld a,(de)
and 80h
jr z,loc_30D9
jr loc_30CD
CP_ADR_STR ld hl,(PPC)
inc hl
inc hl
ld a,h
or l
jr z,loc_30F4
xor a
ld (TRD_5CD6),a ; #FF-
dec hl
dec hl
rst 20h
dw 196Eh
ret
loc_30F4 ld a,0FFh
ld (TRD_5CD6),a ; #FF-
ld hl,(E_LINE) ;
ret
TBL_KEYWORD DB "SAVE",80h
DC "SAVE"
DB "LOAD",80h
DC "LOAD"
DB "RUN",80h
DC "RUN"
DB "CAT",80h
DC "CAT"
DB "ERASE",80h
DC "ERASE"
DB "NEW",80h
DC "NEW"
DB "MOVE",80h
DC "MOVE"
DB "MERGE",80h
DC "MERGE"
DB "PEEK",80h
DC "PEEK"
DB "POKE",80h
DC "POKE"
DB "OPEN",83h
DB "CLOSE",83h
DB "CODE",80h
DC "CODE"
DB "RND",80h
DC "RND"
DB "DATA",80h
DC "DATA"
DB "SCREEN",4,84h
DB "SCREEN",84h
DB "COPY",80h
DC "COPY"
DB "FORMAT",80h
DC "FORMAT"
DB "GOTO",80h
DC "GOTO"
DB "LIST",80h
DC "LIST"
DB "LINE",80h
DC "LINE"
DB "VERIFY",80h
DC "VERIFY"
db 0FFh,0FFh
BYTES_COM dw 0F8F8h ; SAVE
dw 0EFEFh ; LOAD
dw 0F7F7h ; RUN
dw 0CFCFh ; CAT
dw 0D2D2h ; ERASE
dw 0E6E6h ; NEW
dw 0D1D1h ; MOVE
dw 0D5D5h ; MERGE
dw 0BEBEh ; PEEK
dw 0F4F4h ; POKE
dw 0D4D3h ; OPEN CLOSE
dw 0AFAFh ; CODE
dw 0A5A5h ; RND
dw 0E4E4h ; DATA
dw 0AAAAh ; SCREEN
dw 0FFFFh ; COPY
dw 0D0D0h ; FORMAT
dw 0ECECh ; GOTO
dw 0F0F0h ; LIST
dw 0CACAh ; LINE
dw 0D6D6h ; VERIFY
db 0
;
TR-DOS
CP_VARSTRDOS ld hl,(CHANS)
or a
ld bc,TRD_5D25
sbc hl,bc
ret
;***->
;---à®æ¥¤ãà ã¨ç⮦¥¨ï १¨¤¥â®¢----
;-- ¤à¥á CLEAR ¢ë§ë¢ ¥âáï ¨§ MADROM--
; ORG 0X31FD
KILLREZ
CALL CLEAR
JP ERR_OK;0X03E1 ;"O.K."
CLEAR
LD A,0XD7
LD BC,0X7FFD
OUT (C),A
LD (0XC000),A
LD (0XFFF0),A
LD A,0X10
OUT (C),A
RET
DUPL 0X321C-$,0XFF
include dosprogs.a80
; DUPL 0X3C01-$,0FFh
; jr loc_3C06
; db 0FFh
; jr loc_3C09
;loc_3C06 jp loc_3D00
;loc_3C09 jp loc_3D03
DUPL 0X3C30-$,0XFF
include dosprogs_1.a80
;***<-
DUPL 0X3CFA-$,0FFh
FOR_INTERFACE1 jp CP_INTERFACE1 ;
INTERFACE1
loc_3CFD jp CALL_3D13
loc_3D00 nop
jr IN_DOS_15616
loc_3D03 nop
jr IN_DOS_15619
loc_3D06 nop
jp INPUTDATAFILE
loc_3D0A jp OUT_SYM2FILE
nop
loc_3D0E jr loc_3D0A
nop
jr FOR_INTERFACE1
nop
jr loc_3CFD
loc_3D16 nop
;***->
;¯¥à¥å®¤ ¯/¯ ®¡à ¡®âª¨ ®è¨¡®ª
;JP 0X2F69
JP OBROSH;0X3449
; jp WORK4ERROR
;***<-
IN_DOS_15619 call CREATE_VARS_TRD
push hl
jp loc_16C
CREATE_VARS_TRD call CP_VARSTRDOS ;
TR-DOS
nop
nop
call c,CREATE_VARS
ld hl,TRD_5CC2 ;
#C9.
TR-DOS BASIC
ret
nop
nop
loc_3D2F nop
LOC_3D30 ret
IN_DOS_15616 call CREATE_VARS_TRD
push hl
;***->
;JP 0X239 ;¢å®¤ ¢ TR-DOS
JP WHOD;0X3BF0
; jp IN_COMMAND_CPU ;
;***<-
INI_INTERFACE1 xor a
out (0F7h),a
in a,(0F7h)
cp 1Eh
jr z,loc_3D44
cp 1Fh
ret nz
loc_3D44 rst 8
db 31h
ld a,1
ld (TRD_5CEF),a ;
1
INTERFACE1
ret
CREATE_VARS xor a
out (0FFh),a
in a,(0F6h)
ld hl,INI_INTERFACE1
ld de,MEMBOT
ld bc,14h
ldir
ld hl,loc_3D67
push hl
ld hl,loc_3D2F
push hl
jp MEMBOT
loc_3D67 ld hl,SET_VARS
push hl
ld hl,loc_3D2F
push hl
ld hl,1655h
push hl
ld hl,TSTACK_END
push hl
ld (hl),0C9h
ld hl, P_RAMT+1
ld bc,70h
ret
PRINT_0D ld a,0Dh
PRINT_A_
;***->
;¯¥ç âì ᨬ¢®«
;PUSH HL,BC,DE,AF
;CALL 0X20F1 ;¨§¬¥¥¨¥ ¯ ¬ïâ¨(çâ®-â® á ¡ãä¥à ¬¨ 45 ¡ ©â)
;POP AF
;CALL 0X3D94 ;¯¥ç âì ᨬ¢®«
;CALL 0X20F1 ;¢®ááâ.¯ ¬ïâ¨
;POP DE,BC,HL
;RET
JP DOSSYM;0X805
;DB 0XFF,0XFF,0,0
;NU
;JP DOSRUS;0X817
;DB 0XFF,0XFF
IF atm=3; IFN atm
;¤«ï STS ¯®¤ ATM
;3d85
JP JUMP_RES
;3d88
JP RETURN_COM_END
;3d8b
JP RES_WL
ELSE
DUPL 9,0XFF; DS 9,0XFF
ENDIF
DB 0XFF,0,0
DB 0XFF,0XFF,0XFF
; push hl
; push bc
; push de
; push af
; call CP_INTERFACE1 ;
INTERFACE1
; pop af
; call PRINT_SYM
; call CP_INTERFACE1 ;
INTERFACE1
; pop de
; pop bc
; pop hl
; ret
;***<-
PRINT_SYM rst 20h
dw 10h
ret
;
93
COM_00 ld a,08h
COM2VG_WAIT out (1Fh),a
COM2VGWAIT1 push hl
rst 20h
dw 1F54h ;
BREAK
jr c,COM2VGWAIT2
rst 20h
dw 1B7Bh ;
,
BREAK
COM2VGWAIT2 pop hl
in a,(0FFh)
and 80h
jr z,COM2VGWAIT1
ret
;
CP_PRESENT_DISK ld a,08h
call COM2VG_WAIT
ld de,0
in a,(1Fh)
and 2
ld b,a
CPPRESENTDSK1 in a,(1Fh)
and 2
cp b
ret nz
inc de
ld a,e
or d
jr nz,CPPRESENTDSK1
jp DISK_NOT_FOUND
;
ACTIV_DEF_DSK ld a,(TRD_5D19) ;
COM_01
;***->
;LD (0X5CF6),A
JP TCH2 ;¯¥à¥å¢ â ¢ë¡®à ¤¨áª®¢®¤
TCH2Q
; ld (TRD_5CF6),a ;
;***<-
ld hl,TRD_5D16 ;
( #FF)
ld c,a
ld a,3Ch
or c
out (0FFh),a
ld (hl),a
call GET_TIME_HEAD ;
and 80h
jr z,loc_3DFA
call CP_PRESENT_DISK ;
call CP_TIME_GOHEAD ;
call GET_TYPE_DSK ;
cp 0FFh
jr nz,loc_3DFA
push hl
call CP_DSK_TRACK
pop hl
cp 80 ;
80
ld a,0
jr nz,loc_3DF9
ld a,80h
loc_3DF9 ld (hl),a
loc_3DFA call WR_NUM_TRACK
PAUSE725779T ld a,50h
PAUSE_C_A ld c,0FFh
loc_3E01 dec c
jr nz,loc_3E01
dec a
jr nz,PAUSE_C_A
ret
;
GET_TIME_HEAD ld de,TRD_5CFA ;
A
loc_3E0B ld hl,(TRD_5CF6) ;
add hl,de
ld a,(hl)
ret
;
GET_TYPE_DSK ld de,TRD_5CC8 ;
A
jr loc_3E0B
;
CP_TIME_GOHEAD call GET_TIME_HEAD ;
ld b,8
ld c,4
loc_3E1D ld (hl),b
ld a,08h
call COM2VG_WAIT
;***->
;¢ ®¯à¥¤¥«¥¨¨ ¢à¥¬¥¨ ¯¥à¥¬¥é.£®«®¢ª¨
;LD A,0X20
IF testdrv=1; IFN testdrv
LD A,0X10
ELSE
RET
DB 0X10
ENDIF
; ld a,20h
;***<-
ld b,0Bh
call HEAD_POSITION
ld b,(hl)
ld a,1
call HEAD_POSITION
in a,(1Fh)
and 4
jr nz,loc_3E3F
xor a
call HEAD_POSITION
in a,(1Fh)
and 4
ret nz
loc_3E3F inc b
dec c
ret z
jr loc_3E1D
HEAD_POSITION out (7Fh),a
ld a,b
or 18h
;***->
jp LOC_800;COM2VG_WAIT
;***<-
POSITIONIREN out (7Fh),a
;***->
;¢ ¯®§¨æ¨®¨à®¢ ¨¨
;PUSH BC
;LD B,A
;IN A,(0X3F)
;CP B
;POP BC
JP POSITPP;0X3780
CCF
CP B
POP BC
POSITCONT
; push bc
; ld b,a
; in a,(3Fh)
; cp b
; pop bc
;***<-
push af
ld a,b
or 18h
;***->
call LOC_800;COM2VG_WAIT
;***<-
pop af
ret z
push bc
call PAUSE725779T
pop bc
ret
;
COM_02 ld c,a
call COM_16 ; 0
call GET_TYPE_DSK ;
and 2
call nz,SET_SIDE_DISK
push bc
bit 7,(hl)
jr z,loc_3E83
bit 0,(hl)
jr nz,loc_3E83
in a,(3Fh)
cp c
jr z,loc_3E82
rlca
out (3Fh),a
ld a,c
rlca
loc_3E82 ld c,a
loc_3E83 call GET_TIME_HEAD ;
ld b,a
in a,(3Fh)
cp c
push bc
;***->
call nz,LOC_3D30;PAUSE725779T
;***<-
pop bc
ld a,c
call POSITIONIREN
pop bc
ld a,c
out (3Fh),a
ld a,(TRD_5CCD) ; #80-
or a
ret z
xor a
ld (TRD_5CCD),a ; #80-
PAUSE_3_C_A ld b,3
loc_3EA2 ld a,0FFh
call PAUSE_C_A
djnz loc_3EA2
ret
SET_SIDE_DISK ld a,c
or a
rra
ld c,a
ret nc
jp COM_17 ; 1
GET_NUM_TRACK call COM_16 ; 0
loc_3EB5 in a,(1Fh)
and 80h
ld (TRD_5CCD),a ; #80-
in a,(3Fh)
ld h,a
;***->
;¢ ¯à®¢¥àª¥ ¨¤¥ªá®© ®¡«.¤®à®¦ª¨???
;¨á¯à.¨§¢¥á⮣® £«îª ¯®á«¥ ç⥨ï >0X80 ᥪâ.
;CALL 0X3E44 ;¢ë¯®«.ª®¬ ¤ë ¢ ॣ.B
CALL USEmovSPD;0X37CD
; call HEAD_POSITION
;***<-
ld c,7Fh
ld d,1
di
ld a,0C0h
out (1Fh),a
push bc
ld b,3
loc_3ECE in a,(0FFh)
and 0C0h
jr nz,loc_3EF2
inc de
ld a,e
or d
jr nz,loc_3ECE
djnz loc_3ECE
pop bc
ei
ld a,0D0h
out (1Fh),a
ld a,(TRD_5CD1)
cp 0FFh
ret z
DISK_NOT_FOUND call SET_TAPELDERR
ld a,0FFh
ld (TRD_5D17),a ;
,
#AA
jp loc_271B
loc_3EF2 pop bc
in h,(c)
loc_3EF5 in a,(0FFh)
and 0C0h
jr z,loc_3EF5
ei
ret m
di
in a,(7Fh)
jr loc_3EF5
;
COM_03 ld (TRD_5CFF),a
ret
;
COM_04 ld (TRD_5D00),hl
ret
SAVE_SECTOR ld a,0A0h
jr loc_3F10
LOAD_SECTOR ld a,80h
loc_3F10 ld (TRD_5CFE),a
RD_OR_WR_SEC ld d,0Ah
loc_3F15 push de
di
ld a,(TRD_5CFF)
inc a
out (5Fh),a
ld hl,(TRD_5D00)
ld c,7Fh
ld a,(TRD_5CFE)
out (1Fh),a
cp 0A0h
push af
call z,WRITE_SEC ;
pop af
call nz,READ_SEC
pop de
ei
in a,(1Fh)
ld b,a
and 7Fh
ret z
loc_3F39 ld hl,READ_ONLY ; Read Only
and 40h
jr nz,loc_3F4B
ld a,b
and 4
jr z,loc_3FA0
dec d
jr nz,loc_3F15
loc_3F48 ld hl,TXT_DISCERROR_
loc_3F4B ld a,0D0h
out (1Fh),a
ld a,b
and 1
jp nz,DISK_NOT_FOUND
in a,(3Fh)
or a
jr nz,loc_3F5F
in a,(5Fh)
cp 0Ah
ret z
loc_3F5F push hl
call CLEAR_SCREEN ;
pop hl
rst 18h
ld hl,TXT_TRK_
rst 18h
in a,(3Fh)
call PRINT_CHISLO_A_
ld hl,TXT_SEC_ ; " sec"
rst 18h
in a,(5Fh)
call PRINT_CHISLO_A_
ld hl,TXT_RIA_
rst 18h
loc_3F7B call GET_KEYS ;
cp "I" ; Ignore-RET ¢ ¤à¥á #1E8E
ret z
cp "R" ; Retry
jr z,PRESSED_RETRY
cp "A" ; Abort
jr nz,loc_3F7B
call SET_TAPELDERR ; Press Abort
ld a,7
ld (TRD_5D0F),a ;
TR-DOS
jp END_COMAND
PRESSED_RETRY ld a,(TRD_5CF5)
call COM_02 ;
call PAUSE_3_C_A
jp RD_OR_WR_SEC
loc_3FA0 dec d
jp z,loc_3F48
push de
call GET_TIME_HEAD ;
and 2
jr nz,loc_3FAD
inc (hl)
loc_3FAD call COM_00 ;
93
ld a,(TRD_5CF5)
call COM_02 ;
pop de
jp loc_3F15
;
WRITE_SEC ld b,4
WAIT4WRITE in a,(0FFh)
and 0C0h
jr nz,WR_DATAPORT1
inc de
ld a,e
or d
jr nz,WAIT4WRITE
djnz WAIT4WRITE
ret
WR_DATAPORT in a,(0FFh)
and 0C0h
jr z,WR_DATAPORT
ret m
WR_DATAPORT1 outi
jr WR_DATAPORT
READ_SEC ld b,4
WAIT4READ in a,(0FFh)
and 0C0h
jr nz,RD_DATAPORT1
inc de
ld a,e
or d
jr nz,WAIT4READ
djnz WAIT4READ
ret
RD_DATAPORT in a,(0FFh)
and 0C0h
jr z,RD_DATAPORT
ret m
RD_DATAPORT1 ini
jr RD_DATAPORT
;***->
OUT (C),A ;"㬨ª ",ª®â®àë© ¯¥à¢ë© § áãã« áî¤ ,
RET ;«¥ç¨âì ¡¥á¯®«¥§®...
IN A,(C) ; ¢®â ,¥á«¨ ¡ë ® ¤ã¬ « ¯à ¢¨«ìë¬ ¬¥á⮬,
RET ;® ¡ë ¯®«®¦¨« ¢ 0X3DXX. ® ⥯¥àì ¯®§¤®...
;***<-
DUPL 0X3FF8-$,0FFh
DB "TRD612"
DW DATA_VERS