sonicretro / s1disasm

Sonic 1 Disassembly
329 stars 96 forks source link

Define and use object status constants #35

Closed Kekun closed 2 years ago

Kekun commented 4 years ago

Define and use the 7 obStatus* constants corresponding to the objects' status flags.

Kekun commented 4 years ago

Maybe the id_ prefix instead of the ob one would be better? I'm not sure what are the rules here.

Clownacy commented 4 years ago

It's been a very long time since I've done this kind of thing, but doesn't obStatusFacesLeft sometimes mean 'facing right', depending on the object?

Kekun commented 4 years ago

No idea as I am doing that to help me understand the code. :) I noticed some comments say "flip", which isn't exactly perfect either as "air" can be used to represent a vertical flip on some objects. What about obStatusHFlip?

Kekun commented 4 years ago

I renamed it to obStatusHFlip and commented what it means for Sonic.

FraGag commented 4 years ago

What about defining more than one constant for the same value and using the appropriate constant depending on the object? We already do this for object variables:

https://github.com/sonicretro/s1disasm/blob/6dc32551c3adf49b1ef11ffdec352e8f22e814e4/Constants.asm#L148 https://github.com/sonicretro/s1disasm/blob/6dc32551c3adf49b1ef11ffdec352e8f22e814e4/Constants.asm#L151

Clownacy commented 1 year ago

I'm pretty sure that this PR wasn't meant to be closed. It should be reopened and pointed at the asm68k branch (or the AS branch, with some modifications to make the new code work with AS).