Fixed a texture warping issue.

Fixed some compiler warnings.
Fixed assigning no controller.
This commit is contained in:
Extrems 2021-08-17 21:59:21 -04:00
parent d7ca5e913f
commit 1cfbaa363e
11 changed files with 24 additions and 15 deletions

View file

@ -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

View file

@ -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"

View file

@ -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);

View file

@ -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 );

View file

@ -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);
@ -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);
@ -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);
@ -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);

View file

@ -22,6 +22,7 @@
#include <ogc/lwp_heap.h>
#include <ogc/cache.h>
#include <stdlib.h>
#include <malloc.h>
#include "../gc_memory/MEM2.h"

View file

@ -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

View file

@ -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>
@ -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"

View file

@ -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"

View file

@ -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"
@ -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");
@ -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))

View file

@ -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);