Originally posted by DeekeOriginally posted by HammerBrotherespically if your hack is exploration-based.
Hoo boy, will this be a nifty toy to play with.
I don't suppose it's simple for the opened doors be made to
stay open forever, even between play sessions?
It uses RAM that doesn't clear on level load, (sram/bwram plus also required) and this is the hardest part, finding untouched RAM, which can be alleviated using a
debugger.
To make the blocks stay at a state forever, first, assign them to what flag number on
Freeram_MemoryFlag, to do that, you would open these ASM files:
UberasmTool/Library/MBCM16WriteGroup128To7FC060.asm
Blocks/routines/SearchBlockFlagIndex.asm
Blocks/routines/GetWhatKeyCounter
In them, they have a HUGE list, in this case if you place a block in level $105 at position ($0006, $0016) on layer 1 using flag 0, you do this:
This is the list of level numbers for each flag to be assigned to:
Code?GetFlagNumberLevelIndexStart:
dw $0105 ;>Flag $0 -> LM's CM16 $0
dw $FFFF ;>Flag $1 -> LM's CM16 $1
dw $FFFF ;>Flag $2 -> LM's CM16 $2
dw $FFFF ;>Flag $3 -> LM's CM16 $3
This is what layer the block is on, $00 = layer 1, $01 = layer 2 (when using layer 2 level):
Code?GetFlagNumberLayerProcessingStart:
db $00 ;>Flag $0 -> LM's CM16 $0
db $00 ;>Flag $1 -> LM's CM16 $1
db $00 ;>Flag $2 -> LM's CM16 $2
db $00 ;>Flag $3 -> LM's CM16 $3
This is the block location, simply instead of storing the block data as XY coordinates (each value is 16-bit), it is in their $C800 index (one 16-bit value), which is 1/2 the amount of space they take up. With the features of asar, I made the XYCoords -> $C800 index much easier using a function:
Codefunction GetC800IndexHorizLvl(RAM13D7, XPos, YPos) = (RAM13D7*(XPos/16))+(YPos*16)+(XPos%16)
function GetC800IndexVertiLvl(XPos, YPos) = (512*(YPos/16))+(256*(XPos/16))+((YPos%16)*16)+(XPos%16)
And the table should be like this for a position ($0006, $0016):
Code dw GetC800IndexHorizLvl($01B0, $0006, $0016) ;>Flag $0 -> LM's CM16 $0
dw GetC800IndexHorizLvl($01B0, $0000, $0000) ;>Flag $1 -> LM's CM16 $1
dw GetC800IndexHorizLvl($01B0, $0000, $0000) ;>Flag $2 -> LM's CM16 $2
dw GetC800IndexHorizLvl($01B0, $0000, $0000) ;>Flag $3 -> LM's CM16 $3
Of course, the readme links to a javascript file that generates not only various information such as the memory range and number of bits, it also generates ASM tables WITH comments to make this a lot easier.
I tried to make this as user-friendly as possible, since a lot of the effort of inserting this is outside of LM, and more likely that you have to come back and edit the tables as you create levels.
You can have up to 2048 bits in your entire hack, which is 256 bytes of
!Freeram_MemoryFlagRAM. Meaning 2048 non-respawning keys and doors in your hack.
--------------------
Give thanks to RPG hacker for working on Asar.
Follow Us On