Jump to content

  •  

Photo

Emerald Collecting, Master System Style


  • This topic is locked This topic is locked
22 replies to this topic

#1 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 24 November 2011 - 03:00 AM

There are two things I want to do with my Sonic 1 hack, and they both involve the Chaos Emeralds.

1.) I want to move the Chaos Emeralds out of the Special Stages and into the regular stages so Sonic can collect them like in the Master System version of Sonic 1.

2.) I want to put extra lives in the Special Stages in place of the Chaos Emeralds, giving the player a different incentive to go into the Special Stages.

How would I do this as someone new to ASM editing?

Edited by Pyry, 24 November 2011 - 03:04 AM.

  • 0

#2 GT Koopa

GT Koopa

    2 Chaos Emeralds

  • Member
  • 76 posts
  • Gender:Male
  • Location:Elgin. IL

Posted 24 November 2011 - 03:28 AM

So, do you want to make emerald monitors like I did? Or like have an actual emerald out there? Either way it is all counters. When the sprite is collected, the counter goes up one. There is already one for emeralds, but you could set aside a variable for your custom emeralds as well. Also, you need to make room for the art of a emerald within the level, so the space would be used for the art of emeralds the entire game. So...the unused monitor art space? I assume you could just draw an actual emerald there, not put in a monitor, and use it for a emerald object.

Of course this is all from my asm exploring. There could be a better way others would consider.
  • 3

#3 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 24 November 2011 - 03:53 AM

I want the actual emerald out there. An emerald for each zone in Act 2.
  • 0

#4 GT Koopa

GT Koopa

    2 Chaos Emeralds

  • Member
  • 76 posts
  • Gender:Male
  • Location:Elgin. IL

Posted 24 November 2011 - 04:11 AM

a emerald


DERP HOW DID THAT HAPPEN

Anyway, yeah. That's how I would do it, apart from showing you actual code. Keep in mind I haven't done any ASM related stuff since last March, and with my laptop out of commission due to a really bad virus it is going to be that away for a while, unless Mac Sonic Hacking has improved since I got my laptop.

Can't help you with the special stage though. Never looked into how it and objects inside it worked.
  • 0

#5 SpirituInsanum

SpirituInsanum

    6 Chaos Emeralds

  • Pro User
  • 616 posts
  • Gender:Male

Posted 24 November 2011 - 03:49 PM

Something like this? :P

Posted Image

It can be a little complex for a beginner. You'll need 4 free tiles in VRAM, more if you want to animate it without a DPLC. You can use regen (dump the VRAM) to find a few free tiles. First, experiment with a simple object: make it show on screen, make sure it won't stay forever in RAM (ie destroy it when it's beyond the respawn distance), then make it collectible, and find a way so once it's been collected, it won't reappear.

As for the life in the special stage, it should be extremely easy. You could modify object 9 to make the life object end the level, then edit the special stage layouts and replace the emerald with a life icon.
  • 3

#6 MarkeyJester

MarkeyJester

    Intelligence takes you so far, intuition takes you further

  • Pro User
  • 1371 posts
  • Gender:Male

Posted 24 November 2011 - 03:59 PM

Both GT Koopa's and SpirituInsanum's statments are both plausible and worth following, I strongly advise both.

Also, it warms me to see good members helping out without sniping at the guy, a real pleasure =)
  • 1

#7 nineko

nineko

    I am the Holy Cat

  • Staff
  • 713 posts
  • Gender:Male
  • Location:italy
  • Interests:girls

Posted 24 November 2011 - 05:22 PM

Adding a 1-up in the Special Stage would be easy indeed, as the object is already there and working, it's just that none of the existing Special Stages make use of it. With any Special Stage editor out there (such as Puto's or Mercury's) you can easily remove the emeralds and add extra lives instead. To set the 1-up object to end the special stage, you need to add only one line of code. In the Hivebrain 2005 disassembly, look for the Obj09_Get1Up subroutine, and add this line right above the move.w:
addq.b	#2,$24(a0)	; run routine "Obj09_ExitStage"
The new code should look like this:
Obj09_Get1Up:

		addq.b	#1,($FFFFFE12).w ; add 1 to number of lives

		addq.b	#1,($FFFFFE1C).w ; add 1 to lives counter

		addq.b	#2,$24(a0)	; run routine "Obj09_ExitStage"

		move.w	#$88,d0

		jsr	(PlaySound).l	; play extra life music

		moveq	#0,d4

		rts
If you're not using the Hivebrain 2005 disassembly I can't help you instead, sorry.
  • 0

#8 Giga

Giga

    Newbie

  • Trialist
  • 12 posts
  • Gender:Male
  • Location:ILLEGAL PLACE 1111!

Posted 24 November 2011 - 05:48 PM

Something like this? :P

Posted Image

It can be a little complex for a beginner. You'll need 4 free tiles in VRAM, more if you want to animate it without a DPLC. You can use regen (dump the VRAM) to find a few free tiles. First, experiment with a simple object: make it show on screen, make sure it won't stay forever in RAM (ie destroy it when it's beyond the respawn distance), then make it collectible, and find a way so once it's been collected, it won't reappear.

As for the life in the special stage, it should be extremely easy. You could modify object 9 to make the life object end the level, then edit the special stage layouts and replace the emerald with a life icon.

:D AWESOME! picture the adding a 1 up idea is genius thats gives plans for hackers.
The problem is Where to find it (emerald).
  • 0

#9 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 24 November 2011 - 05:49 PM

I got the second thing done. Now there are extra lives in the Special Stages in place of the Chaos Emeralds and the Special Stages end upon collecting the extra life. Now all I have to left to do is to put the Chaos Emeralds in the regular levels.

I've downloaded Regen and right now I'm at the RAM Viewer under Tools. Should I dump the entire RAM or just certain parts of it?
  • 0

#10 SpirituInsanum

SpirituInsanum

    6 Chaos Emeralds

  • Pro User
  • 616 posts
  • Gender:Male

Posted 24 November 2011 - 06:25 PM

Dump the entire VRAM, if possible do it in every zone. Make all dumps show above each other in your favorite image editor, then locate the empty VRAM (really empty, no data at all, there's more there than only graphics).

If I remember correctly, I had some space after the hud's life icon (which isn't visible in Regen for some reason, therefore the dump), but maybe that's because I removed the 'sonic' text from the life icon, not sure. Anyway, once you located a free area, count the 8x8 tiles from the closest known address, multiply that number by $20 (in hexadecimal) and add that closest known address I was talking about.

This will give you the address of the free VRAM, which will be useful to display the object (load the art using the PLC and set the starting art block in the object's status table accordingly).

Then try to load graphics in the right spot (you can still check using regen), create the basic object and make it show in game.

Once you have your item showing in game, you can consider it's almost done. Just use a basic item of your choice for reference if you aren't sure.
  • 1

#11 nineko

nineko

    I am the Holy Cat

  • Staff
  • 713 posts
  • Gender:Male
  • Location:italy
  • Interests:girls

Posted 24 November 2011 - 07:29 PM

It is possible to free some VRAM by shifting stuff around. There is a very simple optimisation you can do, which will give you exactly the 4 tiles of VRAM you need. See, the life icon and the 1-up monitor use the same picture, but its graphic data is stored twice in the VRAM. You can make the 1-up monitor read the graphic data from the life icon, and store the chaos emerald graphic data in its place (or vice-versa). In my hack I made the 1-up monitor read the life icon graphic data by changing a line in _mapsobj26.asm (still, Hivebrain 2005 disassembly). Change:
byte_A5C9:	dc.b 2			; Sonic	monitor

		dc.b $F5, 5, 0,	$1C, $F8

		dc.b $EF, $F, 0, 0, $F0
To:
byte_A5C9:	dc.b 2			; Sonic	monitor

		dc.b $F5, 5, 1,	$54, $F8

		dc.b $EF, $F, $20, 0, $F0
Enjoy your 4 free VRAM tiles.

Bonus: if you add more characters (Tails, Knuckles, Fancharacter_The_Recolor), their 1-up monitors will already be fine as long as you take care of the different life icon :P

Edited by nineko, 24 November 2011 - 07:31 PM.

  • 0

#12 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 25 November 2011 - 12:42 AM

Okay, I've changed byte_A5C9 to make the 1-up monitor read the life icon graphic data. Now what programs would I use to insert the Chaos Emerald object into the game. The only hacking tools I have at my disposal right now are ConTEXT and SonLVL.

Edited by Pyry, 25 November 2011 - 01:25 AM.

  • 0

#13 Animemaster

Animemaster

    Lets get to work!

  • Pro User
  • 990 posts
  • Gender:Male
  • Location:UK

Posted 25 November 2011 - 02:42 AM

Ah hm.... well you do this in Asm, and yeah use context for that or word. You may be able to use the emerald object, if not you could create a new one. (But if the emerald is only going to be used in levels then the one done already should be fine). Considering there is art for chaos emerald already, I don't think there will be in need of importing, but it helps to have a program called SonMapED which is good for editing sprite art and maps.

Head on over to sonicretro and look in the programs section, and if you need to learn how to use it, head over to the "How To:" section for a tutorial on how it operates. You can use it to create the art and maps which you will most likely need to do for the emerald, and take the art of the emeralds from the file. (In the Artnem folder of your disasmembly) I've probly underststood this wrong (its like 1:30am i'm tired =/), so I apologies and feel free to correct me. Also sorry if this was a rubbish explanation.
  • 0

#14 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 25 November 2011 - 02:49 AM

Ah hm.... well you do this in Asm, and yeah use context for that or word. You may be able to use the emerald object, if not you could create a new one. (But if the emerald is only going to be used in levels then the one done already should be fine).

Correct me if I'm wrong, but are you saying there's already an emerald object I can use outside of the Special Stages? Or are you just talking about the graphics for the emerald object? Either way, thanks for the advice. I'll go ahead and get SonMapED.

EDIT: I can't locate the art for the emeralds in the Artnem folder... or anywhere. What's the BIN file called anyway?

I imported the emerald art from a custom image file anyway. It's in place of the 1-up monitor art.

Posted Image

Now what should I do next to make this emerald into an object? Keep in mind that this is my first time adding a new object to a Sonic hack.

Edited by Pyry, 25 November 2011 - 07:19 PM.

  • 0

#15 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 26 November 2011 - 06:02 PM

Sorry to double post, but here is my progress so far. I've edited "_inc/Object pointers.asm" and put in "Chaos_Emerald" in place of Obj06 (Which was an ObjectFall) as shown here.

Posted Image

Then I went into the main ASM file, made a copy of Obj25 (the ring object) and replaced all instances of Obj25 in the copy with Chaos_Emerald. Is there anything I should do next to make the object display the Emerald art and show up in the object list for SonLVL?

Edited by Pyry, 26 November 2011 - 06:05 PM.

  • 0

#16 Animemaster

Animemaster

    Lets get to work!

  • Pro User
  • 990 posts
  • Gender:Male
  • Location:UK

Posted 26 November 2011 - 08:15 PM

You have to include the emerald art file in the pattern load cues(PLC) in the inc folder. Have a look at it to get an idea, the number above the file at the top is how many files are loaded for that part, and the numbers below them are the art locations. So you will most likely need to find a free location, or maybe some how use the special stage emerald location for it.

Note: I'm guessing you will want an emerald(or different colours) for each zone/act, so you will need to include the file for every act. Then you'll need to change the art tile in your emerald object, it will look something like this "Move.w #$54B,2(a0)" this also needs to be done, but i'm alittle lost about this bit this different to the one in pattern load cues but i'm sure there is away to display it the same. Hopefully someone else will fill in.
  • 0

#17 Machenstein

Machenstein

    1 Chaos Emerald

  • Member
  • 34 posts
  • Gender:Male

Posted 03 December 2011 - 10:12 PM

So I'm starting over from scratch, but in doing so, I've made a pretty interesting find. I doubt it's anything new, but I still have to mention it anyway.

Upon looking at ssemeral.bin in SonMapED, there are only three emeralds instead of six. I assume this is because the six emeralds are really just the three seen in ssemeral.bin using different palettes. There is also an extra fourth emerald which is all white, but it's obviously just for the flashing animation of the other three emeralds. One last thing are the sparkles found in ssemstar.bin which must be the sparkles created when Sonic collects the emeralds in the Special Stages, not unlike the sparkles that are created when Sonic collects rings.

What am I getting at here? Well, the emeralds are already an object that sparkles and disappears when Sonic touches them. Instead of creating a brand new object which is based on the ring object, couldn't I just use the emerald object that's already in the game? If so, then it's only a matter of finding what object number the emeralds are and finding a way to make them an object for the other levels. Is this feasible or would I still have to create a brand new emerald object for the regular levels?

Edited by Pyry, 03 December 2011 - 10:15 PM.

  • 0

#18 SpirituInsanum

SpirituInsanum

    6 Chaos Emeralds

  • Pro User
  • 616 posts
  • Gender:Male

Posted 04 December 2011 - 12:19 AM

Special stage "objects" aren't regular objects, excepted for Sonic himself. You may know by now all objects are stored between FFD000 and FFEFFF in memory. So, launch the original S1 in Regen, go to the special stage (and pause the emulator), open the RAM viewer and check what's between FFD000 and FFEFFF.

Hint: the first 40 bytes are Sonic.

Anyway, you'll learn more by making your own basic object.

Also, don't forget you don't have a lot of video RAM to play with. You can't really load all those useless graphics in a regular level.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users