don't click here

Basic Questions & Answers thread

Discussion in 'Engineering & Reverse Engineering' started by Tweaker, May 29, 2008.

  1. Pacca

    Pacca

    ASM amateur Member
    42
    16
    8
    Labyrinth Zone
    Sonic 2 CD Remix
    Overly complicated mappings composed of lots of tiny pieces usually have trouble rendering, particularly if they're placed in a straight line. You're only real option here would be to eat up more VRAM so you can use larger sprite pieces.
     
  2. Devon

    Devon

    Down you're going... down you're going... Tech Member
    1,218
    1,374
    93
    your mom
    On the Genesis, if the horizontal resolution is 320 pixels (which the Sonic games use), then it can only display up to 80 sprites at once, and either up to 20 sprites per scanline or up to 320 sprite pixels per scanline (i.e. if you were to add up the widths of all the sprites on a scanline, and it adds up to more than 320 pixels, it will cut off, too).
     
  3. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,192
    404
    63
    Japan
    As complex as those mappings are, they are mostly vertical rather than horizontal so the horizontal limit would not be imposed, despite being a high sprite count they (including the text count) are still within the sprite per table limit too, and finally, being part of the title card means they are of higher priority than any sprite that would load behind them in the level (not that anything would be loaded at this exact point until the fade in), not to say the limit isn't an issue, but it's not the reason they are not displaying...

    I think the real issue here is the confusion of the Y position's of these sprites, I think you are treating the Y position byte as unsigned, when they are signed. Start the Y positions on those sprites from $80 instead of $00, I strongly suspect you will need to reposition the "oval" object's Y position such that it's positioned directly in the middle of the screen, to take full advantage of the Y range. Another factor is that your mappings are actually incomplete, even if they were positioned correctly, they would not fill the screen fully vertically.

    [​IMG]

    Code (Text):
    1.     dc.b $3C                        ; Oval          
    2.     dc.b $80, 0, 0, $68, 0            
    3.     dc.b $88, 0, 0, $68, 0            
    4.     dc.b $8A, 0, 0, $68, 0          
    5.     dc.b $90, 0, 0, $68, 0          
    6.     dc.b $98, 0, 0, $68, 0          
    7.     dc.b $9A, 0, 0, $68, 0          
    8.     dc.b $A0, 0, 0, $68, 0          
    9.     dc.b $A8, 0, 0, $68, 0          
    10.     dc.b $AA, 0, 0, $68, 0          
    11.     dc.b $B0, 0, 0, $68, 0          
    12.     dc.b $B8, 0, 0, $68, 0          
    13.     dc.b $BA, 0, 0, $68, 0          
    14.     dc.b $C0, 0, 0, $68, 0          
    15.     dc.b $C8, 0, 0, $68, 0          
    16.     dc.b $CA, 0, 0, $68, 0          
    17.     dc.b $D0, 0, 0, $68, 0          
    18.     dc.b $D8, 0, 0, $68, 0          
    19.     dc.b $DA, 0, 0, $68, 0          
    20.     dc.b $E0, 0, 0, $68, 0          
    21.     dc.b $E8, 0, 0, $68, 0          
    22.     dc.b $EA, 0, 0, $68, 0          
    23.     dc.b $F0, 0, 0, $68, 0          
    24.     dc.b $F8, 0, 0, $68, 0          
    25.     dc.b $FA, 0, 0, $68, 0
    26.     dc.b $00, 0, 0, $68, 0
    27.     dc.b $08, 0, 0, $68, 0
    28.     dc.b $0A, 0, 0, $68, 0
    29.     dc.b $10, 0, 0, $68, 0
    30.     dc.b $18, 0, 0, $68, 0
    31.     dc.b $1A, 0, 0, $68, 0
    32.     dc.b $20, 0, 0, $68, 0
    33.     dc.b $28, 0, 0, $68, 0
    34.     dc.b $2A, 0, 0, $68, 0
    35.     dc.b $30, 0, 0, $68, 0
    36.     dc.b $38, 0, 0, $68, 0
    37.     dc.b $3A, 0, 0, $68, 0
    38.     dc.b $40, 0, 0, $68, 0
    39.     dc.b $48, 0, 0, $68, 0
    40.     dc.b $4A, 0, 0, $68, 0
    41.     dc.b $50, 0, 0, $68, 0
    42.     dc.b $58, 0, 0, $68, 0
    43.     dc.b $5A, 0, 0, $68, 0
    44.     dc.b $60, 0, 0, $68, 0
    45.     dc.b $68, 0, 0, $68, 0
    46.     dc.b $6A, 0, 0, $68, 0
    47.     dc.b $80, 1, 0, $66, $08          
    48.     dc.b $90, 1, 0, $66, $08                
    49.     dc.b $A0, 1, 0, $66, $08                
    50.     dc.b $B0, 1, 0, $66, $08                
    51.     dc.b $C0, 1, 0, $66, $08                
    52.     dc.b $D0, 1, 0, $66, $08                
    53.     dc.b $E0, 1, 0, $66, $08                
    54.     dc.b $F0, 1, 0, $66, $08                
    55.     dc.b $00, 1, 0, $66, $08                
    56.     dc.b $10, 1, 0, $66, $08                
    57.     dc.b $20, 1, 0, $66, $08                
    58.     dc.b $30, 1, 0, $66, $08
    59.     dc.b $40, 1, 0, $66, $08
    60.     dc.b $50, 1, 0, $66, $08
    61.     dc.b $60, 1, 0, $66, $08
    I don't have your zig-zag art, but here's what your mappings would look like if they were positioned correctly, if the object was positioned correctly, and if you had enough sprites in the mapping list.

    Having said that, although this does not breach the limit here, it will breach the limit as soon as the level loads sprites afterwards, you will end up seeing objects not displaying in the level until the title cards are moved out the way, likewise, levels with larger names may also pose a problem, so the sprite limit will still be an issue for you and you are best advised to rethink this and perhaps find another solution. This is one instance where sprites are more valuable than tiles, and I recommend you take Pacguy's advice and make space for tiles somewhere so you can use larger sprite pieces, if you can free up 8 tiles in a row, then you can reduce the sprite count of this zig-zag down to 7 pieces.
     
  4. NyaNyaLily

    NyaNyaLily

    Previously CHRnyan Member
    88
    29
    18
    Alright, I've managed to free up quite some VRAM space to put the tiles in.
    So I did that, then I changed the "oval"s Y position to $FE and changed the mappings to:

    [68k]M_Card_Oval: dc.b 8 ; Oval
    dc.b $80, $F, 0, $66, 0
    dc.b $A0, $F, 0, $66, 0
    dc.b $C0, $F, 0, $66, 0
    dc.b $E0, $F, 0, $66, 0
    dc.b 0, $F, 0, $66, 0
    dc.b $20, $F, 0, $66, 0
    dc.b $40, $F, 0, $66, 0
    dc.b $60, $C, 0, $6F, 0
    even[/68k]

    The result is this:
    [​IMG]

    So it finally works now. I'd like to thank you all for your help.

    And now, for me to read the "Signed and Unsigned" part of the 68k tutorial again. :v:
     
  5. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Just a curiosity here. Is it worth the effort porting S3K's level format to S2? Or am I better off just working with S3K to begin with?
     
  6. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,192
    404
    63
    Japan
    The two have their own benefits over each other, but whether those benefits work in your favour is dependent on what exactly you want to do. It may also depend on your skill, or what skill you want to gain.

    For example, porting over something from S3K instead of using S3K will help you learn something about how that element works, on the other hand, using S3K instead will save you time to obtain whatever it is you want which involves that element in the first place. S3K could be considered the more optimal one providing you want you want immediately to get your work in, S2 could be considered more of a blank canvas requiring less to be ripped out in place of your own work.

    It really is circumstantial...
     
  7. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I know I'm probably going to need bigger levels than what S2 currently supports. I also want double jump abilities but...those aren't exactly difficult to implement depending on what the ability is.

    I thought of porting S3K's level format in the first place because I figured I'd be tripped up by a lot more "little things" down the road if I just used S3K as is.
     
  8. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,192
    404
    63
    Japan
    Well, in that case, my opinion is to go for it! Try porting it over~
     
  9. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    I did a little digging and it's all but necessary for my hypothetical project to port Sonic 3's level format. There's a lot of hardcoded mumbo-jumbo to sift through in the skdisasm as well. Yikes.

    I guess I'll start by describing Emerald Hill Zone in Sonic 3's format and saving that as a bin file. I'll figure out how to tell Sonic 2 how to actually use it the right way later next decade.
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    You can use LevelConverter in the SonLVL toolset to convert the layout to S3K format.
     
  11. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Hmm. That's good to know, though it feels like cheating somehow.

    EDIT: So I did something stupid and spent 10 hours following redhotsonic's "2 universal SST" and "port S3K priority manager" guides. After fixing other, dumber errors I got it to build and the game locks up after clearing a Emerald Hill Zone. Seems to be as soon as the continue jingle finishes.

    I tried to follow along with the git disasms. The guides were written 6-odd years ago...I'm not sure how different the gits are now from the SVNs back then.
     
  12. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Back with a dumb question, surprising no-one.

    Are 8x8 (and 16x16) mappings compressed in S3K? The wiki doesn't say they are, but it doesn't say they're not either. They are in Sonic 2 though.
     
  13. Wafer

    Wafer

    Find me on Twitter instead Member
    255
    75
    28
    8x8s use Kosinski, 16x16s use moduled Kosinski. Here's a handy tip: SonEd project files list compression for different content types, and you can find the reference for those types at the bottom of this page: http://www.headcannon.com/hchc/SonED/Docs/Project%20Files.html#Compression
     
  14. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    As long as I know there's compression involved I should be fine...I'd rather not wrestle with SonEd if can avoid it. I just need to read and re-read Sonic 2 and 3's respective level layout loading subroutines to complete my task. Cheers.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Actually it's backwards, tiles use Moduled Kosinski, blocks use Kosinski.
     
  16. How do I haxxors the arcade roms??/

    Seriously though. I'm trying to poke around in the Naomi, TPS, and Model 2 arcade versions of DOA games and they're all subject to some kind of encryption, which every emulator has bypassed, but I can't seem to find any guidance in opening up arcade files. Every article I've found is about older Z80 games like Pacman and Centipede. :/

    Edit: I found a bunch of values with Cheat Engine but don't have the technical skill to turn them into usable codes for M2, Mame, or anything. If someone could provide some guidance. My pointer function is broken and even then the one I did find doesn't quite work when I try to turn it into a script. I could really use some pointers myself (buh-dum-tish). But I've found things like both players' life bars, character slots (i.e. playable boss and leftover garbled beta characters), camera angle, and some other minor stuff. Still digging too.

    [​IMG]

    [​IMG]
     
  17. SHowin

    SHowin

    Member
    13
    0
    1
    So does anyone have a solution to SonicGLVL messing up objects when editing a stage? The two problems I've encountered include certain platforms that previously moved stay motionless after editing the stage and I can't get the fall signs to appear at all.
     
  18. i have been playing around with the character modifier PAR code "FFFF0B:00xx" where you can change what character you are playing, and was really excited when i found that you can activate the code before going in a bonus stage and switch characters mid act. the only problem is that if you do it from or to tails the sprite is all garbled. it definitely has something to do with going into the bonus stage because if you do it at the start of a zone his sprite is fine. as you can see it switches characters once you go in the stage, and then once you are out is when the sprite is messed up. i wanted to know if there is a way to make it so the sprite doesn't do that by altering the code or adding another one. it does the same thing if you go into a special stage, the only difference is it doesn't switch characters until you are outside of the special stage


    https://imgur.com/a/aJYS4PK
     
  19. SuperSnoopy

    SuperSnoopy

    I like Sonic Advance Member
    1,778
    740
    93
    Lyon, France
    Slice of life visual novel, coming soon...?
    Hum... maybe you should post this to the Basic Questions & Answers thread?
     
  20. Fred

    Fred

    Taking a break Oldbie
    1,563
    117
    43
    Portugal
    Sonic 3 Unlocked
    Assuming this is Sonic 3 we're talking about, the reason this happens is because when you enter a bonus/special stage, the game stores the player object's base VDP pattern ("art tile") so it can later be restored when you come back. This is done simply to preserve the player's sprite priority within the main level, but it also has the side effect of permanently applying whatever art address the player object had at the time -- this is why you permanently become a monitor or a HUD monster if you enter debug placement mode after activating a special stage ring, but before the fade out happens.

    In this case, the corruption happens because you enter the bonus stage as one character -- thereby saving their base VDP pattern -- and then come back as a different character, who promptly receives the art address of the one you went in as. Plenty of ways to fix this problem to be sure, but I'll try to find a PAR-friendly one when I get home.