Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - An explanation of rom banks? | |
Add to favorites | "RSS" Feed | Next older thread
User Post
Kailieann

Koopa
Level: 11

Posts: 101/106
EXP: 5320
For next: 665

Since: 10-09-05

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-01-05 04:19 AM Link | Quote
Okay, rather than a lengthy point-by-point explanation of what I'm trying to accomplish (it has to do with ASM jump commands, though), I'm just going to dive straight to the source of my confusion.

Most of the jumps I've seen in custom blocks refer to addresses ranging from 0000-7FFF in whatever bank is appropriate, but Lunar Address says those are invalid, and I can only use addresses 8000-FFFF.

Can anyone shed some light on this? I need to know how to figure out what ROM and PC addresses to use for my JSR/Ls >.o
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 1259/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 11-01-05 06:05 AM Link | Quote
Block Tool is capable of relocating jumps to the correct location in the ROM after insertion ("Reloc Offsets"). For example, if a routine is at $0123 in your .BIN file, your JSR would be 20 23 01. You enter the location of this jump in the Reloc Offsets box, and Block Tool takes care of the rest, pointing it to the correct ROM address.

I hope that solves your problem...
Kailieann

Koopa
Level: 11

Posts: 102/106
EXP: 5320
For next: 665

Since: 10-09-05

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-01-05 07:44 AM Link | Quote
hmmm...
the thing is, I was only mentioning the blocks for reference. I wanted to change some things around inside the actual ROM.
Specifically, I wanted to disable Mario's ability to fly by cape (by changing 0586F from 90 to 80), but later give him the ability to fly after he passes a certain level, by JSRing (or if necessary JSLing) to another location with the appropriate code, but thanks to my inability to decypher addresses, I can't figure out where to put the new code or how to jump there.

Though I'm suddenly getting the feeling that I could just shove the code anywhere and use LA to convert that offset into my JSL address, but even if that works it still wouldn't help me figure out how the banks work.
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 1260/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 11-01-05 03:32 PM Link | Quote
Oh, okay, I think I understand now. LoROM banks are easy. In each bank:

$xx0000-$xx1FFF = first 8K of WRAM ($7E0000-$7E1FFF)
$xx2000-$xx7FFF = hardware registers and "reserved" addresses
$xx8000-$xxFFFF = ROM data

ROM data always starts at SNES $xx8000. To calculate LoROM addresses, you start with $008000 at the very beginning of the ROM (PC $000000, no header), and increment the bank by 1 after every $8000 (32K) bytes:

PC $000000-$007FFF = SNES $008000-$00FFFF
PC $008000-$00FFFF = SNES $018000-$01FFFF
PC $010000-$017FFF = SNES $028000-$02FFFF

etc.

I suggest you read this document. It explains SNES memory mapping far better than I ever could.
Kailieann

Koopa
Level: 11

Posts: 103/106
EXP: 5320
For next: 665

Since: 10-09-05

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-01-05 06:56 PM Link | Quote
So then those other blocks are JSRing to ram addresses?

'cause the animated hurt block starts with 20CB00 (JSR #$00CB), which would put it somewhere just after a misc. sprite table according to the memory map.

Unless for some odd reason JSR doesn't use intel byte order, which would significantly increase my confusion.

Anyways, an unrelated question if you don't mind.
What priority over everything else does LevelASM have? Because I'd like to continuously STZ the controller data in some levels so I can use them for cutscenes. Would that actually work, or would the controller input still get through?


(edited by Kailieann on 11-01-05 08:39 PM)
blackhole89

LOLSEALS
Moderator of ROM hacking
EmuNET IRC network admin
Head GM of TwilightRO
Level: 47

Posts: 968/971
EXP: 739208
For next: 26995

Since: 03-15-04
From: Dresden/Germany

Since last post: 14 hours
Last activity: 12 hours
Posted on 11-01-05 10:24 PM Link | Quote
No.

Jumps in custom blocks are nothing like "real jumps" if they are getting relocated using besaid reloc offsets. They are just offsets relative to the beginning of the custom block binary. When Blocktool inserts them, it adds the starting ROM address of every block to all of the reloc offsets in order to make the jump working. So, if you have a JSR $0013 in the block code, and blocktool copies the block to, say, $0E87A0 (entirely random example), it adds $87A0 to all reloc offsets, so it becomes a JSR $87B3 in ROM.

Hope that helps~;
Kailieann

Koopa
Level: 11

Posts: 104/106
EXP: 5320
For next: 665

Since: 10-09-05

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-02-05 03:47 AM Link | Quote
It does, thank you.
*sits and waits for an answer to her levelASM question*
Glyph Phoenix

Level: 39

Posts: 731/745
EXP: 385876
For next: 18895

Since: 11-07-04

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-02-05 06:13 AM Link | Quote
Eh. Even if someone were to answer your question, you'd be much better off not doing it that way. It sounds messy and problematic.

Writing B to 71 apparently stops Mario from moving, and I'm sure there are other ways. Don't go through with that crappy STZ solution.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 8207/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-02-05 09:54 AM Link | Quote
Originally posted by Kailieann
I'd like to continuously STZ the controller data in some levels so I can use them for cutscenes. Would that actually work, or would the controller input still get through?

Not only does that not work (some input can still get through), it'll stop things like Start+Select. Unless you wanted that...
Kailieann

Koopa
Level: 11

Posts: 106/106
EXP: 5320
For next: 665

Since: 10-09-05

Since last post: 2 hours
Last activity: 2 hours
Posted on 11-02-05 10:16 AM Link | Quote
Writing B to 71 wouldn't be very useful. I didn't want Mario to stop moving, I wanted him to move on his own without any interference from the player.

Losing Start+Select in a cutscene is trivial. The level clear flag wouldn't be set, so it wouldn't have worked anyways.

I seem to recall someone saying 16 and 18 also hold controller data (though only for one frame), and my own research showed that DA2, DA4, DAA, and DAC did as well (and there's probably another 8 addresses for controller 2..), so if blocking 15 and 17 don't work on their own, perhaps combining them with the other addresses would.

It's all moot, though, as I'm beginning to think there's something to be said for interactive cutscenes.
MathOnNapkins

Math n' Hacks
Level: 67

Posts: 2189/2189
EXP: 2495887
For next: 96985

Since: 03-18-04
From: Base Tourian

Since last post: 1 hour
Last activity: 32 min.
Posted on 11-02-05 11:58 AM Link | Quote
Developing a cutscene might be a lot of work unless you have a very clear notion of what you want to do, and how you plan to accomplish it. Rather than clear the joypad info every frame, you ought to find a suitable "start" of the gameloop, then hopefully you have an unused memory address where you can keep track of whether you are in cutscene mode or not. from there, you branch based on that variable, and you'll have to write a different game loop, utilizing existing routines that you want from the gameloop, and possibly having the need to create your own. Scripted stuff that I've seen basically uses a jump table. So you have a variable that keeps track of what stage the cutscene is in.

How you divide that up is up to you, b/c you'll be coding it. Doing something like this is what I'm talking about:

SEP #$30

LDA cutscene_flag

BNE cutscene_activated

RTS/RTL ; whatever you need here

cutscene_activated:

LDA cutscene_index
ASL A
TAX

JSR cutscene_jumptable, X

RTS/RTL

cutscene_jumptable:

dw stageone, stagetwo, stagethree, etc. etc.

stageone:

; insert code

stage two:

; insert code

stage three

; insert code



Add to favorites | "RSS" Feed | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - An explanation of rom banks? | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.016 seconds.