ThomasSpeedrunner Help Thread

Discussion in 'Discussion and Q&A Archive' started by ThomasThePencil, Jan 29, 2013.

Thread Status:
Not open for further replies.
  1. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    The file is spelled properly, it's in the same location, and it IS meant to be a and not a /, because that's how it is with every other file. The file was converted using vladikcomper's converter, but I don't see how doing it that way could change anything. One thing I will note, however, is that it outputs the conversion as an AU Format Sound and not a more proper .bin file. Does this change anything?
     
  2. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    How do you understand the definition of 'a proper BIN file'?

    BIN stands for Binary Data, which virtually means no specified format. You may have two files with the same .bin extension that store sound data, but one should be played as DPCM and another as PCM. How does this extension defines the format of data stored in file? Nohow. Binary files contain pretty much everything - art, palette, music and so on. This is just a generic extension which is used everywhere just because most of data is in game-specific formats, there's nothing that modern OSes support or recognize.

    Then, the SND extension isn't really an AU Sound Format here. As I said, this is just a raw headerless 8-bit PCM stream. I just picked this extension because it's the one that GoldWave uses for raw sound files, so I usually keep PCM samples with rather SND or RAW extension, also helps not to confuse them with DPCM samples with BIN extension.

    I don't see why you need to care about file extension. This doesn't change anything. You could even use the .mp3 extension for all your DAC samples, but this won't make them appear in MPEG Layer 3 format.

    Of course they are. The DAC driver just won't know how to play the sample without these bytes properly set.

    The format is the following:


    dc.l <SlotOffset>, <SampleOffset>
    dc.w <SampleSize>
    dc.b <Pitch>,0

    SlotOffset - address in Z80 RAM where to write this sample slot data to, but in a slightly modified form.

    SampleOffset - address of the beginning of sample in the ROM.

    SampleSize - size of the sample file. Likely in bytes (I don't remember exactly whether it's bytes or words for JMan's driver)

    Pitch - sample's pitch.

    The last zero byte is just used to align the next slot data on even address. Actually, from what I see in code, it could be used in multi-banking mode, but I doubt you'll need one.

    (Honestly speaking, the DAC table is horribly implemented in this driver. And Calculate_PCM code simply wastes a lot of CPU cycles: it calculates slot data every time SMPS requests to play a sample, instead of just precalculating the whole data and not rewriting it all over again. But well, it was okay for its time and you didn't really have a choice back then... I'm planing to implement Mega PCM in the Clone Driver soon. Mega PCM's macros build everything about the DAC table during the compilation, so you don't even need that huge Calculate_PCM routine that wastes CPU cycles)
     
  3. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Ah, now I get it.

    Well, I look forward to seeing Mega PCM in the Sonic 2 Clone Driver.

    And speaking of DAC, I figured out what I was doing wrong. I was putting .bin instead of .snd, not to mention that my SK DAC file had the .bin extension shown when I converted it, which ended up throwing me off entirely. Note to self: check to see if real extension is same as shown extension :U
     
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Erm...I've been toying with this a bit, but can't get it right, so I want to ask: How would I be able to get the Tornado to stop moving at a certain X position in Sky Chase Zone?
     
  5. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    What do you mean? An X position absolute to the whole level (e.g. like it is now, you arrive at a certain point and the level transition to WFZ takes place) or an X position relative to the screen (e.g. you can't go too much on the right, but the level keeps going)?
     
  6. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    I'd recommed taking a look at the Tornado object. What have you tried??

    Edit: wait what exatly are you trying to do, its unclear to me?
     
    Last edited by a moderator: Apr 14, 2013
  7. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I mean an X position absolute to the whole level.
     
  8. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    So you are trying to extend the level is what your saying?

    Edit: Oh wait you want the level to be part Tornado and part on foot?
     
    Last edited by a moderator: Apr 14, 2013
  9. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    No, the very end is a transition of sorts from Aerial Chase to Arcane Airship, signpost not included. So I want the Tornado to stop moving when the max X position of the camera has been reached.

    EDIT: I would post a video explaining what I mean, but once again my laptop has no Internet access.
     
    Last edited by a moderator: Apr 14, 2013
  10. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I apologize if I sound a bit impatient here, but has anyone figured it out yet? I just cannot get it.


    EDIT: Also, would it be possible to make the S&K DAC samples use a different bank than the default ones for the Sonic 2 Clone Driver?
     
    Last edited by a moderator: Apr 14, 2013
  11. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Cut this shit out, you've been told about this once already. People have lives and will reply once they have the answer, or when they are available to answer. Until that time arrives, you wait. Any more of this and you'll be back to moderated posting indefinitely.
     
  12. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
  13. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    I don't mean to be tuting the whistle here but do you do any research before posting a question? You have a thread that's 20 pages long for crying out loud @_@.

    The clone driver doesn't use DAC banks. Just a table and individual samples. The table defines how the DAC sample should be played, and its ID. So I don't even know what you're asking.
     
  14. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Okay. Essentially, I want to take what I have now:


    PCM_Table: dc.l $A00200, DAC1 ; start of default DAC sample definitions
    dc.w $352
    dc.b $19,0
    dc.l $A00208, DAC2
    dc.w $770
    dc.b $4,0
    dc.l $A00210, DAC3
    dc.w $576
    dc.b $8,0
    dc.l $A00218, DAC4
    dc.w $BB5
    dc.b $A,0
    dc.l $A00220, DAC5
    dc.w $1016
    dc.b $1D,0
    dc.l $A00228, DAC6
    dc.w $622
    dc.b $C,0
    dc.l $A00230, DAC7
    dc.w $5C4
    dc.b $1D,0 ; end of default DAC sample definitions
    dc.l $A00238, SK_DAC1 ; start of S&K DAC sample definitions
    dc.w $77E
    dc.b $6,0
    dc.l $A00240, SK_DAC2
    dc.w $46D
    dc.b $6,0
    dc.l $A00248, SK_DAC3
    dc.w $2CF
    dc.b $6,0
    dc.l $A00250, SK_DAC4
    dc.w $71C
    dc.b $6,0
    dc.l $A00258, SK_DAC5
    dc.w $1227
    dc.b $6,0
    dc.l $A00260, SK_DAC6
    dc.w $9FD
    dc.b $6,0
    dc.l $A00268, SK_DAC7
    dc.w $160
    dc.b $6,0
    dc.l $A00270, SK_DAC8
    dc.w $60
    dc.b $6,0
    dc.l $A00278, SK_DAC9
    dc.w $487
    dc.b $6,0 ; end of S&K DAC sample definitions


    ...and separate the default DAC from the S&K DAC. Hope that made my question clearer.
     
  15. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    Maybe I get it, you want to use two different PCM banks, and be able to choose a specific bank for each song, right? So a song can use the S1 drums and another song can use the S3 drums, all without the need to remap the drum numbers in the smps files.


    I think it can be done, but wouldn't it be simpler to just remap the drum numbers in the smps files?
     
  16. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Technically, it probably would be simpler, but I honestly don't want to have to go through the whole of SEVEN different SMPS files just to correct the DAC sample stuff. If it should be done, though, I suppose I could do it. But just in case, what byte(s) would one find the DAC pointer thingy in an S3K-converted-to-S1 song (like the current song being fixed, DEZ1)?
     
  17. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    The pointer to the PCM channel is always at the same place in the SMPS header.


    Bytes 0-1: pointer to the instruments


    Bytes 2-3: channel layout (FM+PCM, PSG; typically 0603)


    Bytes 4-5: tempo

    Bytes 6-7: pointer to the PCM channel


    Bytes 8-9: unused (typically 0000)


    Unless the song does crazy jumps with the F8 coordination flag, the PCM channel goes all the way from the pointer to the F6 coordination flag, which denotes the primary loop.


    Personally I edit SMPS files in ms-dos editor, but I understand not everyone likes to do that, so I can suggest you to try Cinossu's S1SMPS2ASM, which provides a textual representation of the SMPS data. In that way you can see what the PCM channel does and what's the best way to deal with it.


    And yes, editing SMPS files in ms-dos editor is awesome. Remember the first Matrix movie, when the operator looks at the raw Matrix code and says he can understand it just fine? It feels like that :p
     
  18. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Just tried S1SMPS2ASM, built...and I get a purple screen upon loading DEZ1 (it's one of the two songs I converted).

    EDIT: Well, I'm not very good with hex (but then again, I can't really say I'm that good with hacking in general just yet :U), so I'm going to provide a file with all seven ported yet broken S3K songs in it. If someone could please take the time to fix these, I would be very grateful, as I, for one, cannot seem to figure out how to fix them. Thanks in advance if someone fixes these. Never mind. I can just convert them and edit them freely from there.
     
    Last edited by a moderator: Apr 15, 2013
  19. nineko

    nineko I am the Holy Cat Member

    Joined:
    Mar 24, 2008
    Messages:
    1,902
    Location:
    italy
    I suggested S1SMPS2ASM to let you see the contents of the SMPS songs in a textual way, not as an actual mean of editing; if you want to edit the songs in ASM format and actually be able to use them, remember to replace the relevant incbin / binclude in your disasm with an include. Also, I think you'll need certain additional macro files to be present in your disasm directory, to deal with the macros used by S1SMPS2ASM.
     
    Last edited by a moderator: Apr 15, 2013
  20. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    Ah, now I understand. Also, S1SMPS2ASM may actually be my best bet for editing; I can just convert the .bin file to .asm, then if it needs editing, I can just edit it freely.
     
Thread Status:
Not open for further replies.