Skip to content

Commit

Permalink
[Video[ Make rdp.halt a bool
Browse files Browse the repository at this point in the history
  • Loading branch information
zilmar committed May 15, 2017
1 parent 14acae2 commit 4bd415a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
12 changes: 5 additions & 7 deletions Source/Project64-video/rdp.cpp
Expand Up @@ -645,7 +645,7 @@ EXPORT void CALL ProcessDList(void)
rdp.pc_i = 0;
rdp.pc[rdp.pc_i] = dlist_start;
rdp.dl_count = -1;
rdp.halt = 0;
rdp.halt = false;
uint32_t a;

// catches exceptions so that it doesn't freeze
Expand Down Expand Up @@ -724,7 +724,7 @@ EXPORT void CALL ProcessDList(void)
{
rdp.scale_x = rdp.scale_x_bak;
rdp.scale_y = rdp.scale_y_bak;
}
}

if (g_settings->hacks(CSettings::hack_OoT))
{
Expand All @@ -746,17 +746,15 @@ EXPORT void CALL ProcessDList(void)
CI_SET = FALSE;
}
WriteTrace(TraceRDP, TraceDebug, "ProcessDList end");
}
}

// undef - undefined instruction, always ignore
static void undef()
{
WriteTrace(TraceRDP, TraceWarning, "** undefined ** (%08lx) - IGNORED", rdp.cmd0);
#ifdef _ENDUSER_RELEASE_
*gfx.MI_INTR_REG |= 0x20;
gfx.CheckInterrupts();
rdp.halt = 1;
#endif
rdp.halt = true;
}

// spnoop - no operation, always ignore
Expand Down Expand Up @@ -3218,7 +3216,7 @@ void DetectFrameBufferUsage()
rdp.pc_i = 0;
rdp.pc[rdp.pc_i] = dlist_start;
rdp.dl_count = -1;
rdp.halt = 0;
rdp.halt = false;
rdp.scale_x_bak = rdp.scale_x;
rdp.scale_y_bak = rdp.scale_y;

Expand Down
5 changes: 2 additions & 3 deletions Source/Project64-video/rdp.h
Expand Up @@ -347,7 +347,7 @@ typedef struct

#define NUMTEXBUF 92

struct RDP_Base{
struct RDP_Base {
float vi_width;
float vi_height;

Expand Down Expand Up @@ -378,7 +378,7 @@ struct RDP_Base{
uint32_t segment[16]; // Segment pointer

// Marks the end of DList execution (done in uc?:enddl)
int halt;
bool halt;

// Next command
uint32_t cmd0;
Expand Down Expand Up @@ -700,4 +700,3 @@ extern int SwapOK;
// ** utility functions
void load_palette(uint32_t addr, uint16_t start, uint16_t count);
void setTBufTex(uint16_t t_mem, uint32_t cnt);

6 changes: 3 additions & 3 deletions Source/Project64-video/turbo3D.h
Expand Up @@ -44,7 +44,7 @@ struct t3dState {
uint32_t othermode1;
};

struct t3dTriN{
struct t3dTriN {
uint8_t flag, v2, v1, v0; /* flag is which one for flat shade */
};

Expand Down Expand Up @@ -215,7 +215,7 @@ static void Turbo3D()
WriteTrace(TraceRDP, TraceDebug, "Start Turbo3D microcode");
g_settings->SetUcode(CSettings::ucode_Fast3D);
uint32_t a = 0, pgstate = 0, pstate = 0, pvtx = 0, ptri = 0;
do
do
{
a = rdp.pc[rdp.pc_i] & BMASK;
pgstate = ((uint32_t*)gfx.RDRAM)[a >> 2];
Expand All @@ -225,7 +225,7 @@ static void Turbo3D()
WriteTrace(TraceRDP, TraceDebug, "GlobalState: %08lx, Object: %08lx, Vertices: %08lx, Triangles: %08lx", pgstate, pstate, pvtx, ptri);
if (!pstate)
{
rdp.halt = 1;
rdp.halt = true;
break;
}
if (pgstate)
Expand Down
2 changes: 1 addition & 1 deletion Source/Project64-video/ucode00.h
Expand Up @@ -525,7 +525,7 @@ static void uc0_enddl()
WriteTrace(TraceRDP, TraceDebug, "RDP end");

// Halt execution here
rdp.halt = 1;
rdp.halt = true;
}

rdp.pc_i--;
Expand Down
4 changes: 3 additions & 1 deletion Source/Project64-video/ucodeFB.h
Expand Up @@ -411,7 +411,9 @@ static void fb_setcolorimage()
}
rdp.ci_count++;
if (rdp.ci_count > NUMTEXBUF) //overflow
rdp.halt = 1;
{
rdp.halt = true;
}
}

// RDP graphic instructions pointer table used in DetectFrameBufferUsage
Expand Down

0 comments on commit 4bd415a

Please sign in to comment.