The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: benll64 on July 26, 2013, 11:58:39 am

Title: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on July 26, 2013, 11:58:39 am
This is a request/challenge/interest check for all the programming geniuses out there (of which I am not one).

I've been trying for a few months to convince Matt, the author of the excellent Daphne emulator, to add a feature to the program. Unfortunately, he is either uninterested in further improving Daphne, or doesn't have any desire to respond to user requests; his answer was, "figure it out yourself."

I had asked if he could add the "-fastboot" option to the enhanced ROM sets for Dragon's Lair and Space Ace. For the unfamiliar, these are modified roms made by a guy over on the Dragon's Lair Project website named Dave. I, like a lot of people, prefer them to the arcade original roms for these two games. He re-sequenced the scene order so it actually makes sense, added the drawbridge scene back into DL, improved the transition timing between scenes, etc.

Here's a link to the enhanced roms for reference:

Dragon's Lair
http://www.dragons-lair-project.com/tech/enhancements/dle.asp (http://www.dragons-lair-project.com/tech/enhancements/dle.asp)

Space Ace
http://www.dragons-lair-project.com/tech/enhancements/sae.asp (http://www.dragons-lair-project.com/tech/enhancements/sae.asp)

However, there is one major drawback to using these enhanced roms - they take between 45 - 80 seconds to boot into the game. For a real, dedicated machine, that's not really a big deal. But, in an emulated cabinet setting, with all the other games in your setup launching from your frontend in a matter of seconds, it's kind of a deal-breaker. Your average end user just doesn't want to wait that long, and if you're not there to tell them otherwise, they'd probably think the game didn't work and give up.

Matt created a fast boot option in Daphne which reduces the boot time to just a few seconds, but it only works with the original romsets. So, here's my challenge to all of you programmer types - can you figure out a way to add the fast boot support option to Dave's enhanced romsets? If someone could figure this out, we'd have the best of both worlds - quick start up time coupled with the many, many gameplay improvements of the enhanced sets. I've talked with Dave, who did such an amazing job with these sets, but he's not familiar with the language Daphne was written in.

Any takers? I'm sure you'd earn the gratitude of lots of DL/SA fans...





Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: spoot on July 26, 2013, 12:43:48 pm
Is it as easy as changing the daphenet.loadinfo.ini file to have the "other" rom listed and it's corresponding options?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on July 26, 2013, 09:27:14 pm
Hmmm, I don't know. I have no idea what the file is, but I'll look for it and try this idea out. Thanks.

Any other thoughts out there?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: spoot on July 26, 2013, 11:19:58 pm
Dunno either, I did a very rudimentary browse of the code over lunch....but that option really seems to be done from that file.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: keilmillerjr on July 27, 2013, 12:14:19 pm
I have not installed or Daphne, but I did check out the source. I noticed the file frontend/DaphneLoaderInfo.ini. Here is a few little snippets to check out. Editing them hey might resolve your issue. It seems like you could just add your modified game as a new game and tell it to fastboot it. Try it. Good luck!

Line 5
[GameList]
NumberOfGames=30
Game1=Astron Belt (Hitachi)
Game2=Astron Belt (Pioneer)
Game3=Badlands

Line 99
;game info:
[Dragon's Lair (US rev. F2)]
DriverName=lair
ImageName=lair.jpg

CustomCheckBox1title=Fast Boot
CustomCheckBox1onvalue=-fastboot
CustomCheckBox1offvalue=
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on July 30, 2013, 06:31:42 pm
It looks like that would just add the -fastboot option to the command line, which I've tried manually and doesn't work.

Daphne simply ignores the "-fastboot" option for all but the original DL/SA roms. There's something somewhere else in the code that actually changes the rom's bootup process, I think.

I can read the source code with Visual 2010, but I have no idea how to compile - that's way beyond me.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: keilmillerjr on July 30, 2013, 07:19:07 pm
It looks like that would just add the -fastboot option to the command line, which I've tried manually and doesn't work.

Daphne simply ignores the "-fastboot" option for all but the original DL/SA roms. There's something somewhere else in the code that actually changes the rom's bootup process, I think.

I can read the source code with Visual 2010, but I have no idea how to compile - that's way beyond me.

Hmm... It might be best to add an instance of the new game everywhere possible then.

Check Line 187 of io/cmdline.cpp, and game/game.cpp and game/game.h as well as  frontend/DaphneLoaderInfo.ini. I would duplicate every instance you can find of the game and change the name. Directions are in the source for compile. I can do this if you want, and could compile for unix and possibly test it. However, I have no easy way of compiling for winblows unless I pirate microsoft visual studio. I'll see what I can do when I have some free time.
Title: Re: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: ppv on August 01, 2013, 12:11:38 pm
It looks like that would just add the -fastboot option to the command line, which I've tried manually and doesn't work.

Daphne simply ignores the "-fastboot" option for all but the original DL/SA roms. There's something somewhere else in the code that actually changes the rom's bootup process, I think.

I can read the source code with Visual 2010, but I have no idea how to compile - that's way beyond me.

Hmm... It might be best to add an instance of the new game everywhere possible then.

Check Line 187 of io/cmdline.cpp, and game/game.cpp and game/game.h as well as  frontend/DaphneLoaderInfo.ini. I would duplicate every instance you can find of the game and change the name. Directions are in the source for compile. I can do this if you want, and could compile for unix and possibly test it. However, I have no easy way of compiling for winblows unless I pirate microsoft visual studio. I'll see what I can do when I have some free time.
You do not need to pirate, just google VS 2010 express. Its a free version, for stand alone projects it should work without problems.

Sent from my XT925 using Tapatalk 4 Beta

Title: Re: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: keilmillerjr on August 01, 2013, 02:24:21 pm
It looks like that would just add the -fastboot option to the command line, which I've tried manually and doesn't work.

Daphne simply ignores the "-fastboot" option for all but the original DL/SA roms. There's something somewhere else in the code that actually changes the rom's bootup process, I think.

I can read the source code with Visual 2010, but I have no idea how to compile - that's way beyond me.

Hmm... It might be best to add an instance of the new game everywhere possible then.

Check Line 187 of io/cmdline.cpp, and game/game.cpp and game/game.h as well as  frontend/DaphneLoaderInfo.ini. I would duplicate every instance you can find of the game and change the name. Directions are in the source for compile. I can do this if you want, and could compile for unix and possibly test it. However, I have no easy way of compiling for winblows unless I pirate microsoft visual studio. I'll see what I can do when I have some free time.
You do not need to pirate, just google VS 2010 express. Its a free version, for stand alone projects it should work without problems.

Sent from my XT925 using Tapatalk 4 Beta

Nice. I wasn't aware that there was a free version.  :cheers:
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on August 01, 2013, 02:41:27 pm
That's the version I've been using to look at the source code.

But I understand almost nothing about source code, so.... :)
Title: Re: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: Rigby on August 01, 2013, 02:58:55 pm
Nice. I wasn't aware that there was a free version.  :cheers:

There is.  The latest version is 2012, though, and there's a preview of VS2013 that's free.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: Dariusz on August 24, 2013, 06:32:03 am
Has there been any progress on the fast boot?

D
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on August 28, 2013, 11:21:30 am
Well, sort of.

Howard Casto, here on the forum, has agreed to take this on and has added it to his "to-do" list. Hopefully he can make sense of the Daphne source code and figure it out for us.

Anyone else out there willing/able to take a crack at this, or collaborate with Howard?

Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: Hockeyboy on September 05, 2013, 07:52:59 am
While I am not a programmer, as an end user, I am applauding these efforts!!  :applaud:

I've got my Dragon's Lair and Space Ace, along with Cliffhanger, about ready to be loaded onto my arcade cabinet. It would be fantastic to have the DL & SA games run the way you are intending them to with this sort of programming change.

I look forward to the results.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: SavannahLion on September 10, 2013, 04:21:28 pm
Howard is going to have to learn whatever opcodes in the chip that hardware uses. The fastboot option directly modifies the game ROM to skip whatever checks exist. Modifying the source code by replacing/adding all instances is never going to work unless the modified ROMs also have the same data in the same memory locations.

That's probably why he told you to figure it on your own. It's not as simple as it seems.  Just glancing at the source code I see at least five CPU's the 6809, 6502, PPC, x86 and a Z80. Though I suspect at least two are files for emulation on a specific platform rather than the emulation itself.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on September 12, 2013, 11:06:48 am
I have zero understanding of your comment, but for Howard or anyone else that understood it, I'm sure it will be very helpful.

Thanks! :)

Howard - any luck yet?

Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: Howard_Casto on September 12, 2013, 12:58:39 pm
Please don't take this in a bad way.  You are really mis-representing me here. 

I said I would put it on my todo list.  I never said I would get it working for sure.  Also it's on my todo list meaning I haven't done it yet.  (I haven't even looked at the source). 

Honestly I have zero interest in this particular hack, but like I told you via pm, I'm going to eventually add output support to Daphne anyway and if I can figure it out while I'm in there I'll try to do it for you.  If what SL is saying is true, it'll probably be more effort than it's worth, although different variants of laserdisc roms are alarmingly similar... we might luck up and the location turn out ot be either identical or close enough to where I can figure it out. 
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: yotsuya on September 12, 2013, 02:43:51 pm
Granted, I haven't tried these new ROMS, but what does it do at bootup? It is 40-80 seconds of a blank screen?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on September 12, 2013, 05:53:36 pm
Yes, the standard boot-up time is around 1 minute. In a MAME / mult-game setup, no one but me will wait that long; they'll just assume the game doesn't work.

With the -fastboot switch enabled in Daphne, it takes under 10 seconds.

Howard, no problem, thanks for clearing that up. Let us know if you do figure it out!

Anyone else out there want to take a stab at it?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on September 24, 2013, 08:45:04 pm
I had a quick look at the coding in the Daphne source (win32) and notice that the DLE1.1 rom appears to support the fastboot flag.  Existing Daphne code exists to do this.  Code snippet is below.  The patch is not available for the DLE2.x roms but maybe DLE1.1 will be good for you.

So try running daphne with -fastboot with the DLE1.1 rom if you haven't already.

void dle11::patch_roms()
{
   bool passed_test = false;

   // NOW check to make sure the DLE readme file is present and unaltered
   // Dave Hallock requested this check to make sure sites don't remove his readme file
   // and distribute DLE.

   passed_test = verify_required_file("readme11.txt", "dle11", 0x4BF84551);

   // if they failed the test then exit daphne
   if (!passed_test)
   {
      printerror("DLE readme11.txt file is missing or altered.");
      printerror("Please get the original readme11.txt file from www.d-l-p.com (http://www.d-l-p.com), thanks.");
      set_quitflag();
   }

   if (m_fastboot)
   {
      m_cpumem[0x121b] = 0x00;
      m_cpumem[0x1235] = 0x00;
   }

}


Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: Howard_Casto on September 24, 2013, 09:03:02 pm
Well that doesn't look to bad.  It appears that it's simply writing the two "clear" flags over at startup.  You guys could probably figure out the other memory locations via a good cheat engine, I dunno.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on September 24, 2013, 09:04:42 pm
Well that doesn't look to bad.  It appears that it's simply writing the two "clear" flags over at startup.  You guys could probably figure out the other memory locations via a good cheat engine, I dunno.
I was thinking the same,  a little trial and error maybe,  if the DLE1.1 is proven to be good.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: stevebower on September 25, 2013, 01:13:06 pm
 Well 8 hours later and i got it working. Not as easy a fix as i thought but it works. Gonna continue to test today and tommorrow to make sure its 100%. Keep your fingers crossed/
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: yotsuya on September 25, 2013, 01:15:00 pm
Well 8 hours later and i got it working. Not as easy a fix as i thought but it works. Gonna continue to test today and tommorrow to make sure its 100%. Keep your fingers crossed/

 :applaud:
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on September 25, 2013, 08:54:06 pm
stevebower:

Wow, great job! Let us know what you find and if you'd like to share with the rest of us. I'm sure lots of folks would appreciate it.

degenatrons:

Yes, I have tried the DLE 1.1 with the fastboot option, and the fastboot does work. Unfortunately the 1.1 rom doesn't have any of the other features that the 2.1 rom offers, which is the combination I'm looking for.

But I would guess that the 2.1 version has a lot in common with the 1.1 rom, since the author (a guy named Dave over at the Dragon's Lair Project site) appears to have simply taken the functionality of the 1.1 and added to it in order to produce the 2.1 version.

For everyone:

I know that generally, the 2.1 enhancement rom is "radically different" (author's words) than the original arcade version (F2 or whatever). However, I think that mostly pertains to the way the game scenes are resequenced. I would bet that the boot-up tests in all rom versions are quite similar or identical, and that whatever worked for the 1.1 -fastboot option would likely work for the 2.1 - maybe this is what stevebower has discovered?

Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on September 27, 2013, 02:34:38 pm
Well 8 hours later and i got it working. Not as easy a fix as i thought but it works. Gonna continue to test today and tommorrow to make sure its 100%. Keep your fingers crossed/
Tests going well steve?  I kind of stopped looking when you said you had got it working.

Was going to try clearing pairs of bytes around the location I expect the fastboot logic.  Assume this is what you've done?
 
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on October 01, 2013, 04:34:21 pm
Steve or degenatrons -

Any word on testing this for general release?

I'm assuming you've recompiled Daphne and end users would need to just replace the daphne.exe with yours if they want to add the fastboot option?

Thanks!
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on October 01, 2013, 04:43:31 pm
Steve or degenatrons -

Any word on testing this for general release?

I'm assuming you've recompiled Daphne and end users would need to just replace the daphne.exe with yours if they want to add the fastboot option?

Thanks!

Hey,

I was thinking to make a patched rom with fastboot that would replace the original file.  Then there would be no parameters and no recompile of Daphne necessary.  Still waiting on word from stevebower though  :dunno
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: yotsuya on October 04, 2013, 11:25:41 am
/me <3 Haze
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on October 04, 2013, 01:37:36 pm
Ummm....What?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: yotsuya on October 04, 2013, 01:52:19 pm
Cleaned up thread!  :applaud:

I still <3 Haze.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on October 04, 2013, 01:55:31 pm
I may have got the DLE 2.1 enhancement working now with fastboot but a sanity check is needed :P
 
I've never played the Dragons Lair enhancements and don't know how to tell the difference from the original.  Can you let me know what I should be looking for to verify it is working with the enhancement?

So here's what I did...

I know the original rom and the DLE1.1 rom has the fastboot patch in memory address 0x121b and 0x1235 from my above post.
Those positions are within range of the first bin file - "dle11u1l.bin" file.

   static struct rom_def roms[] =
   {
      { "dle11u1l.bin", NULL, &m_cpumem[0x0000], 0x2000, 0x9E65B33D },
      { "dle11u2l.bin", NULL, &m_cpumem[0x2000], 0x2000, 0xF16FA36F },
      { "dle11u3l.bin", NULL, &m_cpumem[0x4000], 0x2000, 0xB8D07A16 },
      { "dle11u4l.bin", NULL, &m_cpumem[0x6000], 0x2000, 0x20FC79B7 },
      { NULL }
   };

Looking at the file contents in hex editor I can see the hex value at both addresses is F0 and that value does not appear often throughout the rest of the file.

Looking at the DLE21 rom,  I verified that those addresses are within range of the first bin file - DLE21_U1.bin,  and the contents confirm that DLE21 has F0 at the same address :D
 
   static struct rom_def roms[] =
   {
      { "DLE21_U1.bin", NULL, &m_cpumem[0x0000], 0x2000, 0x4F8AF481 },
      { "DLE21_U2.bin", NULL, &m_cpumem[0x2000], 0x2000, 0x5FCA04C5 },
      { "DLE21_U3.bin", NULL, &m_cpumem[0x4000], 0x2000, 0xC14F36B3 },
      { NULL }
   };

So,  I patched the file and tried executing in Daphne with the -nocrc flag (to bypass the file level CRC checks).  Didn't work though,  because the dragons lair rom seems to have a built in CRC ROM check :(

I was left with 2 options.
1) compile daphne
2) figure a workaround for the roms CRC check

I tried 1),  compiling Daphne was PITA,  lots of pre-requisites, libraries and versions,  had me going crazy.  I managed to build a daphne.exe for windows but it would not run. :(  Maybe will revisit this one some time.

2) Workaround.
I came up with a cheeky workaround to fool Daphne into thinking the original Dragons Lair rom is being launched...

* Extract all files from the original dragons lair rom (lair.zip) into a folder.  My version has 32 files.
* Delete the first 3 files: dl_a_u1.bin, dl_a_u2.bin, dl_a_u3.bin
* Copy all 4 files from the DLE21.zip into above folder: DLE21_U1.BIN, DLE_U2.BIN, DLE21_U3.BIN, readme21.txt
* Rename the 3 bin files inline with the original rom: DLE21_U1.BIN > dl_a_u1.bin, DLE21_U2.bin > dl_a_u2.bin, DLE_U3.bin > dl_a_u3.bin
* Leave the readme21.txt alone
* Zip the folder contents to make lair.zip and place this in the roms folder.

That's it.

Workaround was tested with the -fastboot flag.
daphne lair vldp -framefile "<framefile path>" -nocrc

In line with the rules on this site,  I won't be posting any rom files.
Would be good for someone to verify the procedure above and also to sanity check the DLE21 is running as it should.

Jon


Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on October 04, 2013, 05:16:07 pm
Jon,

Interesting solution.

To answer your question, here's how to tell the difference as to which rom version you're actually playing:

"lair" [original/arcade rom] - After the opening shot of the castle, the next scene is of Dirk running through the gates as they slam shut behind dim.

"dle21" [enhanced rom] - After the castle shot, you see Dirk walking across the drawbridge. This scene is playable; you have to hit sword/up/up (i think?) to finish it.

I'll try your method, which seems like a clever workaround. If indeed the -fastboot option is enabled within the ROM file itself, then I guess Daphne is distributing a modified version of the original arcade rom??

I'll let you know how it works.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on October 05, 2013, 12:25:24 pm
Jon,

No luck for me.

I'm not sure where you got your lair.zip rom file from, but the version distributed with Daphne does not have 32 files inside of it - only 5, and they are named differently. It is known as the "F2 version" in Daphne.

There are lots of different rom versions with Daphne, and I found that the lair_a.zip (Revision A, i think it's called) had the 3 files that you mentioned - dl_a_u1.bin, etc.

I tried your steps using that rom, but Daphne doesn't load it because it expects lair.zip to be the F2 version, which has differently named .bin files.

I'm thinking that what you're seeing is the non-enhanced/arcade rom running the -fastboot option. Let me know if you get the Dirk walking across the drawbridge and falling through the hole scene or not. If you get that along with the fast boot up time, then you've got it.

Also - had any luck with the Space Ace enhanced rom? (SAE.zip)

Thanks
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on October 07, 2013, 04:19:33 pm
BAh!  It's not working for me either  :banghead:

I discovered that I should've been overwritting the _f2 BIN files in the lair.zip rom instead of the _a BIN files.  Still,  I didn't get much of an improvement with that.  I was able to start the rom but not with fastboot  :cry: 
My thinking was that Daphne is aware of fastboot on the DLE11 and original dragons lair,  so I could fool Daphne it into patching the enhancement by simply replacing the BIN files with DLE21 versions and starting up with -fastboot - nocrc parameters. 
Frustratingly,  this memory patch actually works,  but the game fails a diagonostic check which is built into the game during start-up. 
Fails on a CRC check of EEPROMs.  See chapter 2b in this troubleshooting guide for more info.

http://epg3.tripod.com/dl_subdir/dl_diagnostic.html (http://epg3.tripod.com/dl_subdir/dl_diagnostic.html)

Back to square one then  :embarassed:
Sorry.
Would love to get this working still.  Will take a look at compiling Daphne again when I pick myself up from this downer.

BTW. Thanks for your notes on comparing Daphne versions  :cheers:
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on October 07, 2013, 07:50:51 pm
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.

Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on October 08, 2013, 08:10:57 am
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 (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 (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.

(http://i.imgur.com/8EoaMXCl.png)

I'm out of ideas for now on this one.

On the plus side,  I can compile Daphne.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: 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?
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on October 11, 2013, 08:19:04 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?

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. 
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on November 02, 2013, 08:37:07 am
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: [Select]
//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

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: [Select]
//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


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: [Select]
//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

After the time delay,  the following code sets the CPU speed using the Dragon's Lair defaults.

Code: [Select]
//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

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 (http://www.kadevice.com/temp/daphne/daphne_lair_startup_mod.zip)
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



Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on November 04, 2013, 11:57:53 am
This is a big step in the right direction - nice work! The quick succession of the various startup screens looks very much like a boot with the Daphne -fastboot switch enabled.

I'm having the following issues with it:

1) As you mentioned, the intro video is skipped. To be precise, it plays the first 2 seconds then skips it and goes to the "insert coins" screen. For me, this is a problem, because I really like the intro video to play - makes it feel more like the real deal. Running the regular rom with -fastboot does play the whole intro normally. Maybe something with tweaking the emulation timing of how the virtual laserdisc player does seeks?

2) When I enter coins and press start, instead of beginning the game with the opening shot of the castle, I get a frozen screen from what appears to be the Dirk coming back to life from a skeleton scene, with the castle in the background. The game stays stuck here and I can't do anything but hit "esc" and close the emulation.

3) Have you tried this with the Space Ace enhanced rom? I imagine the process would be very similar?

4) Not sure if this matters much, but the file version of Daphne that you have made is 1.0.7; mine is 1.0.12 - although I'm not sure how I got this, because I re-downloaded from the official Daphne page and got, I think, 1.0.10. I did notice that all three of these versions have different files in the main /Daphne folder - most of them seem to be related to the Ogg Vorbis sound support. Confused...

Thanks for keeping at this.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on November 05, 2013, 11:47:35 am
This is a big step in the right direction - nice work! The quick succession of the various startup screens looks very much like a boot with the Daphne -fastboot switch enabled.

 :cheers:

1) As you mentioned, the intro video is skipped. To be precise, it plays the first 2 seconds then skips it and goes to the "insert coins" screen. For me, this is a problem, because I really like the intro video to play - makes it feel more like the real deal. Running the regular rom with -fastboot does play the whole intro normally. Maybe something with tweaking the emulation timing of how the virtual laserdisc player does seeks?

I'll take another look at reverting speed back to normal before the intro sequence kicks in.

2) When I enter coins and press start, instead of beginning the game with the opening shot of the castle, I get a frozen screen from what appears to be the Dirk coming back to life from a skeleton scene, with the castle in the background. The game stays stuck here and I can't do anything but hit "esc" and close the emulation.

It seems to work fine for me every time.   Load the game, enter coins and press start.   I made a video to show you how I have it running.

Starting up Dragon's Lair (DLE2.1) with Daphne Speed Mod (http://www.youtube.com/watch?v=ktArmnuRCtY#)

3) Have you tried this with the Space Ace enhanced rom? I imagine the process would be very similar?

Not yet tried, but yes, it should be very similar solution for the Space Ace Enhancement.

4) Not sure if this matters much, but the file version of Daphne that you have made is 1.0.7; mine is 1.0.12 - although I'm not sure how I got this, because I re-downloaded from the official Daphne page and got, I think, 1.0.10. I did notice that all three of these versions have different files in the main /Daphne folder - most of them seem to be related to the Ogg Vorbis sound support. Confused...

If you run with my files then you should see similar results to my above video.  Did you extract all my files or just the Daphne executable?  I suppose I can try compiling under the latest Daphne version. 
I didn't bother compiling all of the dependant libraries for Daphne (including Ogg Vorbis).  I dropped DLL's into the Daphne folder instead.  You can delete them if you already have DLL's installed into your system folder. 



Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on November 05, 2013, 02:51:56 pm
Quote
I'll take another look at reverting speed back to normal before the intro sequence kicks in.

That would be awesome; I'm thinking your method must be the same as the Daphne author's, so should be able to get the intro to play normally.

2) When I enter coins and press start, instead of beginning the game with the opening shot of the castle, I get a frozen screen from what appears to be the Dirk coming back to life from a skeleton scene, with the castle in the background. The game stays stuck here and I can't do anything but hit "esc" and close the emulation.

Quote
It seems to work fine for me every time.   Load the game, enter coins and press start.   I made a video to show you how I have it running.

Starting up Dragon's Lair (DLE2.1) with Daphne Speed Mod (http://www.youtube.com/watch?v=ktArmnuRCtY#)

Hmm..yep, that looks great (except for the intro video skip).

3) Have you tried this with the Space Ace enhanced rom? I imagine the process would be very similar?

Quote
Not yet tried, but yes, it should be very similar solution for the Space Ace Enhancement.

Cool - that will be great.


4) Not sure if this matters much, but the file version of Daphne that you have made is 1.0.7; mine is 1.0.12 - although I'm not sure how I got this, because I re-downloaded from the official Daphne page and got, I think, 1.0.10. I did notice that all three of these versions have different files in the main /Daphne folder - most of them seem to be related to the Ogg Vorbis sound support. Confused...

Quote
If you run with my files then you should see similar results to my above video.  Did you extract all my files or just the Daphne executable?  I suppose I can try compiling under the latest Daphne version. 
I didn't bother compiling all of the dependant libraries for Daphne (including Ogg Vorbis).  I dropped DLL's into the Daphne folder instead.  You can delete them if you already have DLL's installed into your system folder. 

I'll mess around with this some more - I'm sure it has something to do with those DLLs or something. If it's not too much trouble, a recompile based on the latest Daphne would be appreciated.
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: degenatrons on November 07, 2013, 11:17:17 am
Quote
I'll take another look at reverting speed back to normal before the intro sequence kicks in.

That would be awesome; I'm thinking your method must be the same as the Daphne author's, so should be able to get the intro to play normally.

This is different to the Daphne author's method.  I'm actually speeding up the emulation in Daphne, as apposed to instructing the rom to perform a fast boot.

I can get the game to show the full intro if I force emulation speed back to normal after 4 seconds into boot.  Problem I'm having now though is that input is disabled until the intro sequence plays through one time.  So have to wait until sequence finishes to enter coins and start game. Maybe this is acceptable though.

I will build this with the latest Daphne version and post here when I get chance.

Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: ark_ader on November 19, 2013, 02:56:07 am
Great so this will speed up my LDP boot time?  :lol
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on January 02, 2014, 03:49:05 pm
Hey degenatrons,

Any luck with recompiling this, with getting the controls to work before the intro has played through, or with applying the same method to Space Ace enhanced rom?

Thanks!
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: benll64 on March 06, 2019, 01:25:52 pm
Degenatrons -

It's been 5 years since the last thread on this post - I'd almost forgotten that I made it!

By any chance, did you ever take any further steps with this? You came closer to solving this than any other efforts that I know of...

Thanks, man!
Title: Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
Post by: DirtBagXon on March 07, 2023, 03:23:08 am
Hi guys,

I have made some progress on this topic.

I have managed to get boot time for the enhanced roms, using -fastboot, to about half the default period.

  sae: 42s to 25s
  dle: 32s to 15s


The user is able to observe boot progress far sooner, with no prolonged black screens.

sae seems to behave fairly correctly, but dle21 has an attract mode issue that doesn't resolve itself until first play.... but as you're fastbooting I assume you will want to play,.

As it's a direct rom memory patch, as per the other fastboots, I need some gameplay testing to ensure this hasn't introduced some weird bugs.

Keep an eye on the hypseus-singe repo commits, or hop onto the Discord I'd like to put out a test exe.

Update: Some video here showing new boot times:

https://www.youtube.com/watch?v=rdlDQIN_oEw