diff --git a/src/loader/0module.mk b/src/loader/0module.mk new file mode 100644 index 0000000..8bc27b6 --- /dev/null +++ b/src/loader/0module.mk @@ -0,0 +1,20 @@ + +LOADER_NAME := loader +LOADER_SRC := $(PATH_SRC)/$(LOADER_NAME) +LOADER_BIN := $(PATH_BIN)/$(LOADER_NAME) +LOADER_HEX := $(LOADER_BIN)/$(LOADER_NAME).hex +LOADER_DAT := $(LOADER_BIN)/$(LOADER_NAME).dat +LOADER_RELS := $(LOADER_BIN)/$(LOADER_NAME).rel +LOADER_CODE := $(LOADER_SRC)/$(LOADER_NAME).asm + +$(LOADER_BIN): + $(call mod_mkdir,$(LOADER_BIN)) + +$(LOADER_BIN)/%.rel: $(LOADER_SRC)/%.asm | $(LOADER_BIN) + $(call mod_compile_asm,$@,$<) + +$(LOADER_HEX): $(LOADER_RELS) + $(call mod_link_asm_8000,$(LOADER_HEX),$(LOADER_RELS)) + +$(LOADER_DAT): $(LOADER_HEX) + $(call mod_hex2dat,$(LOADER_HEX),$(LOADER_DAT)) diff --git a/src/loader/loader.asm b/src/loader/loader.asm new file mode 100644 index 0000000..e7510b7 --- /dev/null +++ b/src/loader/loader.asm @@ -0,0 +1,2512 @@ +;--------------------------------- +; DOME LOADER +; +; (c) 1998 PARAGON Productions +; +; LOADER.DAT +; +;--------------------------------- + +DOS .equ 0x0005 +ENASLT .equ 0x0024 + +GET_INT .equ 0x0100 +PUT_INT .equ 0x0103 +COLOR_WHITE .equ 0x0106 +COLOR_BLACK .equ 0x0109 +SCREEN_ON .equ 0x010C +SCREEN_OFF .equ 0x010F +SET_SCREEN0 .equ 0x0112 +SET_SCREEN5 .equ 0x0115 +SPRITES_ON .equ 0x0118 +SPRITES_OFF .equ 0x011B +;PUT_SPRITE .equ 0x011E +SET_PAGE .equ 0x0121 +GET_TIME .equ 0x0124 +PUT_TXT .equ 0x0127 +PUT_TXT2 .equ 0x012A +INIT_BIOS .equ 0x012D +EXIT_ON_ERR .equ 0x0130 +LOAD .equ 0x0133 +INIT_LIB .equ 0x0136 +SAVE .equ 0x0139 +PUT_PAGE_FD .equ 0x013C +PUT_PAGE_FE .equ 0x013F + +INIT_REP .equ 0x0142 + +M_MUSLOAD .equ 0x0142 +M_KITLOAD .equ 0x0145 +M_PLAY .equ 0x0148 +M_STOP .equ 0x014B +M_CONT .equ 0x014E +M_FADE .equ 0x0151 +M_LOC .equ 0x0154 +M_FREE .equ 0x0157 + +POP_UP_START .equ 0x015A +PUTBLK .equ 0x015D +PUT_COLOR .equ 0x0160 +DOME_MENU_CALL .equ 0x0163 +RESTORE_MEM .equ 0x0166 +INIT_BIOS_MEM .equ 0x0169 +RUN_GAME .equ 0x016C +INT_ROUTINE .equ 0x016F +HOOK_ON .equ 0x0172 +HOOK_OFF .equ 0x0175 +INIT_INT .equ 0x0178 + +M_MUSINFO .equ 0x017B +M_ADR .equ 0x017E +M_DRVINFO .equ 0x0181 +M_DATA .equ 0x0184 +DOSJMP .equ 0x0187 + +CHIPS .equ TAB_LOC-13 + ; CHIPS + ; 0b00000000 + ; 1 = FMPAC + ; 11 = MUS / 256 KB YES/NO + ; 1 = MOONSOUND + ; 1 = MSX-MIDI + ; 1 = FAC-MIDI + ; 1 = + ; 1 = +INT_ON .equ TAB_LOC-12 ; 0=AAN +SPRATR .equ TAB_LOC-11 +MOUSEY .equ TAB_LOC-11 +MOUSEX .equ TAB_LOC-10 +MOUSE_OFF .equ TAB_LOC-9 ; AAN OF UIT +MOUSE_USE .equ TAB_LOC-8 ; " """""""" +MOUSE_PORT .equ TAB_LOC-7 ; PORT 1 OF 2 +MOUSE_WAIT1 .equ TAB_LOC-6 ; WAIT CYCLE 1 +MOUSE_WAIT2 .equ TAB_LOC-5 ; WAIT CYCLE 2 +MOUSE_BUTTONS .equ TAB_LOC-4 +MSX_TYPE .equ TAB_LOC-3 +DOSJMPTAB .equ TAB_LOC-2 + +TAB_LOC .equ 0x0F00 +DOME_BIOS .equ 0x0F00 ; BIOS+GAMECODE(0x2500)+TANKTAB(0x3000) +DOME_VELD .equ 0x0F02 ; THE LEVEL(0x4000) +DOME_CODE .equ 0x0F04 ; THE DOME ENGINE(0x8000) +DOME_PAGE3 .equ 0x0F06 ; MORE ENGINE +DOME_MENU .equ 0x0F08 ; GFX DOME MENU+CODE(0x8000) +DOME_TEMP .equ 0x0F0A ; + +DOME_CH_CODE .equ 0x0F0C ; LEVEL CHOOSER CODE +DOME_CH_GFX1 .equ 0x0F0E ; LEVEL CHOOSE GFX +DOME_CH_GFX2 .equ 0x0F10 ; GFX + +DOME_MENT_CODE .equ 0x0F12 ; CODE VOOR MENTAT +DOME_MENT1 .equ 0x0F14 ; BUFFER VOOR GFX MENTAT + +DOME_GFX_UNIT .equ 0x0F16 ; GAME GFX (UNIT) +DOME_GFX_BLPA .equ 0x0F18 ; GAME GFX (BALK EN PAGE) + +DOME_MMENU .equ 0x0F1A ; MAIN MENU GFX + CODE AT 4000 + + ; org 0x8000 +.area _CODE +ST: + ld e,#"1" + ld c,#0x02 + call 5 + + CALL INIT_BIOS ; SAVE START STACK + CALL INIT_SCR ; MODE 80 + CALL INIT_DOSINT ; GET DOS_INT + CALL INIT_DATE ; + CALL INIT_TIME ; + CALL CHK_MSX ; ================ VANAF HIER KUNNEN DINGEN FOUT !! + CALL CHK_MOUSE ; INIT MOUSE'S + CALL CHK_VDP ; + CALL CHK_CPU ; + CALL INIT_MEM ; INIT MEM ==== DUS HEBBEN WE EEN EXTRA ERR_ROET. + CALL INIT_DISK ; LOAD'S LIB + CALL INIT_SOUND ; LOAD SOUND'S LIB + CALL INIT_LOAD ; LOAD GFX + GAME ENGINE + MENU + JP DO_INTRO ; + + +EXIT_ON_ERR_MEM: ; DEZE NA INIT_MEM + CALL PUT_TXT + LD HL,#TXT_ERR + CALL PUT_TXT +EXIT_ON_ERR_MEM_LP: + IN A,(0xAA) ; check op spatie... + AND #0xF0 + OR #8 + OUT (0xAA),A + IN A,(0xA9) + EI + HALT + AND #1 + JP Z,EXIT_ON_ERR + + JR EXIT_ON_ERR_MEM_LP + +EXIT_ON_ERR_BF: ; DEZE VOOR INIT_MEM + CALL PUT_TXT + LD HL,#TXT_ERR + CALL PUT_TXT +EXIT_ON_ERR_BF_LP: + IN A,(0xAA) ; check op spatie... + AND #0xF0 + OR #8 + OUT (0xAA),A + IN A,(0xA9) + EI + HALT + AND #1 + JP NZ,EXIT_ON_ERR_BF_LP + + LD HL,#INT_DOS + CALL PUT_INT + + LD SP,(DOS_STACK) + CALL SET_SCREEN0 + RET + + +;======================================================================= + +INIT_SCR: + ;CALL SET_SCREEN0 + + LD A,#80 + LD (0xF3AE),A + LD A,#0 ; SCREEN 0 + LD IY,(0xFCC1) + LD IX,#0x5F + CALL 0x1C + + LD HL,#2048 + LD BC,#240 + LD A,#0 + LD IY,(0xFCC1) + LD IX,#0x56 + CALL 0x1C + + LD HL,#2048 + LD B,#10 +INIT_SCR_LOOP: + LD A,#255 + LD IY,(0xFCC1) + LD IX,#0x4D + CALL 0x1C + INC HL + DJNZ INIT_SCR_LOOP + + DI + LD A,#15*16+8 + OUT (0x99),A + LD A,#128+12 + OUT (0x99),A + + LD A,#16*5 + OUT (0x99),A + LD A,#128+13 + OUT (0x99),A + EI + + LD HL,#TXT_RET + CALL PUT_TXT + LD HL,#TXT_DOME_INIT + CALL PUT_TXT + RET + + +;======================================================================= + +INIT_DOSINT: + POP DE ; CALL ENTRY WEG !!! + LD (DOS_STACK),SP + PUSH DE + + LD HL,#INT_DOS + JP GET_INT + +;======================================================================= + +INIT_TIME: + CALL GET_TIME + + PUSH DE ; SEC/0 + PUSH HL ; HOUR/MIN + + LD A,H + LD HL,#TXT_TIME_WR+1 + CALL FIL_HL_A_DEC + + POP HL + LD A,L + LD HL,#TXT_TIME_WR+4 + CALL FIL_HL_A_DEC + + POP DE + LD A,D + LD HL,#TXT_TIME_WR+7 + CALL FIL_HL_A_DEC + + LD HL,#TXT_TIME + CALL PUT_TXT + + RET + + +;======================================================================= + +INIT_DATE: + LD C,#0x2A + CALL DOS + + PUSH HL + PUSH DE ; SEC/0 + + LD HL,#TXT_DATE_WR+2 ; MON/DEU/WOE + CALL FIL_DATE + + POP DE + PUSH DE + LD A,D + LD HL,#TXT_DATE_WR+5 + CALL FIL_HL_A_DEC + + POP DE + LD A,E + LD HL,#TXT_DATE_WR+8 + CALL FIL_HL_A_DEC + + + POP HL + LD DE,#1980 + XOR A + SBC HL,DE + LD A,L + + LD HL,#TXT_DATE_WR+13 + CP #20 + JR NC,INIT_DATE_JK + ADD #80 + + + CALL FIL_HL_A_DEC + + LD HL,#TXT_DATE_WR+11 + LD A,#19 + CALL FIL_HL_A_DEC + + LD HL,#TXT_DATE + JP PUT_TXT + +INIT_DATE_JK: + SUB #20 + CALL FIL_HL_A_DEC + + LD HL,#TXT_DATE_WR+11 + LD A,#20 + CALL FIL_HL_A_DEC + + LD HL,#TXT_DATE + JP PUT_TXT + +FIL_DATE: + PUSH HL + LD HL,#FIL_DATE_TAB + + LD E,A + SLA A ; *2 + ADD E ; +1 + + LD E,A + LD D,#0 + ADD HL,DE + LD A,(HL) + INC HL + LD D,(HL) + INC HL + LD E,(HL) + POP HL + LD (HL),E + DEC HL + LD (HL),D + DEC HL + LD (HL),A + RET +FIL_DATE_TAB: + .str "SUNMONTUEWENTHUFRYSAT" + +;======================================================================= + +CHK_MSX: + LD HL,#TXT_MSX_TYPE + CALL PUT_TXT + + LD HL,#TXT_MSX_1 + OR A + CALL Z,PUT_TXT + + LD HL,#0x002D + LD A,(0xFCC1) + CALL 0x0C + + LD (MSX_TYPE),A + + LD HL,#TXT_MSX_2 + CP #1 + JP Z,PUT_TXT + + LD HL,#TXT_MSX_2P + CP #2 + JP Z,PUT_TXT + + LD HL,#TXT_MSX_TR + CP #3 + JP Z,PUT_TXT + + LD HL,#TXT_MSX_ON + JP PUT_TXT + + +;======================================================================= + +;=================================== + + .db 0 +CHK_MOUSE: + LD A,#15 + OUT (0xA0),A + IN A,(0xA2) + AND #0x8F + OR #0x30 + LD (MOUSE_PORT),A + XOR A + LD (MOUSE_USE),A + LD (MOUSE_OFF),A + + LD HL,#0x002D + LD A,#0 ;(0xFCC1) ; SLOT ADR BIOS = 0 + CALL 0x0C ; interslot call + + CP #3 + JR Z,CHK_MOUSE_TR + + LD A,#31 + LD (MOUSE_WAIT1),A + LD A,#10 + LD (MOUSE_WAIT2),A + JR CHK_MOUSE_CONT +CHK_MOUSE_TR: + LD A,#31*5 + LD (MOUSE_WAIT1),A + LD A,#10*5 + LD (MOUSE_WAIT2),A + + +CHK_MOUSE_CONT: + LD A,(0x0080) + BIT 5,A + JP NZ,CHK_MOUSE_FO + + LD HL,#TXT_MOUSE_CHK + CALL PUT_TXT + + LD A,(MOUSE_PORT) ; Get mouse port in C + LD C,A + LD A,(MOUSE_WAIT1) + LD B,A ; Get Y move + CALL READ_MOUSE + RLCA + RLCA + RLCA + RLCA + LD H,A + CALL READ_MOUSE + OR H + LD H,A + CALL READ_MOUSE ; Get X move + RLCA + RLCA + RLCA + RLCA + LD L,A + CALL READ_MOUSE + OR L + LD C,H ; B = X-move / C = Y-move + LD B,A + + LD A,B ; Move -1,-1 ? + INC A + LD H,A + LD A,C + INC A + OR H + JR Z,CHK_MOUSE_CONT1 + + LD A,#1 + LD (CHK_MOUSE-1),A +CHK_MOUSE_CONT1: + LD A,(MOUSE_PORT) ; Check other port + XOR #0b01000000 + LD (MOUSE_PORT),A + LD C,A + LD A,(MOUSE_WAIT1) + LD B,A ; Get Y move + CALL READ_MOUSE + RLCA + RLCA + RLCA + RLCA + LD H,A + CALL READ_MOUSE + OR H + LD H,A + CALL READ_MOUSE ; Get X move + RLCA + RLCA + RLCA + RLCA + LD L,A + CALL READ_MOUSE + OR L + LD C,H ; B = X-move / C = Y-move + LD B,A + + LD A,B ; Move -1,-1 ? + INC A + LD H,A + LD A,C + INC A + OR H + JR Z,CHK_MOUSE_CONT2 + + LD A,(CHK_MOUSE-1) + SET 1,A + LD (CHK_MOUSE-1),A +CHK_MOUSE_CONT2: + LD A,(CHK_MOUSE-1) + OR A + JR Z,CHK_MOUSE_NO + + LD HL,#TXT_MOUSE_YES + CALL PUT_TXT + + LD A,(CHK_MOUSE-1) + LD HL,#TXT_MOUSE_PORT12 + CP #3 + JP Z,PUT_TXT + + LD HL,#TXT_MOUSE_PORT1 + BIT 0,A + CALL NZ,PUT_TXT + + LD A,(CHK_MOUSE-1) + LD HL,#TXT_RET + BIT 1,A + JP Z,PUT_TXT + + LD HL,#TXT_MOUSE_PORT2 + JP PUT_TXT + +CHK_MOUSE_NO: + LD HL,#TXT_MOUSE_NO + CALL PUT_TXT + LD HL,#TXT_MOUSE_ERR + JP EXIT_ON_ERR_BF + +CHK_MOUSE_FO: + LD HL,#TXT_MOUSE_FO + CALL PUT_TXT + + LD A,(MOUSE_PORT) ; Check other port + XOR #0b01000000 + LD (MOUSE_PORT),A + + LD HL,#TXT_MOUSE_PORT2 + LD A,(0x0080) + BIT 6,A + JP NZ,PUT_TXT + + LD A,(MOUSE_PORT) ; Check other port + XOR #0b01000000 + LD (MOUSE_PORT),A + + LD HL,#TXT_MOUSE_PORT1 + CALL PUT_TXT + LD HL,#TXT_RET + JP PUT_TXT + +;========================================================================= + +CHK_VDP: + LD HL,#TXT_VDP_SCAN + CALL PUT_TXT + + DI + LD A,#1 ; status reg. op 1 + OUT (0x99),A + LD A,#0x8F + OUT (0x99),A + + IN A,(0x99) ; RD ID + LD B,A + + XOR A ; status reg. op 0 + OUT (0x99),A + LD A,#0x8F + OUT (0x99),A + EI + + LD A,B + SRL A + AND #0b00011111 + + PUSH AF + LD HL,#TXT_VDP_ID_WR+1 + CALL FIL_HL_A_HEX + LD HL,#TXT_VDP_ID + CALL PUT_TXT + POP AF + + OR A + LD HL,#TXT_VDP_38 + JP Z,PUT_TXT + CP #2 + LD HL,#TXT_VDP_58 + JP Z,PUT_TXT + LD HL,#TXT_VDP_NOT + JP PUT_TXT + +;========================================================================= + +CHK_CPU: + LD HL,#TXT_CPU + CALL PUT_TXT + + XOR A + EX AF,AF ; Z380 + + LD B,#0x40 + LD C,#0 ; FLAGS SETTEN + PUSH BC + POP AF + + .db 0xCB,0x37 + + ; Z80 : SLL A SHIFT LEFT ,INSERT '1' (Z180) + ; Z180 : DAA 99 + ; Z280 : TEST BIT7,A IF 0 THAN A<=255 + ; Z380 : EX A,A + + LD HL,#TXT_Z280 + JP P,SPEED_TEST + + OR A ; Z380 + LD HL,#TXT_Z380 + JP Z,SPEED_TEST + + LD HL,#0x002D + LD A,(0xFCC1) + CALL 0x0C + CP #3 + LD HL,#TXT_Z80 + JP NZ,SPEED_TEST + + LD IY,(0xFCC1) + LD IX,#0x0183 + CALL 0x1C + + CP #1 + LD HL,#TXT_R800_ROM + JP Z,SPEED_TEST + + PUSH AF + LD HL,#TXT_Z80 + OR A + CALL Z,SPEED_TEST + POP AF + + LD HL,#TXT_R800_DRAM + CP #2 + CALL Z,PUT_TXT + + LD A,#1+128 ; ROM MODE + LD IY,(0xFCC1) + LD IX,#0x0180 + CALL 0x1C + + LD HL,#TXT_R800_DOME +SPEED_TEST: + CALL PUT_TXT + LD HL,#INT_SPEED + HALT + CALL PUT_INT + XOR A +SPEED_LOOP: + LD HL,#SPEED_COUNTER+15 + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT01 + JR SPEED_LOOP +SPEED_NEXT01: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT02 + JR SPEED_LOOP +SPEED_NEXT02: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT03 + JR SPEED_LOOP +SPEED_NEXT03: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT04 + JR SPEED_LOOP +SPEED_NEXT04: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT05 + JR SPEED_LOOP +SPEED_NEXT05: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT06 + JR SPEED_LOOP +SPEED_NEXT06: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT07 + JR SPEED_LOOP +SPEED_NEXT07: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT08 + JR SPEED_LOOP +SPEED_NEXT08: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT09 + JR SPEED_LOOP +SPEED_NEXT09: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT10 + JR SPEED_LOOP +SPEED_NEXT10: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT11 + JR SPEED_LOOP +SPEED_NEXT11: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT12 + JR SPEED_LOOP +SPEED_NEXT12: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT13 + JR SPEED_LOOP +SPEED_NEXT13: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT14 + JR SPEED_LOOP +SPEED_NEXT14: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NEXT15 + JP SPEED_LOOP +SPEED_NEXT15: + DEC HL + LD A,(HL) + INC A + OR A + LD (HL),A + JR Z,SPEED_NOT + JP SPEED_LOOP +SPEED_NOT: + DI + LD HL,#TXT_SPEED + JP EXIT_ON_ERR_BF + +I_SPEED: + DI + IN A,(0x99) ; moet + LD HL,#INT_DOS + CALL PUT_INT ;; NEW INT + POP HL + LD HL,#SPEED_EXIT + PUSH HL + EI + RETI + +SPEED_COUNTER: + .db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; 128 BITS +SPEED_EXIT: + LD HL,#SPEED_COUNTER+14 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+31 + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+12 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+27 ; MOET GELIJ AAN + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+10 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+23 + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+8 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+19 + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+6 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+15 ; MOET GELIJ AAN + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+4 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+11 + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+2 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+7 ; MOET GELIJ AAN + CALL FIL_HL_DE_HEX + + LD HL,#SPEED_COUNTER+0 + LD D,(HL) + INC HL + LD E,(HL) + LD HL,#TXT_SPEED_WR+3 + CALL FIL_HL_DE_HEX + + LD HL,#TXT_SPEED + CALL PUT_TXT + RET + +;========================================================================= + + +INIT_MEM: + LD HL,#TAB_LOC + LD B,#64 +INIT_MEM_LP: + LD (HL),#0 + INC HL + DJNZ INIT_MEM_LP + + LD HL,#TXT_MEMORY ; CHECKING MEM + CALL PUT_TXT + + XOR A + LD D,#"M" + LD E,#30 + CALL 0xFFCA + LD HL,#TXT_MEMMAN + CP #"M" + CALL Z,PUT_TXT ; MEMMAN FOUND + + LD HL,#TXT_DOS ; DOS FOUND + CALL PUT_TXT + + XOR A + LD C,#0x6F + CALL DOS + LD A,B ; DOS VERSION + CP #1 + LD HL,#TXT_DOS1 + JP C,EXIT_ON_ERR_BF + + ADD #48 + LD HL,#TXT_VERSION ; PRINT DOS VERSION + LD (HL),A + CALL PUT_TXT + + LD HL,#TXT_DOSJMPTAB + CALL PUT_TXT + + LD HL,#TXT_DOSVARTAB ;?????????????????????????? + CALL PUT_TXT + + XOR A ; get mapper variable table + LD D,#4 + LD E,#1 + CALL 0xFFCA + LD (DOSVARTAB),HL + + LD HL,#TXT_ALO + CALL PUT_TXT + + LD HL,(DOSVARTAB) + LD A,(HL) + PUSH AF ; SLOT ADR + LD HL,#TXT_DOS_PRI_SLT ; WRITE SLOT ADR + CALL PUT_SLT_ADR + LD HL,#TXT_DOS_PRI + CALL PUT_TXT + + LD HL,(DOSVARTAB) + LD BC,#8 + ADD HL,BC + LD A,(HL) + LD HL,#TXT_DOS_NO_SEC + OR A + JP Z,INIT_MEM_CONT + + LD (SEC_SLOT_ADR),A + LD HL,#TXT_DOS_SEC_SLT + CALL PUT_SLT_ADR + LD HL,#TXT_DOS_SEC +INIT_MEM_CONT: + CALL PUT_TXT + LD A,#3 ; DE 4 VAN OPGESTART PAGE 0-3 + LD (DOS_LOC_PRIM),A + LD (DOS_TOTAL_LOC),A + + POP BC ; SLOT ADR + LD HL,#TAB_LOC + + PUSH HL + LD DE,#0x1B + CALL DOSJMP + POP HL + LD (HL),B + INC HL + LD (HL),A + INC HL + + PUSH HL + LD DE,#0x21 + CALL DOSJMP + POP HL + LD (HL),B + INC HL + LD (HL),A + INC HL + + PUSH HL + LD DE,#0x27 + CALL DOSJMP + POP HL + LD (HL),B + INC HL + LD (HL),A + INC HL + + PUSH HL + LD DE,#0x2D ; DOME IS 3D hAhGA + CALL DOSJMP + POP HL + LD (HL),B ; SLT ADR + INC HL + LD (HL),A ; SEGMENT NR + INC HL + +INIT_MEM_PRI: + LD A,#0 ; USER SEGMANT + LD DE,#0 + PUSH HL + CALL DOSJMP + POP HL + JP C,INIT_MEM_PRI_FULL + + LD (HL),B ; SLT ADR + INC HL + LD (HL),A ; SEGMENT NR + INC HL + + LD A,(DOS_LOC_PRIM) + INC A + LD (DOS_LOC_PRIM),A ; MORE + + LD A,(DOS_TOTAL_LOC) + INC A + LD (DOS_TOTAL_LOC),A + + LD D,A ; DOS_LOAC + LD A,(DOS_MAX_LOC) + LD E,A + LD A,D + CP E + JP Z,INIT_MEM_PRI_MAX ; DOME DON'T NEED MORE MEM + + JR INIT_MEM_PRI ; NEXT + +INIT_MEM_PRI_FULL: + LD A,(SEC_SLOT_ADR) + LD A,#0 ; disable sec + OR A + JR Z,INIT_MEM_SEC_FULL ;==================================================== +INIT_MEM_SEC: + LD A,(SEC_SLOT_ADR) + LD B,A + XOR A + LD DE,#0 + PUSH HL + CALL DOSJMP + POP HL + JP C,INIT_MEM_SEC_FULL + + LD (HL),B ; SLT ADR + INC HL + LD (HL),A ; MAPPER NR + INC HL + + LD A,(DOS_LOC_SEC) + INC A + LD (DOS_LOC_SEC),A + + LD A,(DOS_TOTAL_LOC) + INC A + LD (DOS_TOTAL_LOC),A + + LD A,(DOS_TOTAL_LOC) + LD D,A + LD A,(DOS_MAX_LOC) + LD E,A + LD A,D + CP E + JP Z,INIT_MEM_SEC_MAX + JR INIT_MEM_SEC + +INIT_MEM_SEC_FULL: + LD A,(DOS_TOTAL_LOC) + LD B,A + LD A,(DOS_MAX_LOC) + SUB B + SLA A + LD A,#10 + LD B,A +INIT_MEM_SEC_FULL_LP: + XOR A + LD (HL),A + INC HL + DJNZ INIT_MEM_SEC_FULL_LP + +INIT_MEM_DONE: + LD A,(DOS_LOC_PRIM) + LD HL,#TXT_DOS_PRI_WR+1 ; LOCTECT BIJ PRIM + CALL FIL_HL_A_DEC + LD HL,#TXT_DOS_PRI_LOC + CALL PUT_TXT + + LD A,(DOS_LOC_SEC) + LD HL,#TXT_DOS_SEC_WR+1 ; LOCTECT BIJ SEC + CALL FIL_HL_A_DEC + LD HL,#TXT_DOS_SEC_LOC + CALL PUT_TXT + + LD A,(DOS_TOTAL_LOC) + LD HL,#TXT_DOS_TOT_WR+1 ; MOET GELIJ AAN PRIM+SEC + CALL FIL_HL_A_DEC + LD HL,#TXT_DOS_TOT_LOC + CALL PUT_TXT + + LD A,(DOS_TOTAL_LOC) + LD B,A + LD A,(DOS_MAX_LOC) + CP B + LD HL,#TXT_MAX_MEM + JR NC,INIT_MEM_MAX + LD HL,#TXT_DOS_NOT_MAX +INIT_MEM_MAX: + CALL PUT_TXT + + CALL INIT_BIOS_MEM ; GET THE ORGINAL WAARDEN TO THE BIOS + + LD A,(DOS_TOTAL_LOC) + CP #6 ; MINDER DAN 4 KAN NIET ( DOS !! ) + LD HL,#TXT_MORE_MEM + JP C,EXIT_ON_ERR_MEM ; minder dan 6 + RET + +INIT_MEM_PRI_MAX: + PUSH HL + LD HL,#TXT_DOS_MAX_PRI + CALL PUT_TXT + LD HL,#TXT_DOS_MAX_SEC + CALL PUT_TXT + POP HL + JP INIT_MEM_DONE + ;JP INIT_MEM_PRI_FULL ; TEST ONLY !!!!!!!!11 + +INIT_MEM_SEC_MAX: + PUSH HL + LD HL,#TXT_DOS_MAX_SEC + CALL PUT_TXT + POP HL + JP INIT_MEM_SEC_FULL + +;========================================================================= + +INIT_DISK: + +; LD B,#0 +;INIT_DISK_WLP: + ;HALT + ;HALT + ;HALT + ;DJNZ INIT_DISK_WLP + + LD HL,#TXT_DSK_INIT + CALL PUT_TXT + + XOR A + LD C,#0x19 + CALL DOS + INC A + LD (CURRENT_DRIVE),A + + PUSH AF + LD HL,#TXT_DSK_DRV_WR + ADD A,#64 + LD (HL),A + LD HL,#TXT_DSK_DRV + CALL PUT_TXT + + POP BC + LD HL,#0xFB21 +INIT_DISK_SLT: + LD A,(HL) + SUB B + JR NC,INIT_DISK_CNT + + LD A,(HL) + LD C,A + LD A,B + SUB C + LD B,A + + INC HL + INC HL + JR INIT_DISK_SLT +INIT_DISK_CNT: + INC HL + LD A,(HL) + PUSH AF + LD HL,#TXT_DSK_ROM_WR + CALL PUT_SLT_ADR + LD HL,#TXT_DSK_ROM + CALL PUT_TXT + POP AF + LD HL,#0x4000 + CALL ENASLT + + LD HL,#0x7F80 + LD A,(HL) + CP #"H" + JR NZ,INIT_DISK_EXIT + INC HL + LD A,(HL) + CP #"D" + JR NZ,INIT_DISK_EXIT + + ; WE FOUND A MSX-SCSI BIOS + + LD HL,#TXT_SCSI + CALL PUT_TXT + + + LD HL,#TXT_SCSI_NOT + LD A,(0x0080) + BIT 4,A + CALL NZ,PUT_TXT + + LD A,(0x0080) + BIT 4,A + JR NZ,INIT_DISK_EXIT + + CALL INIT_DISK_NOV + CALL INIT_DISK_SCSI + +INIT_DISK_EXIT: + LD HL,#DOME_VELD + LD A,(HL) + LD HL,#0x4000 + CALL ENASLT ; MOET OMDAT IK HET SLTADR VERANDER ZONDER BIOS + + LD HL,#DOME_VELD + CALL PUT_PAGE_FD + + LD HL,#TXT_DSK_LIB + CALL PUT_TXT + LD HL,#DOME_LIB0 + ;CALL INIT_LIB ;===========================-=-=-=---==-=-=-=-=-=- + LD HL,#TXT_READY + JP PUT_TXT + +INIT_DISK_NOV: + LD HL,#0x7FF0 + LD A,(HL) + CP #"K" + RET NZ + INC HL + LD A,(HL) + CP #"M" + RET NZ + INC HL + LD A,(HL) + CP #"c" + RET NZ + INC HL + LD A,(HL) + CP #"s" + RET NZ + + LD HL,#TXT_NOV + CALL PUT_TXT + + CALL 0x7FC8 ; GET UNIT ON LINE + PUSH DE + LD HL,#TXT_NOV_ON_W+1 + CALL FIL_HL_A_HEX + POP DE + LD A,D + LD HL,#TXT_NOV_ID_W+1 + CALL FIL_HL_A_HEX + + LD HL,#TXT_NOV_ON + CALL PUT_TXT + LD HL,#TXT_NOV_ID + CALL PUT_TXT + + RET + +INIT_DISK_SCSI: + LD HL,#TXT_SCSI_LIST + CALL PUT_TXT + + LD B,#7 +INIT_SCSI_LOOP: + PUSH BC + PUSH BC + LD A,B + LD HL,#INIT_SCSI_BUF + CALL 0x7F92 ; TST UNIT RDY + INC D + DEC D + POP BC + JR NZ,INIT_SCSI_NEXT + + LD HL,#TXT_SCSI_ID+1 + LD A,B + PUSH AF + CALL FIL_HL_A_HEX + + LD HL,#INIT_SCSI_BUF+5 + LD DE,#TXT_SCSI_HD + LD BC,#31 + LDIR + + CALL INIT_SCSI_PUTTXT + +INIT_SCSI_NEXT: + POP BC + DJNZ INIT_SCSI_LOOP + + XOR A + LD HL,#INIT_SCSI_BUF + CALL 0x7F92 ; TST UNIT RDY + INC D + DEC D + RET NZ + + LD HL,#TXT_SCSI_ID+1 + XOR A + CALL FIL_HL_A_HEX + + LD HL,#INIT_SCSI_BUF+5 + LD DE,#TXT_SCSI_HD + LD BC,#31 + LDIR + + CALL INIT_SCSI_PUTTXT + RET + +INIT_SCSI_BUF: + .ds 36 + .db 0x0A,0x0D,0x1D +;-- + + .db 0 +INIT_SCSI_PUTTXT: + LD A,(INIT_SCSI_PUTTXT-1) + OR A + LD HL,#TXT_SCSI_PUT + JP NZ,PUT_TXT + CPL + LD (INIT_SCSI_PUTTXT-1),A + LD HL,#TXT_SCSI_ID + JP PUT_TXT + + +;========================================================================= + +INIT_SOUND: + LD HL,#TXT_SND_INIT + CALL PUT_TXT + CALL CHK_AUDIO ; FMPAC + CALL CHK_MUSIC ; MUSIC-MODULE + CALL CHK_OPL4 ; MOONSOUND + CALL LOAD_SAMC ; LOAD-SAMPLE + CALL LOAD_MUSC ; LOAD-MUSIC + RET + +CHK_AUDIO: + LD IY,#CHIPS + + LD HL,#TXT_FMPAC_FO + SET 0,(IY) + LD A,(0x0080) + BIT 3,A + JP NZ,PUT_TXT + RES 0,(IY) + + LD HL,#TXT_FMPAC_SCAN + CALL PUT_TXT + + CALL SRCFMP + LD A,C ; slt adr + LD HL,#TXT_FMPAC_WR + CALL PUT_SLT_ADR + + LD HL,#DOME_VELD + LD A,(HL) + LD HL,#0x4000 + CALL ENASLT ; MOET OMDAT IK HET SLTADR VERANDER ZONDER BIOS + LD HL,#DOME_VELD + CALL PUT_PAGE_FD + + LD A,(CHIPS) + BIT 0,A + LD HL,#TXT_FMPAC_NO + JP Z,PUT_TXT + + LD HL,#TXT_FMPAC_FOUND + JP PUT_TXT + +;-- + +SRCFMP: LD HL,#0xFCCA + XOR A + LD B,#4 +FMLP2: PUSH BC + LD B,#4 +FMLP1: PUSH BC + PUSH AF + PUSH HL + SET 7,A + LD H,#0x40 + PUSH AF ; SLT ADR + CALL 0x24 + POP BC ; SLT ADR + POP HL + PUSH HL + LD A,(HL) + CP #0x20 + CALL Z,FMTEST + JP Z,FMFND + POP HL + POP AF + ADD A,#4 + AND #0x0F + INC HL + INC HL + INC HL + INC HL + POP BC + DJNZ FMLP1 + ADD A,#1 + AND #0x03 + POP BC + DJNZ FMLP2 + RET + +FMTEST: LD HL,#0x401C + LD DE,#FMTEXT + LD C,B ; SLT ADR + LD B,#4 +FMLP: LD A,(DE) + CP (HL) + RET NZ + INC HL + INC DE + DJNZ FMLP + CP A + RET + +FMFND: POP AF + POP AF + POP AF + POP AF + LD A,(CHIPS) + SET 0,A + LD (CHIPS),A + RET + +FMTEXT: .str "OPLL" + + + + +CHK_MUSIC: + LD HL,#TXT_CHKMUSMD + CALL PUT_TXT + + IN A,(0xC0) + CP #255 + LD HL,#TXT_NOMUS + JP Z,PUT_TXT ; GEEN MUSIC MOD + + LD A,(CHIPS) + SET 1,A + LD (CHIPS),A + + LD HL,#TXT_MUSFOUND + CALL PUT_TXT + + LD HL,#TXT_SAMPLE_SCAN + CALL PUT_TXT + + CALL CHK_MUSIC_MEM + + LD HL,#TXT_SAMPLER_WR+1 + CALL FIL_HL_DE_HEX + LD HL,#TXT_SAMPLE_RAM + CALL PUT_TXT + + RET + +CHK_MUSIC_MEM: + DI + CALL REG_INIT_1 ; WRITE + LD B,#8 +CHK_MUSIC_MEMWR: + LD A,#15 + OUT (0xC0),A ; REG 15 + LD A,#"W" + OUT (0xC1),A ; SAMPLE DATA + + .db 0,0,0,0 + + LD A,#9 + OUT (0xC0),A + LD HL,#DATA_1+7 + LD A,(HL) + ADD A,#32 + LD (HL),A + OUT (0xC1),A + + LD A,#11 + OUT (0xC0),A + LD HL,#DATA_1+11 + LD A,(HL) + ADD A,#32 + LD (HL),A + OUT (0xC1),A + + DJNZ CHK_MUSIC_MEMWR + + CALL REG_INIT_2 ; READ + LD B,#8 +CHK_MUSIC_MEMRD: + LD A,#15 + OUT (0xC0),A ; REG 15 + IN A,(0xC1) + LD C,#"W" + CP C + JP NZ,CHK_MUSIC_NOMEM + + .db 0,0,0,0 + + LD A,#9 + OUT (0xC0),A + LD HL,#DATA_2+7 + LD A,(HL) + ADD A,#32 + LD (HL),A + OUT (0xC1),A + + LD A,#11 + OUT (0xC0),A + LD HL,#DATA_2+11 + LD A,(HL) + ADD A,#32 + LD (HL),A + OUT (0xC1),A + + DJNZ CHK_MUSIC_MEMRD + + LD A,#4 ; REG 4 + OUT (0xC0),A + LD A,#0x80 ; RESET ALLE VLAGGEN + OUT (0xC1),A + + LD A,#7 ; REG 7 + OUT (0xC0),A + LD A,#1 ; RESET ADPCM FUNCTION + OUT (0xC1),A + + LD E,#0 + LD D,A ; 0x0100 + + LD A,(CHIPS) + SET 2,A ; 256 KB FOUND + LD (CHIPS),A + + EI + RET ; BACK TO BASIC + +CHK_MUSIC_NOMEM: + LD A,#4 ; REG 4 + OUT (0xC0),A + LD A,#0x80 ; RESET ALLE VLAGGEN + OUT (0xC1),A + + LD A,#7 ; REG 7 + OUT (0xC0),A + LD A,#1 ; RESET ADPCM FUNCTION + OUT (0xC1),A + + LD A,B + SLA A + SLA A + SLA A ; *32 + SLA A + SLA A + LD E,A + LD D,#0 + + EI + RET ; BACK TO BASIC + +REG_INIT_1: LD B,#9 + LD HL,#DATA_1 + JR INIT_REG + +REG_INIT_2: LD B,#9 + LD HL,#DATA_2 + +INIT_REG: LD A,(HL) + OUT (0xC0),A ; OUT REG + INC HL + LD A,(HL) + OUT (0xC1),A ; OUT INHOUD + INC HL + DJNZ INIT_REG ; TILL B=0 + RET +DATA_1: + .db 4,24 + .db 7,1 + .db 8,0 + .db 9,0x1F ; FF + .db 10,0xFE ; ANDERS BIJ 2 + .db 11,0x1F ; FF + .db 12,0xFF + .db 16,0xF0 ; 240 + .db 7,0x60 +DATA_2: + .db 4,24 + .db 7,1 + .db 8,0 + .db 9,0x1F + .db 10,0xFE ; ANDERS BIJ 2 + .db 11,0x1F + .db 12,0xFF ; ANDERS BIJ 2 (15) + .db 16,0xF0 ; 240 + .db 7,0x20 + +;========== + +CHK_OPL4: + LD HL,#TXT_CHKMOON + CALL PUT_TXT + + LD A,(CHIPS) + BIT 3,A ; MOON FOUND + LD HL,#TXT_NOMOON + JP Z,PUT_TXT ; GEEN OPL4 ??? + + LD HL,#TXT_MOONFOUND + CALL PUT_TXT + + CALL M_DRVINFO + + PUSH HL ; MEM + + LD HL,#TXT_MOON_VER_WR+1 + LD (HL),A + INC HL + INC HL + LD (HL),D + INC HL + LD (HL),E + + LD HL,#TXT_MOON_VER + CALL PUT_TXT + + POP DE + LD HL,#TXT_MOON_MEM_WR+3 + CALL FIL_HL_DE_HEX + + LD HL,#TXT_MOON_MEM + CALL PUT_TXT + + LD HL,#TXT_SORRYMOON + JP PUT_TXT + + +;============ + + +LOAD_MUSC: + LD HL,#TXT_MUS_NONE + LD A,(CHIPS) + AND #0x0F + JP Z,PUT_TXT + + LD HL,#TXT_MUS_LD + CALL PUT_TXT + + LD A,#1 + LD DE,#MUS + CALL M_MUSLOAD + + + +; HIER MOETEN ALLE MUSIC WORDEN INGELADEN + + + LD HL,#TXT_READY + CALL PUT_TXT + + RET + +LOAD_SAMC: + LD A,(CHIPS) + BIT 3,A + JR NZ,LOAD_SAM_OPL4 + + BIT 1,A + LD HL,#TXT_SAM_NO + JP Z,PUT_TXT + + BIT 2,A + JP NZ,LOAD_SAM_256KB + + LD HL,#TXT_SAM_MUS + CALL PUT_TXT + +LOAD_SAM_32KB: + LD HL,#TXT_SAM_L_32KB + CALL PUT_TXT + + ;CALL LOAD_SAM + + LD HL,#TXT_READY + JP PUT_TXT + +LOAD_SAM_256KB: + CALL LOAD_SAM_32KB + + LD HL,#TXT_SAM_L_256KB + CALL PUT_TXT + + ;CALL LOAD_SAMJE + + LD HL,#TXT_READY + CALL PUT_TXT + RET +LOAD_SAM_OPL4: + LD HL,#TXT_SAM_L_OPL4 + CALL PUT_TXT + LD DE,#KIT + CALL M_KITLOAD + LD HL,#TXT_READY + CALL PUT_TXT + RET + +MUS: .str "ATLANTIS.MWM" + .db 0 +KIT: .str "ATLANTIS.MWK" + .db 0 + +;========================================================================= +INIT_LOAD: + ; move from into => no effect + LD A,#255 + LD (INT_ON),A + CALL INIT_INT + + LD HL,#TXT_GFX_INIT + CALL PUT_TXT + LD HL,#TXT_GFX_LD + CALL PUT_TXT + + LD HL,#PARAGON ; PARAGON LOGO VPAGE 1 + LD DE,#0x4000 + LD BC,#0x4000 + LD A,#0 + CALL LOAD + LD HL,#0x4000 + LD DE,#0x8000 + LD A,#0 + CALL POP_UP_START + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#PRESENTS ; PRESENT VPAGE 2 + LD DE,#0x4000 + LD BC,#0x4000 + LD A,#0 + CALL LOAD + LD HL,#0x4000 + LD DE,#0 + LD A,#1 + CALL POP_UP_START + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#DOME ; DOME VPAGE 3 + LD DE,#0x4000 + LD BC,#0x4000 + LD A,#0 + CALL LOAD + LD HL,#0x4000 + LD DE,#0x8000 + LD A,#1 + CALL POP_UP_START + + LD HL,#TXT_PUNT + CALL PUT_TXT + +;----- + + LD HL,#DOME_MENU + CALL PUT_PAGE_FD + + LD HL,#MENU_GFX1 ; DOME MENU IN-GAME + LD DE,#0x5000 + LD BC,#0x3000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#DOME_GFX_UNIT + LD A,(HL) + OR A + JP Z,NO_GFX_GAME + CALL PUT_PAGE_FD + +; test failure due to to little mem +; LD HL,#MMENU +; LD DE,#0x4000 +; LD BC,#0x2000 +; LD A,#0 +; CALL LOAD +; ld e,#0x0A +; ld c,#0x02 +; call DOS +; ld e,#0x0D +; ld c,#0x02 +; call DOS +; LD DE,#0x4000 +;DUMP_LOOP22: +; LD A,(DE) +; PUSH DE +; CALL PUTHEX +; POP DE +; INC DE +; LD A,D +; CP #0x41 +; JR NZ,DUMP_LOOP22 + + + LD HL,#UNITTOT + LD DE,#0x4000 + LD BC,#0x3000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#DOME_GFX_BLPA + LD A,(HL) + OR A + JR Z,NO_GFX_GAME + CALL PUT_PAGE_FD + + LD HL,#BALKEN4 + LD DE,#0x4000 + LD BC,#0x1000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#PAGE5 + LD DE,#0x6000 + LD BC,#0x2000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#DOME_MMENU + LD A,(HL) + OR A + JR Z,NO_GFX_GAME + CALL PUT_PAGE_FD + + LD HL,#ST_MENU1 + LD DE,#0x6000 + LD BC,#0x1000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#ST_MENU2 + LD DE,#0x7000 + LD BC,#0x1000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + +NO_GFX_GAME: + + LD HL,#DOME_VELD + CALL PUT_PAGE_FD + +;------- + + + LD HL,#TXT_GFX_READY + CALL PUT_TXT + + LD HL,#TXT_STUFF_LD + CALL PUT_TXT + + ;LD HL,#DOME_MMENU + ;LD A,(HL) + ;OR A + ;CALL NZ,PUT_PAGE_FD + ;CALL PUT_PAGE_FD + + LD HL,#MMENU + LD DE,#0x4000 + LD BC,#0x2000 + LD A,#0 + CALL LOAD + + LD HL,#TXT_PUNT + CALL PUT_TXT + + LD HL,#TXT_STUFF_READY + CALL PUT_TXT + + LD HL,#TXT_RUN + CALL PUT_TXT + + ld e,#0x0A + ld c,#0x02 + call DOS + ld e,#0x0D + ld c,#0x02 + call DOS + LD DE,#0x4000 +DUMP_LOOP: + LD A,(DE) + PUSH DE + CALL PUTHEX + POP DE + INC DE + LD A,D + CP #0x41 + JR NZ,DUMP_LOOP + + + RET + +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 +;========================================================================= + +DO_INTRO: +;CALL INTRO_WAIT +;CALL INTRO_WAIT + + + + CALL SCREEN_OFF + CALL SPRITES_OFF + LD HL,#COLOR_PARAGON + CALL PUT_COLOR + CALL SET_SCREEN5 + + LD A,#63 ; VPAGE 1 + CALL SET_PAGE + CALL SCREEN_ON + + LD B,#40 + CALL INTRO_WAIT + CALL INTRO_WAIT + CALL INTRO_WAIT + + ;LD HL,#COLOR_PRESENTS ; now equals to paragon colors + ;CALL PUT_COLOR + LD A,#95 ; VPAGE 2 + CALL SET_PAGE + + LD B,#40 + CALL INTRO_WAIT + + LD HL,#COLOR_DOME_LOGO + CALL PUT_COLOR + LD A,#127 + CALL SET_PAGE ; VPAGE 3 + + LD B,#20 + CALL INTRO_WAIT + + JP 0x4000 + +INTRO_WAIT: + IN A,(0xAA) ; check op spatie... + AND #0xF0 + OR #8 + OUT (0xAA),A + IN A,(0xA9) + AND #1 + RET Z + EI + HALT + HALT + HALT + HALT + DJNZ INTRO_WAIT + RET + +;========================================================================= +;========================================================================= +;=================== SUBS ============================================== +;========================================================================= +;========================================================================= + + +PUT_SLT_ADR: + LD D,A + AND #0b00000011 + LD B,#48 + ADD B + LD (HL),A + BIT 7,D + RET Z ; PRIM NOT IN SUB SLOT ??? + INC HL + LD A,#0x2D ; "-" + LD (HL),A + LD A,D + AND #0b00001100 + SRL A + SRL A + LD B,#48 + ADD B + INC HL + LD (HL),A + RET +;======================================================================= +;------------------------- +; IN DE: NR +; HL ; WELKE TXT + 3 + +FIL_HL_DE_HEX: + LD A,E + AND #0b00001111 + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_DE1_HEX + LD B,#7 + ADD B +FIL_HL_DE1_HEX: + LD (HL),A + DEC HL + LD A,E + AND #0b11110000 + SRL A + SRL A + SRL A + SRL A + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_DE2_HEX + LD B,#7 + ADD B +FIL_HL_DE2_HEX: + LD (HL),A + DEC HL + LD A,D + AND #0b00001111 + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_DE3_HEX + LD B,#7 + ADD B +FIL_HL_DE3_HEX: + LD (HL),A + DEC HL + LD A,D + AND #0b11110000 + SRL A + SRL A + SRL A + SRL A + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_DE4_HEX + LD B,#7 + ADD B +FIL_HL_DE4_HEX: + LD (HL),A + RET + +;======================================================================= + +;------------------------- +; IN A: NR +; HL ; WELKE TXT + 1 + +FIL_HL_A_DEC: + JR DIE + + LD B,A + XOR A ; FLAGS GOED + LD A,B + + DAA + LD B,A + AND #0x0F + ADD #48 + LD (HL),A + DEC HL + + LD A,B + SRL A + SRL A + SRL A + SRL A + ADD #48 + LD (HL),A + RET +DIE: + PUSH HL + LD HL,#FIL_HL_A_TAB_DEC + SLA A + LD E,A + LD D,#0 + ADD HL,DE + LD D,(HL) + INC HL + LD E,(HL) + POP HL + LD (HL),E + DEC HL + LD (HL),D + DEC HL + RET + +FIL_HL_A_TAB_DEC: + .str "0001020304050607080910111213141516171819" + .str "2021222324252627282930313233343536373839" + .str "4041424344454647484950515253545556575859" + .str "6061626364656667686970717273747576777879" + .str "8081828384858687888990919293949596979899" + + +;---------------------------- +; IN A: NR +; HL : TXT +1 + +FIL_HL_A_HEX: + LD D,A + AND #0b00001111 + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_A1_HEX + LD B,#7 + ADD B +FIL_HL_A1_HEX: + LD (HL),A + DEC HL + LD A,D + AND #0b11110000 + SRL A + SRL A + SRL A + SRL A + LD B,#48 + ADD B + CP #58 + JP C,FIL_HL_A2_HEX + LD B,#7 + ADD B +FIL_HL_A2_HEX: + LD (HL),A + RET + + +READ_MOUSE: + LD A,#15 + OUT (0xA0),A + LD A,C + OUT (0xA1),A + XOR #0b00110000 + LD C,A + LD A,#14 + OUT (0xA0),A +READ_MOUSE_L: + DJNZ READ_MOUSE_L + + LD A,(MOUSE_WAIT2) + LD B,A + IN A,(0xA2) + AND #0x0F + RET + + +;======================================================================= +;======================================================================= +;======================================================================= +;================== TAB ================================================ +;======================================================================= +;======================================================================= + + +DOS_STACK: .dw 0 +INT_DOS: .dw 0 +INT_SPEED: .dw I_SPEED + +CURRENT_DRIVE: .db 0 + +DOME_LIB0: .str "DOME 000" ; DOME LIB FILE + +UNITTOT: .str "UNITTOT ZOP" ; GFX UNITS +PAGE5: .str "PAGE5 ZOP" ; GFX BUILDINGS +BALKEN4: .str "BALKEN4 ZOP" ; GFX ACHTERGROND + +MMENU: .str "MMENU DAT" ; MAIN MENU 0x4000 +ST_MENU1: .str "ST_MENU1ZOP" ; GFX START MENU +ST_MENU2: .str "ST_MENU2ZOP" ; GFX START MENU_ROOD + +MENU_CODE: .str "MENU DAT" ; DOME_MENU_CALL CODE +MENU_GFX1: .str "MENU ZOP" ; DOME_MENU_CALL GFX + +CHOOSE_CODE: ;DB "CHOOSE DAT" ; LEVEL CHOOSER CODE +CHOOSE_GFX1: ;DB "CHOOSE1 ZOP" ; LEVEL CHOOSEE GFX1 +CHOOSE_GFX2: ;DB "CHOOSE2 ZOP" ; LEVEL CHOOSER GFX2 + +PARAGON: .str "PARAGON ZOP" ; GFX PARAGON PRODUCTIOS +PRESENTS: .str "PRESENTSZOP" ; GFX PRESENTS (C) 1999 +DOME: .str "DOME ZOP" ; GFX DOME LOGO + + +DOSVARTAB: .dw 0 ; adr mappertab +;DOSJMPTAB: .dw 0 + +DOS_TOTAL_LOC: .db 0 ; AANTAL SEGEMNSTENM +SEC_SLOT_ADR: .db 0 +DOS_MAX_LOC: .db 13 ; MOET MINMAAL 5 ZIJN !!!!!!!! +DOS_LOC_PRIM: .db 0 +DOS_LOC_SEC: .db 0 + +COLOR_PARAGON: + .db #0x00,#0x00,#0x77,#0x07,#0x66,#0x06,#0x11,#0x01 + .db #0x55,#0x05,#0x44,#0x04,#0x33,#0x03,#0x22,#0x02 + .db #0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00 + .db #0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00 +COLOR_PRESENTS: + .db #0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00 + .db #0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00,#0x00 + .db #0x00,#0x00,#0x11,#0x01,#0x22,#0x02,#0x33,#0x03 + .db #0x44,#0x04,#0x55,#0x05,#0x66,#0x06,#0x77,#0x07 +COLOR_DOME_LOGO: + .db #0x00,#0x00,#0x04,#0x00,#0x05,#0x00,#0x06,#0x00 + .db #0x55,#0x05,#0x33,#0x03,#0x20,#0x00,#0x30,#0x00 + .db #0x40,#0x00,#0x70,#0x03,#0x70,#0x04,#0x70,#0x05 + .db #0x70,#0x00,#0x60,#0x00,#0x50,#0x00,#0x77,#0x07 + +;======================================================================= +;======================================================================= +;======================================================================= +;================== TXT ================================================ +;======================================================================= +;======================================================================= + + +TXT_PUNT: .str "." + .db 0x1D +TXT_READY: .str "Ready" +TXT_RET: .db 0x0A,0x0D,0x1D + +TXT_DOME_INIT: .str "INIT_DOME : DOME v0.7b BETA" + .db 0x0A,0x0D,0x1D +TXT_ERR: .str "PRESS SPACE 4 DOS......................" + .db 0x0A,0x0D,0x1D + +;======== TIME / DATE + +TXT_TIME: .str "INIT_TIME : Current time : " +TXT_TIME_WR: .str " : : " + .db 0x0A,0x0D,0x1D + +TXT_DATE: .str "INIT_DATE : Current date : " +TXT_DATE_WR: .str " - - " + .db 0x0A,0x0D,0x1D + ; sun 24-12-1998 + +;=========== MSX_TYPE TXT'S + +TXT_MSX_TYPE: .str "CHK_SYS : " + .db 0x1D +TXT_MSX_1: .str "MSX-1 Found." + .db 0x0A,0x0D,0x1D +TXT_MSX_2: .str "MSX-2 Found." + .db 0x0A,0x0D,0x1D +TXT_MSX_2P: .str "MSX-2+ Found." + .db 0x0A,0x0D,0x1D +TXT_MSX_TR: .str "MSX-TURBO-R Found." + .db 0x0A,0x0D,0x1D +TXT_MSX_ON: .str "MSX-3 Found ,let us know it's name." + .db 0x0A,0x0D,0x1D + + +;========== MOUSE TXT'S + +TXT_MOUSE_CHK: .str "CHK_MOUSE : Scaning Game Ports..." + .db 0x0A,0x0D,0x1D +TXT_MOUSE_YES: .str " Mouse found on port : " + .db 0x1D +TXT_MOUSE_PORT1:.str "1 " + .db 0x1D +TXT_MOUSE_PORT12:.str "1 AND #" +TXT_MOUSE_PORT2:.str "2" + .db 0x0A,0x0D,0x1D +TXT_MOUSE_NO: .str " No mouse found" + .db 0x0A,0x0D,0x1D +TXT_MOUSE_ERR: .str "You need a mouse connected on port 1 or #2 to " + .str "run DOME." + .db 0x0A,0x0D,0x1D + +TXT_MOUSE_FO: .str "CHK_MOUSE : MOUSE IS FORCED BY USER ON PORT : " + .db 0x1D + +;=================== vdp + +TXT_VDP_SCAN: .str "CHK_VDP : Checking VDP type." + .db 0x0A,0x0D,0x1D + +TXT_VDP_38: .str " Found V9938 environment." + .db 0x0A,0x0D,0x1D +TXT_VDP_58: .str " Found V9958 environment." + .db 0x0A,0x0D,0x1D +TXT_VDP_90: .str " Found V9990 environment." + .db 0x0A,0x0D,0x1D +TXT_VDP_90_NOT: .str " Sorry V9990 Not supported." + .db 0x0A,0x0D,0x1D +TXT_VDP_NOT: .str " Found unknown VDP environment." + .db 0x0A,0x0D + .db 0x1D + +TXT_VDP_ID: .str " VDP indication number: &H" +TXT_VDP_ID_WR: .str " " + .db 0x0A,0x0D,0x1D + +;============= CPU + +TXT_CPU: .str "CHK_CPU : " + .db 0x1D +TXT_Z80: .str "Z80" + .db 0x0A,0x0D,0x1D +TXT_R800_ROM: .str "R800 ROM" + .db 0x0A,0x0D,0x1D +TXT_R800_DRAM: .str "R800 DRAM" + .db 0x0A,0x0D,0x1D +TXT_R800_DOME: .str " Switching to R800 ROM." + .db 0x0A,0x0D,0x1D + +TXT_Z180: .str "Z180" + .db 0x0A,0x0D,0x1D +TXT_Z280: .str "Z280 (Z800)" + .db 0x0A,0x0D,0x1D +TXT_Z380: .str "Z380" + .db 0x0A,0x0D,0x1D + +TXT_SPEED: .str " CPU_Speed : &H" +TXT_SPEED_WR: .ds 32 ; 128 bit counter + .db 0x0A,0x0D,0x1D + +;============= memory TXT'S + +TXT_MEMORY: .str "INIT_MEM : Current manager : " + .db 0x1D +TXT_MEMMAN: .str "Memman & " + .db 0x1D +TXT_DOS: .str "Dos " + .db 0x1D +TXT_DOS1: .str "You need dos 2.XX or higher to " + .str "run DOME." + .db 0x0A,0x0D,0x1D +TXT_VERSION: .str "2.XX" + .db 0x0A,0x0D,0x1D +TXT_ALO: .str " Alocating memory... " + .db 0x0A,0x0D,0x1D +TXT_MORE_MEM: .str " You need at least 1 more segment to" + .str " run Dome." + .db 0x0A,0x0D,0x1D +TXT_MAX_MEM: .str " You have the maximum memory than current " + .str "is used in Dome." + .db 0x0A,0x0D,0x1D +TXT_MEM_MAPP: .str " Current mapper breedte :" +TXT_MEM_MAPP_WR:.str " " + .db 0x0A,0x0D,0x1D + + +;========= DOS TXT'S + +TXT_DOSJMPTAB: .str " Preparing Dos Jump Table" + .db 0x0A,0x0D,0x1D +TXT_DOSVARTAB: .str " Getting Dos Info Table" + .db 0x0A,0x0D,0x1D +TXT_DOS_PRI: .str " Primary mapper found at slot : " +TXT_DOS_PRI_SLT:.str " " + .db 0x0A,0x0D,0x1D +TXT_DOS_SEC: .str " Next mapper found at slot : " +TXT_DOS_SEC_SLT:.str " " + .db 0x0A,0x0D,0x1D +TXT_DOS_NO_SEC: .str " No More Mappers found." + .db 0x0A,0x0D,0x1D +TXT_DOS_MAX_PRI:.str " No more segment's needed from primary mapper" + .db 0x0A,0x0D,0x1D +TXT_DOS_MAX_SEC:.str " No more segment's needed from other mappers" + .db 0x0A,0x0D,0x1D +TXT_DOS_NOT_MAX:.str " Dome supports more segment's than current" + .str " is showen." + .db 0x0A,0x0D,0x1D ; NAX = NOT MAX :) +TXT_DOS_PRI_LOC:.str " Segment's located by primary mapper......" +TXT_DOS_PRI_WR: .str " " + .db 0x0A,0x0D,0x1D +TXT_DOS_SEC_LOC:.str " Segment's located by other mapper........" +TXT_DOS_SEC_WR: .str " " + .db 0x0A,0x0D,0x1D +TXT_DOS_TOT_LOC:.str " Total segment's located.................." +TXT_DOS_TOT_WR: .str " " + .db 0x0A,0x0D,0x1D + +;=============== DISK TXT'S + +TXT_DSK_INIT: .str "INIT_BDOS : Getting current disk values." + .db 0x0A,0x0D,0x1D +TXT_DSK_DRV: .str " Current Drive-letter : " +TXT_DSK_DRV_WR: .str " :" + .db 0x0A,0x0D,0x1D +TXT_DSK_ROM: .str " DISK-ROM Found at Slot : " +TXT_DSK_ROM_WR: .str " " + .db 0x0A,0x0D,0x1D +TXT_SCSI: .str " Found MSX-SCSI Bios." + .db 0x0A,0x0D,0x1D +TXT_NOV: .str " NOVAXIS SCSI-bios instaled." + .db 0x0A,0x0D,0x1D +TXT_NOV_ID: .str " SCSI-Host ID : " +TXT_NOV_ID_W: .str " " + .db 0x0A,0x0D,0x1D +TXT_NOV_ON: .str " Total SCSI Units Online : " +TXT_NOV_ON_W: .str " " + .db 0x0A,0x0D,0x1D +TXT_SCSI_LIST: .str " SCSI-BUS : " + .db 0x1D +TXT_SCSI_PUT: .str " " +TXT_SCSI_ID: .str " -" +TXT_SCSI_HD: .str " " + .db 0x0A,0x0D,0x1D +TXT_DSK_LIB: .str " Loading First DOME lib..." + .db 0x1D +TXT_SCSI_NOT: .str " NOT SCANNING SCSI DEV. BY USER" + .db 0x0A,0x0D,0x1D + +;=============== SOUND'S TXT'S + +TXT_SND_INIT: .str "INIT_snd : installing dome sound system" + .db 0x0A,0x0D,0x1D +TXT_MUS_NONE: .str " Sorry no music loaded ,You need at least 256KB MEMORY" + .db 0x0A,0x0D,0x1D +TXT_MUS_LD: .str " Loading game music...." + .db 0x1D + +;============= FM-PAC + +TXT_FMPAC_SCAN: .str " Searching for FM-PAC." + .db 0x0A,0x0D,0x1D +TXT_FMPAC_FOUND:.str " FM-PAC Found at Slot : " +TXT_FMPAC_WR: .str " " + .db 0x0A,0x0D,0x1D +TXT_FMPAC_NO: .str " FM-PAC Not Found." + .db 0x0A,0x0D,0x1D +TXT_FMPAC_FO: .str " FM-PAC IS FORCED BY USER." + .db 0x0A,0x0D,0x1D + +;========= MUSIC TXT'S + +TXT_CHKMUSMD: .str " Checking for Music Module." + .db 0x0A,0x0D,0x1D +TXT_MUSFOUND: .str " Music Module found." + .db 0x0A,0x0D,0x1D +TXT_NOMUS: .str " No Music Module Found." + .db 0x0A,0x0D,0x1D +TXT_SAMPLE_SCAN:.str " Scanning Sample ram." + .db 0x0A,0x0D,0x1D +TXT_SAMPLE_RAM: .str " Total sample ram in Kbytes......&H" +TXT_SAMPLER_WR: .str " " + .db 0x0A,0x0D,0x1D + +;================= MOON SOUND + +TXT_CHKMOON: .str " Checking for Moonsound." + .db 0x0A,0x0D,0x1D +TXT_MOONFOUND: .str " Moonsound Found." + .db 0x0A,0x0D,0x1D +TXT_NOMOON: .str " No Moonsound Found." + .db 0x0A,0x0D,0x1D +TXT_SORRYMOON: .str " Sorry no Moonsound support yet." + .db 0x0A,0x0D,0x1D +TXT_MOON_VER: .str " MBWAVE-driver version :" +TXT_MOON_VER_WR:.str " 0.00" + .db 0x0A,0x0D,0x1D +TXT_MOON_MEM: .str " MOONSOUND Sram in Kb : &H" +TXT_MOON_MEM_WR:.str "0000" + .db 0x0A,0x0D,0x1D + +;============== SAMPLE LOADING + +TXT_SAM_NO: .str " No Samples are Loaded." + .db 0x0A,0x0D,0x1D +TXT_SAM_MUS: .str " There will be only music samples" + .db 0x0A,0x0D,0x1D +TXT_SAM_L_32KB: .str " Loading music samples....." + .db 0x1D +TXT_SAM_L_256KB:.str " Loading game Samples......" + .db 0x1D +TXT_SAM_L_OPL4: .str " Loading game and music samples..." + .db 0x1D + +;============== GFX INIT THE LAST AT LEAST + +TXT_GFX_INIT: .str "INIT_GFX : Checking Memory for total pre-LOAD'S" + .db 0x0A,0x0D,0x1D +TXT_GFX_LD: .str " LOADING GFX : [" + .db 0x1D +TXT_STUFF_READY: +TXT_GFX_READY: .str "]" + .db 0x0A,0x0D,0x1D +TXT_STUFF_LD: .str " LOADING STUFF : [" + .db 0x1D + +TXT_RUN: .str " GET READY TO ROCK !" + .db 0x0A,0x0D,0x1D + +.area _DATA