Merge remote-tracking branch 'refs/remotes/project64/master'

This commit is contained in:
purplemarshmallow 2016-03-09 19:58:40 +01:00
commit bb5f54dfc2
13 changed files with 173 additions and 83 deletions

View File

@ -1,4 +1,4 @@
// ============ RDB for PJ64 v2.2. GoodN64 v321 =====================================
// ============ RDB for PJ64 v2.2. GoodN64 v321 =====================================
// PJ64 v2.2 Official RDB
// Not for use with PJ64 v1.6 or previous
//---- START OF RDB FILE HEADER ---------------------------------------------------------
@ -5318,6 +5318,7 @@ Good Name=Star Wars - Shadows of the Empire (E)
Internal Name=Shadow of the Empire
Status=Compatible
Core Note=Swoop bike speed issue
Linking=Off
RDRAM Size=8
[264D7E5C-18874622-C:45]
@ -5548,6 +5549,7 @@ ViRefresh=2200
Good Name=Super Smash Bros. (E) (M3)
Internal Name=SMASH BROTHERS
Status=Compatible
Counter Factor=1
Culling=1
SMM-Cache=0
SMM-FUNC=0

View File

@ -454,7 +454,7 @@ void ConfigNotebook::set_properties()
cbxVRAM->SetToolTip("Autodetect VRAM Size:\nSince OpenGL cannot do this reliably at the moment, the option to set this manually is available.\nIf checked, plugin will try to autodetect VRAM size.\nBut if this appears wrong, please uncheck and set it to correct value.\n[Recommended: on]");
spinVRAM->SetMinSize(wxSize(55, 21));
cbxFBO->SetToolTip("Use frame buffer objects:\nChanges the way FB effects are rendered - with or without usage of the OpenGL Frame Buffer Objects (FBO) extension.\nThe choice depends on game and your video card. FBO off is good for NVIDIA cards, while for ATI cards, it's usually best that FBOs are turned on.\nAlso, some FB effects works only with one of the methods, no matter, which card you have.\nOn the whole, with FBO off, compatibility/ accuracy is a bit better (which is the case for Resident Evil 2).\nHowever, with FBO on with some systems, it can actually be a bit faster in cases.\n[Recommended: video card and game dependant]");
FxI32 size = 0;
int32_t size = 0;
char ** aRes = grQueryResolutionsExt(&size);
if (aRes && size)
{

View File

@ -46,7 +46,7 @@ typedef FxU32 GrCombineMode_t;
//wrapper specific
FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxI32, FxBool, FxBool);
FX_ENTRY GrScreenResolution_t FX_CALL grWrapperFullScreenResolutionExt(FxU32*, FxU32*);
FX_ENTRY char ** FX_CALL grQueryResolutionsExt(FxI32*);
FX_ENTRY char ** FX_CALL grQueryResolutionsExt(int32_t*);
FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key);
FX_ENTRY void FX_CALL grGetGammaTableExt(FxU32, FxU32*, FxU32*, FxU32*);

View File

@ -4097,54 +4097,98 @@ void CALL ProcessRDPList(void)
#endif
WriteTrace(TraceGlide64, TraceDebug, "-");
uint32_t i;
uint32_t cmd, length, cmd_length;
rdp_cmd_ptr = 0;
rdp_cmd_cur = 0;
no_dlist = false;
update_screen_count = 0;
ChangeSize();
// Switch to fullscreen?
if (to_fullscreen)
GoToFullScreen();
//* Set states *//
if (g_settings->swapmode > 0)
SwapOK = TRUE;
rdp.updatescreen = 1;
rdp.tri_n = 0; // 0 triangles so far this frame
rdp.debug_n = 0;
rdp.model_i = 0; // 0 matrices so far in stack
//stack_size can be less then 32! Important for Silicon Vally. Thanks Orkin!
rdp.model_stack_size = minval(32, (*(uint32_t*)(gfx.DMEM + 0x0FE4)) >> 6);
if (rdp.model_stack_size == 0)
rdp.model_stack_size = 32;
rdp.Persp_en = TRUE;
rdp.fb_drawn = rdp.fb_drawn_front = FALSE;
rdp.update = 0x7FFFFFFF; // All but clear cache
rdp.geom_mode = 0;
rdp.acmp = 0;
rdp.maincimg[1] = rdp.maincimg[0];
rdp.skip_drawing = FALSE;
rdp.s2dex_tex_loaded = FALSE;
rdp.bg_image_height = 0xFFFF;
fbreads_front = fbreads_back = 0;
rdp.fog_multiplier = rdp.fog_offset = 0;
rdp.zsrc = 0;
if (rdp.vi_org_reg != *gfx.VI_ORIGIN_REG)
rdp.tlut_mode = 0; //is it correct?
rdp.scissor_set = FALSE;
ucode5_texshiftaddr = ucode5_texshiftcount = 0;
cpu_fb_write = FALSE;
cpu_fb_read_called = FALSE;
cpu_fb_write_called = FALSE;
cpu_fb_ignore = FALSE;
d_ul_x = 0xffff;
d_ul_y = 0xffff;
d_lr_x = 0;
d_lr_y = 0;
depth_buffer_fog = TRUE;
const uint32_t length = dp_end - dp_current;
dp_status &= ~0x0002;
if (dp_end <= dp_current) return;
length = dp_end - dp_current;
rdp.LLE = TRUE;
// load command data
for (i = 0; i < length; i += 4)
for (uint32_t i = 0; i < length; i += 4)
{
rdp_cmd_data[rdp_cmd_ptr++] = READ_RDP_DATA(dp_current + i);
if (rdp_cmd_ptr >= 0x1000)
{
WriteTrace(TraceRDP, TraceDebug, "rdp_process_list: rdp_cmd_ptr overflow %x %x --> %x", length, dp_current, dp_end);
}
rdp_cmd_data[rdp_cmd_ptr] = READ_RDP_DATA(dp_current + i);
rdp_cmd_ptr = (rdp_cmd_ptr + 1) & maxCMDMask;
}
dp_current = dp_end;
bool setZero = true;
cmd = (rdp_cmd_data[0] >> 24) & 0x3f;
cmd_length = (rdp_cmd_ptr + 1) * 4;
while (rdp_cmd_cur != rdp_cmd_ptr) {
uint32_t cmd = (rdp_cmd_data[rdp_cmd_cur] >> 24) & 0x3f;
// check if more data is needed
if (cmd_length < rdp_command_length[cmd])
return;
rdp.LLE = TRUE;
while (rdp_cmd_cur < rdp_cmd_ptr)
{
cmd = (rdp_cmd_data[rdp_cmd_cur] >> 24) & 0x3f;
if ((((rdp_cmd_ptr - rdp_cmd_cur)&maxCMDMask) * 4) < rdp_command_length[cmd]) {
setZero = false;
break;
}
if (((rdp_cmd_ptr - rdp_cmd_cur) * 4) < rdp_command_length[cmd])
return;
if (rdp_cmd_cur + rdp_command_length[cmd] / 4 > MAXCMD)
::memcpy(rdp_cmd_data + MAXCMD, rdp_cmd_data, rdp_command_length[cmd] - (MAXCMD - rdp_cmd_cur) * 4);
// execute the command
rdp.cmd0 = rdp_cmd_data[rdp_cmd_cur + 0];
rdp.cmd1 = rdp_cmd_data[rdp_cmd_cur + 1];
rdp.cmd2 = rdp_cmd_data[rdp_cmd_cur + 2];
rdp.cmd3 = rdp_cmd_data[rdp_cmd_cur + 3];
//RSP.cmd = cmd;
rdp_command_table[cmd]();
rdp_cmd_cur += rdp_command_length[cmd] / 4;
};
rdp_cmd_cur = (rdp_cmd_cur + rdp_command_length[cmd] / 4) & maxCMDMask;
}
if (setZero) {
rdp_cmd_ptr = 0;
rdp_cmd_cur = 0;
}
rdp.LLE = FALSE;
dp_start = dp_end;
dp_status &= ~0x0002;
//}
dp_start = dp_current = dp_end;
}

View File

@ -58,6 +58,9 @@ extern uint32_t frame_count; // frame counter
#define MAX_TMU 2
#define MAXCMD 0x100000
const unsigned int maxCMDMask = MAXCMD - 1;
#define TEXMEM_2MB_EDGE 2097152
// Supported flags

View File

@ -88,13 +88,13 @@ public:
}
}
char ** getResolutionsList(FxI32 * Size)
char ** getResolutionsList(int32_t * Size)
{
if (dwNumResolutions == 0)
{
init();
}
*Size = (FxI32)dwNumResolutions;
*Size = (int32_t)dwNumResolutions;
return aResolutionsStr;
}
@ -1369,7 +1369,7 @@ grSstWinClose(GrContext_t context)
wglMakeCurrent(hDC, NULL);
wglDeleteContext(hGLRC);
hGLRC = NULL;
}
}
if (fullscreen)
{
ChangeDisplaySettings(NULL, 0);
@ -1388,7 +1388,7 @@ grSstWinClose(GrContext_t context)
m_pScreen = NULL;
#endif
return FXTRUE;
}
}
FX_ENTRY void FX_CALL grTextureBufferExt(GrChipID_t tmu,
FxU32 startAddress,
@ -2393,7 +2393,7 @@ GrLfbInfo_t *info)
grDisplayGLError("grLfbLock");
return FXTRUE;
}
}
FX_ENTRY FxBool FX_CALL
grLfbUnlock(GrLock_t type, GrBuffer_t buffer)
@ -2630,12 +2630,12 @@ FxI32 src_stride, void *src_data)
grDisplayGLError("grLfbWriteRegion");
return FXTRUE;
}
}
/* wrapper-specific glide extensions */
FX_ENTRY char ** FX_CALL
grQueryResolutionsExt(FxI32 * Size)
grQueryResolutionsExt(int32_t * Size)
{
WriteTrace(TraceGlitch, TraceDebug, "-");
return g_FullScreenResolutions.getResolutionsList(Size);
@ -2952,7 +2952,7 @@ static void CorrectGamma(const FxU16 aGammaRamp[3][256])
res = SDL_SetGammaRamp(aGammaRamp[0], aGammaRamp[1], aGammaRamp[2]);
WriteTrace(TraceGlitch, TraceDebug, "SDL_SetGammaRamp returned %d\r\n", res);
}
}
#endif
FX_ENTRY void FX_CALL
@ -2995,7 +2995,7 @@ grGetGammaTableExt(FxU32 /*nentries*/, FxU32 *red, FxU32 *green, FxU32 *blue)
blue[i] = aGammaRamp[2][i] >> 8;
}
}
}
}
FX_ENTRY void FX_CALL
guGammaCorrectionRGB(FxFloat gammaR, FxFloat gammaG, FxFloat gammaB)
@ -3108,7 +3108,7 @@ void dump_start()
init = 1;
ilInit();
ilEnable(IL_FILE_OVERWRITE);
}
}
dumping = 1;
tl_i = 0;
}

View File

@ -159,7 +159,7 @@ void set_copy_shader();
//FX_ENTRY void FX_CALL grConfigWrapperExt(HINSTANCE instance, HWND hwnd);
FX_ENTRY void FX_CALL grConfigWrapperExt(FxI32, FxI32, FxBool, FxBool);
FX_ENTRY GrScreenResolution_t FX_CALL grWrapperFullScreenResolutionExt(FxU32*, FxU32*);
FX_ENTRY char ** FX_CALL grQueryResolutionsExt(FxI32*);
FX_ENTRY char ** FX_CALL grQueryResolutionsExt(int32_t*);
FX_ENTRY FxBool FX_CALL grKeyPressedExt(FxU32 key);
FX_ENTRY void FX_CALL grGetGammaTableExt(FxU32, FxU32*, FxU32*, FxU32*);

View File

@ -138,7 +138,6 @@
<ClInclude Include="N64System\Mips\Eeprom.h" />
<ClInclude Include="N64System\Mips\FlashRam.h" />
<ClInclude Include="N64System\Mips\GBCart.h" />
<ClInclude Include="N64System\Mips\MemoryClass.h" />
<ClInclude Include="N64System\Mips\MemoryVirtualMem.h" />
<ClInclude Include="N64System\Mips\Mempak.h" />
<ClInclude Include="N64System\Mips\OpCode.h" />

View File

@ -524,9 +524,6 @@
<ClInclude Include="N64System\Mips\FlashRam.h">
<Filter>Header Files\N64 System\Mips</Filter>
</ClInclude>
<ClInclude Include="N64System\Mips\MemoryClass.h">
<Filter>Header Files\N64 System\Mips</Filter>
</ClInclude>
<ClInclude Include="N64System\Mips\MemoryVirtualMem.h">
<Filter>Header Files\N64 System\Mips</Filter>
</ClInclude>

View File

@ -91,7 +91,6 @@
<ClInclude Include="N64System\Debugger\Debugger-ViewMemory.h" />
<ClInclude Include="N64System\Debugger\debugger.h" />
<ClInclude Include="N64System\Debugger\DebuggerUI.h" />
<ClInclude Include="N64System\RomInformationClass.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="Support.h" />
<ClInclude Include="UserInterface.h" />

View File

@ -164,9 +164,6 @@
<ClInclude Include="Multilanguage\LanguageSelector.h">
<Filter>Header Files\Multilanguage Headers</Filter>
</ClInclude>
<ClInclude Include="N64System\RomInformationClass.h">
<Filter>Header Files\N64 System Headers</Filter>
</ClInclude>
<ClInclude Include="N64System\Debugger\DebugDialog.h">
<Filter>Header Files\N64 System Headers\Debugger Headers</Filter>
</ClInclude>

View File

@ -170,6 +170,54 @@ void RegisterSetting(short SettingID, SETTING_DATA_TYPE Type, const char * Name,
}
}
void RegisterSetting2(short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category, short DefaultID)
{
SettingLocation Location = (SettingLocation)g_PluginSettings.DefaultLocation;
char FullCategory[400];
if (Category && Category[0] != 0)
{
_snprintf(FullCategory, sizeof(FullCategory), "%s\\%s", g_PluginSettingName, Category);
}
else
{
_snprintf(FullCategory, sizeof(FullCategory), "%s", g_PluginSettingName);
}
switch (Type)
{
case Data_DWORD_Game:
case Data_String_Game:
Location = SettingType_GameSetting;
break;
case Data_DWORD_RDB:
case Data_String_RDB:
Location = SettingType_RomDatabase;
break;
case Data_DWORD_RDB_Setting:
case Data_String_RDB_Setting:
Location = SettingType_RdbSetting;
break;
}
switch (Type)
{
case Data_DWORD_Game:
case Data_DWORD_General:
case Data_DWORD_RDB:
case Data_DWORD_RDB_Setting:
g_PluginSettings.RegisterSetting(g_PluginSettings.handle, SettingID + g_PluginSettings.SettingStartRange,
DefaultID + g_PluginSettings.SettingStartRange, Data_DWORD, Location, FullCategory, Name, 0);
break;
case Data_String_General:
case Data_String_Game:
case Data_String_RDB:
case Data_String_RDB_Setting:
g_PluginSettings.RegisterSetting(g_PluginSettings.handle, SettingID + g_PluginSettings.SettingStartRange,
DefaultID + g_PluginSettings.SettingStartRange, Data_String, Location, FullCategory, Name, 0);
break;
}
}
short FindSystemSettingId(const char * Name)
{
if (g_PluginSettings2.FindSystemSettingId && g_PluginSettings.handle)
@ -223,4 +271,4 @@ void SetSetting(short SettingID, unsigned int Value)
void SetSettingSz(short SettingID, const char * Value)
{
g_PluginSettings.SetSettingSz(g_PluginSettings.handle, SettingID + g_PluginSettings.SettingStartRange, Value);
}
}

View File

@ -4,41 +4,42 @@
extern "C" {
#endif
// Get Plugin Settings, take a setting id
unsigned int GetSetting ( short SettingID );
const char * GetSettingSz ( short SettingID, char * Buffer, int BufferLen );
// Get Plugin Settings, take a setting id
unsigned int GetSetting(short SettingID);
const char * GetSettingSz(short SettingID, char * Buffer, int BufferLen);
// Get System Settings, take a setting returned by FindSystemSettingId
unsigned int GetSystemSetting ( short SettingID );
const char * GetSystemSettingSz( short SettingID, char * Buffer, int BufferLen );
// Get System Settings, take a setting returned by FindSystemSettingId
unsigned int GetSystemSetting(short SettingID);
const char * GetSystemSettingSz(short SettingID, char * Buffer, int BufferLen);
// Set a settings value
void SetSetting ( short SettingID, unsigned int Value );
void SetSettingSz ( short SettingID, const char * Value );
// Set a settings value
void SetSetting(short SettingID, unsigned int Value);
void SetSettingSz(short SettingID, const char * Value);
// enum's
enum SETTING_DATA_TYPE
{
Data_DWORD_General = 0, // A unsigned int setting used anywhere
Data_String_General = 1, // A string setting used anywhere
Data_DWORD_Game = 2, // A unsigned int associated with the current game
Data_String_Game = 3, // A string associated with the current game
Data_DWORD_RDB = 4, // A unsigned int associated with the current game in the rom database
Data_String_RDB = 5, // A string associated with the current game in the rom database
Data_DWORD_RDB_Setting = 6, // A unsigned int read from the rom database, with config file
Data_String_RDB_Setting = 7, // A string read from the rom database, with config file
};
// enum's
enum SETTING_DATA_TYPE
{
Data_DWORD_General = 0, // A unsigned int setting used anywhere
Data_String_General = 1, // A string setting used anywhere
Data_DWORD_Game = 2, // A unsigned int associated with the current game
Data_String_Game = 3, // A string associated with the current game
Data_DWORD_RDB = 4, // A unsigned int associated with the current game in the rom database
Data_String_RDB = 5, // A string associated with the current game in the rom database
Data_DWORD_RDB_Setting = 6, // A unsigned int read from the rom database, with config file
Data_String_RDB_Setting = 7, // A string read from the rom database, with config file
};
// set other information about different settings
int SettingsInitilized ( void );
void SetModuleName ( const char * Name );
void RegisterSetting ( short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category,
unsigned int DefaultDW, const char * DefaultStr );
short FindSystemSettingId ( const char * Name );
void FlushSettings ( void );
// set other information about different settings
int SettingsInitilized(void);
void SetModuleName(const char * Name);
void RegisterSetting(short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category,
unsigned int DefaultDW, const char * DefaultStr);
void RegisterSetting2(short SettingID, SETTING_DATA_TYPE Type, const char * Name, const char * Category, short DefaultSettingID);
short FindSystemSettingId(const char * Name);
void FlushSettings(void);
// this must be implemented to be notified when a setting is used but has not been set up
void UseUnregisteredSetting (int SettingID);
// this must be implemented to be notified when a setting is used but has not been set up
void UseUnregisteredSetting(int SettingID);
#if defined(__cplusplus)
}