Author Topic: Hacking a HuCARD game to play audio from the CD unit?  (Read 622 times)

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Hacking a HuCARD game to play audio from the CD unit?
« on: April 23, 2013, 06:47:24 AM »
Would it be possible to hack a HuCARD game so that whenever chip music should begin, the game instead plays a specified track from the CD drive instead?
So, for example, you could have the OutRun arcade soundtrack in the CD drive and have the game play those tracks instead of the chip music?

I had the idea while watching this: - although I adore the PCE music, this is also a fantastic arrangement and It would be amazing to be able to play the PCE to these tracks.
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #1 on: April 23, 2013, 07:14:34 AM »
Well, you probably COULD do it.   It would probably be a pain in the ass to locate the required calls though.   It would also be different for each game I'd imagine since each game uses a different sound engine.   Some games would be similar (Bonk/Air Zonk/Hudson crap), I'd bet.



I know with Squirrel at least, you could set a game up to trigger CD calls instead of card calls and have it start launching CD music at you.  


EDIT: You'd also need to have the CD-ROM bios jammed into the hacked ROM somehow so that the things required to make the calls are there.    This makes things considerably more pain in the ass. 

« Last Edit: April 23, 2013, 07:20:57 AM by Arkhan »
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #2 on: April 23, 2013, 07:27:48 AM »
Damn, I guess my dreams of playing Power Drift to the SST live arrangement are unlikely to come true.
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #3 on: April 23, 2013, 07:30:57 AM »
Damn, I guess my dreams of playing Power Drift to the SST live arrangement are unlikely to come true.

Yeah, it'd be a bit more effort than its worth considering you can just put the CD in a stereo nearby and turn the volume up. 

:)
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #4 on: April 23, 2013, 07:36:40 AM »
Perhaps we should just replace CD tracks with Chiptunes instead. Fancy remaking the Gate of Thunder OST in MML? :D
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #5 on: April 23, 2013, 07:42:20 AM »
Perhaps we should just replace CD tracks with Chiptunes instead. Fancy remaking the Gate of Thunder OST in MML? :D

looool.

No.

Maybe like one song, or two.  but all of them? NOoooooope.

Atlantean would never get done.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

sunteam_paul

  • Hero Member
  • *****
  • Posts: 4732
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #6 on: April 23, 2013, 07:56:32 AM »
OK, how about you just whistle the tracks and put them on the CD instead.
The PC Engine Software Bible
Quote from: Tatsujin
I just felt in a hole!

BigusSchmuck

  • Hero Member
  • *****
  • Posts: 3425
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #7 on: April 23, 2013, 07:58:56 AM »
Wasn't there a game that this was going to happen? Pity I can't remember what it was, but I do remember reading about it waaaaaay back in the day...

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #8 on: April 23, 2013, 08:01:26 AM »
Wasn't there a game that this was going to happen? Pity I can't remember what it was, but I do remember reading about it waaaaaay back in the day...


Insanity?

... i dunno
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

Black Tiger

  • Hero Member
  • *****
  • Posts: 11242
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #9 on: April 24, 2013, 07:25:36 AM »
Wasn't there a game that this was going to happen? Pity I can't remember what it was, but I do remember reading about it waaaaaay back in the day...


SFII'CE. The little known tricks thread has a code to make it work with the released version.

I haven't tried it, but if that trick is legit, then maybe hacking SFII' to find out how it controls the CD player might make it easier to hack HuCards to play CD music.
http://www.superpcenginegrafx.net/forum

Active and drama free PC Engine forum

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #10 on: April 24, 2013, 07:36:59 AM »
Wasn't there a game that this was going to happen? Pity I can't remember what it was, but I do remember reading about it waaaaaay back in the day...


SFII'CE. The little known tricks thread has a code to make it work with the released version.

I haven't tried it, but if that trick is legit, then maybe hacking SFII' to find out how it controls the CD player might make it easier to hack HuCards to play CD music.

I'm not an expert on the whole thing but I'd bet SFII can manage something like that because of the ROM size.  Maybe there is enough spare space to fit the CD BIOS related stuff in.

f*cking around with something smaller might result in alot of headache while trying to jam what is required into the ROM.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

SignOfZeta

  • Hero Member
  • *****
  • Posts: 8497
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #11 on: April 24, 2013, 08:11:31 AM »
Wasn't there a game that this was going to happen? Pity I can't remember what it was, but I do remember reading about it waaaaaay back in the day...




SFII'CE. The little known tricks thread has a code to make it work with the released version.

I haven't tried it, but if that trick is legit, then maybe hacking SFII' to find out how it controls the CD player might make it easier to hack HuCards to play CD music.


...what? I've never heard of this. It doesn't seem like a trick this big would remain "little known" for long.

ElSeven

  • Full Member
  • ***
  • Posts: 222
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #12 on: April 24, 2013, 09:05:02 AM »
i believe this is the post:

http://www.pcenginefx.com/forums/index.php?topic=13610.msg277464#msg277464

this trick will mute the normal bgm on SF2 so that you can play CD music with the normal sfx.  it might not be what you are expecting though, as the cd music just plays over everything with no regard to different menus or stages.

i rediscovered this trick when digging though the turbo list archives one night.  maybe there is a second part to this trick to trigger certain cd tracks for different stages? idk.
currently playing:
PCE - Raiden
SNES - Chrono Trigger
DC - Fast Striker

PCE LP

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #13 on: April 24, 2013, 09:16:33 AM »
Well, you probably COULD do it.   It would probably be a pain in the ass to locate the required calls though.   It would also be different for each game I'd imagine since each game uses a different sound engine.   Some games would be similar (Bonk/Air Zonk/Hudson crap), I'd bet.



I know with Squirrel at least, you could set a game up to trigger CD calls instead of card calls and have it start launching CD music at you.  


EDIT: You'd also need to have the CD-ROM bios jammed into the hacked ROM somehow so that the things required to make the calls are there.    This makes things considerably more pain in the ass.  




Charles Macdonald did some of his own CD routines that were outside the BIOS card. He wrote them himself. The byte string you feed the CD port is very scsi-ish and is already known (emulator authors have to emulate this, so it's known). There's also the Game Express card, in which they wrote all their own routines. That's only 32k, IIRC. Probably much less than that, if you just wanted to extract just the CDDA handle code/bios calls.
Quote
Would it be possible to hack a HuCARD game so that whenever chip music should begin, the game instead plays a specified track from the CD drive instead?
So, for example, you could have the OutRun arcade soundtrack in the CD drive and have the game play those tracks instead of the chip music?

I had the idea while watching this:
- although I adore the PCE music, this is also a fantastic arrangement and It would be amazing to be able to play the PCE to these tracks.


 Trapping the music routine to spy and see what song is being requested, is probably the easier thing to do. I've done this with Megman, Castlevania, Air Zonk and a few others. Matter of fact, if there's an HES file of the rom, then you can very easily see where the song track numbers are setup and hack from there - because of how only the music play is ripped and only a limited amount of ram is used for it, then trace this in the original rom. You just need to hook a piece of code that gets called first, on track select/play or command, that spies the track request. If the track request is a song (usually from a specific range of values of that byte), then you jump to an alt set of code that executes CDDA routines. Of course, that's where it gets more complicated. And yeah, it's game dependent.
« Last Edit: April 24, 2013, 09:23:21 AM by Bonknuts »

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Hacking a HuCARD game to play audio from the CD unit?
« Reply #14 on: April 24, 2013, 09:50:51 AM »
Charles Macdonald did some of his own CD routines that were outside the BIOS card. He wrote them himself. The byte string you feed the CD port is very scsi-ish and is already known (emulator authors have to emulate this, so it's known). There's also the Game Express card, in which they wrote all their own routines. That's only 32k, IIRC. Probably much less than that, if you just wanted to extract just the CDDA handle code/bios calls.
Yeah.  It's not alot of stuff, but you still need to jam the stuff in somewhere that doesn't muck things up.


Quote
then you jump to an alt set of code that executes CDDA routines. Of course, that's where it gets more complicated. And yeah, it's game dependent.


Yeah,  I don't think it'd all be worth it really.
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.