Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Post your fceux movie. It can even be fm3 if you don't include greenzone. http://tasvideos.org/userfiles/my#uploadfile And it's called not Macro/Micro Frame Location, but X position high byte and low byte. In a lua script they can be displayed as a full 16 bit value.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 7/21/2017
Posts: 54
I will post it in a moment. So as long as the value of $0030 is larger than #0002 when this CMP occurs then JSR $DFB4? Though if LDA occurs with the value of 5F then how does A:50 appear on the CMP line?
Chambers_N
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
CLChambers00 wrote:
Though if LDA occurs with the value of 5F then how does A:50 appear on the CMP line?
0x5F AND 0xF0 is 0x50. Bitwise AND only leaves in the resulting value the bits that are set in both operands:
    0b01011111
AND 0b11110000
is  0b01010000
0x means hexadecimal, 0b means binary.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 7/21/2017
Posts: 54
Here is the fm2 file: http://tasvideos.org/userfiles/info/41626445467426292 I don't quite understand the AND in this operation nor how 0x5F can equal 0x50. However, I don't need to understand as long as I know that as long as $0030 being a higher value than $0002 means that JSR $DFB5. If so I can skim through the game to see when this would be the case, that is, under what conditions would this be. Hopefully this is not the only case in the entire game, and if so, then I consider myself fortunate to have found it. :)
Chambers_N
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
If you want to advance in reverse engineering (which is always a great skill if you are aiming to control some occasional thing in games), you will need to learn what does what some day. https://en.wikipedia.org/wiki/Bitwise_operation#AND I'll take a closer look at your movie later. Props to using taseditor btw.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 7/21/2017
Posts: 54
Oh, I want to learn, don't get me wrong, I am just trying to pin down the solution that I can use in trials with TASEditor and RAM Watch. Thanks for the link. I have observed that in the TAS video I sent there are many occasions when $0030 is larger than $0002, so perhaps it is only CMP under certain conditions? Or I am failing to understand the values?
Chambers_N
Joined: 7/21/2017
Posts: 54
Its just that usually people try to help me with explanations and links and despite their help I don't understand most of what is being said. Aside from feeling stupid, when I read the Bit Operation AND as you linked, I simply don't know enough to understand it. How 0101 can be decimal 5 makes no sense. What is decimal 5, how can I get the number 5 from 0101? It isn't that I don't want to learn, it just seems that I pick up only little pieces here and there over a long period of time. In some of this there must be a Level 0 that links what is being said to something that I already know otherwise I will not be able to assimilate it.
Chambers_N
Joined: 7/21/2017
Posts: 54
Thank you for your help by the way. I actually learn more through a process like this. I really do appreciate it! :D
Chambers_N
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
https://en.wikipedia.org/wiki/Binary_number#Counting_in_binary My point is that binary notation is so heavily used by the early games that you will constantly run into this black box feeling until you just look up the basics of it. The hardest part is probably learning the basics, because they don't correspond to usual daily skills of a non-programmer, but once you get over that barrier, you will feel your power. I mentioned that on the RE page: relying on chance is sloppy, when you want to manipulate something, you either learn how to manipulate it or find out it can't be manipulated. That knowledge is maximum you can get in that regard, so it is when you start enjoying obtaining it.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 7/21/2017
Posts: 54
Nice! So 0101 is decimal 5 because it has incremented 5 times - hence... 0001, 0010, 0011, 0100, 0101. There are 8 bits in a byte hence 00000000. And the actual binary value of 0101 would be the same as 00000101. Each place is a 2 to the power using these values 76543210. So 0101 would be (1)x2 to the zero and (1)x2 to the 2. So that is 1 plus 4, and that is 5. :D
Chambers_N
Experienced player (876)
Joined: 11/15/2010
Posts: 267
I've been looking at this a bit with CLChambers00 and I have a little better understanding of what is going on now. Effectively the game is tracking your progress through the level and using the high level counter at 0x017E. It updates this counter each time the screen moves 16 full tiles (either vertically or horizontally, but the game only pans one direction at a time). It is tracking the camera movement on a per tile basis using two byte values at 0x0030-0x0031 for horizontal and 0x0032-0x0033 for vertical. The game has several conditions that it checks for before updating 0x017E. Most importantly that the upper bytes for both horizontal and vertical (0x0030 and 0x0032) are multiples of 16. Also it checks for the movement speed. If the camera is not moving then 0x017E does not get updated. Horizontal movement speed is in 0x0034. This check prevents the value from getting updated accidentally if you hit the bottom of the elevator and just stay still. The bug here is that it is only checking the upper byte, but the tracking is more accurate than that. If you have some leftover sub-pixels and you make the camera move slowly it can be trick. The case as CLChambers00 has recorded is this. You walk onto the elevator and the camera horizontal position gets locked to 0x60XX where XX is some sub-pixels of overshoot. When the elevator moves to the bottom it updates 0x017E once as designed. You take a dboost to the left. The dboost sets the camera speed to 0xFC (aka signed -4). The camera horizontal position decrements by 4 each frame. Since only the upper byte is checked the checks all pass and 0x017E keeps incrementing on each frame until the camera horizontal position goes below 0x6000.
Joined: 7/21/2017
Posts: 54
Most excellent description Link! Thanks for posting it here!
Chambers_N
Joined: 7/21/2017
Posts: 54
It finally dawned on me today to ask the most basic of questions: 1) Can this work in another location in the game? and 2) Can we scroll the screen slower than 4? And I can tell you that the answer is yes to both! I found another 017E memory address manipulation point in Level 3, under the same conditions as Level 4. And then I found that if I jumped straight up and did a one frame input to the left that my speed will maintain 1 every frame until I land. This made it so that we can effectually "convert" whatever micro frames (x position low byte) we have left to address 017E, the address that tracks your progress through the stage. Enjoy! https://www.twitch.tv/videos/173708890
Chambers_N
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Amazing job, congrats!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Zakem66
He/Him
Player (176)
Joined: 4/25/2014
Posts: 25
Location: Finland
Nice find CLChambers00 and great job guys figuring out how stuff works. "And then I found that if I jumped straight up and did a one frame input to the left that my speed will maintain 1 every frame until I land" You can maintain whatever speed you have at any time just by holding UP button. (Maybe you know this already, but just to be sure)
Skilled player (1737)
Joined: 9/17/2009
Posts: 4980
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
Can someone please make an encode of this on what exactly I should be looking at, and how it would look like without the glitch? I tried clicking the twitch links, but it's 18 minutes long, and I'm not sure what I'm looking at.
Experienced player (876)
Joined: 11/15/2010
Posts: 267
It is probably simple enough to describe that an encode isn't necessary if you just watch the part where he brings up the level map that is probably good enough. Without the glitch you spawn at the previous checkpoint when you die. With the glitch you spawn at the last checkpoint of the level.
Joined: 7/21/2017
Posts: 54
Joined: 7/21/2017
Posts: 54
Made a theory tas that does not attempt to be a technical tas but I think it might be faster than what is on this site, posting this here for historical purposes. https://www.youtube.com/watch?v=hMt06bvXwE0
Chambers_N