Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions librecomp/src/ultra_translation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,21 @@ extern "C" void osGetCount_recomp(uint8_t * rdram, recomp_context * ctx) {
ctx->r2 = osGetCount();
}

extern "C" void osSetCount_recomp(uint8_t * rdram, recomp_context * ctx) {
osSetCount(ctx->r4);
}

extern "C" void osGetTime_recomp(uint8_t * rdram, recomp_context * ctx) {
uint64_t total_count = osGetTime();
ctx->r2 = (int32_t)(total_count >> 32);
ctx->r3 = (int32_t)(total_count >> 0);
}

extern "C" void osSetTime_recomp(uint8_t * rdram, recomp_context * ctx) {
uint64_t t = ((uint64_t)(ctx->r4) << 32) | ((ctx->r5) & 0xFFFFFFFFu);
osSetTime(t);
}

extern "C" void osSetTimer_recomp(uint8_t * rdram, recomp_context * ctx) {
uint64_t countdown = ((uint64_t)(ctx->r6) << 32) | ((ctx->r7) & 0xFFFFFFFFu);
uint64_t interval = load_doubleword(rdram, ctx->r29, 0x10);
Expand Down
19 changes: 18 additions & 1 deletion ultramodern/include/ultramodern/renderer_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ struct SDL_Window;

namespace ultramodern {
namespace renderer {
struct ViRegs {
unsigned int VI_STATUS_REG;
unsigned int VI_ORIGIN_REG;
unsigned int VI_WIDTH_REG;
unsigned int VI_INTR_REG;
unsigned int VI_V_CURRENT_LINE_REG;
unsigned int VI_TIMING_REG;
unsigned int VI_V_SYNC_REG;
unsigned int VI_H_SYNC_REG;
unsigned int VI_LEAP_REG;
unsigned int VI_H_START_REG;
unsigned int VI_V_START_REG;
unsigned int VI_V_BURST_REG;
unsigned int VI_X_SCALE_REG;
unsigned int VI_Y_SCALE_REG;
};
ViRegs* get_vi_regs();

#if defined(_WIN32)
// Native HWND handle to the target window.
Expand Down Expand Up @@ -67,7 +84,7 @@ namespace ultramodern {

virtual void enable_instant_present() = 0;
virtual void send_dl(const OSTask* task) = 0;
virtual void update_screen(uint32_t vi_origin) = 0;
virtual void update_screen() = 0;
virtual void shutdown() = 0;
virtual uint32_t get_display_framerate() const = 0;
virtual float get_resolution_scale() const = 0;
Expand Down
2 changes: 2 additions & 0 deletions ultramodern/include/ultramodern/ultra64.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,9 @@ void osViSetYScale(float scale);
PTR(void) osViGetNextFramebuffer();
PTR(void) osViGetCurrentFramebuffer();
u32 osGetCount();
void osSetCount(u32 count);
OSTime osGetTime();
void osSetTime(OSTime t);
int osSetTimer(RDRAM_ARG PTR(OSTimer) timer, OSTime countdown, OSTime interval, PTR(OSMesgQueue) mq, OSMesg msg);
int osStopTimer(RDRAM_ARG PTR(OSTimer) timer);
u32 osVirtualToPhysical(PTR(void) addr);
Expand Down
Loading
Loading