Sonic and Sega Retro Message Board: Sonic 1 "Mega PCM" driver - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 4 Pages +
  • 1
  • 2
  • 3
  • 4
    Locked
    Locked Forum

Sonic 1 "Mega PCM" driver A new DAC driver for Sonic 1, version 1.1 is out!

#31 User is offline vladikcomper 

Posted 14 March 2013 - 02:51 PM

  • Posts: 170
  • Joined: 13-June 09
  • Gender:Not Telling
  • Location:Russia
  • Project:Sonic Winter Adventures
  • Wiki edits:1

View PostThorn, on 11 March 2013 - 01:57 PM, said:

vladikcomper: let me ask the obvious question, then... wouldn't it be practical to set up your driver starting from the Sonic 2 "clone" sound driver (a public, on-the-wiki port of the Sonic 1 sound driver to Sonic 2)? Granted, it's not 100% identical, but it does move things back to SMPS 68k. You've probably already thought of that and it's just not obvious in your answer, but I figured I should ask directly. I've considered looking into it myself, but :effort:.


Ehh, frankly, I totally forgot about Clone Driver =P

I've heard of it, but never used it myself, because I'm not hacking Sonic 2 per se. But considering it's 68K nature, this is definitely what I should be looking for. Thanks mentioning it. But that said, I'm still interested in pulling this thing with the original Sonic 2's sound driver.

EDIT: Quoted due to new page
This post has been edited by vladikcomper: 14 March 2013 - 02:53 PM

#32 User is offline ashthedragon 

Posted 23 March 2013 - 06:37 PM

  • Dragon Team
  • Posts: 1146
  • Joined: 23-February 08
  • Gender:Female
  • Location:Spain
  • Project:Sonic Paradise & Sonic Ages
Stupid question but...Can I have an already compiled .bin of Sonic 1 with the mega PCM driver working? I want to try it at real hardware but I've no idea of hot to compile asm

#33 User is offline vladikcomper 

Posted 24 March 2013 - 06:21 AM

  • Posts: 170
  • Joined: 13-June 09
  • Gender:Not Telling
  • Location:Russia
  • Project:Sonic Winter Adventures
  • Wiki edits:1

View Postashthedragon, on 23 March 2013 - 06:37 PM, said:

Stupid question but...Can I have an already compiled .bin of Sonic 1 with the mega PCM driver working? I want to try it at real hardware but I've no idea of hot to compile asm

Here you go: https://dl.dropbox.c...h_MegaPCM_HQ.7z
This example features Mega PCM playing a digital song on the title screen and replaces some DAC samples in game.

Actually, I've already showed two Sonic 1 disassemblies with Mega PCM in this topic. Both of them also have already compiled ROM for your convenience, see s1built.bin file.

Also, compiling a disassembly is pretty easy, just run build.bat file. If everything is successful, assembler will generate a ROM file for you. It's usually named s1built.bin in case of a Sonic 1 disassembly.

#34 User is offline ashthedragon 

Posted 25 March 2013 - 08:51 PM

  • Dragon Team
  • Posts: 1146
  • Joined: 23-February 08
  • Gender:Female
  • Location:Spain
  • Project:Sonic Paradise & Sonic Ages
Thank you!

#35 User is offline You-Are-Pwned 

Posted 29 March 2013 - 07:49 AM

  • Posts: 48
  • Joined: 28-August 10
  • Gender:Male
I just checked that version. Is it intentional that the Final Zone music plays in SBZ3? Could be a bug.

#36 User is offline vladikcomper 

Posted 02 April 2013 - 03:51 PM

  • Posts: 170
  • Joined: 13-June 09
  • Gender:Not Telling
  • Location:Russia
  • Project:Sonic Winter Adventures
  • Wiki edits:1

View PostYou-Are-Pwned, on 29 March 2013 - 07:49 AM, said:

I just checked that version. Is it intentional that the Final Zone music plays in SBZ3? Could be a bug.

This is intentional. As well as different music in GHZ 2 and 3 and somewhere else.

Because this isn't exactly a clean Hivebrain's disassembly, secretly, this is S1 Hacking Studio 2.0 version of disassembly, so I quickly did some music swaps and game tweaks because I was bored. A bit modified disassembly doesn't affect the way you apply Mega PCM guides at all.

#37 User is offline PsychoSk8r 

Posted 09 April 2013 - 03:11 PM

  • HighKnights
  • Posts: 2576
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
Anyone else working with the attempt to get this running in Sonic 2?
So far, I've managed to use the Sonic 2 Clone Driver as a base to follow this guide, doing what's required along the way for compatibility, to get this in the game, The game runs, SMPS files that came with the clone driver play (running on the "MegaPCM.z80" Driver), but I'm getting garbled DAC ingame.
Excuse the poor host, but here's my resulting ROM:
http://www.mediafire...f8s9ydxvyo9pjnv
Kick and Snare are in there, but as ASM code instead ("dc.b"), as I'm having trouble with bincludes. Timpani is replaced with the kick sample for now. Oddly enough, the kick plays perfectly instead of the Sega Sound on the Sega Screen.

Edit: After some more inspection, and getting the BINCLUDES working correctly (thanks to mainmemory), It appears that it was struggling to play the samples provided with MegaPCM, I used some custom uncompressed samples from a while ago, and it worked. I'm checking now whether it will take some compressed samples I've had laying around.
This post has been edited by PsychoSk8r: 09 April 2013 - 05:26 PM

#38 User is offline vladikcomper 

Posted 10 April 2013 - 04:26 AM

  • Posts: 170
  • Joined: 13-June 09
  • Gender:Not Telling
  • Location:Russia
  • Project:Sonic Winter Adventures
  • Wiki edits:1
Good job, PsychoSk8r!

I'm planning do a Clone Driver port as well and write a full guide, but I don't know when I can start, because now I have few other things I should finish first. Hope to get on it this month, eventually.

As for the garbled DACs issue you had, hearing how it sounds in the ROM you've provided, it looks like Mega PCM is trying to play compressed DPCM samples as uncompressed PCM. Ensure you've changed 'pcm' to 'dpcm' in playback flags for the compressed samples.

#39 User is offline PsychoSk8r 

Posted 10 April 2013 - 08:11 AM

  • HighKnights
  • Posts: 2576
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
I'm glad you'll take a look too, you're bound to know MPCM better than anyone else. =P
I've never been too big on hacking S2, but I have ported objects/routines between S1/S2 in the past (to test my limits). The Sound Driver is in, supports uncompressed custom samples, but I'll be damned if I can get dpcm working lol.
http://www.mediafire...9po8fbbx88c1cz8

Here are my results, complete disassembly, some bonus DAC samples I've had laying around. It's not quite there yet, but getting there. Hopefully this might help you a little.
Apologies if there are any files in there that shouldn't be, I did give the folders a quick once-over to remove unnecessary files. I think I may have left a rather large "DAC Sample" in the DAC folder (copied straight from a side-project). =P

#40 User is offline ValleyBell 

Posted 12 April 2013 - 02:10 AM

  • Posts: 204
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
The fixed IncludeDAC macro for the Xenowhirl disassembly is:
IncludeDAC macro Name,Extension
Name:		label	*
	binclude	"dac/Name.Extension"
Name_End:	label	*
	endm

It took me a while to figure this out when I adding nicer sample tables to S2 Recreation.

#41 User is offline PsychoSk8r 

Posted 12 April 2013 - 03:44 AM

  • HighKnights
  • Posts: 2576
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
Haha, sweet. That should keep things neater. There's got to be some data somewhere on how macros work differently with the two assemblers. Such a shame we don't have one assembler that's supported globally. Also, the "strcmp" (which I loved the usage of in this case) added to the IncludeDAC macro is incompatible. Googling for a compatible alternative yielded no results. =P

#42 User is offline ValleyBell 

Posted 12 April 2013 - 08:16 AM

  • Posts: 204
  • Joined: 08-September 10
  • Gender:Male
  • Project:researching SMPS sound drivers
  • Wiki edits:10
The AS manual has an example in Chaper 3.4.1 where two strings are compared in a sort of case insensitive way.
But there's indeed a lack of documentation for the assemblers. At least a txt with a link to the assembler manuals somewhere in the disassembly would be nice.

#43 User is offline PsychoSk8r 

Posted 12 April 2013 - 10:29 AM

  • HighKnights
  • Posts: 2576
  • Joined: 11-July 07
  • Gender:Male
  • Location:Walsall, UK
  • Project:30 Day Project: Revisited.A New Release!
  • Wiki edits:19
Excellent link. I think perhaps we should attempt to provide documentation with each disassembly, perhaps just throw in a new folder "_Docs" or something. It could be immense amounts of help to anyone trying to familiarise themselves, or porting code. The biggest challenge faced with porting large amounts of code is compatibility between assemblers, I've found.
Thanks for that link. =P

#44 User is offline Caverns 4 

Posted 26 April 2013 - 12:18 AM

  • Posts: 271
  • Joined: 07-December 12
  • Gender:Male
  • Project:Sanik Quest: Journey To The Right
I would like to see this able to work in Sonic 2. Partly because that's what I am hacking, but also partly because the page for porting the Sonic 1 sound driver into Sonic 2 provides an ASM file that looks like somebody screwed with it. There's a bunch of unintelligible garbage data in the file, some of with is replacing pointers and addresses. implementing this might be a good solution even if it's a little more (lot more) advanced than what I was to do.

It looks really awesome, excellent work! I didn't know the genesis was capable of this!

#45 User is offline Clownacy 

  Posted 13 August 2013 - 02:05 PM

  • Needs to make an avatar
  • Posts: 309
  • Joined: 06-July 13
  • Gender:Male
  • Location:Englandland
Building on what I gathered from the previous posts, I have compiled a guide on porting the Mega PCM driver to the Sonic 2 Clone Driver. Included in the guide is a fix for the DPCM bug, and Sonic 2 compatible Z80 stop and VBlank/V_Int optimisations.

Update 17/12/13 dd/mm/yy General clean up. Fixed some factual errors, formatted the last section to a better degree and made the 'Optimizing Z80 stops in SMPS' section an actual guide as opposed to a paragraph long 'I dunno.' Also, new opening.

Spoiler


Information stream:
Spoiler


Original post:
Spoiler

This post has been edited by Clownacy: 01 March 2015 - 09:53 AM

  • 4 Pages +
  • 1
  • 2
  • 3
  • 4
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users