Sonic and Sega Retro Message Board: Basic Questions & Answers thread - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 355 Pages +
  • ◄ First
  • 353
  • 354
  • 355
    Locked
    Locked Forum

Basic Questions & Answers thread NEWBIES: Start here!

#5311 User is offline KingofHarts 

Posted 21 November 2014 - 07:53 PM

  • Unlike Sonic, I don't chuckle...
  • Posts: 1412
  • Joined: 07-August 10
  • Gender:Male
  • Location:Chicago, IL
  • Project:Sonic Triad Studio, Sonic 1 REV C
  • Wiki edits:1
Spoiler tags contain my code issue due to page break.

Spoiler


View PostMainMemory, on 21 November 2014 - 12:00 PM, said:

You probably shouldn't be skipping the btst that checks whether the character is actually touching the object when playing as Knuckles.


Unless I'm missing another btst, I believe that the one you are referring to is the object's push flag to detect if the character is pushing the object, IIRC. I took your advice and I moved it before the character check... and it brought me back to the first issue I was having, where Knuckles can run through the wall, but if he is in the air, it will not work at all. That shouldn't be the case.

In S3K this is skipped when the character is super or the character is Knuckles... in which case it goes on to the breaking code. OR it's also skipped when the player has a flame shield, in that case it skips slightly less ahead to seeing if the character is in his rolling animation. (Blasting through the wall using Sonic's ability)... so I don't think this is the issue.
This post has been edited by KingofHarts: 21 November 2014 - 08:18 PM

#5312 User is offline E-122-Psi 

Posted 21 November 2014 - 08:03 PM

  • Posts: 1457
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Okay progress on the Final Zone query, I've (or more someone more competent) managed to get the boss to take hits properly using a branch, however the result is that the collision is gone for Eggman when getting away (which seems to be based on the normal boss object but is in obj85). Is there any sort of flag or data that recognises the difference between the two to use for the branch?

EDIT: Never mind. Fixed.
This post has been edited by E-122-Psi: 21 November 2014 - 10:36 PM

#5313 User is offline KingofHarts 

Posted 22 November 2014 - 01:34 AM

  • Unlike Sonic, I don't chuckle...
  • Posts: 1412
  • Joined: 07-August 10
  • Gender:Male
  • Location:Chicago, IL
  • Project:Sonic Triad Studio, Sonic 1 REV C
  • Wiki edits:1
Quick update, I fixed my bug. Knuckles works perfectly now. After a more careful search through the code, this is what was needed:


Smash_Solid:	; Routine 2
		move.w	(v_player+x_vel).w,speed(a0) ; load Sonic's horizontal speed
		move.w	#$1B,d1
		move.w	#$20,d2
		move.w	#$20,d3
		move.w	x_pos(a0),d4
		bsr.w	SolidObject

		beq.s	@donothing ; THIS LINE FIXES THE BUG AND MAKES IT ALL WORK CORRECTLY

		cmpi.b	#id_KnuxPlayer,id(a1) 	; is the current character Knuckles
		beq.s	@continue		; if yes, continue
                btst	#5,status(a0)		; is character pushing against the wall?
		beq.s	@donothing		; if yes, branch




Basically the SolidObject subroutine will give a return, determining whether or not the player collided with the object or not. Without this, it will disregard that completely... in vanilla Sonic 1, it doesn't check this because Sonic cannot break the wall simply by touching it. He breaks the wall by rolling along the ground into it, which is why the push bit of obStatus(a0) (#5) is checked. Here, we want to branch away if the character is not touching the object at all, because the character COULD be knuckles.... who walks through the wall. Otherwise, you'd get the bug I got because it's not checking for collision. The S3K equivalent is seen here:


		jsr	(SolidObjectFull).l
		tst.b	subtype(a0)
		bpl.s	loc_215A4
		tst.b	(Level_trigger_array).w
		beq.s	loc_215AC
		jmp	(Delete_Current_Sprite).l
; ---------------------------------------------------------------------------

loc_215A4:
		swap	d6
		andi.w	#3,d6
		bne.s	loc_215B2 ; EQUIVALENT

BreakWall_DoNothing: ;loc_215AC:
		jmp	(Sprite_OnScreen_Test).l



Though not quite exact, here... because there are a couple of other things the engine needs to check in S3K as well, but that line I marked is the equivalent.

Moving the btst to before the character check as MainMemory suggested, didn't work properly because it wasn't necessarily checking for a collision, moreso it was checking whether or not the character was actually pushing against the object along the ground, hence why Knuckles couldn't break it in the air like he's supposed to in S3K.

I hope this helps future Knuckles hacks to understand this.

#5314 User is offline Truner 

Posted 30 November 2014 - 10:58 AM

  • Posts: 103
  • Joined: 01-May 08
  • Gender:Male
  • Location:Hungary
I pretty much know nothing about the Sega Saturn (besides the fact that it's a pita to emulate), so excuse my slightly noobish question here:
Since Sonic 3D uses Redbook audio on the Saturn, does that mean that it could be replaced with the Mega Drive soundtrack, if converted and looped properly? If so, are there any guide for this kind of thing?
EDIT:oh hey, it turns out I should learn to Google better, such a thing already exists. Sweet.
This post has been edited by Truner: 30 November 2014 - 11:16 AM

#5315 User is offline E-122-Psi 

Posted 30 November 2014 - 12:38 PM

  • Posts: 1457
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
* Does the coding in S1 to recognise collecting rings (I take it's Obj25_Collect) have anyway of recognising if it's touched by Sonic and only Sonic? Right now I have a glitch that leads to another object being able to collect rings and add them to the counter.

* This one is more complex. Does anyone know what command makes the green cylinders in Marble Zone move up and down? I want to add a branch to make them stop and start (I've done it with other objects in the game, but for some reason this one won't budge from it's routine).
This post has been edited by E-122-Psi: 30 November 2014 - 12:56 PM

#5316 User is offline Clownacy 

Posted 30 November 2014 - 01:14 PM

  • Needs to make an avatar
  • Posts: 245
  • Joined: 06-July 13
  • Gender:Male
  • Location:Englandland

View PostE-122-Psi, on 30 November 2014 - 12:38 PM, said:

Does the coding in S1 to recognise collecting rings (I take it's Obj25_Collect) have anyway of recognising if it's touched by Sonic and only Sonic? Right now I have a glitch that leads to another object being able to collect rings and add them to the counter.

Why can't you check? I just did, and it's obvious that it doesn't. At least, by default, not explicitly.

Look, Ring_Collect is triggered by the ring object having an obRoutine of 4. Nothing in the obj25 object does that, however. This is done by ReactToItem, who has a special way of handing obj25's obColType, $47 (and similar ones). It works by increasing the object's routine counter by 2 when touched by whatever object branches to ReactToItem. So, in order for a ring to be collected, it must have an obColType of $47, and be touched by an object that routinely branches to ReactToItem. Usually, only Sonic does that. There's your problem.

Above Touch_Monitor (React_Monitor), above the addq.b, add these instructions:

	cmpa.w #BulletRAMSlot,a0	; is the colliding object a bullet?
	beq.s	locret_1AEF2		; if so don't collect ring

This post has been edited by Clownacy: 30 November 2014 - 01:18 PM

#5317 User is offline E-122-Psi 

Posted 30 November 2014 - 01:25 PM

  • Posts: 1457
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Doesn't seem to work. I should note this is a very particular glitch. The object only collects a ring just as it's routine ends and it deletes, otherwise it has no problems.

EDIT: Whoop, hold on. I tweaked the branch to this and it seemed to do it. Thanx very much. :D

	cmp.b #$10,(a0)	; is the colliding object a bullet?

This post has been edited by E-122-Psi: 30 November 2014 - 01:30 PM

#5318 User is offline Caverns 4 

Posted 01 December 2014 - 09:28 PM

  • Posts: 259
  • Joined: 07-December 12
  • Gender:Male
  • Project:Sanik Quest: Journey To The Right
Does anyone know how to remove the heat wave/ripple efect from Angel Island Zone? I've been looking through the disassembly, but I'm not really clear on where it is...

All I've been able to really figure out is that it has something to do with AIZ2_BackgroundEvent, but I've yet to figure out how it works.

#5319 User is offline redhotsonic 

Posted 04 December 2014 - 12:17 PM

  • Also known as RHS
  • Posts: 1101
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic 2 Recreation
  • Wiki edits:24
I haven't tried it, but there is a label called "ApplyFGandBGDeformation". Maybe try skipping that will help?

#5320 User is offline Caverns 4 

Posted 04 December 2014 - 07:34 PM

  • Posts: 259
  • Joined: 07-December 12
  • Gender:Male
  • Project:Sanik Quest: Journey To The Right
Sorry, I've tried that and nothing..
I get the feeling that there's an unequated RAM constant somewhere that's set to make the rippling happens, bur I have no idea what it could be. I'll keep looking into it too.

EDIT: I figured something out that seems to work.

Under loc_50260, I put this line:
		jmp	(AIZ1_ApplyDeformWater).l


Before this:
		jsr	(AIZ2_ApplyDeform).l
		jmp	ShakeScreen_Setup(pc)

This post has been edited by Caverns 4: 04 December 2014 - 07:49 PM

#5321 User is offline E-122-Psi 

Posted 06 December 2014 - 11:20 PM

  • Posts: 1457
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41
Concerning the previous query with the rings, albeit with Sonic 2. From what I see the routines are almost the same, but when I apply the same fix, it doesn't seem to work. Any idea what is altered here?

Also a more complex query. Is it possible to change the character's life icon when they turn Super? I know there are routines that recognize patches for a different character's life icons, but have no idea where and how it knows when to load them and if it can be done mid game.
This post has been edited by E-122-Psi: 06 December 2014 - 11:21 PM

#5322 User is offline MainMemory 

Posted 07 December 2014 - 01:22 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3217
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
For the rings, Sonic 2 has a special rings manager that handles the rings that appear in levels, the actual ring object is only used as part of the code for the scattered rings afaik.

For the life icon, if you wanted to do that, as far as I know you would have to have uncompressed copies of both the normal and super life icons (not the text area, just the picture) and initiate a DMA transfer to the VRAM location of the life icon graphic when you change forms. Depending on your disassembly, the function will be called DMA_68KtoVRAM, QueueCopyToVRAM, QueueVDPCommand, Add_To_DMA_Queue, or QueueDMATransfer.

#5323 User is offline E-122-Psi 

Posted 12 December 2014 - 09:43 AM

  • Posts: 1457
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41

View PostMainMemory, on 07 December 2014 - 01:22 AM, said:

For the life icon, if you wanted to do that, as far as I know you would have to have uncompressed copies of both the normal and super life icons (not the text area, just the picture) and initiate a DMA transfer to the VRAM location of the life icon graphic when you change forms. Depending on your disassembly, the function will be called DMA_68KtoVRAM, QueueCopyToVRAM, QueueVDPCommand, Add_To_DMA_Queue, or QueueDMATransfer.


I'm inexperienced with DMA transfers with art. Could you explain a bit further?

One more thing (I know, I know...), I'm having an oddity in S2 with a jump dash ability, I've made a branch so that it goes higher as Super. The branch doesn't seem to work when jumping, but will if you press when walking off a ledge/spring/object,etc (ie. it doesn't work in MdJump stipulations but does in MdAir ones). I checked both routines and they are the same (the ASM even notes this). Anyone have any idea what would cause this?

  • 355 Pages +
  • ◄ First
  • 353
  • 354
  • 355
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users