New item count - #374
Conversation
todo: sum the nothings / not placed and write them to rom should be complete: item count addition on item collection, newgame with starting items increases number, credits displayed as a fraction is not 100 items placed.
otherwise it displays as 0/00 due to nothings being placed everywhere.
fix count for desolate seeds.
missed updating this.
| offsettable: | ||
| db $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$10,$11,$12,$13 | ||
|
|
||
| masktable: ; collected item bits |
There was a problem hiding this comment.
Do we actually need this mask table? I would assume the unused bits should just stay cleared?
There was a problem hiding this comment.
It was mainly just to ensure that any bits marked as unused are never counted rather than assume they are always 0 (even though they should be!)
It also allows them to be repurposed for something else if ever needed but It could be removed yeah.
There was a problem hiding this comment.
Taking a closer look, confirmed that vanilla clears the entire 64-byte block during new game, and then in the randomizer we install the full block based on the "initial_item_bits", which we initialize with zeros on the Rust side. So assuming they are clear seems safe. If the unused bits are later used, the expected purpose would be to support items in new locations, in which case including them in the count is the correct behavior. So I would prefer that the mask and offset tables be removed. I would probably sum the count over the full 64-byte block (using the bitcount lookup table it should be plenty fast) but stopping at the end of the vanilla-used range is also ok.
There was a problem hiding this comment.
ok cool! I removed the offset table / bitmask table.
I stopped at the end of the vanilla range for now. If custom item locations / more than 100 items are added then maybe some rework will be needed to decide on percent or modify the code for xxx / yyy.
| db $00, $00, $00, $00, $00, $00, $00, $00 | ||
|
|
||
| offsettable: | ||
| db $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$10,$11,$12,$13 |
There was a problem hiding this comment.
Likewise, I don't see a reason to use this extra layer of indirection just to skip over 5 bytes?
There was a problem hiding this comment.
As above, it's not really large and guards against the unused bytes not being 0 / allowing them to be repurposed if ever needed. Simple enough to remove them, I just don't like assuming stuff is / will always be 0...
| ; Include walljump boots and split-speed in item collection count post-credits | ||
| org $8BE65B | ||
| LDX #$001A | ||
| ;org $8BE65B |
There was a problem hiding this comment.
Please delete the no-longer-needed code rather than commenting it out. Very nice to see it going away; I forgot how messy this got with the custom items.
Uh oh!
There was an error while loading. Please reload this page.