Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
Acmlm's Board - I2 Archive - - Posts by Escherial |
Pages: 1 2 3 4 5 |
User | Post | ||
Escherial Shyguy Level: 17 Posts: 81/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Speaking of that, I'm looking for the offsets where the player's granted a powerup in hopes of redirecting it to a health counter (I'm not going to implement it myself, but I'd love to see it in Ninji ). Anyhow, I've managed to find $00D156, which is the address of the INC instruction that increments $7E0019 (the powerup value). I'm currently trying to jump to some safe place in the ROM to do some stuff and then jump back; this is working, but I'm running into strange freezes later down the road (for instance, upon exiting a pipe). I'll keep you all posted on any discoveries. (edited by Escherial on 03-17-05 05:13 PM) |
|||
Escherial Shyguy Level: 17 Posts: 82/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Normally I'd feel silly about asking such a trivial question, but this is starting to bug me. Without further ado... I've been trying to change the INC $19 at $00D156 (ROM address) to a JSL to another location far, far away in the ROM. Unfortunately, the instruction for an absolute long JSL is four bytes and the INC $19 is only two. Granted this, I was forced to move the instruction directly after (LDA #$0) into my target subroutine. This seemed to work fine at the time, but some code later on jumps to that old LDA #$0, which now happens to be the middle of the JSL command, and ends up moving execution to some random section of crash-happy code. So, to put it simply, how do you replace a short segment of code with a longer one without hitting these kinds of issues? I'm assuming that blocktool's and Lunar Magic's ASM hacks jump to unused portions of the ROM, but how do you make sure that you're not screwing up some code following it? Are there unused portions of the ROM local to $00D156 so I can just use a direct JSR rather than the longer JSL? On an unrelated note, anyone know where I can find a copy of 65c816.hlp? (It's a windows help file of all the 65c816 instructions and their hex equivalents.) I left my computer at school and now the dorm's locked up, so I can't get it. I believe it was downloadable on HabsoluteFate's jSmwDev site, but that doesn't exist anymore, as far as I can see . Thanks in advance |
|||
Escherial Shyguy Level: 17 Posts: 83/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
I'm pretty sure that the processor's in 8-bit mode at $00D156, so I'll go with the REP #$20 and not worry about fixing the stack, etc. Preserving the A register shouldn't be a problem, either, since the instruction I'm replacing was going to set A to #$0 in any case (and I'm not going 16-bit in my new code, so there's no danger of screwing up the high byte). So, in general, I'll have to remember that the solution to problems like these is to check the 8/16-bit flag, pad accordingly to fix immediate issues, and watch out for jumps from other sections of code to the one in which I'm working. Thanks to both of you for all the information; I'm honored to be treated to such detailed and informative responses. Naturally, I'll post on my status once I get a chance to work with it again. |
|||
Escherial Shyguy Level: 17 Posts: 84/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
The non-reloc offsets tell the block inserter code where to jump to in your code when the event they correspond to occurs. I.e. the "sprite interaction" offset would specify the "line" to jump to in your code when a sprite collides with your custom block -- the standard practice of giving 0 as the offset means that the block inserter code should jump to the first "line" of your code (-1 means that your block does not support that action and not to jump to your block code at all). This is useful if you want your block to react in different ways to different events -- i.e. you could have a block that would hurt Mario if he touched it, but break when hit by a fireball or a shell. The Reloc Offsets simply list jump locations in your code, so that block inserter can fix them to point to the right places when your code is put into some place in the ROM. In other words, your code assumes that position 0 is the start of your code and all offsets in your code are relative to that -- when your code is implanted into a larger codebase (the ROM, namely), those offsets must be shifted upwards or they'll point to places at the beginning of the ROM and not your code in specific. I hope that makes sense |
|||
Escherial Shyguy Level: 17 Posts: 85/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
A while back, HabsoluteFate was distributing an "SMW hacking kit" which contained a file called "65c816.hlp", a really nice Windows help file documenting all the 65c816 opcodes and their hex equivalents. Unfortunately, my copy of that file is currently unavailable and the site appears to be gone; I've messaged HabsoluteFate about the file, but he hasn't responded for the past few days. If anyone happens to possess the file, I'd appreciate a copy | |||
Escherial Shyguy Level: 17 Posts: 86/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Ok, just to put this matter to rest, I managed to implement your suggestion, MathOnNapkins, and it's working really well Before, I was having a kind of odd re-entry issue with getting mushroomed after coming out of a pipe (interestingly, the game immediately branches to the instruction right after that INC $19, which happened to be my jump before, heh), but this fixes it nicely. So, thanks again I'm working on replacing the powerups with a hit counter, by the way, if anyone's curious. I should have progress (a test IPS, perhaps?) in about a week or so. (edited by Escherial on 03-23-05 06:01 AM) |
|||
Escherial Shyguy Level: 17 Posts: 87/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Could you be a bit more specific? That is, which file does it say you're missing or what's the problem besides? Obviously, there's nothing wrong with the program itself, as tons of people on this board have used it without issue. | |||
Escherial Shyguy Level: 17 Posts: 88/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Taken from LunarDLL.h, starting at line 1012:The format of a RAT tag is as follows:As far as I know, the only difference between RTS and RTL is that RTL pulls the program bank register value off the stack (that was pushed there by JSL) whereas RTS doesn't. With that in mind, I can't think of any way to have RTS jump back to the right section of code unless you somehow ensure that the PBR gets set to wherever the JSL came from originally, which would obviously require modifying the subroutine in question. Sorry if that's not very helpful, but I can't figure any other way to do it. EDIT: Actually, you'd already be screwed once you pulled the PBR, since you'd then be whisked off to some random point in the bank from which you JSLd. The beauty of RTL is that it changes the program counter and the program bank counter in one fell swoop. So yeah, *shrug*... (edited by Escherial on 03-28-05 11:27 PM) |
|||
Escherial Shyguy Level: 17 Posts: 89/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Ah, that one's easy: use the "XBA" opcode (hex value: EB). It swaps the bytes of the A register, as you desire. | |||
Escherial Shyguy Level: 17 Posts: 90/90 EXP: 20866 For next: 3877 Since: 03-15-04 From: Pasadena, CA Since last post: 202 days Last activity: 38 days |
| ||
Here's a custom block I made a while back for moving sprites along rows of blocks: http://somnolence.ath.cx/temp/spmove.zip I didn't really know how offsets worked at the time, hence why there's a file for moving a sprite left and a file for moving a sprite right as opposed to a single file . Set all the offsets to -1 in block inserter except the "Sprite UD Offset" and/or the "Sprite LR Offset", of course, and enjoy Full assembly included. (Note: Keep in mind that it may be a bit buggy, especially when crossing screen boundaries or with Yoshi; I didn't really invest much time in this when I was working on it, unfortunately. Also, it won't move Mario, but that's easily fixable .) |
Pages: 1 2 3 4 5 |
Acmlm's Board - I2 Archive - - Posts by Escherial |