2
0
Fork 0

added levels code

This commit is contained in:
Willem 2019-01-02 00:29:48 +01:00
parent 4ba1c4a4f6
commit 41839649b3
3 changed files with 338 additions and 0 deletions

View file

@ -46,6 +46,10 @@ define mod_link_asm_dos
@echo === Link module asm dos.
$(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x0100 -o $(1) $(2)
endef
define mod_link_asm_1000
@echo === Link module asm 0x1000.
$(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x1000 -o $(1) $(2)
endef
define mod_link_asm_4000
@echo === Link module asm 0x4000.
$(SDCC) $(SDCC_FLAG_CPU) --no-std-crt0 --code-loc 0x4000 -o $(1) $(2)

32
src/levels/0module.mk Normal file
View file

@ -0,0 +1,32 @@
LEVELS_NAME := levels
LEVELS_SRC := $(PATH_SRC)/$(LEVELS_NAME)
LEVELS_BIN := $(PATH_BIN)/$(LEVELS_NAME)
$(LEVELS_BIN):
$(call mod_mkdir,$(LEVELS_BIN));
cp $(LEVELS_SRC)/*.00* $(LEVELS_BIN);
$(LEVELS_BIN)/code001.rel: $(LEVELS_SRC)/code001.asm | $(LEVELS_BIN)
$(call mod_compile_asm,$@,$<)
$(LEVELS_BIN)/code002.rel: $(LEVELS_SRC)/code001.asm | $(LEVELS_BIN)
$(call mod_compile_asm,$@,$<)
$(LEVELS_BIN)/code001.hex: $(LEVELS_BIN)/code001.rel
$(call mod_link_asm_1000,$@,$<)
$(LEVELS_BIN)/code002.hex: $(LEVELS_BIN)/code002.rel
$(call mod_link_asm_1000,$@,$<)
$(LEVELS_BIN)/code001.dat: $(LEVELS_BIN)/code001.hex
$(call mod_hex2dat,$<,$@)
$(LEVELS_BIN)/code002.dat: $(LEVELS_BIN)/code002.hex
$(call mod_hex2dat,$<,$@)
$(LEVELS_BIN)/code.001: $(LEVELS_BIN)/code001.dat
cp $< $@
$(LEVELS_BIN)/code.002: $(LEVELS_BIN)/code002.dat
cp $< $@

302
src/levels/code001.asm Normal file
View file

@ -0,0 +1,302 @@
;=================================
; DOME IN-GAME-CODE
;
; CODE.XXX = LEVEL
;
;=================================
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
LOAD_MUS .equ 0x0145
LOAD_SAM .equ 0x0148
PLAY .equ 0x014B
STOP .equ 0x014E
FADE .equ 0x0151
NEXT .equ 0x0154
MUS_NR .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
; org 0x1000
JP INIT_DOME_HOOK ;0x1000
JP ALGEMEEN_HOOK ;0x1003
JP AI_MS_HOOK1 ;0x1006
JP AI_MS_HOOK2 ;0x1009
JP INT_HOOK ;0x100C
;---
JP BRIEFING_START ;0x100F
JP BRIEFING_DEAD ;0x1002
JP BRIEFING_END ;0x1005
INIT_DOME_HOOK:
CALL GET_TIME
LD (BEGIN_TIME),HL
RET
ALGEMEEN_HOOK:
CALL TIME
RET
TIME:
CALL GET_TIME
LD DE,(BEGIN_TIME)
XOR A
SBC HL,DE
RET NZ
;LD A,#435 (ERR CODE)
;JP MISSION_FAILD (BIOS)
BEGIN_TIME: .dw 0
BLABLA: .str "YOU CONCED DOME REAL ENMY SO BE NOT IN SHIT NEXT TIME...."
.db 0x0A,0x0D,0x1D
AI_MS_HOOK1:
RET
AI_MS_HOOK2:
RET
INT_HOOK:
RET
BRIEF: .str "BRIEF ZOP"
PAGE5: .str "PAGE5 ZOP"
BRIEFING_START:
LD HL,#PAGE5
LD DE,#0x4000
LD BC,#0x2000
LD A,#0
CALL LOAD
LD HL,#0x4000
LD DE,#0x8000
LD A,#1
CALL POP_UP_START
LD HL,#BRIEF
LD DE,#0x4000
LD BC,#0x1000
LD A,#0
CALL LOAD
LD HL,#0x4000
LD DE,#0x8000
LD A,#0
CALL POP_UP_START
LD HL,#COLOR_DOME_GAME
CALL PUT_COLOR
CALL SCREEN_ON
LD A,#63
CALL SET_PAGE
LD HL,#MISSION_NAME
CALL PUT_TXT_GFX2
LD HL,#MISSION_BRIEFING
CALL PUT_TXT_GFX
CALL CHK_SPATIE
RET
CHK_SPATIE:
IN A,(0xAA) ; check op spatie...
AND #0xF0
OR #8
OUT (0xAA),A
IN A,(0xA9)
AND #1
RET Z
EI
HALT
JR CHK_SPATIE
PUT_TXT_GFX2:
PUSH HL
POP DE
LD IY,#LETCOP2
LD 4(IY),#16
LD 6(IY),#8
JR PUT2LP
PUT_TXT_GFX:
PUSH HL
POP DE
LD IY,#LETCOP2
LD 4(IY),#0
LD 6(IY),#48
PUT2LP:
LD A,(DE)
CP #0x1D ; END
RET Z
CP #32
JR Z,PUT2LP_CONT ; SPACE
CP #0x0A
JR Z,LEFT ; TO LEFT SIDE OF SCREEN
CP #0x0D
JR Z,RETURN ; NEXT LINE
SUB #46
LD B,#0
SLA A
RL B
SLA A
RL B
SLA A ;3 KEER = 8 > 2^3
RL B
LD 0(IY),A
SLA B
SLA B
SLA B
LD A,B
ADD #136
LD 2(IY),A
PUSH IY
POP HL
CALL PUTBLK
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
HALT
HALT
HALT
HALT
PUT2LP_CONT:
INC DE
LD A,4(IY)
ADD #6
LD 4(IY),A
CP #148
JR C,PUT2LP
LD A,6(IY)
ADD #8
LD 6(IY),A
XOR A
LD 4(IY),A
JR PUT2LP
LEFT:
INC DE
XOR A
LD 4(IY),A
JR PUT2LP
RETURN:
INC DE
LD A,6(IY)
ADD #8
LD 6(IY),A
JR PUT2LP
LETCOP2: .db 0,0,136,3,0,0,0,1,8,0,8,0,0,0,0x98
MISSION_NAME:
.str "FIRST CONTACT :"
.db 0x0A,0x0D,0x1D
MISSION_BRIEFING: ; " <== TOT DAAR DE TEXT OF ANDERS !!!
.str "IT IS YOUR DUTY AS"
.db 0x0A,0x0D
.str "AN OFFICIER OF THE"
.db 0x0A,0x0D
.str "FORCE TO PROTECT"
.db 0x0A,0x0D
.str "YOUR BASE."
.db 0x0A,0x0D
.str "AND DESTROY THE ENEMY"
.db 0x0A,0x0D
.str "COMPLETELY."
.db 0x0A,0x0D
.str "BUT BE AWARE THAT"
.db 0x0A,0x0D
.str "THE ENEMY IS VERY"
.db 0x0A,0x0D
.str "INTELLIGENT AND HAS"
.db 0x0A,0x0D
.str "A GREAT DEFENSIVE"
.db 0x0A,0x0D
.str "ARMY"
.db 0x0A,0x0D
.str "WE WILL SENT SOME"
.db 0x0A,0x0D
.str "MORE TROOPS TO"
.db 0x0A,0x0D
.str "SUPPORT YOU IN YOUR"
.db 0x0A,0x0D
.str "MISSION.GOOD LUCK."
.db 0x0A,0x0D
.db 0x0A,0x0D
.str " PRESS SPACE"
.db 0x0A,0x0D
.db 0x1D ; END BRIEFING
COLOR_DOME_GAME:
.db #00,#00,#62,#04,#52,#03,#50,#02
.db #23,#02,#20,#01,#53,#04,#11,#01
.db #00,#04,#45,#04,#40,#01,#72,#05
.db #04,#01,#06,#02,#00,#00,#77,#07
BRIEFING_DEAD:
LD HL,#BLABLA
RET ; GET BACK TO THE GAME OVER SCROOL
BRIEFING_END:
LD HL,#BLABLA
RET ; GET BACK TO THE CHOOSER CODE..
.area _DATA