_ldHLind = $4010 ;ld hl,(hl)
_swapt_ = $45F3 ;ex_ahl_bde
+leveldata = $EA00 ;size<$400
+
;-----------------------------
;------- program start -------
;-----------------------------
.db %11101111,%00001111
.db %11000011,%10000000
+levelfile:
+ .db 7,"wormlvl"
+
Start:
ld (SpSave),sp
call _runindicoff
call _flushallmenus
call _clrLCD
- res 2,(iy+13) ;appAutoScroll
+ ld hl,levelfile-1
+ rst 20h ;_ABS_MOV10TOOP1
+ rst 10h ;_FINDSYM
+ ret c ;not found
+ ex de,hl
+ ld a,b ;call _ex_ahl_bde
+ call _SET_ABS_SRC_ADDR
+
+ xor a
+ ld hl,leveldata ;datalevels
+ call _SET_ABS_DEST_ADDR
+ xor a
+ ld hl,2
+ call _SET_MM_NUM_BYTES
+ call _mm_ldir
+
+ xor a
+ ld hl,datalevels
+ call _SET_ABS_DEST_ADDR
+ xor a
+ ld hl,16
+ call _SET_MM_NUM_BYTES
+ call _mm_ldir
+
+ xor a
+ ld hl,leveldata
+ call _SET_ABS_DEST_ADDR
+ xor a
+ ld hl,400
+ call _SET_MM_NUM_BYTES
+ call _mm_ldir
+
+ call _RAM_PAGE_1
+
+ res 2,(iy+13) ;appAutoScroll
ld a,r
ld (Seed),a
;-----------------------------
LetsGetThisPartyOn:
- ld hl,Gametype
- ld a,(hl)
- add a,a
- add a,(hl)
+ ld hl,gamesdata
+ ld a,(Gametype)
ld e,a
ld d,0
- ld hl,gamesdata
add hl,de
-
ld a,(hl)
+ ld (gameCar),a
+
+ add hl,de
+ ld e,8 ;=de
+ add hl,de
+
ld d,a ;push af
and _datasingl
jr z,notsingle
ld (worm1+lives),a
notsingle:
ld a,d
- ld (gameCar),a
- push af
+ push af ;&&&b?
and _datascore
ld de,$FF64 ;virt.infinate
setscorelimit:
ld (scorelimit),de
- inc hl
- call _ldHLind
+ call _ldHLind ;ld hl,(hl)
pop af
push hl
and _datalink
multiplayer:
ld a,2
ld (nrworms),a
- ld de,LevelsDM
;-----------------------------
;--------- game over ---------
ld de,worm4+lives
call _MOV5B
call _mov9b
- pop de
+ pop hl
StartLevel:
- ex de,hl
ld de,Left
ldi
ld de,Speed
inc (hl)
pop hl ; << call
pop hl ; << call
- pop de ; << levelp new
+ pop hl ; << levelp new
cp NUM_LEVELS
jp z,Exit
ld a,(gameCar)
;---------- levels -----------
;-----------------------------
-LevelsDM:
- .db 8,5,15,0
- .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
- .db 128,57
- .db 0,0
-
-LevelsDM2:
- .db 8,5,31,0
- .db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
- .db 128,57
- .db 0
- .db 4 ;4 boxes
- .db 4,19,16,14 ;xsize,ysize,xpos,ypos
- .db 4,19,80,14
- .db 4,19,16,34
- .db 4,19,80,34
-
-LevelsL:
- .db 8,0,15,0
- .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
- .db 228,157
- .db 0,0
-
-LevelsR:
- .db 8,2,10,0
- .db $40,3,2,$40,6,2, $40,9,2,$40,12,2
- .db 128,57
- .db 0
- .db 1
- .db 8,29,32,20
-
-LevelsH:
- .db 8,7,17,0
-#ifdef 0
-huntersize = 31
-#endif
- .db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
- .db 128,57
- .db 0
- .db 4
- .db 4,19,16,14
- .db 4,19,80,14
- .db 4,19,16,34
- .db 4,19,80,34
-
-NUM_LEVELS = 10
-
-LevelsS:
+NUM_LEVELS = 1
+LevelDef:
.db 5,4,15,0 ;peas,speed,begin_size,balls
.db 0,2,63 ;start d, y, x
.db 128,57 ;field width (128-255), height (57-255)
.db 0,0 ;no additional lines, boxes
- .db 8,4,15,0
- .db $40,14,2
- .db 128,57
- .db 1
- .db 28,28,100,28 ;line coords: x1,y1,x2,y2
- .db 0
-
- .db 9,4,15,0
- .db $40,8,2
+LevelDefM:
+ .db 8,0,15,0
+ .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
.db 128,57
- .db 2
- .db 28,14,100,14
- .db 28,41,100,41
- .db 0
-
- .db 9,3,15,0
- .db $40,8,2
- .db 128,80
- .db 2
- .db 64,14,64,66
- .db 20,40,108,40
- .db 0
-
- .db 10,3,15,0
- .db 2,8,$40
- .db 128,90
- .db 3
- .db 18,20,18,70
- .db 110,20,110,70
- .db 18,45,110,45
- .db 0
-
- .db 4,3,10,1 \ .dw $20F
- .db 0,2,63
- .db 128,57
- .db 2
- .db 28,14,100,41
- .db 28,41,100,14
- .db 0
-
- .db 7,3,15,0
- .db 64,4,0
- .db 128,86
- .db 6
- .db 34,13,56,35
- .db 34,71,56,49
- .db 72,35,94,13
- .db 72,49,94,71
- .db 16,20,16,64
- .db 110,20,110,64
- .db 0
-
- .db 9,3,15,0
- .db $40,4,10
- .db 128,82
- .db 3
- .db 0,20,74,20
- .db 54,40,128,40
- .db 0,60,74,60
- .db 0
-
- .db 12,3,15,0
- .db $40,4,0
- .db 128,90
- .db 6
- .db 20,16,54,16
- .db 74,16,110,16
- .db 20,16,20,72
- .db 110,16,110,72
- .db 20,72,54,72
- .db 74,72,110,72
- .db 0
-
- .db 8,2,15,0
- .db $C0,72,48
- .db 128,128
- .db 13
- .db 34,56,56,34
- .db 34,72,56,94
- .db 72,34,94,56
- .db 72,94,94,72
- .db 46,64,80,64
- .db 22,11,22,33
- .db 11,22,33,22
- .db 22,95,22,117
- .db 11,106,33,106
- .db 103,11,103,33
- .db 91,22,115,22
- .db 103,95,103,117
- .db 91,106,115,106
- .db 0
+ .db 0,0
;-----------------------------
_datascore = %10000000 ;score>=100 limit
datasingle: .db %00011110
- .dw LevelsS
datapeas: .db %00011010
- .dw LevelsS
datadeathm: .db %00000010
- .dw LevelsDM2
datafoodm: .db %10010000
- .dw LevelsDM
datalinkm: .db %00000011
- .dw LevelsL
datahuntin: .db %10100000
- .dw LevelsH
datarace: .db %11000000
- .dw LevelsR
-datactf: .db %00000000
- .dw LevelsDM
-datadomin: .db %00000000
- .dw LevelsDM
-
+datactf: .db %00000000 ;==(8 modes)
+;datadomin: .db %00000000
+datalevels: .dw LevelDef, LevelDef
+ .dw LevelDefM,LevelDefM
+ .dw LevelDefM,LevelDefM
+ .dw LevelDefM,LevelDefM
resbit = 2 ;and%11111011
worm1set: .dw $B000,$B000 ;%10110000
--- /dev/null
+.org $EA00-16
+
+.dw single,peaworm,deathmatch,foodmatch
+.dw linkmatch,hunting,race,ctf
+
+;-----------------------------
+;---------- levels -----------
+;-----------------------------
+
+NUM_LEVELS = 10
+
+single:
+peaworm:
+
+ .db 5,4,15,0 ;peas,speed,begin_size,balls
+ .db 0,2,63 ;start d, y, x
+ .db 128,57 ;field width (128-255), height (57-255)
+ .db 0,0 ;no additional lines, boxes
+
+ .db 8,4,15,0
+ .db $40,14,2
+ .db 128,57
+ .db 1
+ .db 28,28,100,28 ;line coords: x1,y1,x2,y2
+ .db 0
+
+ .db 9,4,15,0
+ .db $40,8,2
+ .db 128,57
+ .db 2
+ .db 28,14,100,14
+ .db 28,41,100,41
+ .db 0
+
+ .db 9,3,15,0
+ .db $40,8,2
+ .db 128,80
+ .db 2
+ .db 64,14,64,66
+ .db 20,40,108,40
+ .db 0
+
+ .db 10,3,15,0
+ .db 2,8,$40
+ .db 128,90
+ .db 3
+ .db 18,20,18,70
+ .db 110,20,110,70
+ .db 18,45,110,45
+ .db 0
+
+ .db 4,3,10,1 \ .dw $20F
+ .db 0,2,63
+ .db 128,57
+ .db 2
+ .db 28,14,100,41
+ .db 28,41,100,14
+ .db 0
+
+ .db 7,3,15,0
+ .db 64,4,0
+ .db 128,86
+ .db 6
+ .db 34,13,56,35
+ .db 34,71,56,49
+ .db 72,35,94,13
+ .db 72,49,94,71
+ .db 16,20,16,64
+ .db 110,20,110,64
+ .db 0
+
+ .db 9,3,15,0
+ .db $40,4,10
+ .db 128,82
+ .db 3
+ .db 0,20,74,20
+ .db 54,40,128,40
+ .db 0,60,74,60
+ .db 0
+
+ .db 12,3,15,0
+ .db $40,4,0
+ .db 128,90
+ .db 6
+ .db 20,16,54,16
+ .db 74,16,110,16
+ .db 20,16,20,72
+ .db 110,16,110,72
+ .db 20,72,54,72
+ .db 74,72,110,72
+ .db 0
+
+ .db 8,2,15,0
+ .db $C0,72,48
+ .db 128,128
+ .db 13
+ .db 34,56,56,34
+ .db 34,72,56,94
+ .db 72,34,94,56
+ .db 72,94,94,72
+ .db 46,64,80,64
+ .db 22,11,22,33
+ .db 11,22,33,22
+ .db 22,95,22,117
+ .db 11,106,33,106
+ .db 103,11,103,33
+ .db 91,22,115,22
+ .db 103,95,103,117
+ .db 91,106,115,106
+ .db 0
+
+deathmatch:
+ .db 8,5,31,0
+ .db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
+ .db 128,57
+ .db 0
+ .db 4 ;4 boxes
+ .db 4,19,16,14 ;xsize,ysize,xpos,ypos
+ .db 4,19,80,14
+ .db 4,19,16,34
+ .db 4,19,80,34
+
+foodmatch:
+ctf:
+ .db 8,5,15,0
+ .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
+ .db 128,57
+ .db 0,0
+
+linkmatch:
+ .db 8,0,15,0
+ .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
+ .db 228,157
+ .db 0,0
+
+hunting:
+ .db 8,7,17,0
+#ifdef 0
+huntersize = 31
+#endif
+ .db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
+ .db 128,57
+ .db 0
+ .db 4
+ .db 4,19,16,14
+ .db 4,19,80,14
+ .db 4,19,16,34
+ .db 4,19,80,34
+
+race:
+ .db 8,2,10,0
+ .db $40,3,2,$40,6,2, $40,9,2,$40,12,2
+ .db 128,57
+ .db 0
+ .db 1
+ .db 8,29,32,20
+
+ .end
+.end
\ No newline at end of file