Skip to content

Commit 56cde95

Browse files
committed
level + tileset fixes
imagine not working on this for 11 days
1 parent 2c25b58 commit 56cde95

20 files changed

+66
-35
lines changed

Data/LevelPointers.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ LevelPointers:
1818
addlevel Plains2
1919
addlevel Plains3
2020
addlevel Plains4
21+
addlevel Plains5
2122

Data/Palettes.asm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ Pal_Plains:
8787
RGB 192>>3,192>>3,192>>3
8888
RGB 139>>3, 64>>3, 0>>3
8989
RGB 176>>3, 80>>3, 0>>3
90-
; water + sky
91-
RGB 128>>3,160>>3,255>>3
90+
; water
91+
RGB 0>>3, 0>>3, 0>>3
9292
RGB 0>>3, 88>>3,255>>3
9393
RGB 0>>3,255>>3,255>>3
9494
RGB 255>>3,255>>3,255>>3
@@ -97,7 +97,7 @@ Pal_Plains:
9797
RGB 0>>3, 0>>3, 0>>3
9898
RGB 176>>3, 80>>3, 0>>3
9999
RGB 255>>3,216>>3, 0>>3
100-
; spikes
100+
; spikes (above ground)
101101
RGB 128>>3,160>>3,255>>3
102102
RGB 136>>3,136>>3,136>>3
103103
RGB 198>>3,198>>3,198>>3
@@ -107,8 +107,8 @@ Pal_Plains:
107107
RGB 0>>3,160>>3, 0>>3
108108
RGB 255>>3,216>>3, 0>>3
109109
RGB 255>>3,255>>3,255>>3
110-
; reserved
110+
; spikes (underground)
111111
RGB 0>>3, 0>>3, 0>>3
112-
RGB 255>>3, 0>>3, 0>>3
113-
RGB 255>>3,255>>3, 0>>3
114-
RGB 255>>3,255>>3,255>>3
112+
RGB 78>>3, 78>>3, 78>>3
113+
RGB 162>>3,162>>3,162>>3
114+
RGB 255>>3,255>>3,255>>3

Data/Tilesets.asm

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ section "Plains tileset - Collision map + metatiles",romx
8585
; 07 = ???
8686
ColMap_Plains:
8787
db 0,1,1,1,1,1,0,0,0,4,5,5,6,6,6,6
88-
db 3,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0
88+
db 3,1,0,1,1,1,0,0,0,4,1,0,0,0,0,0
8989
db 3,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0
9090
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
9191
db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@@ -105,8 +105,8 @@ Tileset_Plains:
105105
dw ColMap_Plains
106106
dbw bank(PlainsTiles),PlainsTiles
107107
; sky
108-
db $00,%00000011,$01,%00000011
109-
db $02,%00000011,$03,%00000011
108+
db $00,%00000101,$01,%00000101
109+
db $02,%00000101,$03,%00000101
110110
; top left corner
111111
db $10,%00000001,$11,%00000001
112112
db $13,%00000000,$14,%00000000
@@ -180,14 +180,29 @@ Tileset_Plains:
180180
; tall grass
181181
db $00,%00000110,$00,%00000110
182182
db $3f,%00000110,$3f,%00000110
183-
; solid dirt block
183+
; underground coin
184+
db $48,%00000100,$49,%00000100
185+
db $4a,%00000100,$4b,%00000100
186+
; solid dirt block
184187
db $44,%00000000,$45,%00000000
185188
db $46,%00000000,$47,%00000000
186189
; reserved
187-
rept 6
188-
db 0,0,0,0
189-
db 0,0,0,0
190-
endr
190+
db 0,0,0,0
191+
db 0,0,0,0
192+
; underground spikes (floor)
193+
db $37,%00000111,$37,%00000111
194+
db $38,%00000111,$38,%00000111
195+
; underground spikes (ceiling)
196+
db $38,%01000111,$38,%01000111
197+
db $37,%01000111,$37,%01000111
198+
; underground spikes (right wall)
199+
db $39,%00000111,$3a,%00000111
200+
db $39,%00000111,$3a,%00000111
201+
; underground spikes (left wall)
202+
db $3a,%00100111,$39,%00100111
203+
db $3a,%00100111,$39,%00100111
204+
205+
191206
; water
192207
db $27,%00000011,$27,%00000011
193208
db $27,%00000011,$27,%00000011

Engine/GameModes/Level.asm

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,6 @@ Level_LoadMapColumn:
734734
push de
735735
ld a,[Engine_CurrentScreen]
736736
and $f
737-
cp $f ; check if we're in subscreen 15
738-
jr z,:+
739737
sub 1 ; dec a doesn't set carry and we need to check for overflow
740738
jr nc,:+
741739
xor a
@@ -771,11 +769,7 @@ Level_LoadMapColumn:
771769
add 16
772770
ld l,a
773771
jr nc,:+
774-
ld a,h
775-
add 1
776-
cp $e0
777-
jr nz,:+
778-
ld h,$df
772+
inc h
779773
:
780774
pop bc
781775
dec b

Engine/Metatile.asm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ GetTileCoordinates:
3333
; Input: E = Tile coordinates
3434
; Carry = Subtract 1 from screen
3535
; Output: A = Collision ID, B = Tile ID
36-
; Destroys: B, HL, rROMB0
36+
; Destroys: HL, rROMB0
3737

3838
GetTileL:
3939
push af
@@ -56,6 +56,8 @@ GetTileL:
5656
.nocarry
5757
ld l,e
5858
ld a,[hl]
59+
ld b,a
60+
push bc
5961
; get collision ID
6062
ld e,a
6163
ld a,[Engine_TilesetBank]
@@ -69,6 +71,7 @@ GetTileL:
6971
jr nc,:+
7072
inc h
7173
: ld a,[hl]
74+
pop bc
7275
ret
7376
7477
; Input: E = Tile coordinates

Engine/Player.asm

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,10 @@ ProcessPlayer:
259259
ld l,a
260260
ld a,[Player_XPos]
261261
ld h,a
262+
push bc
262263
call GetTileCoordinates
263-
ld e,a
264+
pop bc
265+
ld e,a
264266
265267
ld hl,Engine_LevelData
266268
ld a,[Engine_CurrentScreen]
@@ -273,8 +275,14 @@ ProcessPlayer:
273275
add 2
274276
ldh [rSVBK],a
275277
ld l,e
278+
ld a,b
279+
cp $19 ; is coin underground?
280+
jr nz,.aboveground
281+
ld a,6
282+
jr :+
283+
.aboveground
276284
xor a
277-
ld [hl],a
285+
: ld [hl],a
278286
ld b,a
279287
ld a,e
280288
swap a

GFX/PlainsTiles.2bpp

0 Bytes
Binary file not shown.

GFX/PlainsTiles.2bpp.wle

61 Bytes
Binary file not shown.

GFX/PlainsTileset.png

4.74 KB
Loading

Levels/Plains1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"map":{"tile_w":16,"tile_h":16,"tile_spacing":0,"image_filename":"../GFX/PlainsTileset.png","animations":[],"tags":[],"w":64,"h":16,"data":[18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,19,19,19,19,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,20,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,19,19,19,19,20,0,10,10,10,0,0,0,0,0,0,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,20,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,38,37,38,37,19,19,19,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,20,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,37,19,19,19,19,21,3,3,3,3,3,4,10,10,2,3,3,3,4,24,0,0,0,10,10,0,0,0,0,0,0,0,10,18,20,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,38,38,19,19,19,19,19,19,19,19,38,19,20,10,10,18,19,19,37,21,3,4,0,25,0,0,0,0,0,0,0,0,0,0,18,20,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,37,19,19,38,37,19,5,35,35,35,35,6,37,20,10,10,18,38,38,19,19,19,21,3,3,3,3,4,0,0,0,0,0,0,0,18,20,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,0,0,18,19,38,19,38,19,5,36,0,0,0,0,18,19,20,10,10,18,19,19,19,37,19,19,37,19,37,19,21,3,3,4,0,10,0,0,18,20,18,20,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,10,0,0,0,0,0,18,38,19,19,5,35,36,0,0,0,0,0,34,35,36,10,10,18,19,19,19,19,19,19,19,37,38,19,38,19,19,20,0,10,0,0,18,20,18,20,0,0,0,0,0,0,0,0,0,25,0,2,3,4,0,0,0,0,0,0,0,0,0,0,18,38,19,37,20,0,0,0,0,0,0,0,0,25,0,0,8,18,19,38,19,19,19,19,19,19,37,19,19,19,19,20,0,10,0,0,18,20,18,20,0,0,0,0,0,0,0,0,0,2,3,22,19,21,4,0,0,0,0,0,0,0,0,0,34,35,35,35,36,0,0,0,0,0,2,3,3,3,3,3,3,22,19,19,19,37,19,19,19,38,19,38,19,19,38,20,0,10,0,0,18,20,18,20,0,0,0,0,0,0,0,0,0,18,19,19,19,19,21,4,0,0,0,0,0,24,9,0,0,10,10,10,0,0,25,25,2,3,22,38,37,19,19,19,19,37,19,37,19,19,19,19,19,38,19,37,19,38,19,20,0,10,0,0,18,20,18,20,0,0,0,0,0,0,0,8,0,18,19,19,19,19,19,21,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,22,37,19,37,19,19,19,38,19,19,19,19,19,19,37,19,38,37,19,37,38,19,37,20,0,10,0,0,34,36,18,20,0,0,0,0,0,0,2,3,3,22,38,19,37,38,37,19,38,19,19,19,19,19,19,19,37,37,19,38,19,38,19,38,19,19,19,19,19,19,19,19,38,19,19,37,19,37,37,19,19,19,19,19,38,19,19,20,0,10,0,0,11,12,18,20,25,0,24,0,2,3,22,19,19,19,19,19,19,38,19,19,19,19,19,19,38,38,19,19,19,19,19,38,37,38,19,38,19,19,19,38,19,19,19,19,37,37,19,19,19,38,19,38,38,19,19,19,19,19,38,20,0,10,0,0,11,12,18,21,3,3,3,3,22,19,38,37,19,19,19,37,19,19,37,19,37,19,19,37,38,38,19,19,19,38,19,19,19,37,37,19,19,19,19,19,38,19,37,19,19,37,19,19,19,19,19,19,19,37,19,19,19,19,19,20,25,25,25,0,11,12,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,21,3,3,3,3,3,4]},"objects":[{"name":"LevelProperties","Tileset":"Tileset_Plains","Music":"MUS_PLAINS","Background":"BG_Test","Palette":"Pal_Plains","x":"0","y":"0"},{"name":"PlayerStart","x":"48","y":"176","w":"16","h":"16"}]}
1+
{"map":{"tile_w":16,"tile_h":16,"tile_spacing":0,"image_filename":"../GFX/PlainsTileset.png","animations":[],"tags":[],"w":64,"h":32,"data":[18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,19,19,19,19,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,19,19,19,19,20,0,10,10,10,0,0,0,0,0,0,10,10,10,10,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,37,19,19,19,19,19,20,0,0,0,0,24,0,0,0,0,0,24,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,19,19,19,19,19,37,38,21,3,3,3,3,3,4,10,10,2,3,3,3,4,25,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,18,38,38,19,37,37,19,19,19,19,19,19,38,19,20,10,10,18,19,19,37,21,3,4,0,0,10,0,0,0,0,0,0,0,0,0,11,12,18,20,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,19,37,19,19,37,19,5,35,35,35,35,6,19,20,10,10,18,19,37,19,19,19,20,0,0,10,0,0,0,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,0,0,0,0,0,0,18,19,19,37,19,19,5,36,0,0,0,0,18,19,20,10,10,18,38,19,19,19,38,21,4,0,10,0,0,0,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,0,0,10,10,10,0,0,0,0,10,0,0,0,0,0,18,37,19,19,5,35,36,0,0,0,0,0,34,35,36,10,10,18,19,19,19,37,19,19,20,0,25,0,0,0,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,24,25,2,3,4,24,0,0,0,0,0,0,0,0,0,18,37,19,19,20,0,0,0,0,0,25,24,0,0,0,0,8,18,19,19,19,19,19,19,21,3,3,4,0,0,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,2,3,22,38,21,4,25,0,0,0,0,0,0,0,0,34,35,35,35,36,0,0,0,0,0,2,3,3,3,3,3,3,22,19,19,19,19,19,19,37,19,38,20,0,24,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,0,0,18,19,19,19,19,21,4,0,0,0,25,0,0,9,0,24,10,10,10,0,0,0,0,2,3,22,19,37,38,19,19,19,37,19,19,37,19,38,38,19,38,37,21,3,4,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,0,8,0,18,19,19,19,19,19,21,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,22,38,38,38,19,19,19,19,19,19,19,19,19,19,38,19,37,19,19,19,19,20,0,0,0,0,0,0,11,12,18,20,0,0,0,0,0,0,2,3,3,22,38,19,19,19,19,37,38,38,19,19,19,19,19,19,37,19,19,19,37,19,19,19,19,19,37,37,38,19,19,19,19,19,19,19,19,19,37,19,38,19,37,38,37,21,3,4,0,0,0,0,11,12,18,20,24,24,0,0,2,3,22,19,19,19,19,19,38,19,37,19,19,19,19,38,19,19,38,19,38,19,19,38,19,19,19,37,19,19,19,37,19,38,38,37,37,38,19,19,19,19,19,19,19,37,19,19,19,19,37,20,0,0,0,0,11,12,18,21,3,3,3,3,22,19,19,37,38,37,19,19,19,19,19,19,19,19,38,19,19,19,38,37,19,37,19,19,19,19,19,37,19,19,19,37,37,19,19,38,19,19,19,19,37,37,19,37,19,19,19,19,19,19,37,20,24,0,0,24,11,12,18,19,19,19,19,19,19,19,37,19,19,37,19,37,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,38,19,19,19,19,37,37,19,19,19,37,19,37,19,19,38,19,19,19,38,19,19,38,19,19,19,19,38,21,3,3,3,3,3,4,34,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,35,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},"objects":[{"name":"LevelProperties","Tileset":"Tileset_Plains","Music":"MUS_PLAINS","Background":"BG_Test","Palette":"Pal_Plains","x":"0","y":"0"},{"name":"PlayerStart","x":"48","y":"176","w":"16","h":"16"}]}

0 commit comments

Comments
 (0)