Copy/Paste from RetroHack
Hi guys. I have seen many hacks trying to create entirely new levels, but these are...
not too much detailed I think, because have not palcycles, deform, animation, and other things
For that, and because Selbi is creating a tool for deform the BG, I'm creating this guide
Note: It's just a basic guide, that explains how to animate the FG, by timming. For the rest,
you must learn by yourself.
Ok, I want add these mushroms, to my FG in my hack,
(You can download these images [url="http://www.mediafire.com/?mj14ciy3xo7qxlp"]here[/url])
(also, note that the image size must be a multiple of 8, like 8x16, 16x32, 16x16)
Into this:
So, how to add this? I'll explain here
First, we'll try to add the first frame. So, go to SonMapEd; before anything, unload all other loaded things, go to Settings > Tile Rendering >
and set the line that will be used.
Now, go to File > Load Data File > Load Seccondary palette lines, and select the zone's palette. You will get this:
We're going to add the first frame. Go to File > Load From Image > Import Sprite Sheet, and then select the first
mushroom frame. Load, and save that uncompressed as Mush1.bin in ArtUnc.
Now, we need create the image's maps, into the level. Maybe like this
To do that, open the level with sonmaped, and insert 4 tiles in the start of the tileset (CTRL + I, in the first one), and write the numbers
1234 in these 4 first tiles. Now, to the block. Go to the block selector and do other more (CTRL + I, in the first one), and map it, depending
of the tiles position added in sonmaped (don't forget the pal line). In this case, may be this:
Now, just add that block in some chunk.
Save, build and test, you just will see numbers, instead of mushrooms. We need do the Animation script. So, open your
main ASM file, and go to Aniart_Load. It's the subrutine that loads the FG animations. We'll create the animation script
here. So, go to Aniart_GHZ.
The uncompressed art is hard to load, so, before work with that, we can install this subroutine, somewhere (Thanks GF64)
So, in aniart_ghz, we want that routine loads the mushrooms art.
after the label, add this
Ok, now we need to calculate the VRAM position. Well, I think that a macro used
for the public S1 Hacking Studio will help here.
Install this macro too, somewhere
Do you remember that we added the 4 tiles in the first possible locations? So, the VRAM
location to be used is $20.
So before the label Aniart_GHZ, put this
Now, the subroutine needs the file size (hex) / 2. On this animation, the total is $3
This is now ok, so call the LoadUncArt subroutine, and return.
And now, we just need to add the tiles's file
Save, build and test... You will se how the first frame is loaded correctly.
Now, we need the other ones. Repeat the SonMapEd's steps to add the other images as Mush2.bin and Mush3.bin into Artunc (include them too), and go to Aniart_GHZ_Mushrooms
Replace that with this, and your animation will be done.
That's all. Enjoy!!
EDIT: For who didn't understand the thing with VRAM correctly:
You need take a slot. For example, $2. $2 * $20 = $40. Other Example, $3A0. $3A0 * $20 = $7400.
Is*$20.
And, for see possible slots, I recommend GensKMod
Hi guys. I have seen many hacks trying to create entirely new levels, but these are...
not too much detailed I think, because have not palcycles, deform, animation, and other things
For that, and because Selbi is creating a tool for deform the BG, I'm creating this guide
Note: It's just a basic guide, that explains how to animate the FG, by timming. For the rest,
you must learn by yourself.
Ok, I want add these mushroms, to my FG in my hack,
(You can download these images [url="http://www.mediafire.com/?mj14ciy3xo7qxlp"]here[/url])
(also, note that the image size must be a multiple of 8, like 8x16, 16x32, 16x16)
Into this:
So, how to add this? I'll explain here
First, we'll try to add the first frame. So, go to SonMapEd; before anything, unload all other loaded things, go to Settings > Tile Rendering >
and set the line that will be used.
Now, go to File > Load Data File > Load Seccondary palette lines, and select the zone's palette. You will get this:
We're going to add the first frame. Go to File > Load From Image > Import Sprite Sheet, and then select the first
mushroom frame. Load, and save that uncompressed as Mush1.bin in ArtUnc.
Now, we need create the image's maps, into the level. Maybe like this
To do that, open the level with sonmaped, and insert 4 tiles in the start of the tileset (CTRL + I, in the first one), and write the numbers
1234 in these 4 first tiles. Now, to the block. Go to the block selector and do other more (CTRL + I, in the first one), and map it, depending
of the tiles position added in sonmaped (don't forget the pal line). In this case, may be this:
Now, just add that block in some chunk.
Save, build and test, you just will see numbers, instead of mushrooms. We need do the Animation script. So, open your
main ASM file, and go to Aniart_Load. It's the subrutine that loads the FG animations. We'll create the animation script
here. So, go to Aniart_GHZ.
The uncompressed art is hard to load, so, before work with that, we can install this subroutine, somewhere (Thanks GF64)
- Code:
; ---------------------------------------------------------------------------
; Subroutine to load uncompressed art
; ---------------------------------------------------------------------------
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||
LoadUncArt:
lea ($C00000), a1 ;Mover VDP Control a "a1"
LoadArt_Loop:
move.l (a2)+, (a1) ;$xxxxxxxx <- linea a procesar
move.l (a2)+, (a1)
move.l (a2)+, (a1)
move.l (a2)+, (a1)
move.l (a2)+, (a1)
move.l (a2)+, (a1)
move.l (a2)+, (a1)
move.l (a2)+, (a1)
dbf d0, LoadArt_Loop ;Repetir los pasos del d0
rts
;===============================================================================
=====
So, in aniart_ghz, we want that routine loads the mushrooms art.
after the label, add this
- Code:
jsr AniArt_GHZ_Mushrooms
Ok, now we need to calculate the VRAM position. Well, I think that a macro used
for the public S1 Hacking Studio will help here.
Install this macro too, somewhere
- Code:
vram macro
if (narg=1)
move.l #($40000000+((\1&$3FFF)<<16)+((\1&$C000)>>14)),($C00004).l
else
move.l #($40000000+((\1&$3FFF)<<16)+((\1&$C000)>>14)),\2
endc
endm
Do you remember that we added the 4 tiles in the first possible locations? So, the VRAM
location to be used is $20.
So before the label Aniart_GHZ, put this
- Code:
Aniart_GHZ_Mushrooms:
vram $20
- Code:
lea (UncMush1),a2
Now, the subroutine needs the file size (hex) / 2. On this animation, the total is $3
- Code:
move.w #3,d0
This is now ok, so call the LoadUncArt subroutine, and return.
- Code:
jsr LoadUncArt
rts
And now, we just need to add the tiles's file
- Code:
UncMush1:
incbin 'artunc\mush1.bin'
Save, build and test... You will se how the first frame is loaded correctly.
Now, we need the other ones. Repeat the SonMapEd's steps to add the other images as Mush2.bin and Mush3.bin into Artunc (include them too), and go to Aniart_GHZ_Mushrooms
Replace that with this, and your animation will be done.
- Code:
Aniart_GHZ_Mushrooms:
vram $20 ;VRAM Location
lea (Uncflows1),a2 ;Tiles
move.w #3,d0 ;Size
jsr LoadUncArt ;Process that
cmpi.b #$10,($FFFFFFB3).w ;Timer 1 elapsed?
bcs AniArt_AHZ_Return ;If not, branch
vram $20 ;VRAM Location
lea (Uncflows2),a2 ;Tiles
move.w #3,d0 ;Size
jsr LoadUncArt ;Process that
cmpi.b #$10,($FFFFFFB4).w ;Timer 2 elapsed?
bcs AniArt_AHZ_Return_2 ;If not, branch
vram $20 ;VRAM Location
lea (Uncflows1),a2 ;Tiles
move.w #3,d0 ;Size
jsr LoadUncArt ;Process that
cmpi.b #$10,($FFFFFFB5).w ;Timer 3 elapsed?
bcs AniArt_AHZ_Return_3 ;If not, branch
vram $20 ;VRAM Location
lea (Uncflows3),a2 ;Tiles
move.w #3,d0 ;Size
jsr LoadUncArt ;Process that
cmpi.b #$10,($FFFFFFB6).w ;Timer 4 elapsed?
bcs AniArt_AHZ_Return_4 ;If not, branch
clr.b ($FFFFFFB3).w ;Clear Timer 1
clr.w ($FFFFFFB4).w ;Clear Timer 2 and 3
clr.b ($FFFFFFB6).w ;Clear Timer 4
rts
AniArt_AHZ_Return:
add.b #1,($FFFFFFB3).w ;Add to Timer 1
rts ;Return
AniArt_AHZ_Return_2:
add.b #1,($FFFFFFB4).w ;Add to Timer 2
rts ;Return
AniArt_AHZ_Return_3:
add.b #1,($FFFFFFB5).w ;Add to Timer 3
rts ;Return
AniArt_AHZ_Return_4:
add.b #1,($FFFFFFB6).w ;Add to Timer 4
rts ;Return
That's all. Enjoy!!
EDIT: For who didn't understand the thing with VRAM correctly:
You need take a slot. For example, $2. $2 * $20 = $40. Other Example, $3A0. $3A0 * $20 = $7400.
Is
And, for see possible slots, I recommend GensKMod