Basic Questions and Answers Thread

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

  1. LuigiXHero

    LuigiXHero Well-Known Member Member

    Joined:
    Mar 22, 2014
    Messages:
    280
    What I used in the past was this old guide for Sonic 1 that saved inputs into sram and then you copy it over to disasm proper after you are done. Most of the tutorials from the tutorial section seems to be missing so I guess just wait until it's restored to find the guide. I'm sure it wouldn't be to difficult to get it to work in Sonic 2.
     
  2. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    So I'm having a major hassle trying to get my rom to build. Recently, I just ripped MegaPCM out of the hack (and tested it to see if it works (it did)) and tried to get Natsumi's ASM68k Z80 thingy working for it, but after getting everything all set up, my build.bat gives me "Too many file names specified". I've tried deleting files that are used (though I really didn't want to because it would've broken the game anyway) but only deleting ".lst" got me past the "too many names specified" error, and instead gave me "Symbol 'segapcm_sz' not defined" (Probably because that symbol was in .lst).

    heres the bat files code:
    Code:
    @echo off
    
    asm68k /p /k /c sound/z80/z80.asm, snd.unc, ,snd.lst
    FW_KENSC\koscmp snd.unc snd.kos
    IF EXIST s1built.bin move /Y s1built.bin s1built.prev.bin >NUL
    asm68k /k /p /o ae- sonic1.asm, s1built.bin, sonic1.sym, sonic1.lst >errors.txt
    convsym sonic1.sym sonic1.symcmp
    copy /B s1built.bin+sonic1.symcmp s1built.bin /Y
    del sonic1.symcmp
    rompad.exe s1built.bin 255 0
    fixheadr.exe s1built.bin
    Pause
    The specific line causing the too many files error is the one with ">errors.txt" attached to it
    I've tried looking online to see if I could find some help by looking around on Google.

    The only 2 addons that need to have files put into the .bat file that I'm using are:
    Vladikcomper's Advanced Error Handler and Debugger (It helped a bit when I was trying to figure out some crashes)
    and Natsumi's Z80 assember for asm68K

    I was thinking I'd need to split the bat file into multiple bat files to fix these issues, but I don't know how to go around doing that...
     
  3. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    There isn't enough information to go by... Would help to see the line that throw this error, the whole error message itself, and how the MegaPCM code is included with the game. Also, the lines around SEGAPCM would help too since that seems related. The 'too many filenames' comes from ASM68K when you try to pass more than 4 files as its arguments (its coded to recognize the ASM file, output file, symbol list and listings file only iirc)
     
  4. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    Well, I only really used the MegaPCM code to switch out the drum samples (Which is why I switched to your Z80 assembler thingy.

    Heres the Sega PCM code:
    Code:
    ; ===========================================================================
    ; btw, sorry for this monstrocity, I did not want to rely on modifying the driver or clunky
    ; external applications to make this any better, so you have this shit to deal with.
    ; I know it could be done miles better, but I wanted to show this off as more like a proof-of-concept
    ; than actual sensible implementation.
    ; This will break if you edit any part of the z80 driver code, so beware!
    
    Kos_Z80:    incbin    "snd.kos", $0000, $0015
            dc.b (SEGAPCM/$8000)&1            ; lsb of bank
            incbin    "snd.kos", $0016, $0006
            dc.b (SEGAPCM/$10000)            ; 8 other bank bits
            incbin    "snd.kos", $001D, $0093
            dc.b (SEGAPCM&$7FFF|$8000)&$FF, (SEGAPCM&$7FFF|$8000)>>8; bank location
            dc.b $21                ; ld hl,**
            dc.b SEGAPCM_sz&$FF, SEGAPCM_sz>>8    ; Sega PCM size
            incbin    "snd.kos", $00B5, $1647
    
    ; ===========================================================================
    Before Adding your Z80 assembler to my hack, I completely deleted all of the megaPCM coding (reverting it back to using vanilla Sonic 1 Sound driver).

    EDIT: While searching for the problem a bit longer, i figured out why it was spitting this error, I forgot to paste the line:
    SegaPCM_sz = *-SEGAPCM

    directly underneath the SegaPCM coding. x-x RIP ME Thanks for the help anyway!
     
  5. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Um, that code is designed for the default Sonic 1 driver as PoC. As it states on the comment, it is not really good idea to use it, anyways. MegaPCM disassembly was provided, and really all you had to change with a previous MegaPCM version, is to just change the file include for the driver binary (and of course do all the batch changes to assemble the driver too)... Quite simply, MegaPCM works very differently to the original driver and does not need any of this hackery to get it working.
     
  6. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    Before I put MegaPCM into the disassembly, I had the 2 fixes to get the music to return to normal speed when you hit a sign post, and the fm6 channel returning when the life music plays during the special stages. Afterwards, I was play testing my hack and noticed the bugs reappeared for some reason or another. o_O So, I was going to revert to the original Sonic 1 Sound driver (and was pretty much looking for a way to change the drum samples because I kinda liked the Sonic 3 drum samples I was using then.

    I did get MegaPCM fully working, I just wasn't happy with the 2 bugs reoccurring. :(
     
  7. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    Could have fixed them again. Possibly some change you did reverted them back (whether copying the entire driver in again or some specific lines)
     
  8. Samey

    Samey Le Bored Hedgie Member

    Joined:
    May 3, 2017
    Messages:
    57
    I checked the game and it appears the fixes are still there, I don't know what was going on when I added MegaPCM (I followed the instructions perfectly ._.). Honestly, I have no need to really use MegaPCM as I'm not giving Sonic or Robotnik a voice, nor am I trying to get digital music working. So, I'm just gonna stick to this sound driver. Again thanks for the help! :D
     
  9. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Trying to add Hidden Palace Zone from Sonic 2 Nick Arcade to Project Sonic 1: Two Eight, Following the ADDING A NEW ZONE tutorial.

    I did convert the level to Sonic 2, Then use correct compressions. However Loading HPZ gives GHZ art no matter what I do. Strangely, when I switch things over I can plainly see HPZ's tiles on GHZ & GHZ's everything minus correct layout on HPZ. And while typing this up I did make a change where I know I screwed up. It now loads correct blocks & chunks. I can easily see the HPZ pipes, yet still loads GHZ's tiles when I have it set to the converted tiles.
    Code:
    Blk16_HPZ: incbin HPZ\E-Blocks.bin; Enigma Blocks
      even
    Nem_HPZ: incbin HPZ\N-Tiles.bin ; Nemesis Tiles
      even
    Blk256_HPZ: incbin HPZ\Chunks.bin ; Kosinski Chunks
      even
    
     
    Last edited by a moderator: Jan 25, 2018
  10. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How and where are you trying to load the artwork at? All you've shown us is that you've included them in the rom. Is the artwork included in _inc/main level load blocks.asm like the guide says to? We don't have enough information to diagnose your problem, because you don't show us any of the changes you made.
     
    MainMemory likes this.
  11. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    as I've said I've followed the guide.
    I've added pallet to pallet pointers, added start location, added to main level load blocks
    Code:
    dc.l Nem_HPZ+$10000000
     dc.l Blk16_HPZ+$11000000
     dc.l Blk256_HPZ
     dc.b 0, $81, 4, 4
    
    what are those offsets for???
    added empty palcycle, bgscroll, aniart, (just an rts), Deform and resize using MZ.
    what I'm not understanding, while I was using an unused offset to load HPZ data, "Hidden Palace" text did appear, but now shows blank since I am doing it this way.
    GHZ's debug list (As seen on the video), collision added, level index added, no objects.
    As I've mentioned, I've made GHZ load HPZ's tiles instead & it has loaded HPZ's tiles with GHZ's Block & Chunk maps. Even though I have HPZ's tiles, blocks & chunks, it won't load HPZ's tiles at all, instead looks like GHZ's
     
  12. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    How would I lock the players controls for only one or two buttons? Closest thing I've found to this in game is the demo screen, but that locks every button, except for start. I want to make it so that the game ignores only a select few buttons.
     
  13. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I assume you are doing it for the characters themselves, so inside the character's object (for example Obj01: in Sonic 1's Hivebrain disassembly), you'll find:

    Code:
    		move.w	($FFFFF604).w,($FFFFF602).w ; enable joypad control
    Replace it with:

    Code:
    		move.w	($FFFFF604).w,d0
    		andi.w	#%SACBRLDUSACBRLDU,d0
    		move.w	d0,($FFFFF602).w
    S = Start
    ACB = A, C, B
    RLDU = Right, Left, Down, Up

    You swap these out with a 0 or 1.

    0 if you want to prevent the button from being used.
    1 if you want it to be useable.

    The first set of SACBRLDU will be "held" buttons, the second set will be "pressed/tapped" buttons.

    The rest of the code reading from FFFFF602 to detect buttons, will process naturally as normal, and any bits (buttons) you cleared, it'll be as far as the routines are concerned, that the buttons were never pressed at all.
     
    TheInvisibleSun, ProjectFM and Pacca like this.
  14. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    where do I look to in Sonic 1 to loop the top & bottom boundaries? I'm just about done porting HPZ

    with the exception of tiles & pallet which for some reason.
     
  15. AURORA☆FIELDS

    AURORA☆FIELDS so uh yes Exiled

    Joined:
    Oct 7, 2011
    Messages:
    759
    To me it is incredible, that after 5 years of me being in the scene and knowing about you, you still fail to port the HPZ. You did get closer at some point previously, but now you are back at almost square 1? Meanwhile I've gone from someone with no clue asking for your help to porting HPZ, to actually porting it, to knowing almost anything there is to know about porting HPZ, and yet you still come back from time to time to ask about it again. I don't want to be a rude or a dick, but have you considered this stuff might be just above your skill level? With this porting business and other hacks you have (attempted) to do, you seem to have awful little luck, because some of this stuff is not exactly simple. I would look for something easier to do, and gradually gain the experience to move onto more complex stuff, and when you feel you have good basic understanding on how all of this stuff works, then come back to it and see if you can do it in few days or so. This stuff isn't exactly rocket science, but you seem to not be able to wrap your head around what is the most sensible, and I would imagine, fun way to approach learning how to hack. Assuming, that is what you are after, since you ask here anyways.
     
    RouRouRou, Devon, SuperEgg and 9 others like this.
  16. warr1or2

    warr1or2 I AM CLG Member

    Joined:
    Apr 7, 2008
    Messages:
    416
    Location:
    Town Creek, AL
    Well I must be doing something right. It loads up right in Sonlvl, but what I'm not understanding is why everytime with HPZ, it loads GHZ's tiles, compared to porting EHZ I had Tiles, Chunks, Blocks & pallet working right... which I may go for again
     
  17. SuperEgg

    SuperEgg I'm a guy that knows that you know that I know Member

    Joined:
    Oct 17, 2009
    Messages:
    Location:
    THE BEST GOD DAMN STATE OF TEXAS
    You STILL aren't doing anything right. Holy fuck, 5 fucking years. You know, SonicBoom and I were talking about you a few weeks back and I asked if you ever figured this shit out, he didn't have an answer, cause he didn't care enough. Glad to see you don't care enough either, because porting levels from Sonic 2 to Sonic 128 is piss easy.

    For Sonic 2 Beta
    The 8x8 tiles are already Nemesis, don't need to convert them.
    Convert the 16x16 blocks from Uncompressed to Enigma
    For the chunks, just drop them into the folder
    Level Layouts need to be run through the converter
    Chunk layouts just need to be compressed into Kosinski. The rest needs to be whatever.

    For Sonic 2 Final
    Convert the 8x8 tiles from kosinski to Nemesis.
    Convert the 16x16 blocks from Kosinski to Enigma
    For the chunks, just drop them into the folder
    Level layouts, rings, objects, and chunk layout, need to be run through a converter.

    For both
    Collision maps are gonna have to be redone. If you have the skill(which I doubt you do considering, well above...) you can create your own code that reads a table based on which zone you're in and loads the Sonic 2 angle maps, so you don't have to convert.....

    Palettes and Rotating palettes are simply copying and pasting shit from the S2B disassembly.

    Last thing is to go into the ArtLoadCues and change the ghz tiles to HPZ tiles that load, because that automatically overwrite if you don't.

    Holy fuck, can't wait to see you fuck this up or ask another thousand questions. Or not, maybe you might get lucky and not spend another FIVE FUCKING YEARS on this.
     
  18. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    267
    To put what SuperEgg said in a more eloquent manner...

    Actually sit back and make an attempt to learn how this shit actually works. It's been 5 years.
    So here's the deal @warr1or2
    Your next post concerning posting HPZ must have actual progress. Not some garbled mess like you keep posting, but something that shows you've taken the time to actually figure this out (tiles displaying correctly, proper collision, etc).
    If you can't do that, every post you make concerning this subject is getting tossed to the trash because hand holding someone who is trying to walk when they can't even sit upright and crawl is silly.
     
  19. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    I sure am going to laugh if someone comes in this thread and shows off a working HPZ port just to one-up the guy who can't even edit a SonLVL file right...
     
    KCEXE and AkumaYin like this.
  20. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    Where can I find ported sound effects and/or PCM samples from Sonic CD? It seems that they've been ripped before (and properly converted in the case of sound effects), but all I've been able to find are dead links, with the exception of a handful of popular SFX.