Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. Viva La Luna

    Viva La Luna A.K.A. crypt0nymous Member

    Joined:
    Jun 7, 2012
    Messages:
    82
    Location:
    Istanbul
    I have a question, exclusively for vladikcomper, since he is the creator of MegaPCM driver;


    While I was making a music for my Sonic 1 hack, I decided/tried to rip some of the orchestra hit samples out to the hack, And it was painful to set the right pitch for it. However, It's cleanly done like a boss, the hits sound harmonic, but I have a more painful problem. The pitch was well-matched when I play it at Gens/Kega. But it sounds different, a slightly bit faster in Regen. And it completely disrupts the music. And I'm afraid it won't also sound right in hardware, too...


    I have a only one question, although I don't want to ask it :p Did I just do something wrong? If not, do we have a way of fixing that, to make the speed doesn't shift in differents emulators/hardware? I ask that because the "Mortal Kombat II Unlimited" hack does have a option for the speed of the sound, by choosing which emulator you use.
     
    Last edited by a moderator: Sep 8, 2014
  2. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    911
    Location:
    the united states. where else?
    Good luck. You'd either be sacrificing features, or making a guide detailing the aforementioned changing of every sound ID in a Xeno disasm.

    It's funny that you say you have no use for the driver. I can remember when you tried using the original Clone Driver, way back when.



    Sacrificing features? Good sir, may I kindly ask what you're talking about? You don't have to sacrifice a damn thing. All you have to do is port things from the Git disasm with a few modifications (seems a bit counterintuitive for an older disasm, I know, but trust me, it's logical) and change the sound IDs accordingly, which is such a simple task it can be done within a 30-minute timespan and makes one's life more than a bit easier. No features sacrificed. Now everybody's happy (well, except the people who say the Git disasms are the best things to use, but I'll write in great length about that at a later date).

    Also, just for the record, I'm using flamewing's improved S3K driver in my hack now, hence why I say I don't really have much of a use for the Clone Driver V2 at the moment. Of course, I may use it sometime in the future...

    Also also, your statement that the Xenowhirl disasm isn't built to have its driver replaced is in every possible aspect incorrect; I've put in the S2 Clone Driver (original one, mind you, as I was relatively uninformed about the Clone Driver V2's capabilities and the S3K/flamewing driver's capabilities at the time), then put in the S3K/flamewing driver later on with more or less no problems. Xenowhirl disasm is just as possible to work with as the Git disasm, if not more possible, but as I previously said, I'll touch on that later on down the road.

    All that said, something tells me I'm going to end up with -9001 rep just for this post :U
     
    Last edited by a moderator: Sep 7, 2014
  3. Clownacy

    Clownacy Mania bad Staff

    Joined:
    Aug 15, 2014
    Messages:
    901
    The feature in question is the additional $80 sound slots. Unless you shift all music calls from $80+ to $00+ and all sound calls from $A0+ to $80+, you won't have access to them.

    Again, the lack of sound ID constants is what makes the Xeno not built to have a new driver. You got lucky because of the original Clone Driver's matching sound IDs. If you want an example of the very worst case in which the IDs don't match, see the SCHG Port S3 Driver to S1 guide. It may be possible, but nowhere near as possible.
     
  4. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    390
    Location:
    Russia
    No, you didn't do anything wrong, it's an emulation issue. I'm afraid, the only way I see to resolve it is to have an emulator option like you said it was done in "Mortal Kombat II Umlimited".

    The problem here is that the DAC driver strictly relies on instructions timing to alter the time between sending samples (in other words, the playback speed or sampling pitch), that's the only way you can pull it off given SEGA's bad hardware design when it comes to dealing with the DAC. Dozens of instructions occur during the playback loop, and each of them takes a different number of processor cycles to execute. If you look through the bits of Mega PCM source code, you may see how counting each and every cycle is critically important to get sample timing done precisely.

    Getting timing right requires an extremely accurate emulation, and I'm afraid, some of emulators out there fail to accomplish this accuracy. Both Kega and Regen emulate the Z80 in a slightly different ways and those slightest differences become pretty noticeable when a high precision is required. And that's just your case. The fact is, the higher the frequency of your samples is, the more emulation precision it need to be played correctly. It wasn't audible with most of the games which mostly kept frequencies at 11--16 kHz, but it's quite noticeable with Mega PCM, when you can play samples at 26+ kHz.

    I came across the same issue some time ago and I made several conclusions about emulation accuracy of Kega and Regen. Ironically, it's Regen that gets timing wrong (that's one of the rarest moments of Regen failing to Kega/Gens in emulation accuracy). When Z80 attempts reading samples through the 68K window, it requires some additional time compared to reading it's own memory, because it has to wait for the 68K to provide the bus. It mostly takes 4 additional cycles, but Regen doesn't take that into account, and Kega seems to emulate this (probably, Gens too, since you say it sounds the same there). I had playback issues with a certain proof-of-concept of mine between Kega and Regen, and when I ran it on the actual hardware, it sounded nearly identical to Kega's output.
     
  5. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,153
    Location:
    Triton (Moon)
    How do you completely reset the Z80 system? My hack requires a complete reset to be possible part way through, and I fear that the Z80 isn't reseting at all.
     
  6. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    911
    Location:
    the united states. where else?
    move.w #$100,($A11100).l ; stop the Z80
    move.w #$100,($A11200).l ; reset the Z80 
    The above code will reset the Z80. I haven't equated this because this way, it will be compatible with any disassembly.
     
    Last edited by a moderator: Sep 9, 2014
  7. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    Maybe this was asked before, but:

    What should have a boss object to work? I tried studying the GHZ boss code for reference, but I can't understand nothing. Any tips or schematic asm (example labels) are both good.
     
  8. PotterAndMatrixFan

    PotterAndMatrixFan Newcomer Trialist

    Joined:
    Sep 5, 2014
    Messages:
    16
    Location:
    Uh, Earth maybe :]?
    Anyone knows how to give Tails and Knuckles their separate Super/Hyper sprites and mappings for Sonic 3 & Knuckles?

    Also how can I make Tails to be in Sonic's size without getting him cut off in half (also for S3K)?
     
    Last edited by a moderator: Sep 9, 2014
  9. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Look at how Sonic loads his mappings, and DPLCs, there is a Super_SonicKnux_flag check, to load different files of them, when super, also has a flag check to load extra art they couldn't fit in the normal art file, because of tile limitations. Once you understand how they did it with him you should be able to do it with Tails and Knuckles. Hint: Super Sonic's art is shared with normal Sonics art.

    Edit: Someone else will have to answer the other question for you.
     
    Last edited by a moderator: Sep 9, 2014
  10. Clownacy

    Clownacy Mania bad Staff

    Joined:
    Aug 15, 2014
    Messages:
    901
    Forgive me, I've never tried making a boss before, but along with the boss object itself, you should need a Dynamic Level Event to spawn the boss, maybe set some parameters for the boss, play the boss music, set Current_Boss_ID. Looking at it now, the Levels Events seem to play a large part in boss handling.
     
  11. Painto

    Painto Samodzierżca Najdłuższego Kija Member

    Joined:
    Mar 24, 2014
    Messages:
    315
    Location:
    Poland
    That's all I know. But I meant the boss object itself.
     
  12. Kaz

    Kaz Well-Known Member Member

    Joined:
    Nov 2, 2013
    Messages:
    66
    What is the equivalent of loc2_1ACD0 (Hivebrain/SVN) in the GitHub disassembly of S1? I swear, some labels are impossible to find here...
     
    Last edited by a moderator: Sep 10, 2014
  13. Crash

    Crash Well-Known Member Member

    Joined:
    Jul 15, 2010
    Messages:
    302
    Location:
    Australia
    There is no equivalent because that label comes from the Spin Dash guide on Retro.
     
  14. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,870
    Regarding making a boss; you could in fact have the boss object loaded via object position (i.e. level position objects), and have the actual boss itself lock the screen, load the art, etc. That should make it a little more easier to maintain and control.
     
  15. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,153
    Location:
    Triton (Moon)
    While trying to install the flamewing driver into the github S2 disassembly using this guide, I got some odd errors, which seemed to be trying to jump to lines that never existed in the first place, and weren't added in the guide. The log file is available below.

    S2.log
     
  16. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    There's a bunch of labels that don't exist. You need to find the old labels that were erased during the driver insertion process, or rename said lines to the new labels that are in the new driver. Either way they should be solved when you define them.
     
  17. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,153
    Location:
    Triton (Moon)
    They weren't deleted when I inserted the new driver, I checked with a clean copy of my previous ASM. I don't know what the equivalent in the github version is, either, so I'm stuck.
     
  18. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    How do you add loops to Spring Yard Zone?
     
  19. FFuser

    FFuser a.k.a Darklight Member

    Joined:
    Nov 14, 2013
    Messages:
    88
    I think after you design it in the editor, then whatever chunk ID # your new loop has +$80 needs to be added to the loopnums.bin file in the misc folder. So for example if your chunk ID # is 3A then insert "BA" ($3A + $80) into that file.

    I don't know if it needs to be in a particular order. Maybe someone else can clarify that.
     
  20. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    I made the loop have a 35 ID for the loop, same as the GHZ one.