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 - ASM-Related Questions | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
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: 3273/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 02-14-05 04:09 AM Link | Quote
[edit] Figured out some, updated post. [/edit]

I had a nifty idea (I'll show you if I can get it working), but I need to know a few things to do it properly:

1) How can I control the speed layer 2 falls at using the 'layer 2 falls' sprite, or make layer 2 fall manually? (I want it to change speeds during the level, using code that executes every frame.)

2) How can I make sound? Like is there a register I can write to that will just play a certain frequency tone?

3) Is there something like a RAM address that I can use to disable Mario's controls? That is, I want the player to be able to pause, exit the level, etc (and my ASM will use some of the buttons and d-pad), but I need to have Mario not move. (Moving back and forth wouldn't be a problem, but things like jumping, shooting fireballs, etc need to be disabled. In fact, I might even be able to take care of fireballs and capes...) If not, does anyone at least know where the controller-reading routine is? (I thought I had it written down, but I can't seem to find it. )

4) How can I disable L/R button scrolling? (Like, permenantly. Might even use those buttons for something later. )

5) Does custom block code run while the game is paused? (I would assume not, but...) What about BMF's palette ASM thing?

6) Is layer 1 rotation possible at all? Would I have to change video modes or use the SFX chip or something crazy like that? Would it affect the actual gameplay?

7) Is there a way to make Mario completely invisible? Would it affect the death seqeunce? (It'd look kinda crappy if Mario just popped out of nowhere and died. )


(edited by HyperHacker on 02-14-05 01:56 PM)
knuck

Hinox
Banned until 19-58-5815: trolling, flaming, spamming, being a general fucktard...
Level: 62

Posts: 1166/1818
EXP: 1894574
For next: 90112

Since: 03-15-04

Since last post: 14 hours
Last activity: 9 hours
Posted on 02-14-05 04:14 AM Link | Quote
Originally posted by HyperHacker
5) Does custom block code run while the game is paused? (I would assume not, but...) What about BMF's palette ASM thing?
I don't think so.
And all that BMF's custom pallete thing does is run a routine without using custom blocks (when a custom block code is in execution, the game stops).
Originally posted by HyperHacker
6) Is layer 1 rotation possible at all? Would I have to change video modes or use the SFX chip or something crazy like that? Would it affect the actual gameplay?
I believe you'd have to use SFX, since changing video modes isn't an easy task at all.
Of course, i can be wrong.
Atma X

Bandit
Level: 43

Posts: 716/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 02-14-05 04:48 AM Link | Quote
Well, the best thing to do is to rewrite part of the "level loading" routine, or another routine in that area (I think thats the Routine Block Inserter cahnges ),... and have it call your routine whenever you want it to. You should be able to find it by first making a copy of your game, inserting a Custom Block, and using Hex Workshop to compare the differences of the two games. I believe it's the Routine that loads a level that Jonwil changed, but I'm not entirely sure, as this is just a guess based off of what I think would be the best way to call my own Routine to a Level (if he changed a different Routine, then just try and figure out which one it is).


(edited by Atma X on 02-14-05 12:49 AM)
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: 3281/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 02-14-05 06:39 AM Link | Quote
Er, what good would that do? I can use a custom block. I just need to make sure the code won't run while the game is paused and muck stuff up.
Atma X

Bandit
Level: 43

Posts: 717/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 02-14-05 07:59 AM Link | Quote
That was to give a solution to number 5.
If Block Tool's Routine and BMF's Palette Routine stays on while paused, then you can write your own, but you'll need a way to call it (sorry, I wasn't very specific as to the point I was getting to in my previous post).

So I just meant to use Block Tool to find a good Routine (whatever Routine Custom Blocks are being called from works,... so why not use that one) that can call your Routine (by finding which Routine Block Tool changes, and then using Hex Workshop to find the difference made to your Game, which would give you the Address of that Routine).


(edited by Atma X on 02-14-05 04:07 AM)
(edited by Atma X on 02-14-05 04:08 AM)
(edited by Atma X on 02-14-05 04:13 AM)
(edited by Atma X on 02-14-05 04:15 AM)
(edited by Atma X on 02-14-05 04:18 AM)
(edited by Atma X on 02-14-05 04:19 AM)
(edited by Atma X on 02-14-05 04:22 AM)
(edited by Atma X on 02-14-05 04:24 AM)
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: 3283/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 02-14-05 08:22 AM Link | Quote
I don't want it to run when the game is paused, that's the whole point.

And doesn't this thing have a conditional JSR, or at least a way to use BRA without SnesASM crashing? Also the 'layer 2 falls' sprite is way too slow, and I can't get layer 1 to move at all. I changed both $26 and $1462 but it just sits there. I did get layer 2 to move manually using $20 and $1468, but it just wraps around instead of scrolling through the entire layer 2 (using a vertical 2-layer level).


(edited by HyperHacker on 02-14-05 04:23 AM)
Atma X

Bandit
Level: 43

Posts: 718/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 02-14-05 08:25 AM Link | Quote
Read again. I read something wrong and fixed it, (but actually, the point isn't whether or not it stays On, but rather if BI's and BMF's Routine(s) fail to satisfy your needs [whatever thay are,... which I know now], if so, then you'll need to write your own Routine... so it wouldn't matter if it were On or Off that you were looking for).


(edited by Atma X on 02-14-05 04:33 AM)
(edited by Atma X on 02-14-05 04:34 AM)
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: 3284/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 02-14-05 09:17 AM Link | Quote
Well I could always just code the block to abort if the game is paused. I just need to know whether that's even necessary.
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

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

Posts: 652/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 02-14-05 04:50 PM Link | Quote
No, neither my code nor jonwil's run while the game is paused. The game actually confines itself to a very small loop when paused, so virtually nothing happens (aside from controller status checks and whatnot).
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: 3285/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 02-14-05 05:30 PM Link | Quote
Ah, good, I figured as much. How do you get layer 1 to move though?
[edit] Found the BRA problem; SnesASM crashes trying to assemble a branch to any part of memory before it. I managed to work around it by just moving the code to after all the branches, but this isn't really a good solution, since I need to check the status of multiple buttons. Doing it this way would ignore all the others if one is pressed.

Also figured out the layer 2 problem, just need to decrement the values in 16-bit mode.

[edit] No, of course that would be too easy. I can't get layer 2 to work quite right...
LDA $0020 ;Move layer 2
DEC
STA $0020
LDA $1468 ;Move physical layer 2
DEC
STA $1468

No matter what combination of FG/BG start positions I use, the graphical layer 2 starts (and stays) 2 screens behind the physical layer. That is I see what's on screen 3, but I'm interacting with what's on screen 5. This even happens if I only take the value from $0020 and write it to both $0020 and $1468 or vice-versa (in 16-bit mode). I also get garbage on the screen if I start at the very bottom screen, and sometimes even on the next one up with certain FG/BG positions.

Also, how can I subtract X or Y from A?

[edit] *kicks modem* I managed to sort of disable moving left and right by zeroing the bits in $15. Mario still slides around, but doesn't change direction or animate. It works good enough though, but the problem is it doesn't work for A and B, leaving him still able to jump.


(edited by HyperHacker on 02-14-05 01:38 PM)
(edited by HyperHacker on 02-14-05 01:55 PM)
(edited by HyperHacker on 02-14-05 02:30 PM)
(edited by HyperHacker on 02-14-05 02:33 PM)
(edited by HyperHacker on 02-14-05 03:07 PM)
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

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

Posts: 654/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 02-15-05 01:21 PM Link | Quote
Originally posted by HyperHacker
No matter what combination of FG/BG start positions I use, the graphical layer 2 starts (and stays) 2 screens behind the physical layer. That is I see what's on screen 3, but I'm interacting with what's on screen 5. This even happens if I only take the value from $0020 and write it to both $0020 and $1468 or vice-versa (in 16-bit mode).
Are you trying to scroll layer 2 in a vertical level? I encountered the same problem, but unfortunately, I don't know how to fix it.

Originally posted by HyperHacker
Also, how can I subtract X or Y from A?
Store X/Y to a temporary address and then use SBC $addr (don't forget to CLC first).

Originally posted by HyperHacker
I managed to sort of disable moving left and right by zeroing the bits in $15. Mario still slides around, but doesn't change direction or animate. It works good enough though, but the problem is it doesn't work for A and B, leaving him still able to jump.
I think A and B are stored at a different address ($17?).
d4s

Panser
Level: 29

Posts: 123/325
EXP: 142151
For next: 5734

Since: 03-23-04

Since last post: 13 days
Last activity: 1 day
Posted on 02-15-05 07:25 PM Link | Quote
Originally posted by HyperHacker
[edit] Figured out some, updated post. [/edit]

I had a nifty idea (I'll show you if I can get it working), but I need to know a few things to do it properly:


2) How can I make sound? Like is there a register I can write to that will just play a certain frequency tone?



nope.
theres nothing like that on the snes.
in fact, the sound system is completely independant from everything else and has its own cpu, ram and dsp.
you can only communicate with it through the 4 apu ports, but you need a program running on the spc that interprets the data you send to the ports correctly of course.

what you probably meant and mistitled as register is a variable in ram that will cause the game to play a sound effect.
that is certainly possible and usually not difficult to achieve.
find the buffers(many games buffer the apu ports and transfer them every frame altough that not a must) that are copied to the apu ports ($2140/$2141/$2142/$2143), pinpoint the routine that writes there while a soundeffect starts to play.
usually the games dont upload the soundeffects every time they are requested, the samples are uploaded to the spc when the game boots and you just send a one or two byte control command to the spc if you want a specific song/effect to be played.

Originally posted by HyperHacker

6) Is layer 1 rotation possible at all? Would I have to change video modes or use the SFX chip or something crazy like that? Would it affect the actual gameplay?



yes, thats possible.
but only if you have mode7 enabled.
the disadvantage is that you are limited to one layer and additional backgrounds would have to be faked with sprites.
using mode7 is not so difficult per se, the problem is integrating it in an existing enviroment like smw because it fundamentally differs from the other modes.
i know that smw uses it in some boss levels but i dont thinks its feasible for a normal level.
for example, the tile format is different from other modes, you cant mirror tiles in mode7 and the tiles occupy more vram space.
if you wanted to still use the status bar, youd have to switch video modes midframe, but smw would probably handle this for you already.

what you can do without mode changes are wave effects like this:



this only requires a free hdma channel and is easy to incorporate almost
everywhere.

i think i told you before about the super fx, didnt i.




Originally posted by HyperHacker

7) Is there a way to make Mario completely invisible? Would it affect the death seqeunce? (It'd look kinda crappy if Mario just popped out of nowhere and died. )


just move marios sprites out of visible screen area.
and i dont mean: move mario.
find the routine that writes the mario sprites to the oam buffer and have it write marios sprites outside the visible area under certain circumstances.

however, these kind of modications probably wont be possible with custom blocks, except for the sound thingie maybe.
ive never touched smw so these are just educated guesses.
ask blackhole when it comes to smws sound stuff.



(edited by d4s on 02-15-05 03:30 PM)
HabsoluteFate

Red Paratroopa
Level: 23

Posts: 98/179
EXP: 58525
For next: 9198

Since: 03-15-04
From: Ottawa, Ontario, Canada

Since last post: 10 days
Last activity: 2 days
Posted on 02-15-05 09:24 PM Link | Quote
If my notes are correct Address $00/E45D Displays mario on the screen although my notes arent too clear to even me
Address $00/E3EF has a Jump to #E45D.
From my notes "DisplayMario" function is E45D to E4B8
Keep in mind this code affects Mario's display on the gamescreen as well as the overworld....
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: 3293/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 02-15-05 10:42 PM Link | Quote
Originally posted by BMF54123
Originally posted by HyperHacker
No matter what combination of FG/BG start positions I use, the graphical layer 2 starts (and stays) 2 screens behind the physical layer. That is I see what's on screen 3, but I'm interacting with what's on screen 5. This even happens if I only take the value from $0020 and write it to both $0020 and $1468 or vice-versa (in 16-bit mode).
Are you trying to scroll layer 2 in a vertical level? I encountered the same problem, but unfortunately, I don't know how to fix it.

Yeah, that's the idea. Mario stays at one of the bottom screens and layer 2 scrolls downward past him. Having the first two screens repeat wouldn't be a huge problem, but I need to get the physical and displayed layers synchronized.
As far as A/B, going by what was in the memory address thread way back when, $15 stores most of the buttons, and $17 is just used to detect L and R and differentiate between A/B and X/Y. I assume $16 and $18 store controller 2's data, or maybe it was a typo; I've never needed to use L/R/X/Y for anything.

Sound isn't completely necessary, but if anyone can find a way to do it that would be nice. I know where the SPC700 I/O ports are mapped to (not off hand, but it's written down somewhere), the problem is just how to tell it what to do. I wonder if the program is even capable of this sort of frequency-specific tone playback? I can't think of a time it would have been used in the game. Rotation I can also live without, just thought it would make a nice effect if possible. I really can't afford to give up a layer though. Wave effects would be neat but there's really no use for them in this level.

As for your idea of moving Mario, I like the sound of it. Is it at all possible to have Mario on subscreen 1 but keep the camera on subscreen 0? (You start with Mario in the middle of subscreen 0, the camera all the way to the left. Hopefully I could put Mario in the middle of subscreen 1, but keep the camera where it is. The level is designed that you can't get far enough to the right to make the camera scroll, so if I can keep it in place, even if I have to reset its position every frame, then I'm good to go. As far as layer 2 interaction, I'll just duplicate the left side of the level on the right so it looks like Mario is still hitting it. )
d4s

Panser
Level: 29

Posts: 125/325
EXP: 142151
For next: 5734

Since: 03-23-04

Since last post: 13 days
Last activity: 1 day
Posted on 02-16-05 04:26 AM Link | Quote
to start you up, heres how smws sound effects stuff works:

like i guessed, $7e:1dfa is the buffer for spc port #2.
every time its value is not #$00, a sound effect is played.
the value represents the number of the sound effect.
for example, 01 is marios jump, 02 are the stupid yoshi drums and so on.

just write some value there any time with whatever you like(custom block etc)
to play a sample.

music works exactly the same way, but you use $7e:1dfb for it instead.
using that you can also change the music in the middle of the stage if you like.


[edit]
whoops, just noticed this is already mentioned in the memory locations thread.
sorry guys, im not up to date with the current smw knowledge stuff.

anyway, thats how you do soundeffects.
i dont think theres a way to generate tones per se.



(edited by d4s on 02-15-05 07:27 PM)
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: 3315/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 02-17-05 04:01 AM Link | Quote
Thanks, that's the one I was looking for. 7E1DF9 - 7E1DFC. I can't really think of a sound effect I could use in its place, but what the hell, it's not necessary. A 'screeching' sound would be kinda nice though, like in SMB3 when you change directions quickly. Anything like that in there?
mikeyk

Koopa
Level: 18

Posts: 35/110
EXP: 25086
For next: 4811

Since: 07-17-04

Since last post: 45 days
Last activity: 44 days
Posted on 02-17-05 04:27 AM Link | Quote
To completely disable the functionality of the L and R buttons, just change PC 0x0854 from F0 to C0. This is part of the routine (which starts at SNES $00/8650) that loads the controller data, and modifying it will make sure the bits for L and R are never even considered.
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: 3323/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 02-17-05 07:01 AM Link | Quote
Wouldn't that disable the buttons themselves? I still want them to work for things like custom blocks and re-entering castles, just not for scrolling.
d4s

Panser
Level: 29

Posts: 126/325
EXP: 142151
For next: 5734

Since: 03-23-04

Since last post: 13 days
Last activity: 1 day
Posted on 02-17-05 11:40 AM Link | Quote
ok, this is how you do it:

change SNESLO $00/CE02 (thats pc file adress 0x4E02 for a rom without header)
from #$30 to #$00.

this will disable the l/r scrolling only and leave everything else functional.
i think this isnt the first time a l/r scroll disable was requested.
feel free to add it to your smw-hacking-wiki(there was something like this, right?).

although i feel like playing around some more with mario world, youll have to find out the rest by yourself.
otherwise you wont learn anything.







(edited by d4s on 02-17-05 02:46 AM)
(edited by d4s on 02-17-05 02:52 AM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - ASM-Related Questions | |


ABII


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



Page rendered in 0.015 seconds.