SP__48.ASM: ключ NEW_TAP_PROC для сборки версии с загрузкой TAP из RAM Disk.

This commit is contained in:
Tolik 2025-10-17 16:28:27 +10:00
parent d9052b6952
commit 8246c09cf5
4 changed files with 209 additions and 27 deletions

View File

@ -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

View File

@ -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 ; •…<E280A2>
DW 0000 ; ‡<>€…

View File

@ -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'

@ -1 +1 @@
Subproject commit a0e68ce3a19bd47537585e49bfbf5e45fab197a1
Subproject commit a9cc74a9eba4044c35c930159bda0b0dde5d429b