|
Post by walker7 on Dec 20, 2009 20:58:14 GMT -5
In the Sonic 2 music format, since $00-$7F denote the note lengths, what is the byte value used for a quarter note, a half note, whole note, triplet, etc.?
|
|
|
Post by Mairtrus on Dec 21, 2009 8:32:09 GMT -5
kram1024, great work!!! This is a good way to use more sound hardware then Shiru's TFM does!!! I have got real SMD system with flash cart and can test it on real hardware. But I have PAL machine Can somebody explain me how to speed up song a little for a 50Hz hardware? You should have no problems, since the Z80 SMPS does not depend on the verticals interruptions to play music. Anyway, the bytes 4-5 changes the playback speed. Byte 5 changes the speed a little, while the byte 4 changes the speed a lot. In the Sonic 2 music format, since $00-$7F denote the note lengths, what is the byte value used for a quarter note, a half note, whole note, triplet, etc.? There is no real equivalence, but since $00 is the maximum length and $01 the minimun (yep, it's 01,02...7F,00), I like to use the following equivalent list: 00: Whole 40: Half 20: Quarter 10: Eighth 08: Sixteenth 04: Thirty-second 02: Sixty-fourth A triplet can be done by dividing the note lenght by 3 and fixing the values to get, by addition, the length of the original note. For example: To make a quarter triplet, you can do 32/3=10.66, so you will have 11+10+11 ($0B+$0A+$0B). I do it this way and gives me really acurate results.
|
|
zephyr
Burger Head
Delphi & Turbo Pascal Coder
Posts: 22
|
Post by zephyr on Dec 21, 2009 14:33:09 GMT -5
Mairtrus, thanks, but in what place I have must made change's??? Can you give a little example??? Engine work slower on PAL machine - you can use last Regen emulator with Europe setting country to see it
|
|
|
Post by walker7 on Dec 26, 2009 4:20:57 GMT -5
I have more questions: What must be done so that when writing to addresses like $A00000 or $A04000, it does not give a 68K illegal operation and instead, plays the music like normal? And in the Sonic 2 ROM, where can the piece of code that reads and writes the music headers be found?
|
|
|
Post by TheMVRules on Dec 28, 2009 11:41:29 GMT -5
Enable bus request. I think it is by writing a 0100 to A11000 to enable and 0000 to disable.
|
|
kramlat
Moldy Popcorn
got slack?
Posts: 42
|
Post by kramlat on Apr 2, 2010 6:59:34 GMT -5
pal speed issue? hmm, if the music is too slow, you can simply change the timing info in the song header (first byte of timing is timing divide, second byte is timing key, those change the speed of the music itself) sure that would make the music faster or slower as you choose, but then the speed of music would be odd on an ntsc machine. the problem you specified has shown up in sonic games a lot. some games in the series seem to play slower music on european megadrive systems than in ntsc ones. just make sure that the rom header is set to pal-only and change the music tempos in the songs.
edit: all sonic games that are effected are ones that use smps-z80, those include sonic2, sonic3, s&k, and sonic 3d blast. the kramlib version is a direct port of the sonic3 driver. most people do not notice this slowdown because they are used to the music tempo of their localization, but it happens and I have no idea why, it has nothing to do with interrupt calls, besides the slowdown is by too much for screen size to be effecting the tempo, also the changetempo routine can speed it up too.
|
|
|
Post by Tom Maneiro on Apr 2, 2010 13:13:05 GMT -5
Given that BEX can detect the console/TV region and set the execution mode based on that (with TVType, UnitType and TVSet), is it possible to set the song speed at runtime? Or will i need to pack two versions of the song (one for PAL, one for NTSC) in the same ROM?
|
|
kramlat
Moldy Popcorn
got slack?
Posts: 42
|
Post by kramlat on Apr 2, 2010 15:19:25 GMT -5
the speed is in the song itself, but region detection with a call to ChangeTempo routine can be done too. ChangeTempo does the sonic3 speed shoes music effect.
|
|
|
Post by TheMVRules on Apr 4, 2010 2:49:57 GMT -5
No, simple use a simple MOVE.b to z80 where the speed byte is set.
|
|