PDA

View Full Version : [Tutorial] Super Mario World Hacking-Lunar Magic Basics


rstar095
August 8th, 2010, 11:30 AM
I havent seen much mention of SMW hacking in this forum(probably because its a pokemon one) but Im bored and feel like sharing my knowledge.
Here is what you need
SNES Super mario World ROM.
Lunar Magic
Lunar Magic is a very powerful tool and is almost all you need to make a good hack. It can be found at Smwcentral.net with many other usefull tools, gfx, sprites, and hacks.

Lets begin with the Basics:
OPENING YOUR ROMlike any other hacking program, you go to file>open ROM

Keyboard Buttons
Some Basic keys are
Page Up/Down = Level Select
Left Click = Select an Object and move it
Right Click = Duplicate or Add Sprite/Object
CTRL+ DELETE = Delete All Data on Level
CTRL+S = Save

LAYERS AND SPRITES
http://i34.tinypic.com/wh4hw.png
There are 3 layers to choose from. The left one is the layer 1 foreground which is used the most. The middle is layer 2 foreground which is a lttle more complicated. The last one is the sprite layer which is used for, well, sprites.

ADDING SPRITES/FOREGROUND
http://i34.tinypic.com/4zyr1i.png
The Next 2 are the buttons for adding objects. The left one is the foreground.http://i35.tinypic.com/14o85t2.pngFrom there you can select an object and right click on the map to place it. Hover over it for a description. To change the size move the sides like stretching out a window.
http://i37.tinypic.com/2r56byg.png
Next is the Sprite window. Open it. Its basically the same except you can't stretch it out, also make sure you have the sprite layer button clicked.
http://i36.tinypic.com/9iwavq.png

Foreground Sections
http://i34.tinypic.com/2nkrot0.jpg
If you haven't noticed yet, there is a drop down menu in the foreground box. The second one is Tileset Specific objects. These will only work if a certain tileset is set for the stage. Well they will still work but the graphics will be messed up.
http://i35.tinypic.com/vw01t.png
The Next one is Exteneded Objects Which are like tileset specific buthas some regular ones too. The last one and the more advanced one is the Map16 tiles. I will go on to explain it later in a diffrent section.http://i33.tinypic.com/2ykdi0w.png
http://i35.tinypic.com/xmsi2o.jpg
[/URL]
SPRITE SECTIONS
http://img11.imagehosting.gr/out.php/i1434213_untitled9.png (http://imagehosting.gr/show.php/1434210_untitled8.png.html)
http://img11.imagehosting.gr/out.php/i1434212_untitled9.jpg (http://imagehosting.gr)
The second one is tileset specific which is the same as foreground. The third one is Special Commands and Generators.
These are used for displaying messages, level scrolling, continuous bullet bills, flying fish, etc.
http://img11.imagehosting.gr/out.php/i1434214_untitled10.png (http://imagehosting.gr)
And The last one is used with Sprite Tool and is a diffrent and seperate tool.


PALETTES
http://img11.imagehosting.gr/out.php/i1434215_untitled11.png (http://imagehosting.gr)
The Picture Explains most of it
http://img11.imagehosting.gr/out.php/i1435558_untitled12.png (http://imagehosting.gr)
And you can end up with something like this^^. You may also notice that the backround is a little messed up. Thats because the pallette wasn't made to be used for that stage so you have to mess around with the colors a bit.


CHANGING BACKGROUND
Coming Soon!

SCREEN EXITS

http://img11.imagehosting.gr/out.php/i1435560_untitled13.png (http://imagehosting.gr)
Not as easy as the others. Well, each level has a certain amount of screen exits all the same size. Screen exits are the place the pipe or door will take you when you go through it. You can have one place that it will take you to per screen. They will take you to the levels entrance by default or the secondary entrance(explained later) Click on the blue door button to view the screen exits.
http://img11.imagehosting.gr/out.php/i1435559_untitled13.jpg (http://imagehosting.gr)
To change the screen exits, click on the indicated button. Next select the screen exit you want to change. Then on the box right below it choose the level it will take you to. Once you choose one it will light up blue(the screen exit.)

http://img11.imagehosting.gr/out.php/i1435594_untitled14.png (http://imagehosting.gr)
Next, when your adding the pipe, make sure its exit enables and inside the screen exit.



SECONDARY EXITS
Coming Soon!

MUSIC AND TIME

http://img11.imagehosting.gr/out.php/i1435557_untitled12.jpg (http://imagehosting.gr)
Again, not very Complicated, click bypass time limit, and change it, for music just choose one from the scroll down box.


IN DEPTH SPRITES
Coming Soon!

IN DEPTH FOREGROUND
Coming Soon!

OVERWORLD
Coming Soon!

GRAPHIC EDITING
Coming Soon!

MAP16
Guess what.Coming soon

Block Tool
Coming Soon!

Sprite Tool
Coming Soon!

MUSIC INSERTION
Coming Soon!


TIPS
http://www.smwcentral.net/?p=showhack&id=4013
This game teaches you some donts in hacking. I didnt make it.


What You Can End up With

I cant figure this youtube stuff out

Beginner
[url]http://www.youtube.com/watch?v=0NTNcHbX7zc

Intermidiate
http://www.youtube.com/watch?v=xkG8Ni59szE

Advanced
http://www.youtube.com/watch?v=FmJHcuwyHHs

Only if your some ASM genius
http://www.youtube.com/watch?v=7gxnvpDKqrg









NOTHING HERE

Team Fail
August 9th, 2010, 07:26 PM
OMG. This is the first SMW Tutorial I HAVE EVER SEEN on this site. Looking forward to the updates!

omegazeroINFI
August 11th, 2010, 05:12 AM
you should try to use block tool super deluxe rather then block tool, btsd is alot better.
if you need help on the music bit, i can help out there

rstar095
August 11th, 2010, 10:33 AM
Thanks, I havent used block tool super deluxe yet, I haven't been doing much with smw lately, and i already know how to add music, I just need to add it to the tut, which I can't get to right now. I'll probably update it evry 2-3 days untill I have almost everything you need to know excluding asm and hex

Team Fail
August 11th, 2010, 12:28 PM
I hope the music can be converted from MIDI format. I love doing midi music!!! :D I can't wait now!

rstar095
August 11th, 2010, 06:11 PM
ya m pretty sure its still commonly used to insert the music

omegazeroINFI
August 12th, 2010, 02:31 PM
midis arent required when adding music, you can write it from scratch in a txt as well as use tinymm to convert a format 0 midi to an mml which you have to get fixed up, the syntax it throws out is not recognized in addmusic, the squares and channel 1 to whatever shouldnt be there, its specified most commonly like this for a channel header
#0 @0 q7f w255 v255 y10 t45.
the channel number s specified with a # and the number 0-7, the instruments are specified @0-29, this gives you 28 instruments total, 19 and 20 i think are the 2 that crash the game, either those 2 or its 20 and 21, the q7f isnt required and can be removed, same with either the w255 or v255, if you get rid of the w255, you can specify vwhatever to all the channels, a major limitation i like better then the pokemon limitations is you only get 8 channels. pokemon probably gives you more, never got it to work, and channels #4, #6, #7 all use sfx, so sfx has priority over music making the song cutout till the sfx is done, i have written a basic music tutorial that can easily be improved if i had a bigger screen to take screenshots with.
http://s1.zetaboards.com/SMW_Archives/topic/3554146/1/#new
you can read up on more in that thread.
im not the best at music porting, but i definitely have alot off the top of my head here,

now for a suggestion, hex isnt that hard, it goes on a base of 16 digits rather then the normal 10,
1=1
2=2
3=3
4=4
5=5
6=6
7=7
8=8
9=9
A=10
B=11
C=12
D=13
E=14
F=15

and 65c816 asm i suppose can be complicated, but try to mention a little bit of asm like making a block.

using block tool super deluxe's format, which has the ability to add 3 extra offsets.

db $42
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireBall : JMP Corners : JMP MarioHeadIn : JMP MarioBodyIn

MarioBelow:
MarioAbove:
MarioSide:
SpriteV:
SpriteH:
MarioCape:
MarioFireBall:
Corners:
MarioHeadIn:
MarioBodyIn:
RTL


you can use http://www.smwcentral.net/?p=map&type=ram for ram address's to load and store to using
LDA= load accumulator and STA store accumulator,

a simple example would be to make mario big using these 2 lines of code.

LDA #$01
STA $19

the ram address is 7e0019 and since 7e00 is assumed, you can either not use long addressing and cut out the 7e00 or just the 7e, up to you.

ram addresses like 0DC2, 7e is assumed,

a side note, ram addresses with flags, load value #$01 or STZ(store zero) to the flag ram address, its a no or yes question.
LDA #$01 ;always use 2 digits for the value you pick,
STA $13CE;if your storing zero, you can always do the below

STZ $13CE ; feel free to change this ram address
;to whatever, you can load and store anything

theres other important commands like
CMP or BEQ, BNE
compare branch if equal branch if not equal, when branching, you make a label for it like this

BEQ label
RTS
label:
RTL
you use a word i guess sorta like a pokemon script, add a colon on the label, write code under it, your good to go.

one more note, blocktool uses rts to end a code and btsd uses rtl to end a code
both return from a subroutine and the rtl returns form a long subroutine, btsd completely obselete block tool at this point.

generators i guess are the blocks version of sprites, if you can code a block, you can code a generator with not much else knowledge.

dcb "INIT"
RTL
dcb "MAIN"
RTL

this is the build for a sprite that hasnt been coded yet in TRASM, xkas is better, but i currently dont know much about making xkas sprites let alone patches.

generators have their code run every frame, so the init routine is left alone
dcb "INIT"
RTL
dcb "MAIN"
STZ $19
RTL

with this code, if you insert as a generator after of course making the config file, just take one form an existing generator, open it in note pad and change the whatever.asm to the name of your asm generator sprite.
the init is run once while main is run every frame, if a generator is run every frame, i bet you dont see a reason to add anything to the init routine which you must always have anyway.

LDA has an x and y counter part. same with sta and cmp
LDX CPX STX same with y, theres also the stack were you push it onto a stack and pull it later like

LDA #$01 load value 1
PHA push to stack
LDX #$02 load value 2 to x reguster
STX $19 store to ram 19 to make mario have a cape
PLA pull value 1 out back to the accumulator
STA $19 store to 19 making mario big.

i could go on for a little, but this isnt my thing to post about, its yours.