WARNING: Don't read unless you read
a lot!
Note: This is not from Ersanio's code.
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/U9hWqPmlttU&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U9hWqPmlttU&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
Here are the new things I show off in the video:
Giant Q-Block: I can get this to spawn any sprite I want. The quake is just an effect too.
Giant brown and coin blocks: I think these are self explanatory. I'm thinking of not making these change with P switches because it takes 8 animations to run them all and that can get quite taxing on the game
Giant Ice blocks: These spawn into four regular ice blocks. I was thinking of making them just disappear, but I like them this way.
Giant P-switches: I love these things! As you can see, they are all independent and will just change the P value, hitting it from the top will not always mean "on." Yes, I was inspired by Ersan's P switch.
These were not made with blocktool or BTSD and use custom block offsets that are not available in either at the moment. So I cannot release them. I am however, open to suggestions of new blocks or improvements for my current blocks. I will not answer any stupid questions or personal requests to put them in your hack. But I will show off the code I used. Maybe another hacker with more time can help you out.
This is directly from my ASM file:
CodeMap16Right:
REP #$30
LDA $9A
CLC
ADC #$0010
STA $9A
JMP ChangeMap16
Map16Left:
REP #$30
LDA $9A
SEC
SBC #$0010
STA $9A
JMP ChangeMap16
Map16Down:
REP #$30
LDA $98
CLC
ADC #$0010
STA $98
JMP ChangeMap16
Map16Up:
REP #$30
LDA $98
SEC
SBC #$0010
STA $98
JMP ChangeMap16
PrematureEnd:
PLX
PLY
PLB
PLP
RTS
ChangeMap16:
PHP
SEP #$20
PHB
PHY
LDA #$00
PHA
PLB
REP #$30
PHX
LDA $9A ;Custom Block: X position
;of contact(low)
STA $0C
LDA $98 ;Custom Block: Y position
;of contact(low)
STA $0E
LDA #$0000
SEP #$20
LDA $5B ;Screen mode
STA $09
LDA $1933
BEQ SkipShift
LSR $09
SkipShift:
LDY $0E
LDA $09
AND #$01
BEQ LeaveXY
LDA $9B ;Custom Block: X position
;of contact(high)
STA $00
LDA $99 ;Custom Block: Y position
;of contact(high)
STA $9B
LDA $00
STA $99
LDY $0C
LeaveXY:
CPY #$0200
BCS PrematureEnd
LDA $1933
ASL A
TAX
LDA $BEA8,x
STA $65 ;24bit pointer to Level Data
LDA $BEA9,x
STA $66
STZ $67
LDA $1925 ;Level Mode settings from header
ASL A
TAY
LDA [$65],y
STA $04
INY
LDA [$65],y
STA $05
STZ $06
LDA $9B
STA $07
ASL A
CLC
ADC $07
TAY
LDA [$04],y
STA $6B
STA $6E
INY
LDA [$04],y
STA $6C
STA $6F
LDA #$7E
STA $6D
INC A
STA $70
LDA $09
AND #$01
BEQ SwitchXY
LDA $99
LSR A
LDA $9B
AND #$01
BRA CurrentXY
SwitchXY:
LDA $9B
LSR A
LDA $99
CurrentXY:
ROL A
ASL A
ASL A
ORA #$20
STA $04
CPX #$0000
BEQ NoAdd:
CLC
ADC #$10
STA $04
NoAdd:
LDA $98
AND #$F0
CLC
ASL A
ROL A
STA $05
ROL A
AND #$03
ORA $04
STA $06
LDA $9A
AND #$F0
REP 3 : LSR A
STA $04
LDA $05
AND #$C0
ORA $04
STA $07
REP #$20
LDA $09
AND #$0001
BNE LayerSwitch
LDA $1A ;X position of screen boundary
SEC
SBC #$0080
TAX
LDY $1C ;Y position of screen boundary
LDA $1933
BEQ CurrentLayer
LDX $1E ;Layer 2 X position
LDA $20 ;Layer 2 Y position
SEC
SBC #$0080
TAY
BRA CurrentLayer
LayerSwitch:
LDX $1A
LDA $1C
SEC
SBC #$0080
TAY
LDA $1933
BEQ CurrentLayer
LDA $1E
SEC
SBC #$0080
TAX
LDY $20
CurrentLayer:
STX $08
STY $0A
LDA $98
AND #$01F0
STA $04
LDA $9A
REP 4 : LSR A
AND #$000F
ORA $04
TAY
PLA
SEP #$20
STA [$6B],y
XBA
STA [$6E],y
XBA
REP #$20
ASL A
TAY
PHK
PER $0006
PEA $804C
JML $00C0FB
PLY
PLB
PLP
RTS
This file has five codes you'll want to use:
ChangeMap16 - This code expects you to have the custom block you want in the X register. Everything else will be taken care of.
Map16Right - Once again, you load the block you want in the X register, then it will change the tile to the right. The other tiles should be obvious right now. Use of all of them correctly gives you a working 32x32 block:
CodeLDX #!Block1
JSR ChangeMap16
LDX #!Block2
JSR Map16Right
LDX #!Block3
JSR Map16Up
LDX #!Block4
JSR Map16Left
RTS
Then you have to apply it for the other blocks you want to use to change. Finally, the actual block ASM code you want to use.
Yes, it's a very long, daunting process to get this crap working, but it is so rewarding once it looks good in gameplay! ^^
Once again,
I'm open to suggestions for new blocks!
----------
Interested in MushROMs? View its progress, source code, and make contributions
here.