Hello again friends.
So I'm using
this custom switch palace switch block, I have 2 questions.
Firstly is that it requires insertion via GPS. This is fine as I have done this plenty of times with no issues, however it would appear to have a pre-defined insertion block number for a map16 graphics swap hardcoded in the asm and changing its insertion position in map16 with GPS causes it to draw incorrect blocks when the switch is pressed. It appears to be drawing the blocks at its default insertion point. I can't easily change the tiles occupying the space it wants to use by default as this space is occupied by LX5's custom powerup blocks and I'm sure doing so would mess up a lot of stuff in other levels using them already.
It wants to use blocks 600 and 601 in map16 by default, however I need it to use blocks A00 and A01. The new location isn't so important I just need to change its default location to some free space. I think I have found where in the asm I would need to change but I'm not sure. It is either somewhere in this section:
Code;Map16 change routine, do not touch, but however, feel free to use it.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
REP #$10 ;\Change the top left block.
LDX #!TopLeft ;|
%change_map16() ;|
SEP #$10 ;/
PHY ;>Protect block behavor
REP #$30 ;>16-bit AXY
LDY #$0004 ;>Loop start
-
PHP ;>protect processor mode.
PHY ;>This subroutine should not mess with Y as a loop counter.
SEP #$30 ;>Because this subroutine is 8-bit mode
JSR SwapXYHigh ;>Vertical levels have their $99 and $9B swapped.
REP #$30 ;>Even with PLP, this needed to prevent game crashes.
PLY ;>Now use Y as a loop counter index
PLP ;>restore processor mode.
LDA $98 ;\Shift Y position
CLC ;|
ADC YPosShft,y ;|
STA $98 ;/
LDA $9A ;\Shift X position
CLC ;|
ADC XPosShft,y ;|
STA $9A ;/
PHY
LDX TileChangeTbl,y ;\Change current tile
%change_map16() ;/
PLY
DEY ;\two bytes over since the tables are 16-bit numbers.
DEY ;/
BPL -
SEP #$30 ;>8-bit AXY
PLY
Or this:
Code;Tables to move and change tiles, do not touch, but feel free to use.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
XPosShft:
dw $FFF0, $0000, $0010
YPosShft:
dw $0000, $0010, $0000
TileChangeTbl:
dw !BottomLeft, !BottomRight, !TopRight
Or both? Or maybe neither and I'm dumb. I'm aware it clearly says do not touch this part of the code but I can't see what else you would change to do what I'm wanting. I'm sure I only need to change a couple of things but I can't spot where or how it is referring to these default tile position values.
There is 2 asm included for the top left and top right tiles of the switch respectively, so I know I'd have to change both but they are mostly identical so figuring that part out shouldn't be too much of a problem.
The second question is maybe a big ask, but as this switch has space and capability for executing custom behaviour I was wanting it to act like a giant blue P-Switch which is the main goal here. I've already redrawn the graphics for it in YYCHR to fit the level theme.
Any help would be greatly appriciated as always.
Thanks
Bottom Text
--------------------