Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen 15 always has bad collision #6

Closed
devinacker opened this issue Jul 16, 2014 · 5 comments
Closed

screen 15 always has bad collision #6

devinacker opened this issue Jul 16, 2014 · 5 comments

Comments

@devinacker
Copy link
Owner

(This is actually a bug with the game, rather than the editor, but i'm putting it here in case there's an easy way to patch it)

Any time a room has a full 16 screens (4x4, etc), screen 15 will either have no collision at all, or will be using the wrong screen's tile data to check collision (I can't tell which yet, since I haven't tested it much).

@devinacker
Copy link
Owner Author

ARRRRGHGHHHH

1F:F756:A5 17     LDA $0017 = #$68
1F:F758:C9 68     CMP #$68
1F:F75A:90 17     BCC $F773
1F:F75C:C9 74     CMP #$74
1F:F75E:B0 13     BCS $F773

when this code runs, the value at $0017 equals the current screen number (times 3/4?) plus $68 (whatever that represents). When you're on the very last screen possible (i.e. $0F), that value equals $74, triggering an off-by-one error which bypasses tile collision checks completely whenever the player is on this screen. Thanks, HAL!

I'll probably add some stupid hack to the editor to silently fix this (just need to make sure this code is in the same place in every ROM revision...)

@devinacker
Copy link
Owner Author

�<��einstein95��>� devin: US (1.0, 1.1) , EU, FR, DE: 1F:F756; CA: 1F:F773; JP: 1F:F770�

@devinacker
Copy link
Owner Author

i also need to make sure this really was an off-by-one error and that there wasn't a valid reason for using those bounds (the value at $0017 is taken from a lookup table which maps 16 screen numbers to the values $68 through $74).

Changing the CMP #$74 in the above code to $75 makes screen 15 collision work fine for both Kirby and other sprites and doesn't seem to have any ill effects that I can see, though

@devinacker
Copy link
Owner Author

fixed by 79ab41a (hopefully without affecting anything else)

@sneakernets
Copy link

It's amazing that you're finding these. Keep it up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants