Skip to content

Commit

Permalink
Cleanup codebase before starting 3.0.0 development (#67)
Browse files Browse the repository at this point in the history
* Remove "pseudo-source control" comments

The Nextor project started on top of the sources of MSX-DOS,
already modified for a mysterious "MSX-DOS 2.50" project.
Apparently that project didn't use any kind of source control tool,
and instead changes were marked with "begin/end DOS 2.50/FAT16 changes"
comments. It was about time to remove those.

Also, some comments and label names that were still containing
"2.50" or "250" have been modified/renamed (e.g. KER250 -> KERNEX).

* Remove conditional compilation directives "if 0" and "if 1"

Removed from kernel and NEXTOR.SYS, not from COMMAND2.COM or the
original MSX-DOS command line tools.

* Remove old hardware-specific code

* Remove commented out code
  • Loading branch information
Konamiman committed Sep 8, 2020
1 parent f30dfbe commit 78167b3
Show file tree
Hide file tree
Showing 119 changed files with 199 additions and 28,619 deletions.
3 changes: 0 additions & 3 deletions source/command/msxdos/kmsg.mac
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
;
MSG MACRO NAME,TEXT
__&NAME EQU MSGNO ;; Define message number label.
if 0
GLOBAL __&NAME ;; And declare it public.
endif
MSGNO DEFL MSGNO+1
IFNB <TEXT> ;; Define the text, if given.
DEFB '&TEXT',0
Expand Down
36 changes: 0 additions & 36 deletions source/command/msxdos/messages.mac
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ CTRL_C EQU 3
LF EQU 0AH
CR EQU 0DH
;
if 1
DEFW END_MSG-$
endif
;
;
;------------------------------------------------------------------------------
Expand Down Expand Up @@ -112,23 +110,13 @@ endif
;
;

if 0
MSG AR ; Message for when 'ignore' is not recommended.
DEFB 'AR ' ; One trailing space.
DEFB 0
;
MSG ARI ; Message for when 'ignore' isn't so dangerous.
DEFB 'ARI ' ; One trailing space.
DEFB 0
else
MSG AR ; Message for when 'ignore' is not recommended.
DEFB 'Abort or Retry (A/R)? ' ; One trailing space.
DEFB 0
;
MSG ARI ; Message for when 'ignore' isn't so dangerous.
DEFB 'Abort, Retry or Ignore (A/R/I)? ' ; One trailing space.
DEFB 0
endif

;
;
Expand Down Expand Up @@ -179,7 +167,6 @@ endif
;
;

if 1
MSG SPLATS, <*** > ; Part (a), one
; trailing space.
;
Expand All @@ -199,31 +186,8 @@ if 1
MSG BADVER, <W>
;

else

MSG SPLATS, <*** > ; Part (a), one
; trailing space.
;
MSG EREND ; Part (c)
DEFB 0 ; (null in English).
;
MSG INSERT, <Insert COMMAND2.COM disk in drive > ; Part (d),
; one trailing space.
;
MSG INSDRV, <:> ; Part (e).
;
MSG PAUSE, <Press any key to continue... > ; Part (f), one
; trailing space.
;
MSG NOMEM, <Not enough memory, system halted>
;
MSG BADVER, <Wrong version of MSX-DOS, system halted>
;
endif

if 1
END_MSG:
endif
;
;
END
61 changes: 3 additions & 58 deletions source/command/msxdos/sys.mac
Original file line number Diff line number Diff line change
Expand Up @@ -99,35 +99,6 @@ VERMSG: DEFB 'NEXTOR.SYS version '
DEFB 0
;
;
;
;------------------------------------------------------------------------------
;
; This is the sign-on message that gets printed when MSX-DOS.SYS starts
; up. If the testing version is assembled, then extra text is included as a
; warning.
;
if 0
SIGNON: DEFB 'Nextor version '
DEFB VERSION##+'0', '.', RELEASE##/256+'0', RELEASE##+'0'
DEFB CR,LF
DEFB 'Copyright ('
DEFB CRYEAR##/1000 MOD 10 +'0'
DEFB CRYEAR##/ 100 MOD 10 +'0'
DEFB CRYEAR##/ 10 MOD 10 +'0'
DEFB CRYEAR## MOD 10 +'0'
DEFB ') Konamiman',CR,LF
;
IF TEST
DEFB CR,LF
DEFB '*** MZED-compatible testing version ***'
DEFB CR,LF
ENDIF
;
DEFB CR,LF
DEFB 0
endif
;
;
;------------------------------------------------------------------------------
;
; This is the initial start up entry point. As in CP/M, this is entered
Expand All @@ -148,13 +119,6 @@ endif
STARTUP:LD HL,P3BDOS ; Character outputs initially go through page 3
LD (OVEC),HL ; entry point.
;
if 0 ;v2.31
LD A,(NOTFIRST##) ; Print sign-on message through page 3 entry,
LD DE,SIGNON ; but only if the first time.
OR A
CALL Z,DSTR
;
endif
LD C,_DOSVER## ; Get the version number.
CALL P3BDOS ; In case it's an old system.
LD A,B
Expand Down Expand Up @@ -328,14 +292,6 @@ MEMOK: LD SP,BIOS_STACK ; Use MSX-DOS.SYS's own stack in page 3.
LD C,_CURDRV## ; Get the current drive and put it at 4 for
CALL BDOS ; CP/M compatibility.
LD (4),A
;
if 0 ;Hal_F
LD HL,(6) ; Make the F37D entry point jump to the same
LD (P3BDOS+1),HL ; place as the normal entry point at 5.
CODE MVI A
CODE JMP
LD (P3BDOS),A
endif
;
LD A,(ERROR) ; Get error code from COMMAND without doing a
CP .BADCMD## ; JOIN, and don't reload if .BADCMD or .OKCMD
Expand Down Expand Up @@ -553,7 +509,7 @@ BDOS:
LD A,(ENTERS) ; Get re-entrancy count.
INC A ; First entry?
LD (ENTERS),A
if 1

jr z,BDOS05
ld (BIOS_SP),sp
ld sp,BIOS_STACK-100
Expand All @@ -574,9 +530,6 @@ BDOS02: pop bc
xor a
ld (ENTERS),a
BDOS05:
else
JR NZ,BDOS10 ; Go if not, else switch stacks.
endif
;
LD (LOAD_FLAG##),A ; Gets set to 0 on every BDOS call.
LD (BDOS_SP),SP
Expand All @@ -593,12 +546,12 @@ BDOS10: EX AF,AF' ; Save alternate register set, as the KBDOS
PUSH IX ; A couple of routines below change the values
PUSH IY ; of these saved IX and IYs.
LD (SP_SAVE),SP ; Save SP for abort entry.
if 1 ;v2.30

LD HL,DISK_ERROR ; Set up disk error handler vector.
LD (KDSK_VECT##),HL
LD HL,ABORT ; Set up abort routine vector.
LD (KAB_VECT##),HL
endif

LD HL,BDOS_DONE ; Call KBDOS then return to BDOS_DONE.
PUSH HL
;
Expand Down Expand Up @@ -872,10 +825,6 @@ MAXFN EQU ($-FNTAB)/2 ; Largest function number.
@INNOE:
@CONST:
@CPMVER:
if 0
@DSKRST:
@SELDSK:
endif
@SNEXT:
@LOGIN:
@CURDRV:
Expand All @@ -888,7 +837,6 @@ endif
RET
;
;
if 1
@DSKRST:
LD E,0
@SELDSK:
Expand All @@ -903,7 +851,6 @@ BAD_DRIVE:
LD A,L
LD B,H
RET
endif
;
;
;------------------------------------------------------------------------------
Expand Down Expand Up @@ -1013,8 +960,6 @@ zstr_slow:
@DOSVER:
call FUNC_WITH_IXIY
ld de,(VERNUM)
;LD D,VERSION## ; Return MSX-DOS.SYS version too.
;LD E,RELEASE##+(RELEASE##/256)*16
ret

FUNC_WITH_IXIY:
Expand Down
4 changes: 2 additions & 2 deletions source/kernel/bank0/alloc.mac
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ ALLOC:
add hl,sp ;[HL] = [SP] - size
ccf
ret c ;size too big
if 1

ld a,h
cp high (BOOTAD+512)
ret c ;no room left
endif

ld de,(BOTTOM) ;get current RAM bottom
sbc hl,de ;get memory space left after allocation
ret c ;no space left
Expand Down
20 changes: 1 addition & 19 deletions source/kernel/bank0/bdos.mac
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ DB_INIT::
ld a,(P2_64K##)
call PUT_P2##
;
if 0
ld bc,LEN_1## ;Allocate space for the
call DB_PALLOC## ; three buffers for
ld (BUF_1##),hl ; strings, FIBs and FCB's
ld bc,LEN_2## ; in BDOS_GO.
call DB_PALLOC##
ld (BUF_2##),hl
ld bc,LEN_3##
call DB_PALLOC##
ld (BUF_3##),hl
;
ld bc,64 ;Allocate space for the
call DB_PALLOC## ; error message buffer.
ld (ERR_BUF##),hl
;
endif
ret
;
;
Expand Down Expand Up @@ -198,8 +182,6 @@ DOS1_GO::
EX AF,AF' ;Save parameters to BDOS
EXX ; function.
;
if 1
;
; Insure error vectors are directed to us. Just for bad mannered applications
; that call 0005h at one time and F37Dh at another time. ...HF...
;
Expand All @@ -212,7 +194,7 @@ KDERJ equ KABJ+7
ld (KAB_VECT##),hl ; abort vector routines for
ld hl,KDERJ ; ; MSX-DOS 1.0 compatability.
ld (KDSK_VECT##),hl ;
endif

LD HL,(BDOS_STACK##)
OR A ;If the current stack pointer
SBC HL,SP ; value is in the "BDOS_STACK"
Expand Down
35 changes: 2 additions & 33 deletions source/kernel/bank0/dosboot.mac
Original file line number Diff line number Diff line change
Expand Up @@ -92,24 +92,9 @@ setup_cmd_loop: ld a,(hl) ; by HL to the buffer at
or a ; in register A then try that
call nz,TRY_MSX_DOS ; one.
;
if 1
pop af ;If that drive failed then
call TRY_MSX_DOS ; try default drive.
ret
else
ld b,MAX_UNITS##
ld c,1
try_dos_loop: push bc ;If that drive failed then
ld a,c ; try each drive in turn
call TRY_MSX_DOS ; starting from drive "A:".
pop bc
inc c
djnz try_dos_loop
;
pop af ;If it all failed then restore
ld (CUR_DRV##),a ; default drive and jump to
ret ; disk BASIC in disgrace.
endif
;
;
JUMP_TABLE: dw RDSLT##, $RDSLT## ;Jumps in page-0
Expand Down Expand Up @@ -157,13 +142,9 @@ try_boot_loop: push bc
ld de,0 ; boot sector in.
ld hl,0
ld c,_RDDRV##
if 1
call PPAT1
endif
call BOOT_BDOS
if 1
call PPAT2
endif
pop bc ;Jump if we managed to
jr nz,try_boot_next ; read the boot sector OK
ld hl,($SECBUF##) ; and the first byte of it has
Expand All @@ -188,23 +169,13 @@ read_boot_ok: ld a,c ;Set current drive to the
or a
ret
;
if 1

PPAT1:
push hl
;===== start mod DOS2.50 (avoid assembler bug)
ld l,0C3h ;JP
ld (H.PROMPT##),hl
ld hl,PCODE1
ld (H.PROMPT##+1),hl
;; ld hl,H.PROMPT##
;; code MVI M
;; code JMP
;; inc hl
;; ld (hl),low PCODE1
;; inc hl
;; ld (hl),high PCODE1
;; inc hl
;===== end mod DOS2.50
pop hl
ret
PCODE1:
Expand Down Expand Up @@ -261,7 +232,6 @@ PP30:
pop hl
pop af
ret
endif
;
;-----------------------------------------------------------------------------
;
Expand Down Expand Up @@ -323,12 +293,11 @@ msxdos_bootok:
;
ld a,(CUR_DRV##) ;Record the drive in case
ld (BOOT_DRV##),a ; we ever need to reboot.
if 1

ld a,0C3h
ld ($DOSON##),a ;Activate these routines.
ld ($DOSOFF##),a ;
ld (XFER##),a ;
endif

jp 100h ;Start up MSXDOS.SYS
;
Expand Down
Loading

0 comments on commit 78167b3

Please sign in to comment.