Skip to content

Commit

Permalink
Fixed bitpattern pointer for osContInit and removed shader cache func…
Browse files Browse the repository at this point in the history
…tionality (#69)
  • Loading branch information
Mr-Wiseguy authored Nov 9, 2024
1 parent ef6e84c commit d5c81d0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 19 deletions.
5 changes: 4 additions & 1 deletion librecomp/src/cont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ extern "C" void osContInit_recomp(uint8_t* rdram, recomp_context* ctx) {
PTR(OSMesgQueue) mq = _arg<0, PTR(OSMesgQueue)>(rdram, ctx);
PTR(u8) bitpattern = _arg<1, PTR(u8)>(rdram, ctx);
PTR(OSContStatus) data = _arg<2, PTR(OSContStatus)>(rdram, ctx);
u8 bitpattern_local = 0;

s32 ret = osContInit(PASS_RDRAM mq, bitpattern, data);
s32 ret = osContInit(PASS_RDRAM mq, &bitpattern_local, data);

MEM_B(0, bitpattern) = bitpattern_local;

_return<s32>(ctx, ret);
}
Expand Down
1 change: 0 additions & 1 deletion librecomp/src/recomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,6 @@ bool wait_for_game_started(uint8_t* rdram, recomp_context* context) {

save_type = game_entry.save_type;
ultramodern::init_saving(rdram);
ultramodern::load_shader_cache(game_entry.cache_data);

try {
game_entry.entrypoint(rdram, context);
Expand Down
1 change: 0 additions & 1 deletion ultramodern/include/ultramodern/renderer_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ namespace ultramodern {
virtual void shutdown() = 0;
virtual uint32_t get_display_framerate() const = 0;
virtual float get_resolution_scale() const = 0;
virtual void load_shader_cache(std::span<const char> cache_binary) = 0;

protected:
SetupResult setup_result;
Expand Down
2 changes: 1 addition & 1 deletion ultramodern/include/ultramodern/ultra64.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ u32 osVirtualToPhysical(PTR(void) addr);

/* Controller interface */

s32 osContInit(RDRAM_ARG PTR(OSMesgQueue), PTR(u8), PTR(OSContStatus));
s32 osContInit(RDRAM_ARG PTR(OSMesgQueue), u8*, PTR(OSContStatus));
s32 osContReset(RDRAM_ARG PTR(OSMesgQueue), PTR(OSContStatus));
s32 osContStartQuery(RDRAM_ARG PTR(OSMesgQueue));
s32 osContStartReadData(RDRAM_ARG PTR(OSMesgQueue));
Expand Down
1 change: 0 additions & 1 deletion ultramodern/include/ultramodern/ultramodern.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ void sleep_until(const std::chrono::high_resolution_clock::time_point& time_poin
uint32_t get_target_framerate(uint32_t original);
uint32_t get_display_refresh_rate();
float get_resolution_scale();
void load_shader_cache(std::span<const char> cache_data);
void trigger_config_action();

// Audio
Expand Down
13 changes: 1 addition & 12 deletions ultramodern/src/events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ struct SwapBuffersAction {
struct UpdateConfigAction {
};

struct LoadShaderCacheAction {
std::span<const char> data;
};

using Action = std::variant<SpTaskAction, SwapBuffersAction, UpdateConfigAction, LoadShaderCacheAction>;
using Action = std::variant<SpTaskAction, SwapBuffersAction, UpdateConfigAction>;

static struct {
struct {
Expand Down Expand Up @@ -248,10 +244,6 @@ float ultramodern::get_resolution_scale() {
return resolution_scale.load();
}

void ultramodern::load_shader_cache(std::span<const char> cache_data) {
events_context.action_queue.enqueue(LoadShaderCacheAction{cache_data});
}

void ultramodern::trigger_config_action() {
events_context.action_queue.enqueue(UpdateConfigAction{});
}
Expand Down Expand Up @@ -321,9 +313,6 @@ void gfx_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_re
old_config = new_config;
}
}
else if (const auto* load_shader_cache_action = std::get_if<LoadShaderCacheAction>(&action)) {
renderer_context->load_shader_cache(load_shader_cache_action->data);
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions ultramodern/src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ static void __osContGetInitData(u8* pattern, OSContStatus *data) {
}
}

extern "C" s32 osContInit(RDRAM_ARG PTR(OSMesgQueue) mq, PTR(u8) bitpattern_, PTR(OSContStatus) data_) {
u8 *bitpattern = TO_PTR(u8, bitpattern_);
extern "C" s32 osContInit(RDRAM_ARG PTR(OSMesgQueue) mq, u8* bitpattern, PTR(OSContStatus) data_) {
OSContStatus *data = TO_PTR(OSContStatus, data_);

max_controllers = MAXCONTROLLERS;
Expand Down

0 comments on commit d5c81d0

Please sign in to comment.