dmitry_s wrote: ↑January 1st, 2022, 11:11 pm
Exactly. The only place in the game where that bit is being used is for the stuck loose tile. But for some reason it is also set in the original levels for the gates.
FYI, on the original levels, bit #6 of the tile byte is set if the tile below needs to have floor above it.
This was added for the convenience of Mechner's own editor.
I have posted about this earlier here:
viewtopic.php?p=20148#p20148
viewtopic.php?p=18193#p18193
In the Apple II source, there is the
linklist array which tells whether a tile needs floor above it, and other things as well.
https://github.com/jmechner/Prince-of-P ... .S#L27-L28
linklist is indexed by tile type ID.
The possible values are:
* The ID of another tile, if this tile is only half of an object. The value of the item is the ID of its pair. (Examples: big pillars, level doors, balconies, large arches)
* 0xFE, if a floor is needed above this tile.
* 0xFF, if no floor is needed above this tile.
Here is the meaning of values in the array:
Code: Select all
linklist[0x00] = 0xFF // empty -> no
linklist[0x01] = 0xFF // floor -> no
linklist[0x02] = 0xFF // spikes -> no
linklist[0x03] = 0xFE // pillar -> floor needed above
linklist[0x04] = 0xFF // gate -> no
linklist[0x05] = 0x00 // stuck floor -> ???
linklist[0x06] = 0xFF // drop button -> no
linklist[0x07] = 0xFE // doortop with floor -> floor needed above
linklist[0x08] = 0x09 // big pillar bottom half -> paired with big pillar top half
linklist[0x09] = 0xFE // big pillar top half -> floor needed above
linklist[0x0A] = 0xFF // potion -> no
linklist[0x0B] = 0xFF // loose floor -> no
linklist[0x0C] = 0xFE // doortop -> floor needed above
linklist[0x0D] = 0xFE // mirror -> floor needed above
linklist[0x0E] = 0xFF // broken floor -> no
linklist[0x0F] = 0xFF // raise button -> no
linklist[0x10] = 0x11 // level door left half -> paired with level door right half
linklist[0x11] = 0xFF // level door right half -> no
linklist[0x12] = 0xFE // chomper -> floor needed above
linklist[0x13] = 0xFF // torch -> no
linklist[0x14] = 0xFE // wall -> floor needed above
linklist[0x15] = 0xFF // skeleton -> no
linklist[0x16] = 0xFF // sword -> no
linklist[0x17] = 0x18 // balcony left half -> paired with balcony right half
linklist[0x18] = 0xFF // balcony right half -> no
linklist[0x19] = 0xFF // lattice pillar -> no
linklist[0x1A] = 0xFF // lattice down -> no
linklist[0x1B] = 0xFF // lattice small arch -> no
linklist[0x1C] = 0x1D // lattice large arch left half -> paired with lattice large arch right half
linklist[0x1D] = 0xFF // lattice large arch right half -> no
These mostly match what you'd expect, except no floor is required above gates and lattice pieces.
The array is used here:
https://github.com/jmechner/Prince-of-P ... OR.S#L1038
The mask for bit #6 is here:
https://github.com/jmechner/Prince-of-P ... /EQ.S#L485
bit #6 of loose floors is checked here:
https://github.com/jmechner/Prince-of-P ... VER.S#L396