Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)  (Read 18013 times)

0 Members and 1 Guest are viewing this topic.

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
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

Space Ace
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...






spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
Is it as easy as changing the daphenet.loadinfo.ini file to have the "other" rom listed and it's corresponding options?

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 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?

spoot

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 688
  • Last login:June 15, 2015, 10:36:18 am
  • Destroyer of electronics
Dunno either, I did a very rudimentary browse of the code over lunch....but that option really seems to be done from that file.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
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=

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 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.

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
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.

ppv

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 236
  • Last login:October 16, 2020, 03:08:56 pm
  • The cheap@ss gamer
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

Doing arcades, the cheap@ss way!
First Project : ttp://forum.arcadecontrols.com/index.php/topic,151071.0.html
Next one : The Token Muncher [urlhttp://forum.arcadecontrols.com/index.php/topic,135417.0.html[/url]

keilmillerjr

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1847
  • Last login:October 06, 2023, 10:20:39 pm
  • Web Developer.
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:

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #9 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.... :)

Rigby

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 171
  • Last login:August 26, 2014, 09:40:59 am
  • I am good at liking video games
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.

Dariusz

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:November 23, 2018, 02:41:36 pm
  • I want to Build My Own Arcade Controls!!
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #11 on: August 24, 2013, 06:32:03 am »
Has there been any progress on the fast boot?

D

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #12 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?


Hockeyboy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 221
  • Last login:April 17, 2022, 02:48:38 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #13 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.

SavannahLion

  • Wiki Contributor
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5986
  • Last login:December 19, 2015, 02:28:15 am
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #14 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.

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #15 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?


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #16 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. 

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19955
  • Last login:April 12, 2024, 11:03:32 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #17 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?
***Build what you dig, bro. Build what you dig.***

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #18 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?

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #19 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, thanks.");
      set_quitflag();
   }

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

}


« Last Edit: October 11, 2013, 08:08:23 am by degenatrons »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19400
  • Last login:April 15, 2024, 10:59:21 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #20 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.

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #21 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.

stevebower

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 2
  • Last login:November 20, 2013, 11:34:53 am
  • I want to build my own arcade controls!
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #22 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/

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19955
  • Last login:April 12, 2024, 11:03:32 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #23 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:
***Build what you dig, bro. Build what you dig.***

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #24 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?


degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #25 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?
 

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #26 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!

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #27 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

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19955
  • Last login:April 12, 2024, 11:03:32 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #28 on: October 04, 2013, 11:25:41 am »
* yotsuya <3 Haze
***Build what you dig, bro. Build what you dig.***

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #29 on: October 04, 2013, 01:37:36 pm »
Ummm....What?

yotsuya

  • Trade Count: (+21)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19955
  • Last login:April 12, 2024, 11:03:32 pm
  • 2014 UCA Winner, 2014, 2015, 2016 ZapCon Winner
    • forum.arcadecontrols.com/index.php/topic,137636.msg1420628.html
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #30 on: October 04, 2013, 01:52:19 pm »
Cleaned up thread!  :applaud:

I still <3 Haze.
***Build what you dig, bro. Build what you dig.***

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #31 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


« Last Edit: October 11, 2013, 08:10:30 am by degenatrons »

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #32 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.

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #33 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

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #34 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

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:
« Last Edit: October 11, 2013, 08:11:46 am by degenatrons »

benll64

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 81
  • Last login:December 17, 2020, 09:40:31 pm
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #35 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.


degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #36 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.  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.
« Last Edit: October 08, 2013, 08:17:08 am by degenatrons »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #37 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?

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #38 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. 

degenatrons

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 364
  • Last login:March 29, 2016, 05:53:23 pm
    • KADE
Re: ATTN All Programmers - Help improve Daphne (Dragon's Lair, Space Ace)
« Reply #39 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
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