Skip to content

Commit

Permalink
Level select done, saves folder obsoleted
Browse files Browse the repository at this point in the history
Fixed fish missile health, don't know if right-facing is fixed or not
Ma Pignon room was throwing an address error because of...... a pot!
  • Loading branch information
andwn committed Feb 25, 2017
1 parent f22c3b8 commit 732f095
Show file tree
Hide file tree
Showing 250 changed files with 120 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ prof2sram
tscomp
tileopt
lutgen
savetrim
savegen_cache/
save/
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ lutgen:
prof2sram:
gcc tools/prof2sram/prof2sram.c -o prof2sram $(TOOLFLAGS)

savetrim:
gcc tools/savetrim/savetrim.c -o savetrim $(TOOLFLAGS)

clean:
rm -f $(RESOURCES)
rm -f doukutsu.bin doukutsu.elf temp.bin symbol.txt
Expand Down
2 changes: 1 addition & 1 deletion inc/sheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ enum {
SHEET_SISHEAD, SHEET_BUYOB, SHEET_BUYO, SHEET_HOPPY, SHEET_ACID, SHEET_NIGHTSHOT,
SHEET_GUNFSHOT,SHEET_MIDO, SHEET_PRESS, SHEET_STUMPY, SHEET_CORES1, SHEET_CORES3,
SHEET_CORES4, SHEET_REDDOT, SHEET_MIMI, SHEET_DOCSHOT,SHEET_RING, SHEET_SHOCK,
SHEET_FIRE,
SHEET_FIRE, SHEET_MAPI,
};

u8 sheet_num;
Expand Down
42 changes: 22 additions & 20 deletions res/resources.res
Original file line number Diff line number Diff line change
Expand Up @@ -985,23 +985,25 @@ WAV SFX_9B "sfx/9B.wav" 5
# Level Select Saves
# ----------------------------------------------------------------------------------------------

BIN LS_Mimi "save/mimi.sram"
BIN LS_Eggs "save/eggs.sram"
BIN LS_Weed "save/weed.sram"
BIN LS_Balfrog "save/balfrog.sram"
BIN LS_Sand "save/sand.sram"
BIN LS_Toroko "save/toroko.sram"
BIN LS_Maze "save/maze.sram"
BIN LS_Booster "save/booster.sram"
BIN LS_Core "save/core.sram"
BIN LS_Stream "save/stream.sram"
BIN LS_Mimi2 "save/mimi2.sram"
BIN LS_Oside "save/oside.sram"
BIN LS_Cent "save/cent.sram"
BIN LS_Last "save/last.sram"
BIN LS_Blcny "save/blcny.sram"
BIN LS_Stream2 "save/stream2.sram"
BIN LS_Pignon "save/pignon.sram"
BIN LS_Last2 "save/last2.sram"
BIN LS_Hell "save/hell.sram"
BIN LS_Ballos "save/ballos.sram"
BIN LS_00 "save/00_firstcave.sram-trim"
BIN LS_01 "save/01_mimigavillage.sram-trim"
BIN LS_02 "save/02_eggcorridor.sram-trim"
BIN LS_03 "save/03_grasstown.sram-trim"
BIN LS_04 "save/04_malco.sram-trim"
BIN LS_05 "save/05_balfrog.sram-trim"
BIN LS_06 "save/06_sandzone.sram-trim"
BIN LS_07 "save/07_omega.sram-trim"
BIN LS_08 "save/08_storehouse.sram-trim"
BIN LS_09 "save/09_labyrinth.sram-trim"
BIN LS_10 "save/10_monsterx.sram-trim"
BIN LS_11 "save/11_labyrinthm.sram-trim"
BIN LS_12 "save/12_core.sram-trim"
BIN LS_13 "save/13_waterway.sram-trim"
BIN LS_14 "save/14_eggcorridor2.sram-trim"
BIN LS_15 "save/15_outerwall.sram-trim"
BIN LS_16 "save/16_plantation.sram-trim"
BIN LS_17 "save/17_lastcave.sram-trim"
BIN LS_18 "save/18_lastcave2.sram-trim"
BIN LS_19 "save/19_balcony.sram-trim"
BIN LS_20 "save/20_sacredground.sram"
BIN LS_21 "save/21_sealchamber.sram"
Binary file renamed save/minigma village.blastem.sram → res/save/00_firstcave.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/3hp mimiga village.blastem.sram → res/save/01_mimigavillage.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed res/save/mimi.sram → res/save/02_eggcorridor.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/beat balrog.blastem.sram → res/save/03_grasstown.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/restart egg corridor.blastem.sram → res/save/04_malco.sram-trim
100644 → 100755
Binary file not shown.
Binary file added res/save/05_balfrog.sram-trim
Binary file not shown.
Binary file renamed save/pre-trade for machinegun.blastem.sram → res/save/06_sandzone.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/pre-sand zone.blastem.sram → res/save/07_omega.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/before toroko.blastem.sram → res/save/08_storehouse.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/3hp before grasstown.blastem.sram → res/save/09_labyrinth.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/got arms barrier.blastem.sram → res/save/10_monsterx.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed save/3hp got jelly juice.blastem.sram → res/save/11_labyrinthm.sram-trim
100644 → 100755
Binary file not shown.
Binary file added res/save/12_core.sram-trim
Binary file not shown.
Binary file renamed res/save/balfrog.sram → res/save/13_waterway.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed res/save/eggs.sram → res/save/14_eggcorridor2.sram-trim
100644 → 100755
Binary file not shown.
Binary file renamed res/save/weed.sram → res/save/15_outerwall.sram-trim
100644 → 100755
Binary file not shown.
Binary file added res/save/16_plantation.sram-trim
Binary file not shown.
Binary file added res/save/17_lastcave.sram-trim
Binary file not shown.
Binary file added res/save/18_lastcave2.sram-trim
Binary file not shown.
Binary file added res/save/19_balcony.sram-trim
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file removed res/save/blcny.sram
Binary file not shown.
Binary file removed res/save/booster.sram
Binary file not shown.
Binary file removed res/save/cent.sram
Binary file not shown.
Binary file removed res/save/core.sram
Binary file not shown.
Binary file removed res/save/last.sram
Binary file not shown.
Binary file removed res/save/last2.sram
Binary file not shown.
Binary file removed res/save/maze.sram
Binary file not shown.
Binary file removed res/save/mimi2.sram
Binary file not shown.
Binary file removed res/save/oside.sram
Binary file not shown.
Binary file removed res/save/pignon.sram
Binary file not shown.
Binary file removed res/save/sand.sram
Binary file not shown.
Binary file removed res/save/stream.sram
Binary file not shown.
Binary file removed res/save/stream2.sram
Binary file not shown.
Binary file removed res/save/toroko.sram
Binary file not shown.
Binary file modified res/sprite/pot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed save/3hp before grasstown.gens.srm
Binary file not shown.
Binary file removed save/3hp got jelly juice.gens.srm
Binary file not shown.
Binary file removed save/3hp mimiga village.gens.srm
Binary file not shown.
Binary file removed save/4 dogs collected.blastem.sram
Binary file not shown.
Binary file removed save/4 dogs collected.gens.srm
Binary file not shown.
Binary file removed save/arrive at plantation.blastem.sram
Binary file not shown.
Binary file removed save/arrive at plantation.gens.srm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed save/arthur's place exploring.blastem.sram
Binary file not shown.
Binary file removed save/arthur's place exploring.gens.srm
Binary file not shown.
Binary file removed save/arthur's place found undies.blastem.sram
Binary file not shown.
Binary file removed save/arthur's place found undies.gens.srm
Binary file not shown.
Binary file removed save/arthur's place got nemesis.blastem.sram
Binary file not shown.
Binary file removed save/arthur's place got nemesis.gens.srm
Binary file not shown.
Binary file removed save/arthur's place to sand zone.blastem.sram
Binary file not shown.
Binary file removed save/arthur's place to sand zone.gens.srm
Binary file not shown.
Binary file removed save/arthur's place.blastem.sram
Binary file not shown.
Binary file removed save/arthur's place.gens.srm
Binary file not shown.
Binary file removed save/back to village.blastem.sram
Binary file not shown.
Binary file removed save/back to village.gens.srm
Binary file not shown.
Binary file removed save/beat balrog.gens.srm
Binary file not shown.
Binary file removed save/beat core with polar star.blastem.sram
Binary file not shown.
Binary file removed save/beat core with polar star.gens.srm
Binary file not shown.
Binary file removed save/beat ghost.blastem.sram
Binary file not shown.
Binary file removed save/beat ghost.gens.srm
Binary file not shown.
Binary file removed save/beat last boss with spur only.blastem.sram
Binary file not shown.
Binary file removed save/beat last boss with spur only.gens.srm
Binary file not shown.
Binary file removed save/beat monster x with machinegun.blastem.sram
Binary file not shown.
Binary file removed save/beat monster x with machinegun.gens.srm
Binary file not shown.
Binary file removed save/beat monster x with snake.blastem.sram
Binary file not shown.
Binary file removed save/beat monster x with snake.gens.srm
Binary file not shown.
Binary file removed save/beat omega.blastem.sram
Binary file not shown.
Binary file removed save/beat omega.gens.srm
Binary file not shown.
Binary file removed save/before balrog.blastem.sram
Binary file not shown.
Binary file removed save/before balrog.gens.srm
Binary file not shown.
Binary file removed save/before blue mush with mask.blastem.sram
Binary file not shown.
Binary file removed save/before blue mush with mask.gens.srm
Binary file not shown.
Binary file removed save/before decision.blastem.sram
Binary file not shown.
Binary file removed save/before decision.gens.srm
Binary file not shown.
Binary file removed save/before enraged mimiga.blastem.sram
Binary file not shown.
Binary file removed save/before enraged mimiga.gens.srm
Binary file not shown.
Binary file removed save/before feed mush with mask.blastem.sram
Binary file not shown.
Binary file removed save/before feed mush with mask.gens.srm
Binary file not shown.
Binary file removed save/before feed mushroom.blastem.sram
Binary file not shown.
Binary file removed save/before feed mushroom.gens.srm
Binary file not shown.
Binary file removed save/before final bosses 2.blastem.sram
Binary file not shown.
Binary file removed save/before final bosses 2.gens.srm
Binary file not shown.
Binary file removed save/before final bosses with mask.blastem.sram
Binary file not shown.
Binary file removed save/before final bosses with mask.gens.srm
Binary file not shown.
Binary file removed save/before final bosses with whimsi.blastem.sram
Binary file not shown.
Binary file removed save/before final bosses with whimsi.gens.srm
Binary file not shown.
Binary file removed save/before final bosses.blastem.sram
Binary file not shown.
Binary file removed save/before final bosses.gens.srm
Binary file not shown.
Binary file removed save/before final cave hidden.blastem.sram
Binary file not shown.
Binary file removed save/before final cave hidden.gens.srm
Binary file not shown.
Binary file removed save/before final cave with mask.blastem.sram
Binary file not shown.
Binary file removed save/before final cave with mask.gens.srm
Binary file not shown.
Binary file removed save/before ghost.blastem.sram
Binary file not shown.
Binary file removed save/before ghost.gens.srm
Binary file not shown.
Binary file removed save/before last bosses again.blastem.sram
Binary file not shown.
Binary file removed save/before last bosses again.gens.srm
Binary file not shown.
Binary file removed save/before last bosses.blastem.sram
Binary file not shown.
Binary file removed save/before last bosses.gens.srm
Binary file not shown.
Binary file removed save/before mushroom.blastem.sram
Binary file not shown.
Binary file removed save/before mushroom.gens.srm
Binary file not shown.
Binary file removed save/before sisters.blastem.sram
Binary file not shown.
Binary file removed save/before sisters.gens.srm
Binary file not shown.
Binary file removed save/before toroko.gens.srm
Binary file not shown.
Binary file removed save/decision time.blastem.sram
Binary file not shown.
Binary file removed save/decision time.gens.srm
Binary file not shown.
Binary file removed save/done fetch quest.blastem.sram
Binary file not shown.
Binary file removed save/done fetch quest.gens.srm
Binary file not shown.
Binary file removed save/early labyrinth.blastem.sram
Binary file not shown.
Binary file removed save/early labyrinth.gens.srm
Binary file not shown.
Binary file removed save/egg corridor 2 beat sisters.blastem.sram
Binary file not shown.
Binary file removed save/egg corridor 2 beat sisters.gens.srm
Binary file not shown.
Binary file removed save/egg corridor 2 pre-choice.blastem.sram
Binary file not shown.
Binary file removed save/egg corridor 2 pre-choice.gens.srm
Binary file not shown.
Binary file removed save/egg corridor 2.blastem.sram
Binary file not shown.
Binary file removed save/egg corridor 2.gens.srm
Binary file not shown.
Binary file removed save/egg corridor with id.blastem.sram
Binary file not shown.
Binary file removed save/egg corridor with id.gens.srm
Binary file not shown.
Binary file removed save/egg corridor.blastem.sram
Binary file not shown.
Binary file removed save/egg corridor.gens.srm
Binary file not shown.
Binary file removed save/enter sacred ground.blastem.sram
Binary file not shown.
Binary file removed save/enter sacred ground.gens.srm
Binary file not shown.
Binary file removed save/final cave 2.blastem.sram
Binary file not shown.
Binary file removed save/final cave 2.gens.srm
Binary file not shown.
Binary file removed save/final cave.blastem.sram
Binary file not shown.
Binary file removed save/final cave.gens.srm
Binary file not shown.
Binary file removed save/finished fetching.blastem.sram
Binary file not shown.
Binary file removed save/finished fetching.gens.srm
Binary file not shown.
Binary file removed save/getting turbocharge before bosses.blastem.sram
Binary file not shown.
Binary file removed save/getting turbocharge before bosses.gens.srm
Binary file not shown.
Binary file removed save/got arms barrier.gens.srm
Binary file not shown.
Binary file removed save/got nemesis with spur.blastem.sram
Binary file not shown.
Binary file removed save/got nemesis with spur.gens.srm
Binary file not shown.
Binary file removed save/got spur and bubbler.blastem.sram
Binary file not shown.
Binary file removed save/got spur and bubbler.gens.srm
Binary file not shown.
Binary file removed save/grasstown done.blastem.sram
Binary file not shown.
Binary file removed save/grasstown done.gens.srm
Binary file not shown.
Binary file removed save/grasstown pre-jail at plantation.blastem.sram
Binary file not shown.
Binary file removed save/grasstown pre-jail at plantation.gens.srm
Binary file not shown.
Binary file removed save/grasstown.blastem.sram
Binary file not shown.
Binary file removed save/grasstown.gens.srm
Binary file not shown.
Binary file removed save/just got 5th dog in hand.blastem.sram
Binary file not shown.
Binary file removed save/just got 5th dog in hand.gens.srm
Binary file not shown.
Binary file removed save/labyrinth after ghost weapon up.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth after ghost weapon up.gens.srm
Binary file not shown.
Binary file removed save/labyrinth after ghost.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth after ghost.gens.srm
Binary file not shown.
Binary file removed save/labyrinth beat boss and balrog.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth beat boss and balrog.gens.srm
Binary file not shown.
Binary file removed save/labyrinth before core 2.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth before core 2.gens.srm
Binary file not shown.
Binary file removed save/labyrinth before core.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth before core.gens.srm
Binary file not shown.
Binary file removed save/labyrinth before ghost.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth before ghost.gens.srm
Binary file not shown.
Binary file not shown.
Binary file removed save/labyrinth got snake and arms barrier.gens.srm
Binary file not shown.
Binary file removed save/labyrinth got turbocharger.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth got turbocharger.gens.srm
Binary file not shown.
Binary file removed save/labyrinth opened door.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth opened door.gens.srm
Binary file not shown.
Binary file not shown.
Binary file removed save/labyrinth pre-boss (snake grabbed) 2.gens.srm
Binary file not shown.
Binary file removed save/labyrinth pre-boss (snake grabbed).blastem.sram
Binary file not shown.
Binary file removed save/labyrinth pre-boss (snake grabbed).gens.srm
Binary file not shown.
Binary file removed save/labyrinth.blastem.sram
Binary file not shown.
Binary file removed save/labyrinth.gens.srm
Binary file not shown.
Binary file not shown.
Binary file removed save/mimiga village before blue mush fight.gens.srm
Binary file not shown.
Binary file removed save/mimiga village booster 2.blastem.sram
Binary file not shown.
Binary file removed save/mimiga village booster 2.gens.srm
Binary file not shown.
Binary file removed save/minigma village.gens.srm
Binary file not shown.
Binary file removed save/option to grab snake.blastem.sram
Binary file not shown.
Binary file removed save/option to grab snake.gens.srm
Binary file not shown.
Binary file removed save/plantation finished fetching.blastem.sram
Binary file not shown.
Binary file removed save/plantation finished fetching.gens.srm
Binary file not shown.
Binary file removed save/plantation just before final cave.blastem.sram
Binary file not shown.
Binary file removed save/plantation just before final cave.gens.srm
Binary file not shown.
Binary file removed save/plantation rocket ready.blastem.sram
Binary file not shown.
Binary file removed save/plantation rocket ready.gens.srm
Binary file not shown.
Binary file removed save/pre-core with polar star.blastem.sram
Binary file not shown.
Binary file removed save/pre-core with polar star.gens.srm
Binary file not shown.
Binary file removed save/pre-frog-balrog.blastem.sram
Binary file not shown.
Binary file removed save/pre-frog-balrog.gens.srm
Binary file not shown.
Binary file removed save/pre-last boss.blastem.sram
Binary file not shown.
Binary file removed save/pre-last boss.gens.srm
Binary file not shown.
Binary file removed save/pre-omega.blastem.sram
Binary file not shown.
Binary file removed save/pre-omega.gens.srm
Binary file not shown.
Binary file removed save/pre-sand zone.gens.srm
Binary file not shown.
Binary file removed save/pre-trade for machinegun.gens.srm
Binary file not shown.
Binary file removed save/predecision.blastem.sram
Binary file not shown.
Binary file removed save/predecision.gens.srm
Binary file not shown.
Binary file removed save/reget lev 3 machinegun.blastem.sram
Binary file not shown.
Binary file removed save/reget lev 3 machinegun.gens.srm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed save/reload just before polar star trade.gens.srm
Binary file not shown.
Binary file removed save/restart egg corridor.gens.srm
Binary file not shown.
Binary file removed save/retry after core.blastem.sram
Binary file not shown.
Binary file removed save/retry after core.gens.srm
Binary file not shown.
Binary file removed save/retry again before decision.blastem.sram
Binary file not shown.
Binary file removed save/retry again before decision.gens.srm
Binary file not shown.
Binary file removed save/retry beat ghost no snake.blastem.sram
Binary file not shown.
Binary file removed save/retry beat ghost no snake.gens.srm
Binary file not shown.
Binary file removed save/right before final cave.blastem.sram
Binary file not shown.
Binary file removed save/right before final cave.gens.srm
Binary file not shown.
Binary file removed save/sacred ground with spur.blastem.sram
Binary file not shown.
Binary file removed save/sacred ground with spur.gens.srm
Binary file not shown.
Binary file removed save/sacred grounds with whimsi.blastem.sram
Binary file not shown.
Binary file removed save/sacred grounds with whimsi.gens.srm
Binary file not shown.
Binary file removed save/sand zone 2 just beat curly.blastem.sram
Binary file not shown.
Binary file removed save/sand zone 2 just beat curly.gens.srm
Binary file not shown.
Binary file removed save/sand zone before toroka.blastem.sram
Binary file not shown.
Binary file removed save/sand zone before toroka.gens.srm
Binary file not shown.
Binary file removed save/sand zone boss with polar star.blastem.sram
Binary file not shown.
Binary file removed save/sand zone boss with polar star.gens.srm
Binary file not shown.
Binary file removed save/sand zone.blastem.sram
Binary file not shown.
Binary file removed save/sand zone.gens.srm
Binary file not shown.
Binary file removed save/save at door to plantation.blastem.sram
Binary file not shown.
Binary file removed save/save at door to plantation.gens.srm
Binary file not shown.
Binary file removed save/storehouse.blastem.sram
Binary file not shown.
Binary file removed save/storehouse.gens.srm
Binary file not shown.
Binary file removed save/turbocharge.blastem.sram
Binary file not shown.
Binary file removed save/turbocharge.gens.srm
Binary file not shown.
Binary file removed save/waterfall arrive.blastem.sram
Binary file not shown.
Binary file removed save/waterfall arrive.gens.srm
Binary file not shown.
Binary file removed save/waterfall curly.blastem.sram
Binary file not shown.
Binary file removed save/waterfall curly.gens.srm
Binary file not shown.
Binary file removed save/waterway 2.blastem.sram
Binary file not shown.
Binary file removed save/waterway 2.gens.srm
Binary file not shown.
Binary file removed save/waterway build back missiles.blastem.sram
Binary file not shown.
Binary file removed save/waterway build back missiles.gens.srm
Binary file not shown.
Binary file removed save/waterway.blastem.sram
Binary file not shown.
Binary file removed save/waterway.gens.srm
Binary file not shown.
8 changes: 4 additions & 4 deletions src/ai/cemetery.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void ai_ma_pignon(Entity *e) {
u8 blockl = FALSE, blockr = FALSE;

// Ma Pignon jumps off screen and should not collide with the map while doing so
if (e->y > block_to_sub(8)) {
if (e->y_next > block_to_sub(5)) {
blockl = e->x_speed < 0 && collide_stage_leftwall(e);
blockr = e->x_speed > 0 && collide_stage_rightwall(e);
if(!e->grounded) e->grounded = collide_stage_floor(e);
Expand Down Expand Up @@ -402,7 +402,7 @@ void ai_ma_pignon(Entity *e) {
e->frame = 2;
if (++e->timer > 4) {
e->state++;
e->frame = 12;
e->frame = 11;
e->y_speed = -SPEED(0x800);
e->grounded = FALSE;
sound_play(SND_FUNNY_EXPLODE, 5);
Expand All @@ -415,7 +415,7 @@ void ai_ma_pignon(Entity *e) {
break;
case MP_Fly_Up+1: // flying up
{
ANIMATE(e, 4, 12,13);
ANIMATE(e, 4, 10,11);

if (e->y < (16<<CSF))
e->state = MP_Spawn_Clones;
Expand All @@ -432,7 +432,7 @@ void ai_ma_pignon(Entity *e) {
}
case MP_Spawn_Clones+1:
{
ANIMATE(e, 4, 12,13);
ANIMATE(e, 4, 10,11);

if ((++e->timer % 8) == 0) {
s32 x = block_to_sub(4 + (random() % 12));
Expand Down
5 changes: 4 additions & 1 deletion src/ai/monsterx.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static void spawn_fish(u8 index) {
fish->eflags &= ~NPC_INVINCIBLE;
fish->nflags &= ~NPC_SHOOTABLE;
fish->eflags |= NPC_SHOOTABLE;
fish->health = 10;
fish->health = 1;
//FIRE_ANGLED_SHOT(OBJ_X_FISHY_MISSILE,
// bossEntity->x + xoffs[index], bossEntity->y + yoffs[index],
// 0x80 + index * 0x100, SPEED(0x400));
Expand Down Expand Up @@ -392,6 +392,7 @@ void ai_monsterx(Entity *e) {
entities_clear_by_type(OBJ_X_DOOR);
entities_clear_by_type(OBJ_X_TREAD);
entities_clear_by_type(OBJ_X_INTERNALS);
player.grounded = FALSE; // Stop player from floating where treads were
e->state = STATE_DELETE;
return;
}
Expand Down Expand Up @@ -717,6 +718,8 @@ void ai_x_fishy_missile(Entity *e) {
e->y_speed = sin[e->cur_angle];
e->x += e->x_speed;
e->y += e->y_speed;

e->dir = 0; // Never flip sprite, let angles handle it all
}


Expand Down
2 changes: 1 addition & 1 deletion src/db/npc.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ const npc_info_def npc_info[NPC_COUNT + 9 + 14 + 4] = {
{ NULL, NOSHEET, PAL0, 1, &ai_null, &ai_null, &ondeath_default }, // Bute (Sword)
{ NULL, NOSHEET, PAL0, 1, &ai_null, &ai_null, &ondeath_default }, // Bute (Archer)
{ NULL, NOSHEET, PAL0, 1, &ai_null, &ai_null, &ai_null }, // Bute Projectile
{ &SPR_MaPignon,NOSHEET, PAL3, 1, &onspawn_persistent, &ai_ma_pignon, &ondeath_default }, // Ma Pignon
{ NULL, SHEET_MAPI, PAL3, 1, &onspawn_persistent, &ai_ma_pignon, &ondeath_default }, // Ma Pignon
{ NULL, NOSHEET, PAL0, 1, &ai_null, &ai_null, &ai_null }, // Falling (?)
{ NULL, NOSHEET, PAL1, 1, &ai_null, &ai_null, &ondeath_default }, // Hopping Enemy (?)
{ NULL, NOSHEET, PAL0, 1, &ai_null, &ai_null, &ondeath_default }, // Bute (Defeated)
Expand Down
15 changes: 13 additions & 2 deletions src/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,20 @@ void vblank() {

u8 game_main(u8 load) {
SYS_disableInts();
VDP_setEnable(FALSE);
VDP_setPaletteColors(0, PAL_FadeOut, 64);
VDP_setPaletteColor(15, 0x000);
//VDP_setEnable(FALSE);
// This is the SGDK font with a blue background for the message window
VDP_loadTileSet(&TS_MsgFont, TILE_FONTINDEX, TRUE);
SYS_setVIntCallback(vblank);
//SYS_setHIntCallback(hblank_water);
effects_init();
SYS_enableInts();

game_reset(load);

VDP_setEnable(TRUE);
SYS_disableInts();
//VDP_setEnable(TRUE);
VDP_setWindowPos(0, 0);

// Load game doesn't run a script that fades in and shows the HUD, so do it manually
Expand Down Expand Up @@ -110,6 +115,8 @@ u8 game_main(u8 load) {
VDP_fadeTo(0, 63, VDP_getCachedPalette(), 20, TRUE);
continue;
} else if(rtn == 3) {
VDP_setPaletteColors(0, PAL_FadeOut, 64);
VDP_setPaletteColor(15, 0x000);
game_reset(FALSE); // Start from beginning
continue;
} else { // End credits
Expand All @@ -131,11 +138,13 @@ u8 game_main(u8 load) {
}

void game_reset(u8 load) {
SYS_disableInts();
camera_init();
tsc_init();
hud_create();
// Default sprite sheets
sheets_load_stage(255, TRUE, TRUE);
SYS_enableInts();
gameFrozen = FALSE;
if(load) {
if(load == 1) {
Expand All @@ -153,11 +162,13 @@ void game_reset(u8 load) {
system_new();
tsc_call_event(GAME_START_EVENT);
}
SYS_disableInts();
SHEET_LOAD(&SPR_Bonk, 1, 1, 1, 1, 0,0);
// Load up the main palettes
VDP_setCachedPalette(PAL0, PAL_Main.data);
VDP_setCachedPalette(PAL1, PAL_Sym.data);
VDP_setPaletteColors(0, PAL_FadeOut, 64);
SYS_enableInts();
}

void draw_itemmenu(u8 resetCursor) {
Expand Down
4 changes: 4 additions & 0 deletions src/sheet.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ void sheets_load_stage(u16 sid, u8 init_base, u8 init_tiloc) {
SHEET_ADD(SHEET_CRITTER, &SPR_MizaCritter, 3,2,2, 0,1, 0,2, 0,3);
// Projectile
} break;
case 0x53: // Ma Pignon
{ SHEET_ADD(SHEET_MAPI, &SPR_MaPignon, 12,2,2,
0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7, 0,8, 0,9, 0,10, 0,11);
} break;
default: printf("Stage %hu has no sheet set", sid);
}
// Weapons at the end
Expand Down
9 changes: 6 additions & 3 deletions src/stage.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ void stage_load_entities() {
// each entity as it is loaded so the problematic NPC can be found
/*
{
VDP_setEnable(TRUE);
SYS_disableInts();
//VDP_setEnable(TRUE);
VDP_setPaletteColor(15, 0xEEE);
char str[2][36];
sprintf(str[0], "X:%hu Y:%hu I:%hu", x, y, id);
Expand All @@ -197,9 +198,11 @@ void stage_load_entities() {
while(!joy_pressed(BUTTON_C)) {
input_update();
VDP_waitVSync();
VDP_setHorizontalScroll(PLAN_A, 0);
VDP_setVerticalScroll(PLAN_A, 0);
}
SYS_disableInts();
VDP_setEnable(FALSE);
//SYS_disableInts();
//VDP_setEnable(FALSE);
}
*/
Entity *e = entity_create((x<<CSF)*16 + (8<<CSF),
Expand Down
6 changes: 3 additions & 3 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
typedef struct { u8 hour, minute, second, frame; } Time;

static const uint8_t *FileList[] = {
LS_Mimi, LS_Eggs, LS_Weed, LS_Balfrog, LS_Sand, LS_Toroko, LS_Maze, LS_Booster,
NULL, LS_Core, LS_Stream, LS_Mimi2, LS_Oside, LS_Cent, LS_Last, LS_Blcny,
NULL, LS_Stream2, LS_Pignon, LS_Last2, LS_Hell, LS_Ballos,
LS_00, LS_01, LS_02, LS_03, LS_04, LS_05, LS_06, LS_07,
LS_08, LS_09, LS_10, LS_11, LS_12, LS_13, LS_14, LS_15,
LS_16, LS_17, LS_18, LS_19, LS_20, LS_21,
};

u8 debuggingEnabled = FALSE;
Expand Down
29 changes: 16 additions & 13 deletions src/titlescreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,34 +136,37 @@ u8 titlescreen_main() {
VDP_setPaletteColor(12, 0x666);
VDP_setPaletteColor(16 + 15, 0xAAA);
static const char *levelStr[] = {
" First Cave",
" Mimiga Village",
" Egg Corridor",
" Grasstown",
" Malco",
" Balfrog",
" Sand Zone",
" Toroko",
" Omega",
" Storehouse",
" Labyrinth",
" Booster",
"=NORMAL END ROUTE=",
" Monster X",
" Labyrinth M",
" Core",
" Waterway",
" Empty Village",
" Egg Corridor 2",
" Outer Wall",
" Plantation",
" Last Cave",
" Balcony",
"= BEST END ROUTE =",
" Waterway 2",
" Ma Pignon",
" Last Cave 2",
" Balcony",
" Sacred Ground",
" Ballos",
" Seal Chamber",
};
static const u16 tx = 11, ty = 2;
u16 tx = 11, ty = 1;
if(IS_PALSYSTEM) ty++;
VDP_drawText("= Welcome to Warp Zone =", 7, ty);
ty += 2;
for(u8 i = 0; i < SAVES; i++) {
if(cursor == i) VDP_setTextPalette(PAL0);
else VDP_setTextPalette(PAL1);
VDP_drawText(levelStr[i], tx, 2+i);
VDP_drawText(levelStr[i], tx, ty+i);
}
SYS_enableInts();
while(!joy_pressed(BUTTON_C) && !joy_pressed(BUTTON_START)) {
Expand All @@ -173,7 +176,7 @@ u8 titlescreen_main() {
VDP_drawText(levelStr[cursor], tx, ty + cursor);
if(cursor == 0) cursor = SAVES - 1;
else cursor--;
if(cursor == 8 || cursor == 16) cursor--;
//if(cursor == 8 || cursor == 16) cursor--;
VDP_setTextPalette(PAL0);
VDP_drawText(levelStr[cursor], tx, ty + cursor);
sound_play(SND_MENU_MOVE, 0);
Expand All @@ -182,7 +185,7 @@ u8 titlescreen_main() {
VDP_drawText(levelStr[cursor], tx, ty + cursor);
if(cursor == SAVES - 1) cursor = 0;
else cursor++;
if(cursor == 8 || cursor == 16) cursor++;
//if(cursor == 8 || cursor == 16) cursor++;
VDP_setTextPalette(PAL0);
VDP_drawText(levelStr[cursor], tx, ty + cursor);
sound_play(SND_MENU_MOVE, 0);
Expand Down
42 changes: 42 additions & 0 deletions tools/savetrim/savetrim.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Strip padding at the end of SRAM
*
* Compile:
* gcc savetrim.c -o savetrim
*
* Usage:
* ./prof2sram <file1> [file2] [...]
*/

#include <stdint.h>
#include <stdio.h>
#include <string.h>

#define SRAM_SIZE 0x500

int main(int argc, char *argv[]) {
for(int i = 1; i < argc; i++) {
FILE *in = fopen(argv[i], "rb");
if(!in) {
printf("E: Couldn't open %s.\n", argv[i]);
continue;
}
char outfn[256];
sprintf(outfn, "%s-trim", argv[i]);
FILE *out = fopen(outfn, "wb");
if(!out) {
printf("E: Couldn't create %s.\n", outfn);
continue;
fclose(in);
}
uint8_t sram[SRAM_SIZE];
if(fread(sram, 1, SRAM_SIZE, in) < SRAM_SIZE) {
printf("E: %s shorter than %d bytes.\n", argv[i], SRAM_SIZE);
}
fclose(in);
if(fwrite(sram, 1, SRAM_SIZE, out) < SRAM_SIZE) {
printf("E: Wrote less than %d bytes to %s.\n", SRAM_SIZE, outfn);
}
fclose(out);
}
}

0 comments on commit 732f095

Please sign in to comment.