Skip to content

Commit

Permalink
Fixed a texture warping issue.
Browse files Browse the repository at this point in the history
Fixed some compiler warnings.
Fixed assigning no controller.
  • Loading branch information
Extrems committed Aug 18, 2021
1 parent d7ca5e9 commit 1cfbaa3
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion fileBrowser/fileBrowser-CARD.c
Expand Up @@ -139,7 +139,7 @@ int fileBrowser_CARD_writeFile(fileBrowser_file* file, void* buffer, unsigned in
CardStat.banner_fmt = 0;
CardStat.icon_addr = 0x40;
tmpBuffer = memalign(32,newLength);
memset(tmpBuffer,0,sizeof(tmpBuffer));
memset(tmpBuffer,0,newLength);
strcpy(tmpBuffer,ctime (&gc_time));
strcpy(tmpBuffer+0x20,file->name);
memcpy(tmpBuffer+0x40,CARDIcon,sizeof(CARDIcon)); // copy icon
Expand Down
1 change: 1 addition & 0 deletions fileBrowser/fileBrowser-libfat.c
Expand Up @@ -26,6 +26,7 @@
#include <fat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/dir.h>
#include "fileBrowser.h"
Expand Down
2 changes: 1 addition & 1 deletion glN64_GX/OpenGL.cpp
Expand Up @@ -807,7 +807,7 @@ void OGL_UpdateStates()
(int)((gDP.scissor.lrx - gDP.scissor.ulx) * OGL.scaleX), (int)((gDP.scissor.lry - gDP.scissor.uly) * OGL.scaleY) );
}
#else // !__GX__
if ((gDP.changed & CHANGED_SCISSOR) || (gSP.changed & CHANGED_VIEWPORT))
if (gDP.changed & CHANGED_SCISSOR)
{
float ulx = max(OGL.GXorigX + gDP.scissor.ulx * OGL.GXscaleX, 0);
float uly = max(OGL.GXorigY + gDP.scissor.uly * OGL.GXscaleY, 0);
Expand Down
4 changes: 2 additions & 2 deletions glN64_GX/gSP.cpp
Expand Up @@ -1267,8 +1267,8 @@ void gSPModifyVertex( u32 vtx, u32 where, u32 val )
#endif
break;
case G_MWO_POINT_ST:
gSP.vertices[vtx].s = _FIXED2FLOAT( (s16)_SHIFTR( val, 16, 16 ), 5 );
gSP.vertices[vtx].t = _FIXED2FLOAT( (s16)_SHIFTR( val, 0, 16 ), 5 );
gSP.vertices[vtx].s = _FIXED2FLOAT( (s16)_SHIFTR( val, 16, 16 ), 5 ) / gSP.texture.scales;
gSP.vertices[vtx].t = _FIXED2FLOAT( (s16)_SHIFTR( val, 0, 16 ), 5 ) / gSP.texture.scalet;
#ifdef DEBUG
DebugMsg( DEBUG_HIGH | DEBUG_HANDLED, "gSPModifyVertex( %i, %s, 0x%08X );\n",
vtx, MWOPointText[(where - 0x10) >> 2], val );
Expand Down
16 changes: 8 additions & 8 deletions menu/ConfigureInputFrame.cpp
Expand Up @@ -243,9 +243,9 @@ void Func_TogglePad0Type()
{
int i = PADASSIGN_INPUT0;
#ifdef HW_RVL
padType[i] = (padType[i]+1) %3;
padType[i] = (padType[i]==PADTYPE_WII) ? PADTYPE_NONE : padType[i]+1;
#else
padType[i] = (padType[i]+1) %2;
padType[i] = (padType[i]==PADTYPE_GAMECUBE) ? PADTYPE_NONE : padType[i]+1;
#endif

Func_AssignPad(i);
Expand All @@ -257,9 +257,9 @@ void Func_TogglePad1Type()
{
int i = PADASSIGN_INPUT1;
#ifdef HW_RVL
padType[i] = (padType[i]+1) %3;
padType[i] = (padType[i]==PADTYPE_WII) ? PADTYPE_NONE : padType[i]+1;
#else
padType[i] = (padType[i]+1) %2;
padType[i] = (padType[i]==PADTYPE_GAMECUBE) ? PADTYPE_NONE : padType[i]+1;
#endif

Func_AssignPad(i);
Expand All @@ -271,9 +271,9 @@ void Func_TogglePad2Type()
{
int i = PADASSIGN_INPUT2;
#ifdef HW_RVL
padType[i] = (padType[i]+1) %3;
padType[i] = (padType[i]==PADTYPE_WII) ? PADTYPE_NONE : padType[i]+1;
#else
padType[i] = (padType[i]+1) %2;
padType[i] = (padType[i]==PADTYPE_GAMECUBE) ? PADTYPE_NONE : padType[i]+1;
#endif

Func_AssignPad(i);
Expand All @@ -285,9 +285,9 @@ void Func_TogglePad3Type()
{
int i = PADASSIGN_INPUT3;
#ifdef HW_RVL
padType[i] = (padType[i]+1) %3;
padType[i] = (padType[i]==PADTYPE_WII) ? PADTYPE_NONE : padType[i]+1;
#else
padType[i] = (padType[i]+1) %2;
padType[i] = (padType[i]==PADTYPE_GAMECUBE) ? PADTYPE_NONE : padType[i]+1;
#endif

Func_AssignPad(i);
Expand Down
1 change: 1 addition & 0 deletions r4300/Recomp-Cache-Heap.c
Expand Up @@ -22,6 +22,7 @@


#include <ogc/lwp_heap.h>
#include <ogc/cache.h>
#include <stdlib.h>
#include <malloc.h>
#include "../gc_memory/MEM2.h"
Expand Down
3 changes: 3 additions & 0 deletions r4300/Recomp-Cache.h
Expand Up @@ -41,6 +41,9 @@ void RecompCache_Free(unsigned int addr);
// Update the LRU info of the indicated block
// (call when the block is accessed)
void RecompCache_Update(PowerPC_func* func);
void RecompCache_Link(PowerPC_func* src_func, PowerPC_instr* src_instr,
PowerPC_func* dst_func, PowerPC_instr* dst_instr);
void RecompCache_Init(void);

// Allocate memory from the meta cache
// This will free from both the recomp and meta caches if capacity is hit
Expand Down
2 changes: 2 additions & 0 deletions r4300/ppc/Recompile.c
Expand Up @@ -27,6 +27,7 @@
If it's possible, only use the blocks physical addresses (saves space)
*/

#include <ogc/cache.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
Expand All @@ -36,6 +37,7 @@
#include "../interupt.h"
#include "Recompile.h"
#include "../Recomp-Cache.h"
#include "Register-Cache.h"
#include "Wrappers.h"
#include "../ARAM-blocks.h"

Expand Down
1 change: 1 addition & 0 deletions r4300/ppc/Recompile.h
Expand Up @@ -103,6 +103,7 @@ void clear_freed_funcs(void);
PowerPC_func* recompile_block(PowerPC_block* ppc_block, unsigned int addr);
void init_block (PowerPC_block* ppc_block);
void deinit_block(PowerPC_block* ppc_block);
void invalidate_block(PowerPC_block* ppc_block);

#ifdef HW_RVL
#include "../../gc_memory/MEM2.h"
Expand Down
6 changes: 3 additions & 3 deletions r4300/ppc/Wrappers.c
Expand Up @@ -26,6 +26,7 @@
#include "../ARAM-blocks.h"
#include "../../gc_memory/memory.h"
#include "../interupt.h"
#include "../exception.h"
#include "../r4300.h"
#include "../macros.h"
#include "../Recomp-Cache.h"
Expand All @@ -51,7 +52,7 @@ static PowerPC_func* last_func;
* $sp | old sp
*/

inline unsigned int dyna_run(PowerPC_func* func, unsigned int (*code)(void)){
inline unsigned int dyna_run(PowerPC_func* func, PowerPC_instr* code){
PowerPC_instr* return_addr;

register void* r3 __asm__("r3");
Expand Down Expand Up @@ -134,8 +135,7 @@ void dynarec(unsigned int address){
int index = (address - func->start_addr)>>2;

// Recompute the block offset
unsigned int (*code)(void);
code = (unsigned int (*)(void))func->code_addr[index];
PowerPC_instr* code = func->code_addr[index];

// Create a link if possible
if(link_branch && !func_was_freed(last_func))
Expand Down
1 change: 1 addition & 0 deletions r4300/ppc/Wrappers.h
Expand Up @@ -50,6 +50,7 @@ typedef enum { MEM_LW, MEM_LH, MEM_LB, MEM_LD,
MEM_SWC1, MEM_SDC1, MEM_SC,
MEM_SWL, MEM_SWR, MEM_SDL, MEM_SDR } memType;

void dynarec(unsigned int address);
unsigned int decodeNInterpret(MIPS_instr, unsigned int, int);
#ifdef COMPARE_CORE
int dyna_update_count(unsigned int pc, int isDelaySlot);
Expand Down

0 comments on commit 1cfbaa3

Please sign in to comment.