don't click here

Basic Questions & Answers thread

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

  1. MarkeyJester

    MarkeyJester

    Time to Grow Up. Resident Jester
    2,128
    253
    63
    Japan
    <!--quoteo(post=445299:date=Apr 20 2010, 11:02 PM:name=McGuirk)--><div class='quotetop'>QUOTE (McGuirk @ Apr 20 2010, 11:02 PM) <a href="index.php?act=findpost&pid=445299">[​IMG]</a></div><div class='quotemain'><!--quotec-->But then why don't the horizontal spikes load checkpoint art by default if the mapping for the obj36 declare them to be at $8F80?<!--QuoteEnd--></div><!--QuoteEEnd-->

    Because...

    8F80 & 07FF = 0780 x 20 = F000 "VRam location"

    It's declare them to be at $F000, not 8F80 =P
     
  2. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    576
    0
    16
    Fort Worth, Texas, USA
    Making a Full-Sized Egg Carrier in Minecraft.
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->8F80 & 07FF = 0780 x 20 = F000<!--QuoteEnd--></div><!--QuoteEEnd-->

    Where did you get that 07FF number from? The wiki just describes a bitmask in the mappings, with 11 bits for the address, which multiplied by $20 should give the VRAM address. I'm thinking I've been reading something incorrectly that is giving me much trouble.
     
  3. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    5,181
    300
    63
    Lincs, UK
    TurBoa, S1RL
    <!--quoteo(post=445320:date=Apr 21 2010, 12:36 AM:name=McGuirk)--><div class='quotetop'>QUOTE (McGuirk @ Apr 21 2010, 12:36 AM) <a href="index.php?act=findpost&pid=445320">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->8F80 & 07FF = 0780 x 20 = F000<!--QuoteEnd--></div><!--QuoteEEnd-->

    Where did you get that 07FF number from? The wiki just describes a bitmask in the mappings, with 11 bits for the address, which multiplied by $20 should give the VRAM address. I'm thinking I've been reading something incorrectly that is giving me much trouble.
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    11 bits = 0000011111111111 = 07FF

    If you take the last 11 bits of 8F80, you get 0780, in exactly the same way.
     
  4. Varion Icaria

    Varion Icaria

    He's waiting.... Tech Member
    1,014
    3
    18
    S4: Cybernetic Outbreak
    <!--quoteo(post=441556:date=Apr 12 2010, 01:20 PM:name=DigitalDuck)--><div class='quotetop'>QUOTE (DigitalDuck @ Apr 12 2010, 01:20 PM) <a href="index.php?act=findpost&pid=441556">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=441477:date=Apr 12 2010, 04:03 PM:name=Cracker)--><div class='quotetop'>QUOTE (Cracker @ Apr 12 2010, 04:03 PM) <a href="index.php?act=findpost&pid=441477">[​IMG]</a></div><div class='quotemain'><!--quotec-->So how far in the future do you think a split disassemble program will be ready for 3&K?<!--QuoteEnd--></div><!--QuoteEEnd-->

    I'd personally guess at another 4-5 years, although I wish we already had it. I'm looking forward to discovering exactly how it works.
    <!--QuoteEnd--></div><!--QuoteEEnd-->


    <!--quoteo(post=441645:date=Apr 12 2010, 03:49 PM:name=Animemaster)--><div class='quotetop'>QUOTE (Animemaster @ Apr 12 2010, 03:49 PM) <a href="index.php?act=findpost&pid=441645">[​IMG]</a></div><div class='quotemain'><!--quotec-->Ask Varion, he might be able to help you with that question.<!--QuoteEnd--></div><!--QuoteEEnd-->

    It seems people are starting to get interested in S3K hacking. Well Now that these posts were brought to my attention I'd like to say that My disassembly is more complete than that of Andlabs' and that I've been doing work on my hack from it. It's more or less 65% complete in terms of labels. Enumerations are 40%. I am still working on my disassembly but I wont' release it till it's more tangible for others to be able to work with and understand better. It took me awhile to learn how most things have worked in S3K but I've got S3K down to around 3026kb. It's still in the works and I will release it when everything is complete to make everything easier on everybody. So expect it sometime in the next several months as I do have other things to work on such as a Super Mario RPG hack and other things.
     
  5. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    576
    0
    16
    Fort Worth, Texas, USA
    Making a Full-Sized Egg Carrier in Minecraft.
    Alright, thanks for the lessons folks, I finally get what Thorn was saying in detail.

    I'm not seeing a $2434 anywhere in this sprite mapping file though. Or a $?780.

    Just for clarification, I'm using the current split dissasembly, and looking at file "mappings/sprite/obj36.bin".

    First few bytes of said file of said file:
    Code (Text):
    1. 00 10 00 22 00 44 00 76 00 b8 00 ca 00 ec 01 1e 00 02 f0 07 00 00 00 00 ff f0 f0
    EDIT

    I R DUM LOL

    The mappings just maintain an index of the tiles from the VRAM offset. The VRAM offset is declared in the object's init subroutine.

    Code (Text):
    1. ; loc_15926:
    2. Obj36_Init:
    3. &nbsp;&nbsp;&nbsp;&nbsp;addq.b&nbsp;&nbsp;&nbsp;&nbsp;#2,routine(a0)
    4. &nbsp;&nbsp;&nbsp;&nbsp;move.l&nbsp;&nbsp;&nbsp;&nbsp;#Obj36_MapUnc_15B68,mappings(a0)
    5. &nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$2434,art_tile(a0)
    Am I correct on this?

    AGAIN EDIT -

    Aha! s2.asm, I have vanquished thee!

    Line 25972 -
    Code (Text):
    1. &nbsp;&nbsp;&nbsp;&nbsp;move.w&nbsp;&nbsp;&nbsp;&nbsp;#$242C,art_tile(a0)
    The art needs to be at $8580.

    I tried it and it's frickin' working. I just need to sort out the art file and the mappings now. Thanks for the help folks!

    FINAL EDIT: Art sorted. Horizontal spikes working, and well. Thanks again, kids!
     
  6. NeKit

    NeKit

    Member
    57
    0
    0
    Russia
    Sonic SCANF
    <!--quoteo(post=445113:date=Apr 20 2010, 11:37 PM:name=Hanoch)--><div class='quotetop'>QUOTE (Hanoch @ Apr 20 2010, 11:37 PM) <a href="index.php?act=findpost&pid=445113">[​IMG]</a></div><div class='quotemain'><!--quotec-->Here is a little tip: 8x16 is like 8 columns of 16 (pixels) from Soned2's block editor. I think you need to edit the mappings to fit those limiations but if you want your art to look as accurate to the 1P versions, you might want to try edit the art (though I think it uses 2 8x16 block next to each other so it looks like a full block)<!--QuoteEnd--></div><!--QuoteEEnd-->
    I wonder where 2P mappings are kept. I can't find something special for Emerald Hill/Casino Night/Mystic Cave.
     
  7. VivaLaVida

    VivaLaVida

    This Guy.... Member
    35
    0
    0
    Editing layouts in SonED2
    Grr, I still can't get GHZ to load correctly after building my ROM. I even re-did all the steps in the guide 3 times over, and still the same choppiness. Does anyone know if I'm doing anything wrong? Here's the picture

    <a href="http://s915.photobucket.com/albums/ac358/VivaSonic/?action=view&current=yeah-3.gif&newest=1" target="_blank">http://s915.photobucket.com/albums/ac358/V...if&newest=1</a>
     
  8. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    576
    0
    16
    Fort Worth, Texas, USA
    Making a Full-Sized Egg Carrier in Minecraft.
    Hey folks, I'm having some issues.

    Something is corrupted in my rings data. When I use my custom layout, the 128x128 chunks mess up visually. The game runs as if the correct chunks were loaded (I can still run around, go through loops that I can't see, etc), but all I can see is the same 4x4 set of 128x128 chunks that are near the character starting location of the level. The problem goes away if I revert to the original ring data for the zone. My ring data is also smaller (mine is 448 bytes, original is 552).

    Any ideas as to what might be causing the issue? Ring data edited with SonED2, on a split dissasembly of s2rev01, if that helps.
     
  9. Thorn

    Thorn

    Tech Member
    335
    19
    18
    Home
    Sonic 2 Retro Remix
    ^ The data size may not be the issue. Notice that in SonED2, you can create rows and columns of rings from length 1 to 8. While the file saves this row/column data, every ring is considered individually in-game, so you can get a data overflow despite having less sets of rings if there's more rings per set.

    You could eliminate rings, or consider <a href="http://info.sonicretro.org/SCHG How-to:Port Sonic 3k's rings manager to Sonic 2" target="_blank" style="background: url(http://info.sonicretro.org/images/5/50/Reticon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">SCHG How-to:Port Sonic 3k's rings manager to Sonic 2</a>.
     
  10. McGuirk

    McGuirk

    The Egg-Man Cometh. Member
    576
    0
    16
    Fort Worth, Texas, USA
    Making a Full-Sized Egg Carrier in Minecraft.
    Very cool, I'm working on that new ring manager now.

    Muy gracias, Thorn!


    EDIT:

    Blah, the files provided with this are a bit out of date. Most of the branches are pointing to loc_XXXXX as opposed to the newer labels. Most of the labels still have their loc commented above them, but not all, so that's causing a few issues. I, as best as I can tell, have fixed them, but I'm still having some issues.

    It hangs on the title card, but music continues playing and I hear a lot of rings being gathered at odd intervals, followed by a subsequent gaining of en extra life.
     
  11. SegaLoco

    SegaLoco

    W)(at did you say? Misfit
    Question regarding 8x16, that's actually a Mega Drive thing, not a Sonic engine thing right? It's used for the interlaced modes right? (Or at least #2) IIRC it just uses two VRAM cells together to make the 8x16... so it's gotta have stuff loaded in there that when interlaced together will look like one clean tile)
     
  12. Mercury

    Mercury

    His Name Is Sonic Tech Member
    I'd like to add an extra monitor type to Sonic 1 that gives Sonic extra time when he destroys it (like the Blue UFOs in the Sonic CD special stage).

    I've added the extra monitor type, but I'm not sure how best to subtract 20 seconds from the Time. I'm so used to coding in high-level languages with modulo commands and everything, but I'm lost when it comes to ASM.
     
  13. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    This should do it:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">sub</span>.<span style="color: #00bfff;">l</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">1400</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE22</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; substract 20 ($14) seconds from the time</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">1</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFFE1E</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; update time counter</span></pre><!--gc2--><!--CQlzdWIubAkjJiMwMzY7MTQwMCwoJiMwMzY7RkZGRkZFMjIpLncJOyBzdWJzdHJhY3QgMjAgKCYjMDM2
    OzE0KSBzZWNvbmRzIGZyb20gdGhlIHRpbWUKCQltb3ZlLmIJIzEsKCYjMDM2O0ZGRkZGRTFFKS53CTsgd
    XBkYXRlIHRpbWUgY291bnRlcg==--><!--egc2--><!--g2--></div><!--eg2-->
    In $FFFFFE22 you have the time as a longword in this format: $MMSSMS. MM are the minutes, SS are the seconds, MS the milli seconds (not displayed but used for counting the seconds).
    However, you will need to do multiple checks too:
    1: If your time is below 20 seconds (for example 0:09) you want to reset it to 0:00 instead of substracting 20 seconds from it or else the time counter will glitch up.
    2: If you destroy the monitor so you get back to the last minute (for example you are at 1:17 and destroy the monitor) you will additionally need to put down the minute counter a bit (if you understood what I told you above, that shouldn't be a problem for ya).
     
  14. Mr.Kaosu

    Mr.Kaosu

    Member
    52
    0
    0
    Sonic Zero: Remastered
    This is my last trial post, so I have to use this wisely.

    Anyway, I have this question, and I'll make it clear as possible.

    How do most of you make your level art graphics for Sonic Games? I mean, this is a complicated question for me, but I want to learn how to make my own original level art, so it won't look like some common recolor or something so bland. Take Project Sonic Retro for example. It had such a beautiful grass level. a mass amount of talent and knowledge, that I alone don't have enough of. I want to be able to make something as unique as that, or at least have help making something unique as that.

    I've been trying to make my own Sonic game since the beginning of click products and such, and you think, by now, I'd be better at it. I am, but not when it comes to the pixel art. I've been trying to get someone to help me on that sense, so I think I may as well try asking again here. All I ask is please... Don't Spam me.
     
  15. MarkeyJester

    MarkeyJester

    Time to Grow Up. Resident Jester
    2,128
    253
    63
    Japan
    The idea behind making a level for sonic games is dependant on what sonic game you're editing, as each one has it's own special engine, and there's VDP (Video Display Processor) rules to follow.

    The VDP has 4 palette lines holding a total of 16 colours per each line, excluding the first colour which acts as a transparent colour use. There are individual blocks of art which we call "Tiles" (Or has also been known as "Cells"), each "Tile"/"Cell" is made up of 32 pixels in an 8x8 pixel square, example:

    [​IMG]

    Each of these "Tiles" can use 1 of the 16 colours using 1 of the 4 palette lines, these "Tiles" are grouped together in "Blocks" of 4, like so:

    [​IMG]

    This is known as a "Block", each block holds 4 tiles making a total of 16x16 pixels in size, each tile within this block can be either flipped, mirrored, set to use any of the 4 palette lines, and set in hi or low plane (In front or behind).

    These blocks are grouped together in a large square called a "Chunk", these chunks make a total size of 256x256 pixels for Sonic the hedgehog (16-bit megadrive/genesis), however 128x128 pixels for Sonic the hedgehog 2, 3, & Knuckles (16-bit megadrive/genesis), like so (Sonic The Hedgehog):

    [​IMG]

    Each of these "Chunks" can hold "Blocks" which can be flipped or mirrored, and set a certain solidity. These "Chunks" are held in a large section of space known as a layout.

    To edit these "Tiles", "Blocks" and "Chunks", they must be firstly decompressed, each one is compressed in a certain format depending on the game, once decompressed, they can be edited via a hex editor, then recompressed and saved back into the rom.

    Now most people don't like using hex editors, and for such an important thing for games as level editing, I don't blame them. There are however, tools which can be used for editing the levels, if you are editing the rom itself via hex hacking, then tools such as:

    <a href="http://info.sonicretro.org/Esrael_Sonic_Editor" target="_blank">ESE by Esrael</a>

    and

    <a href="http://info.sonicretro.org/SonED" target="_blank">SonED by Stealth</a>

    ..can be used for doing this in a more confortable way, though if you are editing the first sonic game, then there is a bit of manual work to do, as SonED tends to edit the savestate data rather than the rom itself, so you'd need to extract the data from the savestate, save it, and insert it into the rom, and maybe change a few vital pointers.

    If you are editing a <a href="http://info.sonicretro.org/Disassemblies" target="_blank">Disassembly</a> then you might want to take a look at <a href="http://info.sonicretro.org/SonED#SonED2" target="_blank">SonED 2 by Stealth</a>, this is used for editing levels for disassemblies which does not require savestate editing, hex modifying or pointer changing of any kind, and is the most recommended tool to date.

    Check those links out for more information, other links may include:

    <a href="http://info.sonicretro.org/SCHG_How-to:Import_Art_to_SonED2" target="_blank">http://info.sonicretro.org/SCHG_How-to:Import_Art_to_SonED2</a>
    <a href="http://info.sonicretro.org/SCHG:SonED2_Manual" target="_blank">http://info.sonicretro.org/SCHG:SonED2_Manual</a>

    Good luck.
     
  16. Tidbit

    Tidbit

    Member
    If you need help with art, I'll be happy to give you a hand. Just msg me over msn and we'll get spriting. Also don't worry, when I first started, I felt like making my own art would be as complicated as doing advanced mathematics. But once you learn some of the basics it becomes as easy as riding a bike. So like I said im happy to help you and or any one who needs it.
     
  17. Mr.Kaosu

    Mr.Kaosu

    Member
    52
    0
    0
    Sonic Zero: Remastered
    I can't believe my last post failed slightly. But unfortunately, regarding the earlier post, That's not exactly what I meant by making level art. I don't know the first thing about hacking Sonic ROMS. The above is very useful advice, I won't lie.

    What I mean was, actually making the art. Making levels like in these images pixel by pixel so well. I want to be able to make THIS.
    [​IMG][​IMG]
    Sorry for bringing something old back up, but there is no greater example.
     
  18. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    0
    0
    across town from Hinchy
    All the bitches.
    <!--quoteo(post=449024:date=Apr 29 2010, 10:07 PM:name=Mr.Kaosu)--><div class='quotetop'>QUOTE (Mr.Kaosu @ Apr 29 2010, 10:07 PM) <a href="index.php?act=findpost&pid=449024">[​IMG]</a></div><div class='quotemain'><!--quotec-->I can't believe my last post failed slightly. But unfortunately, regarding the earlier post, That's not exactly what I meant by making level art. I don't know the first thing about hacking Sonic ROMS. The above is very useful advice, I won't lie.

    What I mean was, actually making the art. Making levels like in these images pixel by pixel so well. I want to be able to make THIS.
    [​IMG][​IMG]
    Sorry for bringing something old back up, but there is no greater example.<!--QuoteEnd--></div><!--QuoteEEnd-->


    Open MS-Paint or similar program.
    Use basic art skills.
    ??????
    Profit.


    There's nothing more than that to it. You just need to know how to draw in some form and you're done.
     
  19. Chimpo

    Chimpo

    Member
    7,431
    143
    43
    Atomic Sonic Part II
    That's pretty much it. There's no real tutorial for it, you just have to have the skill to do it.
     
  20. Mr.Kaosu

    Mr.Kaosu

    Member
    52
    0
    0
    Sonic Zero: Remastered
    <!--quoteo(post=449038:date=Apr 29 2010, 09:31 PM:name=Chimpo)--><div class='quotetop'>QUOTE (Chimpo @ Apr 29 2010, 09:31 PM) <a href="index.php?act=findpost&pid=449038">[​IMG]</a></div><div class='quotemain'><!--quotec-->That's pretty much it. There's no real tutorial for it, you just have to have the skill to do it.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Oy. I'll try not to make this confusing.

    I wish I had the skill. I thought I did before, but there were a good few that didn't think so. I just don't know how to make anything better.

    [​IMG]
    By <a href="http://profile.imageshack.us/user/sonjohenji" target="_blank">sonjohenji</a> at 2010-03-14

    This is my oldest bit of proof. But I know a lot of you will say that it's no more than a knockoff. It can't be anything better. It would just be better if I got someone else to help me make this better or even make other zones.