Skip to content

Commit d5c81d0

Browse files
authored
Fixed bitpattern pointer for osContInit and removed shader cache functionality (#69)
1 parent ef6e84c commit d5c81d0

File tree

7 files changed

+7
-19
lines changed

7 files changed

+7
-19
lines changed

librecomp/src/cont.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ extern "C" void osContInit_recomp(uint8_t* rdram, recomp_context* ctx) {
1616
PTR(OSMesgQueue) mq = _arg<0, PTR(OSMesgQueue)>(rdram, ctx);
1717
PTR(u8) bitpattern = _arg<1, PTR(u8)>(rdram, ctx);
1818
PTR(OSContStatus) data = _arg<2, PTR(OSContStatus)>(rdram, ctx);
19+
u8 bitpattern_local = 0;
1920

20-
s32 ret = osContInit(PASS_RDRAM mq, bitpattern, data);
21+
s32 ret = osContInit(PASS_RDRAM mq, &bitpattern_local, data);
22+
23+
MEM_B(0, bitpattern) = bitpattern_local;
2124

2225
_return<s32>(ctx, ret);
2326
}

librecomp/src/recomp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ bool wait_for_game_started(uint8_t* rdram, recomp_context* context) {
551551

552552
save_type = game_entry.save_type;
553553
ultramodern::init_saving(rdram);
554-
ultramodern::load_shader_cache(game_entry.cache_data);
555554

556555
try {
557556
game_entry.entrypoint(rdram, context);

ultramodern/include/ultramodern/renderer_context.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ namespace ultramodern {
7272
virtual void shutdown() = 0;
7373
virtual uint32_t get_display_framerate() const = 0;
7474
virtual float get_resolution_scale() const = 0;
75-
virtual void load_shader_cache(std::span<const char> cache_binary) = 0;
7675

7776
protected:
7877
SetupResult setup_result;

ultramodern/include/ultramodern/ultra64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ u32 osVirtualToPhysical(PTR(void) addr);
297297

298298
/* Controller interface */
299299

300-
s32 osContInit(RDRAM_ARG PTR(OSMesgQueue), PTR(u8), PTR(OSContStatus));
300+
s32 osContInit(RDRAM_ARG PTR(OSMesgQueue), u8*, PTR(OSContStatus));
301301
s32 osContReset(RDRAM_ARG PTR(OSMesgQueue), PTR(OSContStatus));
302302
s32 osContStartQuery(RDRAM_ARG PTR(OSMesgQueue));
303303
s32 osContStartReadData(RDRAM_ARG PTR(OSMesgQueue));

ultramodern/include/ultramodern/ultramodern.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ void sleep_until(const std::chrono::high_resolution_clock::time_point& time_poin
8585
uint32_t get_target_framerate(uint32_t original);
8686
uint32_t get_display_refresh_rate();
8787
float get_resolution_scale();
88-
void load_shader_cache(std::span<const char> cache_data);
8988
void trigger_config_action();
9089

9190
// Audio

ultramodern/src/events.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ struct SwapBuffersAction {
3434
struct UpdateConfigAction {
3535
};
3636

37-
struct LoadShaderCacheAction {
38-
std::span<const char> data;
39-
};
40-
41-
using Action = std::variant<SpTaskAction, SwapBuffersAction, UpdateConfigAction, LoadShaderCacheAction>;
37+
using Action = std::variant<SpTaskAction, SwapBuffersAction, UpdateConfigAction>;
4238

4339
static struct {
4440
struct {
@@ -248,10 +244,6 @@ float ultramodern::get_resolution_scale() {
248244
return resolution_scale.load();
249245
}
250246

251-
void ultramodern::load_shader_cache(std::span<const char> cache_data) {
252-
events_context.action_queue.enqueue(LoadShaderCacheAction{cache_data});
253-
}
254-
255247
void ultramodern::trigger_config_action() {
256248
events_context.action_queue.enqueue(UpdateConfigAction{});
257249
}
@@ -321,9 +313,6 @@ void gfx_thread_func(uint8_t* rdram, moodycamel::LightweightSemaphore* thread_re
321313
old_config = new_config;
322314
}
323315
}
324-
else if (const auto* load_shader_cache_action = std::get_if<LoadShaderCacheAction>(&action)) {
325-
renderer_context->load_shader_cache(load_shader_cache_action->data);
326-
}
327316
}
328317
}
329318

ultramodern/src/input.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ static void __osContGetInitData(u8* pattern, OSContStatus *data) {
8282
}
8383
}
8484

85-
extern "C" s32 osContInit(RDRAM_ARG PTR(OSMesgQueue) mq, PTR(u8) bitpattern_, PTR(OSContStatus) data_) {
86-
u8 *bitpattern = TO_PTR(u8, bitpattern_);
85+
extern "C" s32 osContInit(RDRAM_ARG PTR(OSMesgQueue) mq, u8* bitpattern, PTR(OSContStatus) data_) {
8786
OSContStatus *data = TO_PTR(OSContStatus, data_);
8887

8988
max_controllers = MAXCONTROLLERS;

0 commit comments

Comments
 (0)