mirror of
https://github.com/N64Recomp/N64ModernRuntime.git
synced 2026-05-10 19:01:53 +00:00
Implement osViRepeatLine
This commit is contained in:
parent
93fab7ecc4
commit
cd933edd68
3 changed files with 30 additions and 5 deletions
|
|
@ -17,6 +17,10 @@ extern "C" void osViBlack_recomp(uint8_t* rdram, recomp_context* ctx) {
|
|||
osViBlack((uint32_t)ctx->r4);
|
||||
}
|
||||
|
||||
extern "C" void osViRepeatLine_recomp(uint8_t* rdram, recomp_context* ctx) {
|
||||
osViRepeatLine((uint32_t)ctx->r4);
|
||||
}
|
||||
|
||||
extern "C" void osViSetSpecialFeatures_recomp(uint8_t* rdram, recomp_context* ctx) {
|
||||
osViSetSpecialFeatures((uint32_t)ctx->r4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -284,6 +284,7 @@ void osViSwapBuffer(RDRAM_ARG PTR(void) frameBufPtr);
|
|||
void osViSetMode(RDRAM_ARG PTR(OSViMode));
|
||||
void osViSetSpecialFeatures(uint32_t func);
|
||||
void osViBlack(uint8_t active);
|
||||
void osViRepeatLine(uint8_t active);
|
||||
void osViSetXScale(float scale);
|
||||
void osViSetYScale(float scale);
|
||||
PTR(void) osViGetNextFramebuffer();
|
||||
|
|
|
|||
|
|
@ -345,9 +345,12 @@ extern unsigned int VI_V_BURST_REG;
|
|||
extern unsigned int VI_X_SCALE_REG;
|
||||
extern unsigned int VI_Y_SCALE_REG;
|
||||
|
||||
#define VI_STATE_BLACK 0x20
|
||||
#define VI_STATE_REPEATLINE 0x40
|
||||
|
||||
uint32_t hstart = 0;
|
||||
uint32_t vi_origin_offset = 320 * sizeof(uint16_t);
|
||||
bool vi_black = false;
|
||||
uint16_t state = 0;
|
||||
|
||||
void set_dummy_vi() {
|
||||
VI_STATUS_REG = 0x311E;
|
||||
|
|
@ -366,11 +369,16 @@ void set_dummy_vi() {
|
|||
}
|
||||
|
||||
extern "C" void osViSwapBuffer(RDRAM_ARG PTR(void) frameBufPtr) {
|
||||
if (vi_black) {
|
||||
VI_H_START_REG = hstart;
|
||||
if (state & VI_STATE_BLACK) {
|
||||
VI_H_START_REG = 0;
|
||||
} else {
|
||||
VI_H_START_REG = hstart;
|
||||
}
|
||||
|
||||
if (state & VI_STATE_REPEATLINE) {
|
||||
VI_Y_SCALE_REG = 0;
|
||||
VI_ORIGIN_REG = osVirtualToPhysical(frameBufPtr);
|
||||
}
|
||||
|
||||
events_context.vi.next_buffer = frameBufPtr;
|
||||
events_context.action_queue.enqueue(SwapBuffersAction{ osVirtualToPhysical(frameBufPtr) + vi_origin_offset });
|
||||
}
|
||||
|
|
@ -457,7 +465,19 @@ extern "C" void osViSetSpecialFeatures(uint32_t func) {
|
|||
}
|
||||
|
||||
extern "C" void osViBlack(uint8_t active) {
|
||||
vi_black = active;
|
||||
if (active) {
|
||||
state |= VI_STATE_BLACK;
|
||||
} else {
|
||||
state &= ~VI_STATE_BLACK;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void osViRepeatLine(uint8_t active) {
|
||||
if (active) {
|
||||
state |= VI_STATE_REPEATLINE;
|
||||
} else {
|
||||
state &= ~VI_STATE_REPEATLINE;
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" void osViSetXScale(float scale) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue