Good evening,
I'm working on a module, and IT IS working... just the code seems lengthy and I'm sure I'm doing things the wrong way!
Anyways, I decided to pick up the latest Phoenix (v2.8: http://www.arts-union.ru/node/23) because all the games ran smoothly and without a/v sync problems.
From how I understand the emulator works, is the "phoenix.config.xml" gets updated with any games that have been dumped that goes in the collection (the xml includes path, size, fast-md5, and md5 for each title added). To get a game to load, you must change the xml to the parent dump tag (CD-ROM), and include the whole rom path in the attach attribute (and this is optional=just the romPath in the last-path attribute.
Extensions supported: .iso, .img, .cdi, .bin, .nrg, .binar
I have also attached the "phoenix.config.xml" file and the "translation.xml" in English that I made with Google, and then just made it make sense, which changes the language for the emulator. The "phoenix.config.xml" file has about 200+ games pre-done, just have to global replace the starting directory; I have the game files unzipped.
Here is my module if anyone can give tips etc. on cleaning up the code and overall making it work better:
Regards,
and thank you!
I'm working on a module, and IT IS working... just the code seems lengthy and I'm sure I'm doing things the wrong way!
Anyways, I decided to pick up the latest Phoenix (v2.8: http://www.arts-union.ru/node/23) because all the games ran smoothly and without a/v sync problems.
From how I understand the emulator works, is the "phoenix.config.xml" gets updated with any games that have been dumped that goes in the collection (the xml includes path, size, fast-md5, and md5 for each title added). To get a game to load, you must change the xml to the parent dump tag (CD-ROM), and include the whole rom path in the attach attribute (and this is optional=just the romPath in the last-path attribute.
Extensions supported: .iso, .img, .cdi, .bin, .nrg, .binar
I have also attached the "phoenix.config.xml" file and the "translation.xml" in English that I made with Google, and then just made it make sense, which changes the language for the emulator. The "phoenix.config.xml" file has about 200+ games pre-done, just have to global replace the starting directory; I have the game files unzipped.
Here is my module if anyone can give tips etc. on cleaning up the code and overall making it work better:
Code:
MEmu := "Phoenix"
MEmuV := "v2.8"
MURL := ["http://www.arts-union.ru/node/23"]
MAuthor := ["djvj"]
MVersion := "2.0.4"
MCRC := "51C61D0E"
iCRC := "109E182B"
MID := "635038268914342592"
MSystem := ["Panasonic 3DO"]
;----------------------------------------------------------------------------
; Notes:
; This emu only supports iso images
; Set SelectGameMode if you have any problems with the emu opening the game
; If your bios file is called fz10_rom.bin, rename it to fz10.rom, it should be placed in the same dir as the emu exe.
; On first launch, Phoenix will ask you to point it to the fz10.rom. After you do that, exit the emu and select a game in your Front End and it should work.
; If you do not have an English windows, set the language you use for the MLanguage setting in RocketLauncherUI. Currently only Spanish/Portuguese is supported.
;
; Phoenix stores its config in the registry @ HKEY_CURRENT_USER\Software\FreeDO\FreeDO Emulator
;----------------------------------------------------------------------------
StartModule()
BezelGUI()
FadeInStart()
settingsFile := modulePath . "\" . moduleName . ".ini"
Fullscreen := moduleIni.Read("Settings", "Fullscreen","true",,1)
ControlDelay := IniReadCheck(settingsFile, "Settings", "ControlDelay","20",,1) ; raise this if the module is getting stuck somewhere
KeyDelay := IniReadCheck(settingsFile, "Settings", "KeyDelay","-1",,1) ; raise this if the module is getting stuck using SelectGameMode 2
dialogOpen := i18n("dialog.open") ; Looking up local translation
ExitKey := moduleIni.Read("Settings", "ExitKey","Esc",,1)
If bezelEnabled
BezelStart(If Fullscreen = "true" ? "" : "fixResMode")
;hideEmuObj := Object(dialogOpen . " ahk_class #32770",0,"Phoenix ahk_class Qt5QWindowIcon",1) ; Hide_Emu will hide these windows. 0 = will never unhide, 1 = will unhide later
7z(romPath, romName, romExtension, 7zExtractPath)
SetControlDelay, %ControlDelay%
SetKeyDelay(KeyDelay)
If romExtension in .7z,.rar,.zip
ScriptError("Pheonix does not support archived or cue files. Only ""iso"", ""img"", and ""bin"" files can be loaded. Either enable 7z support, or extract your games first.")
HideEmuStart() ; This fully ensures windows are completely hidden even faster than winwait
; Your XML file to be altered in a variable
FileRead, xml, %emuPath%\phoenix.config.xml
romPath2 = %romPath%/%romName%%romExtension%
romPath3 = %romPath%
StringReplace, romPath2, romPath2, \, /, UseErrorLevel
StringReplace, romPath3, romPath3, \, /, UseErrorLevel
; The regex to search for. 1 to 100 digits followed by a period and 1 to 100 more digits
ToReplace =
(
<CD-ROM expanded="true" attach="(.*?)" last-path="(.*?)">
)
; What to replace those digits with which would be your number that was given.
Replacement =
(
<CD-ROM expanded="true" attach="%romPath2%" last-path="%romPath3%">
)
; Make it possible to parse through by replacing the string we are looking for with an unusual character. In this case ®
StringReplace, NewDelimiter, xml, <Platform-3DO>, ®<Platform-3DO>
Loop, Parse, NewDelimiter, ®
{
If (A_Index = 2) ;Determine which variable we are working with and give it the contents for that piece
{
xSens = %A_LoopField%
}
}
Loop, Parse, xSens, `n, `r ; Replace the X variable
{
NewLine := RegExReplace(A_LoopField, ToReplace, Replacement)
If (A_Index = 1)
{
NewxSens = %NewLine%
}
else
{
NewxSens = %NewxSens%`n%NewLine%
}
}
xml =
(
<?xml version="1.0" encoding="utf-8"?>
<root Platform="3DO">
<Settings current="0">
<Global>
%NewxSens%'
)
FileDelete, %emuPath%\phoenix.config.xml
FileAppend, %xml%, %emuPath%\phoenix.config.xml
Run(executable, emuPath)
DetectHiddenWindows, on
WinWait("ahk_class Qt5QWindowIcon")
WinWaitActive("ahk_class Qt5QWindowIcon")
;WinMenuSelectItem, ahk_class Qt5QWindowPopupDropShadow,, 2&, 1&
Send, {Alt}{Right}{Enter}{Enter} ; power on roms
If Fullscreen = true
Send, {F11} ; fullscreen
Sleep, 1000
BezelDraw()
HideEmuEnd()
FadeInExit()
Process("WaitClose", executable)
7zCleanUp()
BezelExit()
FadeOutExit()
ExitModule()
Esc:: Send, !{F4}
RestoreEmu:
Send, !{Enter}
Return
CloseProcess:
FadeOutStart()
WinClose("ahk_class Qt5QWindowIcon") ; Removing Phoenix from the title because the emulator shows statistics in the title while a game is playing
Return
Regards,
and thank you!