From 8246c09cf551bebec7886f9093f0bc7a38457728 Mon Sep 17 00:00:00 2001 From: Tolik <85737314+Tolik-Trek@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:28:27 +1000 Subject: [PATCH] =?UTF-8?q?SP=5F=5F48.ASM:=20=D0=BA=D0=BB=D1=8E=D1=87=20NE?= =?UTF-8?q?W=5FTAP=5FPROC=20=D0=B4=D0=BB=D1=8F=20=D1=81=D0=B1=D0=BE=D1=80?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B8=20=D1=81=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=BA=D0=BE=D0=B9=20TAP=20?= =?UTF-8?q?=D0=B8=D0=B7=20RAM=20Disk.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SP_128.ASM | 29 +++++---- SP_TRDOS.ASM | 37 ++++++++++- SP__48.ASM | 168 +++++++++++++++++++++++++++++++++++++++++++++--- Shared_Includes | 2 +- 4 files changed, 209 insertions(+), 27 deletions(-) diff --git a/SP_128.ASM b/SP_128.ASM index 321f47f..fbaaea7 100644 --- a/SP_128.ASM +++ b/SP_128.ASM @@ -1,7 +1,8 @@ ; ************************************** ; *** SPECTRUM 128 ROM 0 DISASSEMBLY *** ; ************************************** - + INCLUDE 'Shared_Includes/macroses/macros.z80' + ; The Spectrum ROMs are copyright Amstrad, who have kindly given permission ; to reverse engineer and publish Spectrum ROM disassemblies. @@ -718,7 +719,7 @@ L0004: DEC BC ; Delay about 0.2s to allow screen switching mechani ; - BLOCK #10-$,#FF + _mInfoBLOCK #10-$,#FF ; --------------------------- ; RST #10 - Print A Character ; --------------------------- @@ -735,7 +736,7 @@ RSTx28.part2_3: ; - BLOCK #18-$,0 + _mInfoBLOCK #18-$,0 ; ----------------------------- ; RST #18 - Collect A Character ; ----------------------------- @@ -754,7 +755,7 @@ RSTx28.part1_2: ; - BLOCK #20-$,0 + _mInfoBLOCK #20-$,0 ; -------------------------------- ; RST #20 - Collect Next Character ; -------------------------------- @@ -772,7 +773,7 @@ RSTx28.part1_3: ; - BLOCK #28-$,0 + _mInfoBLOCK #28-$,0 ; ------------------------------- ; RST #28 - Call Routine in ROM 1 ; ------------------------------- @@ -803,7 +804,7 @@ RSTx28.part2_2: ; - BLOCK #38-$,0 + _mInfoBLOCK #38-$,0 ; ========================== ; MASKABLE INTERRUPT ROUTINE ; ========================== @@ -867,7 +868,7 @@ RSTx28.part2: ; ; - BLOCK #66-$,0 + _mInfoBLOCK #66-$,0 NMI_POINT: RETN ;[^]..................................................................................................................... SP2000 [^] @@ -875,7 +876,7 @@ NMI_POINT: ; - BLOCK #6B-$,0 + _mInfoBLOCK #6B-$,0 ; ============ ; RAM ROUTINES ; ============ @@ -7489,7 +7490,7 @@ COM_LN: PUSH DE CALL L026B ; Parse and execute the BASIC line. ; [Will not return here but will exit via the error handler routine] ; - BLOCK #1B14-$,0 + _mInfoBLOCK #1B14-$,0 ; ----------------------- ; List Program to Printer @@ -10030,7 +10031,7 @@ L2584: CALL L28BE ; Reset Cursor Position. ; -------------- ; Show Main Menu ; -------------- - BLOCK #259F-$,#FF; стандартный адрес + _mInfoBLOCK #259F-$,#FF; стандартный адрес L259F: LD HL,TSTACK ; #5BFF. LD (OLDSP),HL ; #5B81. @@ -10574,7 +10575,7 @@ M_COM: BYTE 6,0 ;[^]..................................................................................................................... SP2000 [^] ; - BLOCK #2811-$,0 + _mInfoBLOCK #2811-$,0 ; ===================== ; Menu Handler Routines ; ===================== @@ -10673,7 +10674,7 @@ ED_COM: BYTE 10 ; Number of entries. ; DB #1A ; просто стереть эту строчку, не нужна ;[^]..................................................................................................................... SP2000 [^] - BLOCK #2851-$,0 + _mInfoBLOCK #2851-$,0 ; --------------------------- ; Edit Menu - Renumber Option ; --------------------------- @@ -16695,7 +16696,7 @@ L3C59: HALT ; Wait for half a second. ; be displayed at. ;Entry point - A syntax error was detected so the error marker must be located - BLOCK #3C63-$,0 + _mInfoBLOCK #3C63-$,0 L3C63: LD A,#01 ; Signal to locate the error marker. JR L3C69 ; Jump forward. @@ -17792,7 +17793,7 @@ L3FEF: DEFB #00 L3FFF: DEFB #01 ; ; - BLOCK #4000-$,#FF + _mInfoBLOCK #4000-$,#FF ; ; ============================== ; REFERENCE INFORMATION - PART 2 diff --git a/SP_TRDOS.ASM b/SP_TRDOS.ASM index bce2e2f..412a2c6 100644 --- a/SP_TRDOS.ASM +++ b/SP_TRDOS.ASM @@ -136,6 +136,7 @@ CONT_5: JR CONT_6 //////////////////////////////////////////////////////////////////////// + REDIR_RST38: _mInfoBLOCK #38-$,#FF ; JP RST38X @@ -4871,8 +4872,11 @@ AUTO_2A4B: LD (ZX_VARS.K_STATE+1),A LD BC,PORT_128 LD A,16 - OUT (C),A - RET + ;[x] fixing port #1F to #0F + OUT (C),A + RET + ;JP Port_1F_Fix + ; MAGIC_2: ;AUTO_2A56: PUSH AF @@ -6504,6 +6508,12 @@ AUTO_3C09: LD A,CNF_PORT.ZX_BIOS OUT (CNF_PORT.ON),A RET +;************************************ + +//////////////////////////////////////////////////////////////////////// +; Port_1F_Fix_JP: +; JP Port_1F_Fix_2 +//////////////////////////////////////////////////////////////////////// ;************************************ ;!FIXIT not used @@ -6513,6 +6523,17 @@ READR_X: LD B,A JP set_side_0 ;************************************ + +//////////////////////////////////////////////////////////////////////// +; Port_1F_Fix: +; OUT (CELL_PORT.TMP_1),A +; LD A,C +; OUT (CELL_PORT.TMP_2),A +; IN A,(CELL_PORT.TMP_1) +; JR Port_1F_Fix_JP +//////////////////////////////////////////////////////////////////////// + +;************************************ ;!FIXIT not used _mInfoBLOCK #3C30 - $,255 IN A,(FDC_93.Command) @@ -6758,8 +6779,18 @@ PRINT_CR: LD A,#0D ; enter PRINT_SYM: JP PRINT_RED -;======================================================================= +//////////////////////////////////////////////////////////////////////// +; Port_1F_Fix_2: +; RES 4,C +; OUT (C),A +; IN A,(CELL_PORT.TMP_2) +; LD C,A +; IN A,(CELL_PORT.TMP_1) +; RET +//////////////////////////////////////////////////////////////////////// + +;======================================================================= _mInfoBLOCK #3D8F-$,#FF ; ХЕР DW 0000 ; ЗНАЕТ diff --git a/SP__48.ASM b/SP__48.ASM index 8d98aa7..f1ce615 100644 --- a/SP__48.ASM +++ b/SP__48.ASM @@ -3,11 +3,11 @@ ; ************************************** INCLUDE 'shared_includes/constants/sp2000.inc' - + INCLUDE 'Shared_Includes/macroses/macros.z80' ; The Spectrum ROMs are copyright Amstrad, who have kindly given permission ; to reverse engineer and publish ROM disassemblies. - + DEFINE NEW_TAP_PROC ; ===== ; NOTES ; ===== @@ -1364,7 +1364,7 @@ L046E: DEFB #89, #02, #D0, #12, #86; 261.625565290 C ; These routines begin with the service routines followed by a single ; command entry point. ; The first of these service routines is a curiosity. - + IFNDEF NEW_TAP_PROC;--------------------------------------------------------- ; ----------------------- ; THE 'ZX81 NAME' ROUTINE ; ----------------------- @@ -1394,7 +1394,32 @@ L04AA: CALL L24FB ; routine SCANNING to evaluate expression. SET 7,(HL) ; invert it. RET ; return. -; ========================================= + ELSE ;--------------------------------------------------------------------- +NEW_TAP.MAIN: ; достаём параметры +.MAIN: ; ставим SYS_PAGE + PUSH AF + LD C,SLOT3 + IN B,(C) + LD A,SYS_PAGE + OUT (C),A + ; берём указатель на текущее положение в блоке и втыкаем блок + EXX + ; LD HL,(SYS_PAGE.TAP_RAM_BLK) + ; LD H, high SYS_PAGE.RAM_TABLE + ; LD A,(HL) + LD A,(SYS_PAGE.TAP_RAM_BLK) + ;!TODO check error - 0 or FF + LD HL,(SYS_PAGE.TAP_RAM_POINT) + EX AF,AF' + EXX + ; + OUT (C),B + POP AF + JP NEW_TAP.MAIN2 + BLOCK #04C2-$,#FF + ENDIF +;------------------------------------------------------------------------------ + ; ; PORT 254 (#FE) ; @@ -1638,6 +1663,7 @@ L0552: RST 08H ; ERROR-1 L0554: POP AF ; restore the accumulator. RET ; return. + ;TAPE Load API. READ ; ------------------------------------ ; Load header or block of information ; ------------------------------------ @@ -1646,6 +1672,8 @@ L0554: POP AF ; restore the accumulator. ; and DE holds the length of bytes to be loaded. If, on entry the carry flag ; is set then data is loaded, if reset then it is verified. + IFNDEF NEW_TAP_PROC;--------------------------------------------------------- + ;; LD-BYTES L0556: INC D ; reset the zero flag without disturbing carry. EX AF,AF' ; preserve entry flags. @@ -1661,8 +1689,8 @@ L0556: INC D ; reset the zero flag without disturbing carry. ; the reading of the EAR bit (D6) will always be preceded by a test of the ; space key (D0), so store the initial post-test state. - - IN A,(#FE) ; read the ear state - bit 6. + ;!TODO RAM-TAP LOADER +L0562: IN A,(#FE) ; read the ear state - bit 6. RRA ; rotate to bit 5. AND #20 ; isolate this bit. OR #02 ; combine with red border colour. @@ -1872,6 +1900,7 @@ L05ED: INC B ; increment the time-out counter. RET Z ; return with failure when #FF passed. LD A,#7F ; prepare to read keyboard and EAR port + ;!TODO RAM-TAP LOADER IN A,(#FE) ; row #7FFE. bit 6 is EAR, bit 0 is SPACE key. RRA ; test outer key the space. (bit 6 moves to 5) RET NC ; return if space pressed. >>> @@ -1895,6 +1924,127 @@ L05ED: INC B ; increment the time-out counter. ; time allowed. RET ; return. + ELSE ;--------------------------------------------------------------------- +L0556: +NEW_TAP: DI + ;JR NC,.Error ; не поддерживается Verify + RET NC + ; + EXX + PUSH BC + PUSH DE + PUSH HL + EXX + CALL NEW_TAP.MAIN + ; + EX AF,AF' + LD A,SYS_PAGE + OUT (SLOT3),A + INC HL + LD (SYS_PAGE.TAP_RAM_POINT),HL + POP HL + POP DE + POP BC + EXX + LD DE,0 + OUT (C),B + EX AF,AF' + EI + RET + ; +.MAIN2: PUSH DE ; размер данных + ; обработка блока TAP + EX AF,AF' + OUT (SLOT3),A + ; берём длину блока + EXX + LD A,(HL) + INC HL + LD D,(HL) + INC HL + LD E,(HL) + INC HL + EX AF,AF' + ; проверяем тип блока и требуемый блок + CP E + EX AF,AF' + LD E,A + EX AF,AF' + DEC DE + DEC DE + EXX + JR NZ,.skipThatBlock +.skipThatBlock: ;!FIXIT + ; восстанавливаем страницу пользователя + EX AF,AF' + IN A,(SLOT3) + EX AF,AF' + OUT (C),B + ; проверяем соответствие размера блока запрашиваемому + EXX + POP BC + EX DE,HL + AND A + SBC HL,BC + EX DE,HL + SCF + CCF + RET NZ + ; + ;EXX +.LoopTAP: EX AF,AF' + OUT (SLOT3),A + EX AF,AF' + LD A,(HL) + ;CPI + INC HL + DEC BC + EXX + OUT (C),B + EXX + LD (IX),A + INC IX + LD A,H + OR L + JR NZ,.NoSetNewPage + ; + ;;;;;;;;;;;;;;;;;;;; + LD A,SYS_PAGE + OUT (SLOT3),A + ; + LD HL,#C000 + EXX + LD HL,(SYS_PAGE.TAP_RAM_BLK) + LD H, high SYS_PAGE.RAM_TABLE + EX AF,AF' + LD A,(HL) + LD (SYS_PAGE.TAP_RAM_BLK),A + OUT (C),B + ; + EXX + CP #FF + JR NZ,.NotEnd + ; + EX AF,AF; + LD A,B + OR C + RET NZ + EX AF,AF; +.NotEnd: EX AF,AF' + ;;;;;;;;;;;;;;;;;;;; + ; +.NoSetNewPage: LD A,B + OR C + JR NZ,.LoopTAP + ; + SCF + RET + ; + BLOCK #0605-$,#FF + ENDIF +;------------------------------------------------------------------------------ + + ; --------------------------------- ; Entry point for all tape commands ; --------------------------------- @@ -19262,7 +19412,7 @@ L3C97: ; UNUSED ; ------ - BLOCK #3CF0-$,0 ;15600 + _mInfoBLOCK #3CF0-$,0 ;15600 ;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; ; ╔═══════════════════════════╗ ; ║ дополнения для SP48 !! ║ @@ -19277,7 +19427,7 @@ L3C97: ;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; ;> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >; - BLOCK #3CF8-$,0 + _mInfoBLOCK #3CF8-$,0 JMP_EX: PUSH HL PUSH AF @@ -19295,7 +19445,7 @@ JMP_EX: PUSH HL RET ; возврат ;< < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < <; - BLOCK #3D00-$,00 ;15616 + _mInfoBLOCK #3D00-$,00 ;15616 ; ------------------------------- ; THE 'ZX SPECTRUM CHARACTER SET' diff --git a/Shared_Includes b/Shared_Includes index a0e68ce..a9cc74a 160000 --- a/Shared_Includes +++ b/Shared_Includes @@ -1 +1 @@ -Subproject commit a0e68ce3a19bd47537585e49bfbf5e45fab197a1 +Subproject commit a9cc74a9eba4044c35c930159bda0b0dde5d429b