Main > Software Forum
ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
benll64:
Hmmm....Interesting.
My understanding from talking to Matt, the Daphne creator, was that he created the -fastboot option as part of Daphne; in other words, the fastboot "code" isn't in the rom files themselves, it's in Daphne. Now, I don't know if that means that the Daphne -fastboot option temporarily "hacks" the roms when it loads them or something like that - but he did tell me that the rom files, as they sit on your hard drive, are not modified in any way. Does that make sense?
He made the option only for the "lair" and "ace" rom names, not for the "dle21" and "sae" rom names. That's why I'm thinking a recompile is needed? I'm thinking somewhere in the Daphne code is something that does this....
Still not sure what your lair.zip file is with 32 files inside of it...do you possibly have an older version of Daphne? Maybe all of the various rom types for DL were all zipped together into a single lair.zip file, and that's the one you have? Because in my Daphne install, there's about a dozen rom variants for DL, each one with maybe 3-5 files or so.
degenatrons:
The -fastboot flag simply instructs Daphne to modify the memory addresses in the rom files. This has same effect as 1) the hack I was making directly to the files and 2) indirectly by fooling Daphne into thinking the -fastboot was supported on the DLE2 roms.
I have now done a full Daphne recompile! after modding the source for dle2 rom patching:
// DLE v2.x test to make sure readme20.txt file is present and unaltered
void dle2::patch_roms()
{
bool passed_test = false;
if (strcasecmp(m_shortgamename, "dle20") == 0)
{
if (!(passed_test = verify_required_file("readme20.txt", "dle20", 0x51C50010)))
{
printerror("DLE readme20.txt file is missing or altered.");
printerror("Please get the original file from http://www.d-l-p.com. Thanks.");
set_quitflag();
}
}
else
{
if (!(passed_test = verify_required_file("readme21.txt", "dle21", 0xA68F0D21)))
{
printerror("DLE readme21.txt file is missing or altered.");
printerror("Please get the original file from http://www.d-l-p.com. Thanks.");
set_quitflag();
}
}
//degenatrons - attempt fastboot
if (m_fastboot)
{
m_cpumem[0x121b] = 0x00;
m_cpumem[0x1235] = 0x00;
}
It doesn't work :hissy:
I get the same results as my file hack - which I was kind of expecting.
The games diagnostic check fails when checking eeproms.
I'm out of ideas for now on this one.
On the plus side, I can compile Daphne.
headkaze:
What are the values of those bytes before you change them? Is it possible to place the same values later in an unused area of the ROM and trick it into calculating the correct checksum?
degenatrons:
--- Quote from: headkaze on October 11, 2013, 01:32:22 am ---What are the values of those bytes before you change them? Is it possible to place the same values later in an unused area of the ROM and trick it into calculating the correct checksum?
--- End quote ---
Both bytes are 0xF0 before the change.
I've hooked up with the developer of the Dragons Lair Enhancements and I am hoping that he can remove/relax the ROM CRC check when used with Daphne. It's his call.
degenatrons:
Bad news and good news.
I've been talking with the developer of the Dragon's Lair enhancements in the hope that he can assist by removing rom protection from his files - which is preventing my Daphne patch from working. The developer was very helpful and has considered my request but is unable to assist. His roms are legally authorized as part of a licensing agreement and he cannot support Daphne specific developments. I respect his wishes and will not be pursuing the rom modification solution.
So, on with the good news.
I took a look at the Daphne emulation and figured that I could temporarily speed up the CPU for the duration of the start-up.
I added a function in Daphne (program cpu.cpp) to change the processing speed by specifying values for cpu hz and interrupt period.
--- Code: ---//degenatrons cpu mod
void cpu_change_speed(Uint8 id, double new_period, double new_hz)
{
struct cpudef *cpu = get_cpu_struct(id);
cpu->irq_period[0] = new_period;
cpu->hz = new_hz;
cpu_recalc();
}
//degenatrons end
--- End code ---
I made a Dragon's Lair specific change (program lair.cpp) to massively increase the processing speed during startup. I call my above function when the lair code is initialised. I multiple the hz by 20 and divide irq period by 20.
--- Code: ---//degenatrons speed mod - start
//increase speed during start up
m_speedmod_executed = false;
cpu_change_speed(0,LAIR_IRQ_PERIOD / 20, LAIR_CPU_HZ * 20);
//degenatrons speed mod - end
--- End code ---
The fast processing needs to return to normal after Dragon's Lair loads. I found that it was not possible to return speed to normal during the intro screen as this caused issues with the laser disc read. So instead, I detect when the user has pressed the start button and then set a timer to wait for 1 second before calling my function to revert the CPU speed.
--- Code: ---//degenatrons speed mod - start
if (move==SWITCH_START1||move==SWITCH_START2)
if (!m_speedmod_executed)
{
//call function to reset speed after delay timer
HWND hwnd = ::CreateWindowA("STATIC","dummy",WS_DISABLED,0,0,100,100,NULL,NULL,NULL,NULL);
SetTimer(hwnd, 1, 925, TimerProc);
m_speedmod_executed = true;
}
//degenatrons speed mod - end
--- End code ---
After the time delay, the following code sets the CPU speed using the Dragon's Lair defaults.
--- Code: ---//degenatrons speed mod - start
void CALLBACK TimerProc(HWND hwnd, UINT umsg, UINT idevent, DWORD dwTime)
{
//reset default speed
cpu_change_speed(0, LAIR_IRQ_PERIOD, LAIR_CPU_HZ);
}
//degenatrons speed mod - end
--- End code ---
This is tested and working on all Dragon's Lair roms.
The DLE 2.x roms are now starting up in less than 5 seconds ;D I'll post a video of the boot up when i get chance. After booting, I notice that the intro video does not show because the CPU speed is forcing the laser disc to skip through the videos too quickly. Not sure if this will be an issue for you.
After entering coins and starting the game everything should run as normal and at normal speed.
I build a modified version of Daphne with this mod which can be downloaded from here
Extract all the files into a folder.
There are no roms or video included. This is just the Daphne installation. Don't ask me where to obtain Dragon's Lair roms and video.
I'm just using the regular start up parameters e.g.
daphne dle21 vldp -framefile "c:\daphne\framefile\Lair.txt"
Feedback and testing would be much appreciated.
If the changes are working and useful then I will contribute the source to Daphne project.
Jon
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version