Skip to content

Commit

Permalink
hardcoding goddess palette states
Browse files Browse the repository at this point in the history
  • Loading branch information
NotImplementedLife committed Apr 9, 2022
1 parent a4c6675 commit a554578
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
Binary file added data/hue_data.bin
Binary file not shown.
28 changes: 10 additions & 18 deletions source/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "level_8_bin.h"
//...

#include "hue_data_bin.h"

#include "physical_object.hpp"
#include "actor_player.hpp"
#include "actor_cat.hpp"
Expand Down Expand Up @@ -52,8 +54,6 @@ u32 choose_star_pos(const u8* level_map);
#include "trampoline.h"
#include "heart.h"

#include "hue.h"

#include "obstacle_activator.h"
#include "obstacle_horizontal.h"
#include "obstacle_vertical.h"
Expand Down Expand Up @@ -81,8 +81,8 @@ class LevelDungeon : public Background

void init() override
{
Background::load_tiles(all_levelsTiles, all_levelsTilesLen, true, 160);
dmaCopy((u8*)all_levelsPal,(u16*)(TMP_BG_PALETTE)+160, all_levelsPalLen);
Background::load_tiles(all_levelsTiles, all_levelsTilesLen, true, 96);
dmaCopy((u8*)all_levelsPal,(u16*)(TMP_BG_PALETTE)+96, all_levelsPalLen);
}
};

Expand Down Expand Up @@ -204,7 +204,7 @@ class LevelDialog : public DialogBackground
// Dialog 0: use to display level title
//dbg_ctx="Vwf";
vwf = new Vwf(defaultFont816);
vwf->set_text_color(0x62);
vwf->set_text_color(0x80);
create_dialog_box(1, 1, 16, 4, vwf);

// Dialog 1: use dialog timings to control jumping on sprites
Expand All @@ -220,14 +220,14 @@ class LevelDialog : public DialogBackground
//dbg_ctx="Vwf";
vwf_g = new Vwf(defaultFont816);
create_dialog_box(1,14,28,6, vwf_g);
vwf_g->set_text_color(0x62);
vwf_g->set_text_color(0x80);

// Dialog 3: jump dialog, for cat
//dbg_ctx="Vwf";
vwf_jc = new Vwf(defaultFont816);
create_dialog_box(5, 22, 3, 4, vwf_jc);

TMP_BG_PALETTE[0x62] = 0x7FFF;
TMP_BG_PALETTE[0x82] = 0x7FFF; // it's a bug in vwf |=
}

virtual ~LevelDialog()
Expand Down Expand Up @@ -704,18 +704,10 @@ void Level::on_start_frame()
void Level::on_end_frame()
{
if(goddess_mode)
{
u16* hue = (u16*)hueBitmap;
{
goddess_tick++;
u8 hid=goddess_tick>>1;
for(int i=0;i<96;i++)
{
BG_PALETTE[i]=cl_blend(hue[hid],((u16*)notebook_sheetPal)[i],12);
}
for(int i=0;i<32;i++)
{
BG_PALETTE[160+i]=cl_blend(hue[hid],((u16*)all_levelsPal)[i],12);
}
u8 hid=goddess_tick>>1;
dmaCopy(((u16*)hue_data_bin)+(hid<<7),BG_PALETTE,2*128);
}
framecount++;
}
Expand Down

0 comments on commit a554578

Please sign in to comment.