2
0
Fork 0

added dome and loader

This commit is contained in:
Willem 2018-12-25 00:50:41 +01:00
parent eaf2415a63
commit 95503dd119
7 changed files with 12105 additions and 0 deletions

20
src/bios/0module.mk Normal file
View file

@ -0,0 +1,20 @@
BIOS_NAME := bios
BIOS_SRC := $(PATH_SRC)/$(BIOS_NAME)
BIOS_BIN := $(PATH_BIN)/$(BIOS_NAME)
BIOS_HEX := $(BIOS_BIN)/$(BIOS_NAME).hex
BIOS_DAT := $(BIOS_BIN)/$(BIOS_NAME).dat
BIOS_RELS := $(BIOS_BIN)/$(BIOS_NAME).rel
BIOS_CODE := $(BIOS_SRC)/$(BIOS_NAME).asm
$(BIOS_BIN):
$(call mod_mkdir,$(BIOS_BIN))
$(BIOS_BIN)/%.rel: $(BIOS_SRC)/%.asm | $(BIOS_BIN)
$(call mod_compile_asm,$@,$<)
$(BIOS_HEX): $(BIOS_RELS)
$(call mod_link_asm_dos,$(BIOS_HEX),$(BIOS_RELS))
$(BIOS_DAT): $(BIOS_HEX)
$(call mod_hex2dat,$(BIOS_HEX),$(BIOS_DAT))

1697
src/bios/bios.asm Normal file

File diff suppressed because it is too large Load diff

20
src/dome/0module.mk Normal file
View file

@ -0,0 +1,20 @@
DOME_NAME := dome
DOME_SRC := $(PATH_SRC)/$(DOME_NAME)
DOME_BIN := $(PATH_BIN)/$(DOME_NAME)
DOME_HEX := $(DOME_BIN)/$(DOME_NAME).hex
DOME_DAT := $(DOME_BIN)/$(DOME_NAME).dat
DOME_RELS := $(DOME_BIN)/$(DOME_NAME).rel
DOME_CODE := $(DOME_SRC)/$(DOME_NAME).asm
$(DOME_BIN):
$(call mod_mkdir,$(DOME_BIN))
$(DOME_BIN)/%.rel: $(DOME_SRC)/%.asm | $(DOME_BIN)
$(call mod_compile_asm,$@,$<)
$(DOME_HEX): $(DOME_RELS)
$(call mod_link_asm_8000,$(DOME_HEX),$(DOME_RELS))
$(DOME_DAT): $(DOME_HEX)
$(call mod_hex2dat,$(DOME_HEX),$(DOME_DAT))

1207
src/dome/ai_new.asm Normal file

File diff suppressed because it is too large Load diff

8425
src/dome/dome.asm Normal file

File diff suppressed because it is too large Load diff

20
src/init/0module.mk Normal file
View file

@ -0,0 +1,20 @@
INIT_NAME := init
INIT_SRC := $(PATH_SRC)/$(INIT_NAME)
INIT_BIN := $(PATH_BIN)/$(INIT_NAME)
INIT_HEX := $(INIT_BIN)/$(INIT_NAME).hex
INIT_COM := $(INIT_BIN)/$(INIT_NAME).com
INIT_RELS := $(INIT_BIN)/$(INIT_NAME).rel
INIT_CODE := $(INIT_SRC)/$(INIT_NAME).asm
$(INIT_BIN):
$(call mod_mkdir,$(INIT_BIN))
$(INIT_BIN)/%.rel: $(INIT_SRC)/%.asm | $(INIT_BIN)
$(call mod_compile_asm,$@,$<)
$(INIT_HEX): $(INIT_RELS)
$(call mod_link_asm_dos,$(INIT_HEX),$(INIT_RELS))
$(INIT_COM): $(INIT_HEX)
$(call mod_hex2com,$(INIT_HEX),$(INIT_COM))

716
src/init/init.asm Normal file
View file

@ -0,0 +1,716 @@
;------------------------------------
; DOME
;
; (c) 1998 PARAGON Productions
;
; DOME.COM
;
;------------------------------------
DOS .equ 0x5
D_OPEN .equ 0x0F
D_SETDMA .equ 0x1A
D_READ .equ 0x27
D_CLOSE .equ 0x10
.area _CODE
JP START
.db 0x0D ; type dome.com
.db 0x0D,0x0A
.str "DOME (c) 1999 PARAGON Productions"
.db 0x0D,0x0A
.db 0x1A ; Einde txt
TXT_END:
.ds 0x4000 ;-TXT_END (XASM CRACHED HIEROP !!!)
TXT_HELP:
.str "GETTING STATED WITH DOME"
.db 0x0A,0x0D
.db 0x0A,0x0D
.str "GAME STORY:"
.db 0x0A,0x0D
.db 0x0A,0x0D
.str "The evel harkonon are at war with"
.db 0x0A,0x0D
.str "the shadow attridis....."
.db 0x0A,0x0D
.db 0x0A,0x0D
.str "that is the true story of dome."
.db 0x0A,0x0D
.db 0x0A,0x0D
.str "GAME PLAY:"
.db 0x0A,0x0D
.db 0x0A,0x0D
.str "Very simple"
.db 0x0A,0x0D,0x1D
TXT_COM:
.str " "
.db 0x0A,0x0D
.str "Below you see a listing of all the"
.db 0x0A,0x0D
.str "extra options you can give to DOME."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /? = This text. "
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /HELP = This functions give's you the entire "
.db 0x0A,0x0D
.str " help of DOME."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /TEST = START'S ONLY LEVEL 001 WITH MIN. INIT."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /MOUSEx = x is 1 or #2 so you can skip the mouse search."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /FMPAC = DOME asume's you have a FM-PAC."
.db 0x0A,0x0D
.str " And forces if moonsound drv is found to reload."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " /NO_SCSI= DOME don't seek's thoug your MSX-SCSI config."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str " PS : Your are also able to type in small letter."
.db 0x0A,0x0D
.str " "
.db 0x0A,0x0D
.str "_______________DOME_______________"
.db 0x0A,0x0D
.str " PARAGON PRODUCTIONS (C)1999"
.db 0x0A,0x0D,0x1D
TXT_DOME_LIB: .str "LOADING : DOME_LIB...."
.db 0x1D
TXT_DOME_MUS: .str "LOADING : DOME_MUSDRV."
.db 0x1D
TXT_DOME_BIOS: .str "LOADING : DOME_BIOS..."
.db 0x1D
TXT_DOME_LOADER:.str "LOADING : DOME_LOADER."
.db 0x1D
TXT_READY: .str "Ready"
.db 0x0A,0x0D,0x1D
START:
LD A,(0x0080) ; aantal tekens
OR A
CALL NZ,GET_COM ; 0 tekens = geen tekst
CALL CHK_DISK
CALL CHK_MUS
LD A,(0x0080)
LD HL,#TXT_COM
BIT 0,A
JP NZ,PUT_TXT ; TEXT COMMMENT'S
BIT 1,A
JP NZ,PRT_HELP ; DOME HELP MOET GRAFISH
LD HL,#TXT_DOME_LIB
CALL PUT_TXT
; LD HL,#DOME_LIB
; CALL INIT_LIB
LD HL,#TXT_READY
CALL PUT_TXT
LD HL,#TXT_DOME_BIOS
CALL PUT_TXT
LD HL,#BIOS
LD DE,#0x0100
LD A,#0 ; 254
LD BC,#0x3000
CALL LOAD
LD HL,#TXT_READY
CALL PUT_TXT
LD HL,#TXT_DOME_LOADER
CALL PUT_TXT
LD HL,#LOADER
LD DE,#0x8000
LD A,#0 ; 255=+CLOSE
LD BC,#0x3000
CALL LOAD
LD HL,#TXT_READY
CALL PUT_TXT
ld e,#"0"
ld c,#0x02
call DOS
ld e,#0x0A
ld c,#0x02
call DOS
ld e,#0x0D
ld c,#0x02
call DOS
LD DE,#0x8000
DUMP_LOOP:
LD A,(DE)
PUSH DE
CALL PUTHEX
POP DE
INC DE
LD A,D
CP #0x81
JR NZ,DUMP_LOOP
DI ; VEILIGHEID
JP 0x8000
DOME_LIB: .str "DOME 000"
BIOS: .str "BIOS DAT"
LOADER: .str "LOADER DAT"
WAVEDRV: .str "WAVEDRV COM"
PUTHEX:
PUSH AF
RRCA
RRCA
RRCA
RRCA
CALL HEXSUB
POP AF
HEXSUB:
AND #0x0F
ADD A,#'0'
CP #'9'+1
JR C,HEXS1
ADD A,#'A'-10-'0'
HEXS1:
LD E,A
LD C,#2
CALL DOS
RET
CHK_DISK:
LD A,#0 ;CURRENT
LD C,#0x1B
CALL DOS
RET
CHK_MUS:
LD HL,#TXT_DOME_MUS
CALL PUT_TXT
CALL CHK_OPL4
LD HL,#TXT_READY
JP NZ,PUT_TXT
;CALL CHK_MUSIC
LD HL,#TXT_READY
JP PUT_TXT
CHK_OPL4:
LD A,#5
OUT (0xC6),A ; reg 5 ( FM)
PUSH BC
POP BC
LD A,#3
OUT (0xC5),A ; SET OPL4 REGISTER SET
PUSH BC
POP BC
LD A,#2
OUT (0x7E),A ; REG 2 (WAVE)
PUSH BC
POP BC
IN A,(0x7F) ;
CPL
OR A
RET Z ; GEEN OPL4 DUS OOK GEEN DRV
XOR A ; get mapper variable table
LD D,#4
LD E,#1
CALL 0xFFCA
LD A,C ; XOR A ???
LD BC,#2
ADD HL,BC
LD A,(HL)
CP #6 ; MUSIC NEED 4 SEGMENTS !!!!!!!!!!!!!!!!!!!
JP NC,CHK_OPL4_CONT ; MEER DAN 6
CALL CHECK_IF_INST
RET NZ ; GEEN DRV
LD HL,#WAVEDRV
CALL RELEASE_DRV
CHK_OPL4_EXIT:
LD A,#1
OR A ; NZ ANDERS MUSIC OOK
RET
CHK_OPL4_CONT:
LD A,(0x0080)
BIT 3,A
LD HL,#WAVEDRV
JR NZ,LOAD_DRV ; GEWWON NOG EEN KEER LADEN
CALL CHECK_IF_INST
JR Z,CHK_OPL4_EXIT
LD HL,#WAVEDRV
LOAD_DRV:
LD IY,#0x0080
LD A,(IY)
PUSH AF
LD (IY),#7
LD (IY),#" "
LD (IY),#"/"
LD (IY),#"I"
LD (IY),#">"
LD (IY),#"N"
LD (IY),#"U"
LD (IY),#"L"
LD DE,#0x0100
LD BC,#0x1000
LD A,#0
CALL LOAD
CALL 0x0100 ; WAVE DRV
POP AF
LD (0x0080),A
RET
RELEASE_DRV:
LD IY,#0x0080
LD A,(IY)
PUSH AF
LD (IY),#7
LD (IY),#" "
LD (IY),#"/"
LD (IY),#"R"
LD (IY),#">"
LD (IY),#"N"
LD (IY),#"U"
LD (IY),#"L"
LD DE,#0x0100
LD BC,#0x1000
LD A,#0
CALL LOAD
CALL 0x0100 ; WAVE DRV
POP AF
LD (0x0080),A
RET
; Check if replayer is installed
; output: if nz=0 not installed
; if z=1 installed
CHECK_IF_INST:
LD HL,#ID_FB04
LD DE,#0xFB04+21
LD B,#5
CHECK_IF_INST_LP:
LD A,(DE)
CP (HL)
RET NZ
INC HL
INC DE
DJNZ CHECK_IF_INST_LP
RET
ID_FB04:.str "MBTSR" ; If this is on address FB04h+21
;=====
GET_COM:
LD IY,#0x0080
LD HL,#0x0081
LD B,(IY)
LD (IY),#0
GET_COM_LP:
LD A,(HL)
INC HL
CP #"?"
JR NZ,GET_COM_CONT
SET 0,(IY) ; ACTIVATE HELP HIGHEST PIRIOTIJD
GET_COM_CONT:
PUSH BC
PUSH HL ; DOOR INC HL GA DOOR NAAR NEXT CMD
CP #"/"
CALL Z,GET_COM_STR
POP HL
POP BC
DJNZ GET_COM_LP
RET
;=====
GET_COM_STR:
LD DE,#GET_COM_TAB
GET_COM_STR_LP:
LD A,(HL)
LD C,A
LD A,(DE)
OR A
JR Z,GET_COM_BIT ; NEXT COM
CP #255 ; GEEN COMMANDO FOUND
RET Z
CP C
JR Z,GET_COM_STR_CONT ; A
ADD #32
CP C
JR Z,GET_COM_STR_CONT ; a
GET_COM_STR_NOT_LP:
LD A,(DE)
INC DE
OR A
JR NZ,GET_COM_STR_NOT_LP ; ZOEK TOT VOLGEND COM
INC DE
POP BC ; CALL STACK
POP HL ; ; org ADR OF CMD
PUSH HL
PUSH BC
JR GET_COM_STR_LP
GET_COM_STR_CONT:
INC HL
INC DE
JR GET_COM_STR_LP
;----
GET_COM_BIT:
INC DE
LD A,(DE)
DEC A
JR Z,COM_HELP
DEC A
JR Z,COM_DOS2
DEC A
JR Z,COM_FMPAC
DEC A
JR Z,COM_NO_SCSI
DEC A
JR Z,COM_MOUSE
DEC A
JR Z,COM_NO_TXT
RET
COM_HELP:
SET 1,(IY)
RET
COM_DOS2:
SET 2,(IY)
RET
COM_FMPAC:
SET 3,(IY)
RET
COM_NO_SCSI:
SET 4,(IY)
RET
COM_MOUSE:
SET 5,(IY)
LD A,(HL)
CP #"1"
RET Z
SET 6,(IY)
RET
COM_NO_TXT:
SET 7,(IY)
RET
GET_COM_TAB:
.str "HELP"
.db 0,1 ; /HELP = COM.. 0=LAST
.str "TEST"
.db 0,2
.str "FMPAC"
.db 0,3
.str "NO_SCSI"
.db 0,4
.str "MOUSE"
.db 0,5
.str "NO_TXT"
.db 0,6,255
PRT_HELP:
LD HL,#TXT_HELP
JP PUT_TXT
PUT_TXT:
LD A,(HL)
CP #0x1D
RET Z
LD E,A
LD C,#2
PUSH HL
CALL DOS
POP HL
INC HL
JR PUT_TXT
; IF A=NOT 254 OR A=NOT 255 THEN
;
; HL= FILE NAME (LOAD_BIN)
; DE= DMA-ADR
; A= HEADER TRACH
; BC= LENGTE
; ELSE
; HL= FILE NAME (LOAD_LIB)
; DE= DMA-ADR
;
; IF A=255 THEN CLOSE_LIB
; END
LOAD:
CP #254 ; CLOSE LIB ON EXIT
JR C,LOAD_BIN ; KLEINER DAN
EX AF,AF
PUSH DE ; ADR
CALL SEARCH_FILE ; if found lengte in HL
POP DE ; ADR
PUSH HL ; LENGT
CALL SETDMA ; DE is adres
POP HL
CALL READ
EX AF,AF
CP #255
RET NZ
JP CLOSE
;---------
LOAD_BIN:
PUSH BC
PUSH AF
PUSH DE
CALL PUT_NAM_FCB
CALL OPEN
POP DE
CALL SETDMA
POP HL
LD L,H ; KAN ??
LD H,#0
CALL READ ; kan dit ??
POP HL
CALL READ ; op oude DMA adres ???
CALL CLOSE ; ja !! raar he ?!
RET
; Zoek file op in directory en stel record number in
; In: HL: adres te laden file-naam
; DE: adres directory
; Uit: HL: lengte file
; A: 0 indien gelukt, 255 indien mislukt
SEARCH_FILE:
LD DE,#DIRECTORY ; eerste2 bytes zijn aantal files
SEARCH_FILE0:
PUSH HL ; adres naam v.d. file
PUSH DE ; adres directory
CALL CMP_STR
OR A
JR Z,SEARCH_FILE1
POP DE
LD HL,#11 + 2 + 3
ADD HL,DE
EX DE,HL ; DE = positie in directory
POP HL
JR SEARCH_FILE0
SEARCH_FILE1: ; HL = adres in directory
EX DE,HL
LD E,(HL)
INC HL
LD D,(HL) ; laad lengte
INC HL
PUSH DE
LD DE,#FCB + 33
LD BC,#3
LDIR ; Record Number naar FCB
XOR A ; drive ??
LD (DE),A
POP HL ; lengte in HL
POP DE
POP DE
RET
CMP_STR:
LD B,#11
CMP_STR1:
LD A,(DE)
CP (HL)
RET NZ
INC HL
INC DE
DJNZ CMP_STR1
XOR A
RET
; Laad directory
; In: HL: Adres filename
; DE: Bestemmingsadres directory
INIT_LIB:
LD DE,#DIRECTORY
PUSH DE
PUSH DE
CALL PUT_NAM_FCB ; put HL in FCB
CALL OPEN
cp #0
jr z,INIT_LIB_OK
LD HL,#FILE_ERROR
LD B,#10
CALL PUT_TXT
INIT_LIB_OK:
POP DE
CALL SETDMA ; destination is DIRECTORY
LD HL,#2
CALL READ
POP HL ; In BC aantal files
LD C,(HL)
INC HL
LD B,(HL)
LD HL,#0
LD DE,#11 + 3 + 2 ; lengte entry = name
CALC_LENGTH:
ADD HL,DE
DEC BC
LD A,B
OR C
JR NZ,CALC_LENGTH
CALL READ ; lees directory struct
RET
;=========================================================================
;=========================================================================
;=================== SUBS ==============================================
;=========================================================================
;=========================================================================
PUT_NAM_FCB: ; ; In: HL = file name pointer
LD DE,#FCB+1
LD BC,#0x0B ; Out: A = drive name (0 = def., 1 =
LDIR ; Cng: HL,DE BC,AF
XOR A
LD (FCB),A ; (DRVNAM) must be valid
RET
SETDMA:
LD C,#D_SETDMA ; DE=ADR
JP DOS
OPEN:
LD DE,#FCB
LD C,#D_OPEN
CALL DOS
LD HL,#0x01
LD (FCB+14),HL ; Record length = 1 byte
DEC L
LD (FCB+33),HL
LD (FCB+35),HL ; Current record number = 0
RET
READ:
LD DE,#FCB
LD C,#D_READ ; HL=NR BYTES
JP DOS
CLOSE:
LD DE,#FCB
LD C,#D_CLOSE
JP DOS
FILE_ERROR: .str " NOT FOUND" ; 10 len
.db 0x0A,0x0D
FCB: .db 0
FILENAME: .str " "
BLOCK: .dw #00
RECORDLENGTH: .dw #00
FILELENGTH: .dw #00,#00
SYSTEMVAR: .dw #00,#00,#00,#00,#00,#00
.db 0
RECORDNR: .dw #00,#00
DIRECTORY:
.db 0 ; 7 BYTES PER FILE OF 11+3+2 suckS
; ; NAAM - LENGTE - REC.NUM
.area _DATA