Skip to content

Commit

Permalink
Labyrinth for Espitene is finished - but not tested.
Browse files Browse the repository at this point in the history
  • Loading branch information
mojontwins committed Aug 8, 2018
1 parent 8a5adc5 commit 69f3f04
Show file tree
Hide file tree
Showing 35 changed files with 400 additions and 386 deletions.
6 changes: 6 additions & 0 deletions src/utils/rle44mapchrrom.bas
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ While Not Eof (fListIn)
cMapAmalgam (i) = ""
Next i

Clear bigMap (0,0), , 256*128*sizeOf (uByte)
Clear cMap (0,0), , 256*128*sizeOf (uByte)
Clear scrSizes (0), , 128*sizeOf (uByte)
Clear locks (0), , 64*sizeOf (uByte)
Clear scrMaps (0), , 128*sizeOf(uByte)

i = 0: dp = 0
locksI = 0
decosAre = 0
Expand Down
Binary file modified src/utils/rle44mapchrrom.exe
Binary file not shown.
18 changes: 18 additions & 0 deletions testers/05_tester_tile_get/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,29 @@ Finally, we want the bubble to animate, and we also want to make Espitene move s
2,
oam_index
);
[...]
}
```

We added a nice countdown if the timer is < 10, using sprites.

We also want to respawn type 5 hotspots (time refills) automaticly:

```c
// Underwater
if (underwater) {
[...]

// Respawn time refills
if (ht [n_pant] == HOTSPOT_TYPE_TIME && timer < 10) {
hrt = HOTSPOT_TYPE_TIME;
hact [n_pant] = 1;
}
}
```
## Also of interest
### Custom renderer
Expand Down
69 changes: 34 additions & 35 deletions testers/05_tester_tile_get/dev/assets/chr_rom_maps.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,27 +207,27 @@ const unsigned int map_30_scr_offsets [] = {
const unsigned int map_31_scr_offsets [] = {
MAP_31_BASE + 0x0000, MAP_31_BASE + 0x0034,
MAP_31_BASE + 0x004F, MAP_31_BASE + 0x0083,
MAP_31_BASE + 0x009D, MAP_31_BASE + 0x00B1,
MAP_31_BASE + 0x00D5, MAP_31_BASE + 0x00F8,
MAP_31_BASE + 0x0143, MAP_31_BASE + 0x0174,
MAP_31_BASE + 0x019B, MAP_31_BASE + 0x01CD,
MAP_31_BASE + 0x0213, MAP_31_BASE + 0x0259,
MAP_31_BASE + 0x0285, MAP_31_BASE + 0x02B0,
MAP_31_BASE + 0x02EC, MAP_31_BASE + 0x0339,
MAP_31_BASE + 0x0383, 0 ,
MAP_31_BASE + 0x03BE, MAP_31_BASE + 0x03E4,
MAP_31_BASE + 0x0403, MAP_31_BASE + 0x0425,
MAP_31_BASE + 0x00B9, MAP_31_BASE + 0x00DE,
MAP_31_BASE + 0x010A, MAP_31_BASE + 0x0139,
MAP_31_BASE + 0x0184, MAP_31_BASE + 0x01CB,
MAP_31_BASE + 0x01E6, MAP_31_BASE + 0x0218,
MAP_31_BASE + 0x0261, MAP_31_BASE + 0x02B6,
MAP_31_BASE + 0x02F6, MAP_31_BASE + 0x0318,
MAP_31_BASE + 0x0354, MAP_31_BASE + 0x03A1,
MAP_31_BASE + 0x03F0, 0 ,
MAP_31_BASE + 0x0437, MAP_31_BASE + 0x045F,
MAP_31_BASE + 0x0480, MAP_31_BASE + 0x04B0,
0
};

// Total screens size in bytes is 1089
// Total screens size in bytes is 1244

// Map # 7 read from level02.map (3x1)

// Definitions

#define MAP_02_CHRROM 2
#define MAP_02_BASE 0x1D6C
#define MAP_02_BASE 0x1E07
#define MAP_02_W 3
#define MAP_02_H 1
#define MAP_02_MAXPANTS 3
Expand All @@ -247,7 +247,7 @@ const unsigned int map_02_scr_offsets [] = {
// Definitions

#define MAP_12_CHRROM 2
#define MAP_12_BASE 0x1E2C
#define MAP_12_BASE 0x1EC7
#define MAP_12_W 3
#define MAP_12_H 1
#define MAP_12_MAXPANTS 3
Expand All @@ -267,7 +267,7 @@ const unsigned int map_12_scr_offsets [] = {
// Definitions

#define MAP_22_CHRROM 2
#define MAP_22_BASE 0x1E86
#define MAP_22_BASE 0x1F21
#define MAP_22_W 1
#define MAP_22_H 3
#define MAP_22_MAXPANTS 3
Expand All @@ -282,27 +282,7 @@ const unsigned int map_22_scr_offsets [] = {

// Total screens size in bytes is 128

// Map # 10 read from level32.map (3x1)

// Definitions

#define MAP_32_CHRROM 2
#define MAP_32_BASE 0x1F06
#define MAP_32_W 3
#define MAP_32_H 1
#define MAP_32_MAXPANTS 3
#define MAP_32_N_LOCKS 0

// Screens index

const unsigned int map_32_scr_offsets [] = {
MAP_32_BASE + 0x0000, MAP_32_BASE + 0x001E,
MAP_32_BASE + 0x0033
};

// Total screens size in bytes is 90

// Map # 11 read from level00.map (10x3)
// Map # 10 read from level00.map (10x3)

// Definitions

Expand Down Expand Up @@ -335,3 +315,22 @@ const unsigned int map_00_scr_offsets [] = {

// Total screens size in bytes is 760

// Map # 11 read from level32.map (2x1)

// Definitions

#define MAP_32_CHRROM 3
#define MAP_32_BASE 0x02F8
#define MAP_32_W 2
#define MAP_32_H 1
#define MAP_32_MAXPANTS 2
#define MAP_32_N_LOCKS 0

// Screens index

const unsigned int map_32_scr_offsets [] = {
MAP_32_BASE + 0x0000, MAP_32_BASE + 0x003A
};

// Total screens size in bytes is 111

8 changes: 7 additions & 1 deletion testers/05_tester_tile_get/dev/assets/compiled_enems.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ const unsigned char beh2 [] = {
0x00, 0x09, 0x73, 0xbd, 0x65, 0xd5, 0x00
};

const unsigned char beh3 [] = {
0xbd, 0x55, 0x55, 0x46, 0xbe, 0x74, 0x0a, 0x80, 0x0a, 0x54, 0xbd, 0x46, 0x75, 0x75, 0x63, 0xbe,
0x54, 0x09, 0x80, 0x0a, 0x74, 0xbd, 0x66, 0xbe, 0x54, 0x09, 0x80, 0x0a, 0x74, 0xbd, 0x63, 0xdf,
0x00
};

const unsigned char * const en_behptrs [] = {
beh0, beh1, beh2
beh0, beh1, beh2, beh3
};

20 changes: 15 additions & 5 deletions testers/05_tester_tile_get/dev/assets/enem_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,29 @@

// level31.ene

#define HOTSPOTS_OFFSET_31 0x0000
#define HOTSPOTS_OFFSET_31 0x012c

#define MAX_ENEMS_TYPE_3_31 2
#define MAX_ENEMS_TYPE_4_31 7
#define MAX_ENEMS_TYPE_5_31 14

#define KILLABLE_ENEMS_31 0
#define KILLABLE_ENEMS_31 2

#define MAX_HOTSPOTS_TYPE_1_31 0
#define MAX_HOTSPOTS_TYPE_0_31 16
#define MAX_HOTSPOTS_TYPE_1_31 1
#define MAX_HOTSPOTS_TYPE_3_31 1
#define MAX_HOTSPOTS_TYPE_4_31 1
#define MAX_HOTSPOTS_TYPE_5_31 6

// level32.ene

#define HOTSPOTS_OFFSET_32 0x0000
#define HOTSPOTS_OFFSET_32 0x0018

#define MAX_ENEMS_TYPE_20_32 1

#define KILLABLE_ENEMS_32 0
#define KILLABLE_ENEMS_32 1

#define MAX_HOTSPOTS_TYPE_0_32 1
#define MAX_HOTSPOTS_TYPE_1_32 0
#define MAX_HOTSPOTS_TYPE_5_32 1

2 changes: 1 addition & 1 deletion testers/05_tester_tile_get/dev/assets/enem_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
#define WORK_ENEMS22_H_BIN_OFFS 2394
#define WORK_ENEMS30_H_BIN_OFFS 2436
#define WORK_ENEMS31_H_BIN_OFFS 2786
#define WORK_ENEMS32_H_BIN_OFFS 2786
#define WORK_ENEMS32_H_BIN_OFFS 3136

2 changes: 1 addition & 1 deletion testers/05_tester_tile_get/dev/assets/levelset.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const unsigned char l_ini_y [] = {
3, 3, 3, // Benny Hill Zone
3, 3, 3, // Broken Fridge Zone
3, 3, 3, // Bosque de Badajoz Zone
6, 3, 3, // Wet Ruins Zone
6, 6, 6, // Wet Ruins Zone
};
const unsigned char l_map_w [] = {
MAP_00_W, MAP_01_W, MAP_02_W, // Benny Hill Zone
Expand Down
4 changes: 2 additions & 2 deletions testers/05_tester_tile_get/dev/assets/palettes.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const unsigned char palss0 [] = {

// Palette data from ..\gfx\palss0a.png
const unsigned char palss0a [] = {
0x21, 0x0F, 0x13, 0x33,
0x21, 0x03, 0x23, 0x33,
0x21, 0x1D, 0x1A, 0x3B,
0x21, 0x0F, 0x1C, 0x31,
0x21, 0x0F, 0x09, 0x19
0x21, 0x0F, 0x18, 0x29
};

// Palette data from ..\gfx\palts0.png
Expand Down
Binary file modified testers/05_tester_tile_get/dev/cart.nes
Binary file not shown.
Binary file modified testers/05_tester_tile_get/dev/cart.nes.deb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
void add_tile (void) {
map_buff [rdm] = rda;
++ rdm;
// Need to do this to keep track of where I am
rdx = (rdx + 1) & 15; if (!rdx) ++ rdy;
}

void draw_scr (void) {

// Draw Map

rdx = rdy = rdm = 0;
rdm = 0;

#ifdef MAP_FORMAT_PACKED
// Get pointer
Expand Down Expand Up @@ -119,13 +117,13 @@ void draw_scr (void) {
#ifdef MAP_FORMAT_RLE44_CHRROM
bankswitch (c_map_chr_rom_bank);
vram_adr (c_map [n_pant]);
rda = VRAM_READ; // Dummy read.
rdt = VRAM_READ; // Dummy read.

// UNRLE into scr_buff
while (rdm < 192) {
rdt = VRAM_READ;
rda = rdt & 0x0f;

rdct = rdt;
while (rdct >= 16) {
add_tile (); rdct -= 16;
Expand Down
3 changes: 2 additions & 1 deletion testers/05_tester_tile_get/dev/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ extern const unsigned char m_ingame [];
void main(void) {
bank_spr (1);
bank_bg (0);
set_vram_update (0, 0);

ppu_off ();
first_game = 1;
Expand All @@ -128,7 +129,7 @@ void main(void) {
//

//DEBUG
level = 9; level_world = 3; level_act = 0; pemmeralds = 7;
level = 11; level_world = 3; level_act = 2; pemmeralds = 15;

// Game loop

Expand Down
Loading

0 comments on commit 69f3f04

Please sign in to comment.