Basic Questions and Answers Thread

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

  1. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    What I do to remedy this is to have a row of solid chunks at the top of the layout, making the camera boundary 1 chunk below the top (pretty sure it's $100 if 256x256 chunks, $80 if 128x128 chunks). What they look like is up to you, they just have to have a solid bottom row of blocks. This way, players can't head over the top boundary no matter what they try. It may reduce the size of the playing field a bit, but I'm pretty sure that can be compensated for.

    This is, of course, not exactly a perfect fix, as the amount of usable level space is decreased slightly, but alas, I can't be bothered to come up with a true fix at the moment.
     
    Last edited by a moderator: Nov 11, 2014
  2. Kaz

    Kaz Well-Known Member Member

    Joined:
    Nov 2, 2013
    Messages:
    66
    S3 SMPS uses a Z80 driver for all Music/SFX, and S1 SMPS uses 68K driver for Music/SFX, except DAC. You would need SMPSConv to port the sound effects.
     
  3. Shockwave

    Shockwave 3 Time Stones Member

    Joined:
    Dec 18, 2013
    Messages:
    121
    Location:
    LA, CA
    What I do to remedy this is to have a row of solid chunks at the top of the layout, making the camera boundary 1 chunk below the top (pretty sure it's $100 if 256x256 chunks, $80 if 128x128 chunks). What they look like is up to you, they just have to have a solid bottom row of blocks. This way, players can't head over the top boundary no matter what they try. It may reduce the size of the playing field a bit, but I'm pretty sure that can be compensated for.

    This is, of course, not exactly a perfect fix, as the amount of usable level space is decreased slightly, but alas, I can't be bothered to come up with a true fix at the moment.You can also put solid chunks at the bottom of a level on the x-position where you don't want the player jumping over the level. That's a bit better than fixing the top level boundary for each level.


    Alternatively, you can modify the _LevelBound routine to have an additional top y-boundary check and stop the player's movement similarly to how the horizontal boundry checks work.
     
    Last edited by a moderator: Nov 11, 2014
  4. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    This seems a lot better than the fix I suggested since it requires no restriction of the boundaries whatsoever. May experiment with this later on this week and see what I come up with, since I'm getting back around to working on my hack anyway. Might as well start applying these patches.
     
    Last edited by a moderator: Nov 12, 2014
  5. Deadalive

    Deadalive Newcomer Trialist

    Joined:
    Aug 3, 2014
    Messages:
    19
    Location:
    Green Hill Zone
    When porting Tails to Sonic 1 I noticed one of his brown closely resembles the brown on Sonic's default palette. My question is, if I can only keep one blue which one should I keep? The lightest one?(which I think is also used for shields)
     
  6. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    All the shades of blue are used, if your messing with the blue at all, just change every color to an appropriate shade of the color you need.
     
    Last edited by a moderator: Nov 14, 2014
  7. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    I've recently ported Knuckles to Sonic 2, but I have 2 issues:

    • When I select Knuckles from options menu, he works perfectly. But when I select him, go to level select and start playing, he doesn't glide and climb. How can I fix it?
    • How can I add Knuckles to Special Stage? I tried to port mappings and DPLCs from KiS2, but it displays garbage.
    Thanks in advice.
    EDIT: Nevermind about the first one, actually it was in Knuckles object (the part which disables glide in demo but in S2 is LevSel.)
     
    Last edited by a moderator: Nov 15, 2014
  8. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,016
    The mappings in KiS2 are in S3's format. So if you haven't converted them, that is the cause of your problem.
     
  9. KingSerperior

    KingSerperior Newcomer Trialist

    Joined:
    Apr 7, 2014
    Messages:
    5
    Location:
    Waypoint 2
    Hey guys, lately I've been trying to port the Sonic 3 & Knuckles ring manager to Sonic 2, but I keep running into this error regardless of what I do;

    > > >s2.asm(23632): error: symbol undefined
    > > > teleport_swap_table
    > > >     lea    (teleport_swap_table).l,a3
    > > >s2.asm(23632): error: addressing mode not allowed here
    > > >     lea    (teleport_swap_table).l,a3
    > > >s2.asm(23633): error: symbol undefined
    > > > teleport_swap_table
    > > >     moveq    #(teleport_swap_table_end-teleport_swap_table)/6-1,d2    ; amount of entries in table - 1
    > > >s2.asm(23633): error: symbol undefined
    > > > teleport_swap_table_end
    > > >     moveq    #(teleport_swap_table_end-teleport_swap_table)/6-1,d2    ; amount of entries in table - 1
    > > >s2.asm(27477): error: symbol undefined
    > > > BuildRings
    > > >     bsr.w    BuildRings
    > > >s2.asm(27863): error: symbol undefined
    > > > BuildRings_P1
    > > >     bsr.w    BuildRings_P1
    > > >s2.asm(27977): error: symbol undefined
    > > > BuildRings_P2
    > > >     bsr.w    BuildRings_P2
    > > >s2.asm(28853): error: symbol undefined
    > > > loc_11FC8
    > > >     beq.w    loc_11FC8
    > > >s2.asm(28854): error: symbol undefined
    > > > loc_1201E
    > > >     bra.w    loc_1201E
    > > >s2.asm(51159): error: addressing mode not allowed on 68000
    > > >     lea    byte_28726(pc,d1.w),a1
    > > >s2.asm(51159): error: addressing mode not allowed here
    > > >     lea    byte_28726(pc,d1.w),a1
    > > >s2.asm(81287): error: symbol undefined
    > > > Touch_Rings
    > > >     jmp    (Touch_Rings).l
    > > >s2.asm(81287): warning: address is not properly aligned
    > > >     jmp    (Touch_Rings).l
    > > >s2.asm(81287): error: addressing mode not allowed here
    > > >     jmp    (Touch_Rings).l

     

    I tried doing things such as putting "even" at the parts that would normally trigger the addressing mode errors, but that failed to solve the problem as well.

    Any ideas on how to fix this?
     
  10. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    The "Symbol Undefined" errors occur when you attempt to have the code access a code label which simply isn't there. In your case "BuildRings", "teleport_swap_table", and "teleport_swap_table_end".
     
  11. JoenickROS

    JoenickROS ROS (bug fixing in progress) Member

    Joined:
    Feb 5, 2012
    Messages:
    929
    Sorry, but after that comment I have to explain what evens are for. Its for lining up data, issues can arise, (like crashing) if data is at odd addresses. I suggest you study up on things before you start porting from other games.

    Edit: Just some friendly advise, I know it didn't seem like it.
     
    Last edited by a moderator: Nov 15, 2014
  12. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    > > >s2.asm(23632): error: symbol undefined
    > > > teleport_swap_table
    > > >     lea    (teleport_swap_table).l,a3"teleport_swap_table" does not exist, it is likely an equate in the Sonic 3 & Knuckles disassembly, you'll have to search for it there, and copy it over.

    Code:
    > > >s2.asm(23632): error: addressing mode not allowed here
    > > >     lea    (teleport_swap_table).l,a3
    Ignore, only occurs because the previous error occurred.

    Code:
    > > >s2.asm(23633): error: symbol undefined
    > > > teleport_swap_table
    > > >     moveq    #(teleport_swap_table_end-teleport_swap_table)/6-1,d2    ; amount of entries in table - 1
    "teleport_swap_table" does not exist.

    Code:
    > > >s2.asm(23633): error: symbol undefined
    > > > teleport_swap_table_end
    > > >     moveq    #(teleport_swap_table_end-teleport_swap_table)/6-1,d2    ; amount of entries in table - 1
    "teleport_swap_table_end" does not exist.

    Code:
    > > >s2.asm(27477): error: symbol undefined
    > > > BuildRings
    > > >     bsr.w    BuildRings
    "BuildRings" does not exist, it is a subroutine in the Sonic 3 & Knuckles disassembly, you'll have to find it and copy it all over.

    Code:
    > > >s2.asm(27863): error: symbol undefined
    > > > BuildRings_P1
    > > >     bsr.w    BuildRings_P1
    "BuildRings_P1" does not exist, see above.

    Code:
    > > >s2.asm(27977): error: symbol undefined
    > > > BuildRings_P2
    > > >     bsr.w    BuildRings_P2
    "BuildRings_P2" does not exist, see above.

    Code:
    > > >s2.asm(28853): error: symbol undefined
    > > > loc_11FC8
    > > >     beq.w    loc_11FC8
    "loc_11FC8" does not exist, see above.

    Code:
    > > >s2.asm(28854): error: symbol undefined
    > > > loc_1201E
    > > >     bra.w    loc_1201E
    "loc_1201E" does not exist, see above.

    Code:
    > > >s2.asm(51159): error: addressing mode not allowed on 68000
    > > >     lea    byte_28726(pc,d1.w),a1
    What it's suppose to say is "relative distance too big" or something similar, to the point, where-ever "byte_28726:" is, it's too far away from that instruction.

    Code:
    > > >s2.asm(51159): error: addressing mode not allowed here
    > > >     lea    byte_28726(pc,d1.w),a1
    See above.

    Code:
    > > >s2.asm(81287): error: symbol undefined
    > > > Touch_Rings
    > > >     jmp    (Touch_Rings).l
    "loc_1201E" does not exist.

    Code:
    > > >s2.asm(81287): warning: address is not properly aligned
    > > >     jmp    (Touch_Rings).l
    Code:
    > > >s2.asm(81287): error: addressing mode not allowed here
    > > >     jmp    (Touch_Rings).l
    Ignore, only occurs because the previous error occurred.
    EDIT: vvv I could have sworn the best posters around here post something actually worth posting.
     
    Last edited by a moderator: Nov 16, 2014
  13. ThomasThePencil

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    I could've sworn there was a guide on this, but yay for people doing things without guides, I guess.

    *silently returns to lurking*
     
  14. LooneyDude

    LooneyDude Back after a long absence! Member

    Joined:
    Feb 1, 2014
    Messages:
    277
    Location:
    EVERYWHERE
    Sorry to just come out of nowhere, but in Sonic 1, in there a way to make Sonic use his underwater palette as his regular palette for a specific level? The level is dark, and a bright Sonic looks out of place. I'd prefer a solution for the GitHub disassembly, but I could work with a Hivebrain one, too.
     
  15. Pacca

    Pacca Having an online identity crisis since 2019 Member

    Joined:
    Jul 5, 2014
    Messages:
    1,175
    Location:
    Limbo
    You could have a check in sonic's init code that loads a seperate alternate pallete when you are in that zone. You'd have to add a seperate pallete to the list of available palettes to get it to work.
     
  16. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    If it's happening in a specific act, it'd be best to change which palette it loads in the level init code, when the palette normally loads. If it's for the entire zone, you just need to change the palette ID in the level load block.
     
  17. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    In Sonic.asm of the GitHub Disassembly, you'll find these lines:




    Level_LoadPal:


           move.w    #30,(v_air).w


            move    #$2300,sr


            moveq    #palid_Sonic,d0


            bsr.w    PalLoad2    ; load Sonic's palette


            cmpi.b    #id_LZ,(v_zone).w ; is level LZ?


            bne.s    Level_GetBgm    ; if not, branch


            moveq    #palid_LZSonWater,d0 ; palette number $F (LZ)


            cmpi.b    #3,(v_act).w    ; is act number 3?


            bne.s    Level_WaterPal    ; if not, branch


            moveq    #palid_SBZ3SonWat,d0 ; palette number $10 (SBZ3)



    I don't imagine it will be hard to figure out what to do from here. Good Luck!

    EDIT: After visiting your Sonic Zoom! Topic, I can see from the video you posted that you figured it out.  Good job!
     
    Last edited by a moderator: Nov 19, 2014
  18. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Another question that confuses me. Now I talked about this briefly on IRC, but I've always never understood this although I assume its probably simple. Regardless perhaps someone could shed some light?.

    I want to load alternative PLC, which of course has alternate art. So I've got all my art ready, I test it normally first, it loads fine. I do a check for in LoadPLC: to load the alternate art only when so and so happens, ok yup seems right. Do exactly the same for LoadPLC2:, build load the rom. Huh? everything loads the new art except one part of the PLC. PLC_Main: refuses to load the alternate art even though I've made the alterations and did the same check for it like LoadPLC.

    Is there something I'm not understanding here? I couldn't see LoadPLC2 to have anywhere else where it loads the standard pattern load cues when my file maybe overwritten. I always found this strange that everything in the load cues would load, apart from PLC_main: and it seems to relate to LoadPLC2:. I've fixed this before but it was unintentional so I have no idea what I did. So, does anyone know what I'm doing wrong?.
     
  19. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    PLC_Main is loaded before the title screen is displayed. Any changes you make post the title screen will not come into effect until you receive; a Game Over, a Time Over, completing the game, letting the demo finish, or returning to the title screen via "PAUSE" then "A" in debug control mode.

    A way of getting around this, is to relocate the PLC loading into the level set-up routine, go to "Level:" and right before the line "move #$2700,sr", insert this below:

    Code:
    		moveq	#$00,d0			; set PLC ID 00 (PLC_Main)
    		bsr.w	LoadPLC2		; load PLC information ready
    
    Level_WaitMainPLC:
    		bsr.w	RunPLC_RAM		; decompress a section of the art to RAM
    		move.b	#$0C,($FFFFF62A).w	; set which V-blank routine to run
    		bsr.w	DelayProgram		; wait for V-blank to occur (transfer decompressed art to VRAM)
    		tst.l	($FFFFF680).w		; is the PLC list finished?
    		bne.s	Level_WaitMainPLC	; if not, branch
     
  20. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Ah I see! so it was the fact that its called before the titlescreen that my alterations were not shown. I did see it being loaded but I was not sure if it actually had an affect at all. Thanks for clearing that one up Markey, appreciate it.
     
    Last edited by a moderator: Nov 21, 2014