Support CLUT (untested)

This commit is contained in:
Jaby 2022-10-02 14:18:35 +02:00 committed by Jaby
parent 96ed4b54a0
commit da60502c98
2 changed files with 19 additions and 5 deletions

View File

@ -11,7 +11,7 @@ namespace GPU {
// Upload SplashScreen picture // Upload SplashScreen picture
auto state = FileProcessor::create(reinterpret_cast<const uint32_t*>(SplashScreen), SimpleTIM(93, 0, 0, 0)); auto state = FileProcessor::create(reinterpret_cast<const uint32_t*>(SplashScreen), SimpleTIM(93, 0, 0, 0));
while(state.process((2048/sizeof(uint32_t)))); while(state.process((sizeof(SplashScreen)/sizeof(uint32_t))));
Display::enable(); Display::enable();
} }

View File

@ -88,6 +88,21 @@ namespace FileProcessor {
} }
} }
static bool switch_state_parse_data(State::Configuration& config, SimpleTIMState& state) {
set_gpu_receive_data(config.data_adr, state, state.size_info.getTextureWidth(), state.size_info.getTextureHeight());
return Helper::exchange_and_execute_process_function(parse_data, config, state);
}
static bool parse_clut(State::Configuration& config, SimpleTIMState& state) {
if(parse_data(config, state)) {
return true;
}
else {
return switch_state_parse_data(config, state);
}
}
static bool parse_header(State::Configuration& config, SimpleTIMState& state) { static bool parse_header(State::Configuration& config, SimpleTIMState& state) {
if(config.data_word_size >= (sizeof(SimpleTIMSize)/sizeof(uint32_t))) { if(config.data_word_size >= (sizeof(SimpleTIMSize)/sizeof(uint32_t))) {
Helper::simple_read(state.size_info, config); Helper::simple_read(state.size_info, config);
@ -95,14 +110,13 @@ namespace FileProcessor {
//Check if we have a clut to care about //Check if we have a clut to care about
if(state.size_info.getClutWidth() > 0) { if(state.size_info.getClutWidth() > 0) {
//CLUTs are 16bit full color anyway //CLUTs are 16bit full color anyway
printf("We found a CLUT which is not yet implemented!\n"); set_gpu_receive_data(config.data_adr, state, state.size_info.getClutWidth(), state.size_info.getClutHeight());
return false; return Helper::exchange_and_execute_process_function(parse_clut, config, state);
} }
//We have direct data //We have direct data
else { else {
set_gpu_receive_data(config.data_adr, state, state.size_info.getTextureWidth(), state.size_info.getTextureHeight()); return switch_state_parse_data(config, state);
return Helper::exchange_and_execute_process_function(parse_data, config, state);
} }
} }