No new rev from someone else the last days I see, I thought

in the time I wasnt at home some other person commits something ;)
However I'm back so lets get back to work
-added a few DML video modes, PAL60, NTSC480p, PAL480p, work with
DML r52+
-updated english.ini
-updated german.ini
This commit is contained in:
fix94.1 2012-03-25 19:52:35 +00:00
parent 8b7cf87550
commit aaad7c07ef
6 changed files with 75 additions and 32 deletions

View File

@ -20,44 +20,67 @@ syssram* __SYS_LockSram();
u32 __SYS_UnlockSram(u32 write);
u32 __SYS_SyncSram(void);
void GC_SetVideoMode(int i)
void GC_SetVideoMode(u8 videomode)
{
syssram *sram;
sram = __SYS_LockSram();
void *m_frameBuf;
static GXRModeObj *rmode;
int memflag = 0;
if(VIDEO_HaveComponentCable())
sram->flags |= 0x80; //set progressive flag
else
sram->flags &= 0x7F; //clear progressive flag
if (!i)
if(videomode == 1 || videomode == 3 || videomode == 5)
{
rmode = &TVNtsc480IntDf;
sram->flags &= 0xFE; // Clear bit 0 to set the video mode to NTSC
sram->ntd &= 0xBF; //clear pal60 flag
memflag = 1;
sram->flags |= 0x01; // Set bit 0 to set the video mode to PAL
sram->ntd |= 0x40; //set pal60 flag
}
else
{
sram->flags &= 0xFE; // Clear bit 0 to set the video mode to NTSC
sram->ntd &= 0xBF; //clear pal60 flag
}
if(videomode == 1)
rmode = &TVPal528IntDf;
sram->flags |= 0x01; // Set bit 0 to set the video mode to PAL
sram->ntd |= 0x40; //set pal60 flag
else if(videomode == 2)
rmode = &TVNtsc480IntDf;
else if(videomode == 3)
{
rmode = &TVEurgb60Hz480IntDf;
memflag = 5;
}
else if(videomode == 4)
rmode = &TVNtsc480Prog;
else if(videomode == 5)
{
rmode = &TVNtsc480Prog; //TVEurgb60Hz480Prog codedumps
memflag = 5;
}
__SYS_UnlockSram(1); // 1 -> write changes
while(!__SYS_SyncSram());
/* Set video mode to PAL or NTSC */
*(vu32*)0x800000CC = i;
*(vu32*)0x800000CC = memflag;
DCFlushRange((void *)(0x800000CC), 4);
ICInvalidateRange((void *)(0x800000CC), 4);
VIDEO_Configure(rmode);
m_frameBuf = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
VIDEO_ClearFrameBuffer(rmode, m_frameBuf, COLOR_BLACK);
VIDEO_SetNextFramebuffer(m_frameBuf);
VIDEO_SetBlack(TRUE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(rmode->viTVMode&VI_NON_INTERLACE)
VIDEO_WaitVSync();
}
u8 get_wii_language()
@ -112,7 +135,7 @@ bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgame
return false;
}
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc)
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode)
{
gprintf("Wiiflow DML: Launch game 'sd:/games/%s/game.iso' through memory (new method)\n", GamePath);
@ -121,7 +144,7 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo
DMLCfg->Magicbytes = 0xD1050CF6;
DMLCfg->CfgVersion = 0x00000001;
DMLCfg->VideoMode |= DML_VID_NONE;
DMLCfg->VideoMode |= DML_VID_FORCE;
DMLCfg->Config |= DML_CFG_ACTIVITY_LED; //Sorry but I like it lol, option will may follow
DMLCfg->Config |= DML_CFG_PADHOOK; //Makes life easier, l+z+b+digital down...
@ -157,6 +180,15 @@ void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, boo
if(nodisc > 0)
DMLCfg->Config |= DML_CFG_NODISC;
if(DMLvideoMode == 1)
DMLCfg->VideoMode |= DML_VID_FORCE_PAL50;
else if(DMLvideoMode == 2)
DMLCfg->VideoMode |= DML_VID_FORCE_NTSC;
else if(DMLvideoMode == 3)
DMLCfg->VideoMode |= DML_VID_FORCE_PAL60;
else
DMLCfg->VideoMode |= DML_VID_FORCE_PROG;
//Write options into memory
memcpy((void *)0xC0001700, DMLCfg, sizeof(DML_CFG));
MEM2_free(DMLCfg);

View File

@ -42,10 +42,10 @@ enum dmlvideomode
DML_VID_FORCE_PROG = (1<<3),
};
void GC_SetVideoMode(int i);
void GC_SetVideoMode(u8 videomode);
void GC_SetLanguage(u8 lang);
bool GC_GameIsInstalled(char *discid, const char* partition, const char* dmlgamedir);
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc);
void DML_New_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats, bool debugger, u8 NMM, u8 nodisc, u8 DMLvideoMode);
void DML_Old_SetOptions(char *GamePath, char *CheatPath, char *NewCheatPath, bool cheats);
#endif //GC_H_

View File

@ -974,9 +974,9 @@ private:
static const SOption _languages[11];
static const SOption _videoModes[7];
static const SOption _GlobalDMLvideoModes[3];
static const SOption _GlobalDMLvideoModes[6];
static const SOption _GlobalGClanguages[7];
static const SOption _DMLvideoModes[4];
static const SOption _DMLvideoModes[7];
static const SOption _GClanguages[8];
static const SOption _NandEmu[3];

View File

@ -104,17 +104,23 @@ const CMenu::SOption CMenu::_videoModes[7] = {
{ "vidprog", L"Progressive" }
};
const CMenu::SOption CMenu::_GlobalDMLvideoModes[3] = {
const CMenu::SOption CMenu::_GlobalDMLvideoModes[6] = {
{ "DMLdefG", L"Game" },
{ "DMLpal", L"PAL 576i" },
{ "DMLntsc", L"NTSC 480i" }
{ "DMLntsc", L"NTSC 480i" },
{ "DMLpal60", L"PAL 480i" },
{ "DMLprog", L"NTSC 480p" },
{ "DMLprogP", L"PAL 480p" }
};
const CMenu::SOption CMenu::_DMLvideoModes[4] = {
const CMenu::SOption CMenu::_DMLvideoModes[7] = {
{ "DMLdef", L"Default" },
{ "DMLdefG", L"Game" },
{ "DMLpal", L"PAL 576i" },
{ "DMLntsc", L"NTSC 480i" }
{ "DMLntsc", L"NTSC 480i" },
{ "DMLpal60", L"PAL 480i" },
{ "DMLprog", L"NTSC 480p" },
{ "DMLprogP", L"PAL 480p" }
};
const CMenu::SOption CMenu::_GlobalGClanguages[7] = {
@ -651,11 +657,16 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
if(has_enabled_providers() && _initNetwork() == 0)
add_game_to_card(id);
u8 DMLvideoMode = min((u32)m_gcfg2.getInt(id, "dml_video_mode", 0), ARRAY_SIZE(CMenu::_DMLvideoModes) - 1u);
DMLvideoMode = (DMLvideoMode == 0) ? min((u32)m_cfg.getInt("DML", "video_mode", 0), ARRAY_SIZE(CMenu::_GlobalDMLvideoModes) - 1u) : DMLvideoMode-1;
u8 GClanguage = min((u32)m_gcfg2.getInt(id, "gc_language", 0), ARRAY_SIZE(CMenu::_GClanguages) - 1u);
GClanguage = (GClanguage == 0) ? min((u32)m_cfg.getInt("DML", "game_language", 0), ARRAY_SIZE(CMenu::_GlobalGClanguages) - 1u) : GClanguage-1;
u8 DMLvideoMode = min((u32)m_gcfg2.getInt(id, "dml_video_mode", 0), ARRAY_SIZE(CMenu::_DMLvideoModes) - 1u);
DMLvideoMode = (DMLvideoMode == 0) ? min((u32)m_cfg.getInt("DML", "video_mode", 0), ARRAY_SIZE(CMenu::_GlobalDMLvideoModes) - 1u) : DMLvideoMode-1;
if((id[3] == 'P') && (DMLvideoMode == 0))
DMLvideoMode = 1;
else if((id[3] != 'P') && (DMLvideoMode == 0))
DMLvideoMode = 2;
if(DML)
{
m_cfg.setString("DML", "current_item", id);
@ -676,7 +687,7 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
}
if(m_new_dml)
DML_New_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats, DML_debug, NMM, nodisc);
DML_New_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats, DML_debug, NMM, nodisc, DMLvideoMode);
else
DML_Old_SetOptions(hdr->path, CheatPath, NewCheatPath, cheats);
@ -701,14 +712,8 @@ void CMenu::_launchGC(dir_discHdr *hdr, bool DML)
SDHC_Init();
memcpy((char *)0x80000000, id, 6);
if(((id[3] == 'P') && (DMLvideoMode == 0)) || (DMLvideoMode == 1))
GC_SetVideoMode(1);
if(((id[3] != 'P') && (DMLvideoMode == 0)) || (DMLvideoMode == 2))
GC_SetVideoMode(0);
GC_SetVideoMode(DMLvideoMode);
GC_SetLanguage(GClanguage);
VIDEO_SetBlack(TRUE);
VIDEO_Flush();
VIDEO_WaitVSync();
if(WII_LaunchTitle(0x100000100LL) < 0)
Sys_LoadMenu();

View File

@ -136,8 +136,11 @@ dlmsg8=Full cover not found. Downloading from %s
dlmsg9=%i/%i files downloaded. %i are front covers only.
DMLdef=Default
DMLdefG=Game
DMLntsc=NTSC 480i
DMLpal=PAL 576i
DMLntsc=NTSC 480i
DMLpal60=PAL 480i
DMLprog=NTSC 480p
DMLprogP=PAL 480p
gameinfo1=Developer: %s
gameinfo2=Publisher: %s
gameinfo3=Region: %s

View File

@ -136,8 +136,11 @@ dlmsg8=Vollständige Hülle nicht gefunden. Lade von %s
dlmsg9=%i/%i Hüllen wurden heruntergeladen. Von %i nur die Vorderseite.
DMLdef=Standard
DMLdefG=Spiel
DMLntsc=NTSC 480i
DMLpal=PAL 576i
DMLntsc=NTSC 480i
DMLpal60=PAL 480i
DMLprog=NTSC 480p
DMLprogP=PAL 480p
gameinfo1=Entwickler: %s
gameinfo2=Herausgeber: %s
gameinfo3=Region: %s