User | Post |
BMF98567
Posts: 1222/1261 |
Actually, Y only stores the high byte of the block number, so it's 8-bit. |
Tauwasser
Posts: 21/27 |
The only thing that I see might be an obstacle might be the processor mode and how it needs to be set to 16bit for the compare (since Y is 16 bit).
cYa,
Tauwasser |
Dark Ludwig
Posts: 148/172 |
Have the routine (triggered with LevelASM) check, each frame, if Mario is touching a certain block, you can have the block act any way you want. Then get it to check if Y holds the same number as that block's map16 number's high byte, then have it check 7E1693 for the block's map16 number's low byte. If it comes true both times, then have it write a number to an empty place in RAM, and have it also each frame check if that number is not 0. If it isn't, then write to Mario's image RAM address and decrement that counter.
LDA (MEMORY) 7EXXXX;Spare RAM address (counter) CMP $00 BEQ $XX;To "*" LDA (IMMEDIATE) XX;Mario's image number STA (MEMORY) 7EXXXX;Mario's image number's RAM value DEC (MEMORY) 7EXXXX;(counter) RTS *TYA CMP XX;Map16 page of specific block BNE XX;To "~" LDA (MEMORY) 7E1693 CMP XX;Map16 block number on page BNE;To "~" LDA XX;How long you want Mario to have the certain image (See note) STA 7EXXXX;Mario's image RAM value ~RTS
Note: One second is approximately 0x40 frames.
This is completely untested. In fact, I just typed this up without opening any other windows or anything. This is not guaranteed to work, but it seems okay to me. I have all sorts of homework to do, and no time to test this, so I hope it works, and I hope I helped some. |
Kailieann
Posts: 60/106 |
Well, obviously this is going to come in very handy, but I had wanted to change Mario's image for a few frames as a result of coming into contact with a 'generic' block, and I'm not entirely sure how this will help with that. |
BMF98567
Posts: 1208/1261 |
LevelASM
Lets you run code every frame. Like a custom block, but you don't need to touch anything. |
Kailieann
Posts: 59/106 |
Well, it may have something to the fact that I didn't use LevelASM. In fact, I'm not entirely certain what LevelASM is.
Furthermore, a google search for LevelASM turned up one result, on a Chinese page. I was just using a block. |
BMF98567
Posts: 1206/1261 |
Hmm. My as-yet-unused shooter code writes #$20 (Mario sitting) to $13E0, and it works fine. As I recall, LevelASM code runs right before custom block code, so I don't see why a block wouldn't work.
Double-check your code and make sure it's writing to the correct address (8D E0 13)...that's really all I can suggest. |
Dark Ludwig
Posts: 139/172 |
Hmm, thoughts?
ZSNES's cheats rewrite RAM values immediately after that value is modified. It's possible that Mario's image is calculated after your custom block code. I would suggest using something with LEVELASM or PALASM, because they (I'm pretty sure) always override everything else. Have a custom subroutine check if Mario's touching that custom block, and then make that custom subroutine change his image.
I'm not 100% sure that'll work, or if I was right about Mario's image not changing, but they are ideas, so I decided to throw them out to the community. |
Kailieann
Posts: 55/106 |
It should be as simple as A9 ?? 8D E0 13 60, but for some reason it won't work. Has anyone else tried this? Is there another address that needs to be used? Changing 7E130E using ZSNES's cheat function works fine, I don't get why it wouldn't work with blocks.
Unless Mario's image is being constantly written by the game's normal code, and ZSNES can override it but blocks can't.
Any thoughts? |