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?
  
User name:
Password:
Reply:
 

UserPost
MathOnNapkins
Posts: 2189/2189
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



Kailieann
Posts: 106/106
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.
HyperLamer
Posts: 8207/8210
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...
Glyph Phoenix
Posts: 731/745
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.
Kailieann
Posts: 104/106
It does, thank you.
*sits and waits for an answer to her levelASM question*
blackhole89
Posts: 968/971
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
Posts: 103/106
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?
BMF98567
Posts: 1260/1261
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
Posts: 102/106
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
Posts: 1259/1261
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
Posts: 101/106
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
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.023 seconds.