News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Reveal by Mastertronic Music Ripping

Started by mlynn, 23:00, 11 October 24

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mlynn

I always like the Maple Leaf Rag and I had the Spectrum version of Reveal:
https://cpcrulez.fr/GamesTest/reveal.htm

The Spectrum version has beeper music but the CPC version has brilliant AY chip music. 
I wonder why the author didn't do a Spectrum 128k enhancement with this music?
For that reason I'd like to rip the music and try to convert it to the Spectrum 128k.

I've disassembled the game using WinAPE but I'm a bit stuck:
Here we seem to have code output every channel:
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif].l338a[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld ix,l33a9[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld c,#00[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]call l33b5[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld ix,l33ad[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld c,#01[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]call l33b5[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld ix,l33b1[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]ld c,#02[/font][/size][/color]
[color=#0f0f0f][size=2][font=Roboto, Arial, sans-serif]call l33b5[/font][/size][/color]

If this subroutine is changed to return early the sound output holds until the logo is displayed and the sound fades out when it goes into demo mode.

Although I have a few ideas about how the function reads the notation I can't find the notation data block, or how big it is.
Does anyone recognise this type of function and is it a common music format or was it written specifically for this game?

I've already ripped it in YM5 format and have a routine in STOS BASIC to replay it on the Atari ST!

Shaun M. Neary

Quote from: mlynn on 23:00, 11 October 24I wonder why the author didn't do a Spectrum 128k enhancement with this music?
A lot of budget software houses didn't bother. Mentality of "The 48k version will do for everyone". Quick and nasty.
Dizzy falls into the same category, they used a horrible beeper speaker version of the C64 title screen.
Currently playing on: 2xCPC464, 1xCPC6128, 1x464Plus, 1x6128Plus, 2xGX4000. M4 board, ZMem 1MB and still forever playing Bruce Lee.
No cheats, snapshots or emulation. I play my games as they're intended to be played. What about you?

arnoldemu

Hi,

Two things to note:
* Amstrad and Spectrum use different I/O ports to access AY
* the AY in the Amstrad is running at 1Mhz and the AY in the Spectrum is running at 1.7735Mhz. Therefore if you use the AY values direct the music will have a different pitch.

The most common player setup I've seen is play routine in Z80 (as you've already identified part of it. I think it starts around &3251 - seems to be a function for tune selection here), followed by a tone table (at &3411, it starts with &777 and goes down but it's fairly easy to see once you recognise it), followed by the data in the player's specific form (&34a8-&36f0?? unclear where the end actually is so some experimentation with extracting data would be needed). The player code will read this data which is in a special form runs the code to generate the final tone, noise, envelope etc values which are written to the AY (&323b is part of it - I recognise the OUT code pattern)

You have some choices.
* Take the play routine and data as it is, possibly patch it for a different location in Spectrum RAM, patch the I/O for the Spectrum and patch to convert the frequency for the correct pitch.

To patch to a different location I often choose to dissassemble the code and convert all the addresses where there are calls, jps and the destinations of jr/djnz etc to labels. Once I've got a re-assembleable version I can use org to relocate it. I then patch the OUT for the Spectrum (&323b -> OUTs for spectrum. PUSH DE: LD E,C:LD BC,&FFFD: OUT (C),A:LD BC,&BFFD:OUT (C),E:POP DE) and I'll have an initial version out of pitch. Then I'll patch in code to take the values just before they are written to the AY and use z80 code to compensate for the differences in Mhz.


* Use the YM data you've got on the ST, run it through one of the tools for CPC and use one of the CPC/Spectrum playback routines. The issue here is how much all this data will take and if you have space in RAM for it. (e.g. https://www.cpcwiki.eu/index.php/AYC). Here find a routine that plays it on the Spectrum and adjusts the tone if possible.

* If the tune is simple and short. Take the YM data you have and extract the per frame AY tone values, volume, noise etc. If necessary convert these to the notes. (https://www.cpcwiki.eu/imgs/2/2c/S968ap08.pdf might help). Re-enter these into a music tracker program that will generate for spectrum and generate the tracker and spectrum code that way.

I hope that all helps





My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod