Language…
9 users online: acd13141,  AmperSam, Cristian Cardoso, CroNo, fanfan21, Green Jerry, Hayashi Neru, Maw, tOaO - Guests: 237 - Bots: 382
Users: 64,795 (2,377 active)
Latest user: mathew

problem with custom block *SOLVED*

Link Thread Closed

i am making a custom block, wich lets you jump automatically on contact. but when i touch the block in SMW, i get a black screen with a random sound.
my code is this:

Code
;let mario jump on contact

JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return

Mario:
	JSL $00D65E	;jump (i got the address from the ROM map)
Return:
	RTL


i think i made a stupid mistake =P

btw: i use Blocktool Super Deluxe



I might put some sort of signature here once. I guess.
Yep, you certainly made a stupid mistake. The routine you're trying to JSL to ends with a RTS.
Try applying this patch to your ROM:
Code
header
lorom

org $00FF93
JSR $D65E
RTL

And then use this block instead:
Code
;let mario jump on contact
JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
Mario:
JSL $00FF93 ;jump (i got the address from the ROM map)
Return:
RTL

<blm> zsnes users are the flatearthers of emulation

applying a patch? with what tool?
sorry i never patched a code to my roms :P



I might put some sort of signature here once. I guess.
Originally posted by rules sticky (weird place for it, but I'm too lazy to change it)
HOW TO APPLY XKAS PATCHES

Applying xkas patches is very simple, simply copy cmd.exe from the system32 folder to a folder with your ROM, patch and xkas. Then type in command:

Quote
xkas patch.asm rom.smc


With the obvious substitutions.

Since most xkas patches require free space for new code, you'll need to change a 'freespace' variable of some sort in the patch to free space in your ROM. This is a SNES / LoROM address that will require lunar address to convert between the address you see in the hex editor and the address you put in the patch.
To find the freespace, get the SMW Free Space Logger by smkdan from the Tools section. Of course, also have Lunar Address with you.
Now do as following:

1. Drag-drop your ROM over the SMW Free Space Logger.
2. A file is generated. Open it, and select a PC address you see fit. (It should have a sufficient amount of bytes.)
3. Convert that PC address to a SNES address in Lunar Address - input the PC address in the 'PC Address' tab, the corresponding SNES address will show up on the other side. Make sure you have SNES LoROM $00:8000-$6F:FFFF (the top-most option) checked.
4. Now replace the freespace address (org $1ACE00, org $xxxxxx, or !FreeSpace = $xxxxxx, whatever) with the SNES address that outputs.
You should be done right now.

Here's the link to xkas that for some reason isn't in that thread...
<blm> zsnes users are the flatearthers of emulation

ok i done everyting now, but it only plays the jump sound and if i make the block walk-thru it goes down slowly. help? maybe its the address?



I might put some sort of signature here once. I guess.
That subroutine certainly isn't made for JSLing to, and I'm starting to think that that address isn't made for JSRing to...
Maybe this'll work?
Code
;let mario jump on contact
JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
Mario:
LDA #$C0 ; Jump height
STA $7D
LDA #$01 ; Sound effect
STA $1DFA ; Sound effect bank
Return:
RTL

<blm> zsnes users are the flatearthers of emulation

YEAH! thanks! that worked!



I might put some sort of signature here once. I guess.
Link Thread Closed