Basic Questions and Answers Thread

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

  1. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Please learn how bitmasks work...
     
    AURORA☆FIELDS likes this.
  2. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
  3. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
  4. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    268
    Ashuro, please, for once...
    If you don't know something, google it. This place may be "basic q and a" but it's not here to hold your fucking hand. Learn how to use a search engine and do things for yourself.
     
    AURORA☆FIELDS likes this.
  5. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Calm down please, i do, i do.
    I just asked for help, no to hold my "fucking" hand.
     
  6. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    I really beg to differ. You were to told the exact instruction to change, and instead of studying it and its relevance to the surrounding code, you make a blind edit, and then immediately come to us when it doesn't work.
     
    AURORA☆FIELDS and Soldaten like this.
  7. Soldaten

    Soldaten The Coilgun Root Admin

    Joined:
    Mar 10, 2016
    Messages:
    268
    You linked to MarkeyJester's tutorial which explains all of the instructions for the 68k and you didn't even bother to look through it yourself to find it. Anything else I have to say Clowny already went over.. What you've been doing is asking people to hold your hand and coming to ask questions every time something breaks instead of sitting down and trying to see how you fucked up. We've been down this road before. At least attempt to figure out what went wrong before running to get help.
     
    AURORA☆FIELDS likes this.
  8. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    It's been hours since I tried several things, go to several forums, try several things, and when Clownacy show me the link, i have already find it. I come here to ask a last resort. Yeah, before I came to any thing but I do not do that now.

    I ask your help frequently because it's 5/10/2016, the SHC dead line is the 9 (okay, we can update it until 18 if I'm not mistaken) but i really want to finish it and i'm stuck with this one stupid bug.

    But thanks anyway, i will read again.
     
  9. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    I'll explain bitmasks once, but after that it's up to you to find the answer.

    That #7 value you changed determines the bits that are checked against a respective value, and the command (AND, OR etc) determines what the output result is.

    Bits carry values as such when set:

    Bit 0 = 1
    Bit 1 = 2
    Bit 2 = 4
    Bit 3 = 8
    etc.

    As you can see, each sequential bit increases by a power of 2, so you can work out how this goes on for greater values. There are 8 bits to a byte, 16 bits to a word and 32 bits to a longword. When all bits are set for each data size, these are $FF, $FFFF and $FFFFFFFF respectively.

    Now, the command you're dealing with is the AND command. What this does is check the bits that are set in the mask value (in your case this value is #7) and compares them with the bits that are set in the comparative value (in this case, the zone ID which has been placed in d0). If certain bits are set in each value, then these bits will be set in the output result (hence the AND name).

    For example, #7 is 111 in binary. If your zone ID was #3, then the binary for that would be 011. When comparing the two using the AND command, the result is as follows:

    111 < Mask value
    011 < Zone value
    011 < Output

    The output becomes 011 because bit 2 is not set in both values, and so in the output it becomes a 0 (unset).

    Now, with Sonic 1 only using zone IDs up to #7, the game only needed to mask the first 3 bits as these bits alone when set could total #7. This is shown in the below table.

    001 = 1
    010 = 2
    011 = 3
    100 = 4
    101 = 5
    110 = 6
    111 = 7

    The problem here is that you have added a zone with an ID of 8, which doesn't fall within the bracket of what is currently being checked. However, by changing the value to #8, you have told the game to check Bit 3 only. This is because what you are now executing is the following:

    1000 < Mask value

    When this code is applied to a zone with an ID of less the #8, the following will happen:

    1000 < Mask Value
    0111 < Zone value of #7 for example
    0000 < Output

    You get this output because none of the bits are set in both the Mask and the Zone ID. What this means is that any zone with an ID less than #8 will end up returning a value of 0, which means that your list will always end up reading the first value of the lookup table for which zone to load next, which is not what you want. What you want your mask value to be in binary is 1111, so that way all the bits that can comprise your zone ID are covered. With that, the following would happen:

    1111 < Mask Value
    0111 < Zone value for example #7
    0111 < Output (which will output correctly for #7)

    1111 < Mask value
    1000 < Zone value for example #8
    1000 < Output (which will be correct for #8)

    Now, I'm not going to give you the value directly that you will need to change #7 to, as I want you to work it out based on this information so that you will hopefully at least learn something from it.

    Now, it's been a while since I've properly worked with 68K so if anyone wishes to add anything or correct anything I've said then feel free, as I can't help but feel I may have overlooked something somewhere, but this is the basic idea behind bitmasks (the AND command at least. OR works in a similar way, but the outputs follow different rules. See Markeys guide for a breakdown on that).
     
    ProjectFM, Ashuro and Pacca like this.
  10. B. Comet

    B. Comet Is fun still infinite? Member

    Joined:
    Aug 19, 2016
    Messages:
    83
    Location:
    South America Zone
    I will make that simple question again. How I can delete the objects of the Green Hill Zone Act 3? I already deleted them, but, when I play the hack, they are still there and the SonLVL doesn't show nothing on the screen.
     
  11. Devon

    Devon I'm a loser, baby, so why don't you kill me? Member

    Joined:
    Aug 26, 2013
    Messages:
    1,376
    Location:
    your mom
    Did you remember to save your changes? If you did, then you should probably report it as a bug in SonLVL.
     
  12. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Did you ever try using SonLVL.ini, instead of SonLVL.rev01.ini?
     
    B. Comet likes this.
  13. B. Comet

    B. Comet Is fun still infinite? Member

    Joined:
    Aug 19, 2016
    Messages:
    83
    Location:
    South America Zone
    Solved.
    Thanks. But, what is the exact difference between the SonLVL.ini and SonLVL.rev01.ini ?
     
  14. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Stephen, thank you for this little guide.
    BUT!
    After reading it, i have understand that, logically, the value for 1111 is $F, so i have put $F,d0, but it still do not work. From SYZ, i want to go to WZ (8) but it goes to FIZ (7).

    My wife and i, have the idea to try all the values (8,d0 - 9,d0 - A,d0 - B,d0 - C,d0 - D,d0 - E,d0 - F,d0 - 10,d0 ).
    Yes i'm stupid or crazy i don't know but now, i really don't understand how to figure it out, i have reading your post 3 times, with a binary/hex/dec converter and a calculator.
     
  15. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    1,020
    Sonic 1 had two versions: REV00 and the later REV01. REV01 featured revised levels, different from REV00's. In order to support both revisions, SonLVL has two INI files; one for each version of the game. In particular, REV01 has an alternate GHZ Act 3 object layout, meaning each INI file will save to a different object layout file.

    I wouldn't recommend sticking with REV00 as your hack's base: REV01 features bugfixes, and advanced background scrolling. You can change what revision your ROM builds by changing the Revision setting at the start of sonic.asm.
     
    B. Comet likes this.
  16. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I just don't understand, i start to think that i'm not made for asm after all.

    $F - 1111

    Because 7 is 111 but 8 is 1000

    But if this is 1000, it only support the 8th zone, so C 1100 but it's not and so F 1111 but not.
    1F not
    F0 not

    Maybe i'm wrong and this is not this value but the andi i have to change, or the .w to a .l, or i don't know, i don't know, i don't know.
    You've made a easy guide but a am not even able to get by with that, i'm a noob, i'm a piece of shit.
    I read, I read I read, and the only things i understand is "hi i want some help", I do not deserve to participate the SHC
    I hate myself
     
  17. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    $F is the value that should be used to cover all Zone ID possibilities from 0 to $F. What concerns me though is that you seem to have understood nothing that I've said in that post, and instead just converted the 1111 I posted to come up with the $F value. That's apparent by the fact that you tried a lot of other different values despite the fact that I already stated why the value had to be 1111 in binary to work. If you go to Wood Zone in your level select and finish Act 1, does it move on to the correct Act 2 when using $F as your mask? If it does, then the mask is obviously working correctly and your problem lies elsewhere. I haven't got time to look into it now though, so I can't help with that. I'd highly recommend you take a fresh disassembly, read Markey's 68K guide and play around in it to actually learn what you're doing, because you seem to be well out of your depth at the moment.

    One final thing, can you please stop with all the self pity posts, because I'm sick of reading them now. Calling yourself a piece of shit, saying you hate yourself and all that other shit contributes nothing to this community at all, and quite frankly it's not something the people who come here want to be reading. If you have issues, then that's something you need to work on yourself, but getting so over emotional here over something so trivial is unnecessary.
     
    Pacca, ProjectFM, Soldaten and 2 others like this.
  18. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    So yes, my problem is elsewhere. But nevermind, I'll do what told me to do.
    How can i remove my entry from SHC?
     
  19. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Why remove the entry completely? Just leave it in the contest but make it so that Wood Zone is level select only, or completely inaccessible. That way you can still be judged on what you have done.
     
  20. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Yes it can be but... Its disappoint me to not post a full work...
    I'll think about it, until I learn how to solve my problem.