Sonic and Sega Retro Message Board: Sonic 2 Nick Arcade disassembly - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Sonic 2 Nick Arcade disassembly

#1 User is offline drx 

  Posted 03 December 2006 - 01:17 AM

  • <Shade> fuck MJ
  • Posts: 2170
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
http://www.hacking-cult.org/?news/c/48

Enjoy.

PS. I tried to use Hive's terminology in that one, for compatibility reasons.

#2 User is offline Lath 

Posted 03 December 2006 - 01:23 AM

  • Posts: 118
  • Joined: 14-July 04

View Postdrx, on Dec 3 2006, 12:17 AM, said:

http://www.hacking-cult.org/?news/c/48

Enjoy.

PS. I tried to use Hive's terminology in that one, for compatibility reasons.

Nice going DRX, let's see who the first to port over the wall crashing thing to S2 final XD

Oh, pin please.

#3 User is offline Hivebrain 

Posted 03 December 2006 - 01:37 AM

  • Posts: 2721
  • Joined: 15-January 03
  • Gender:Male
  • Location:53.4N, 1.5W
  • Project:HivePal 2.0
  • Wiki edits:6,176
Nice work! I'll have a good look at this tomorrow.

View Postdrx, on Dec 3 2006, 06:17 AM, said:

PS. I tried to use Hive's terminology in that one, for compatibility reasons.

If you mean labels, I'm changing a lot of them for the next S1 disassembly.

#4 User is offline Rika Chou 

Posted 03 December 2006 - 02:56 AM

  • Posts: 5197
  • Joined: 11-January 03
  • Gender:Not Telling
  • Wiki edits:4
Awesome, I will be looking though this later for sure. Thanks drx!

#5 User is offline Dracula 

Posted 03 December 2006 - 03:15 AM

  • Posts: 599
  • Joined: 03-March 03
  • Gender:Male
  • Location:I'm watching you!
  • Project:The Guardian Legend UNROM to MMC5 and Issues
  • Wiki edits:12
Nice work! How did you dig this up so fast? =P
This post has been edited by Neo the Hedgehog: 03 December 2006 - 10:25 AM

#6 User is offline Weird Person 

Posted 03 December 2006 - 07:51 AM

  • You lost two seconds reading this
  • Posts: 367
  • Joined: 12-March 05
  • Project:Who knows?
Nice. Very interesting!

Code from ROM: (Vertical Blank code...)

		move.l	#$C0000000,4(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)
		move.l	(a0)+,(a1)


Yuji Naka isn't the organized programmer I tough he was. =P

#7 User is offline StephenUK 

Posted 03 December 2006 - 08:42 AM

  • Liquor in the front, poker in the rear
  • Posts: 1675
  • Joined: 30-December 04
  • Gender:Male
  • Location:Manchester, UK
  • Project:Quackshot Disassembly
Actually, that's done quite a few times in the S2 Final disassembly and is quicker to execute than looping over the same line X amount of times.

#8 User is offline Weird Person 

Posted 03 December 2006 - 08:53 AM

  • You lost two seconds reading this
  • Posts: 367
  • Joined: 12-March 05
  • Project:Who knows?

View PostStephenUK, on Dec 3 2006, 05:42 AM, said:

Actually, that's done quite a few times in the S2 Final disassembly and is quicker to execute than looping over the same line X amount of times.


I agree it's quicker, but the difference between a "dbra" loop and a lot of lines with the same instruction is desprezive, right?

#9 User is offline drx 

Posted 03 December 2006 - 09:35 AM

  • <Shade> fuck MJ
  • Posts: 2170
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8

View PostEmily Sapphire, on Dec 3 2006, 07:23 AM, said:

View Postdrx, on Dec 3 2006, 12:17 AM, said:

http://www.hacking-cult.org/?news/c/48

Enjoy.

PS. I tried to use Hive's terminology in that one, for compatibility reasons.

Nice going DRX, let's see who the first to port over the wall crashing thing to S2 final XD

Oh, pin please.


The whole wall crashing thingy is the Sonic_WallRecoil subroutine. And of course, you need to port the animation, frame and graphics.

#10 User is offline Quickman 

Posted 03 December 2006 - 09:46 AM

  • Posts: 5584
  • Joined: 03-December 03
  • Gender:Male
  • Location::x
  • Project:omg porjcet
  • Wiki edits:10

View PostWeird Person, on Dec 3 2006, 01:53 PM, said:

View PostStephenUK, on Dec 3 2006, 05:42 AM, said:

Actually, that's done quite a few times in the S2 Final disassembly and is quicker to execute than looping over the same line X amount of times.


I agree it's quicker, but the difference between a "dbra" loop and a lot of lines with the same instruction is desprezive, right?

Using my ninja context-fu I am predicting the content of this post, since "desprezive" did not translate.

"I agree it's quicker, but isn't a dbra loop quicker?"

The answer is no, a dbra loop is a lot slower in terms of processor cycles than just doing the same thing over and over the requisite number of times.
This post has been edited by Quickman: 03 December 2006 - 09:46 AM

#11 User is offline Weird Person 

Posted 03 December 2006 - 10:03 AM

  • You lost two seconds reading this
  • Posts: 367
  • Joined: 12-March 05
  • Project:Who knows?

View PostQuickman, on Dec 3 2006, 06:46 AM, said:

View PostWeird Person, on Dec 3 2006, 01:53 PM, said:

View PostStephenUK, on Dec 3 2006, 05:42 AM, said:

Actually, that's done quite a few times in the S2 Final disassembly and is quicker to execute than looping over the same line X amount of times.


I agree it's quicker, but the difference between a "dbra" loop and a lot of lines with the same instruction is desprezive isn't big, right?

Using my ninja context-fu I am predicting the content of this post, since "desprezive" did not translate.

"I agree it's quicker, but isn't a dbra loop quicker?"

The answer is no, a dbra loop is a lot slower in terms of processor cycles than just doing the same thing over and over the requisite number of times.


Fixed.

By the way, I hate you Quickman.

#12 User is offline drx 

Posted 03 December 2006 - 10:07 AM

  • <Shade> fuck MJ
  • Posts: 2170
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
Let me review the case:

Using so many move.l:

Each instruction takes 20 CPU cycles (3 read cycles, 2 write cycle). * 32 = 640 CPU cycles (96 read cycles and 64 write cycles).

Now using dbra, the code would have to look like this:

	move.w	#31,d1
loop:
	move.l	(a0)+,(a1)
	dbra	d1,loop


move.w #31,d1 - 8 cycles (2 read cycles, 0 write cycles)
move.l (a0)+,(a1) - 640 cycles (96 read cycles and 64 write cycles), like above
dbra d1,loop - 31 * branch taken timing - 310 cpu cycles (62 read cycles, 0 write cycles)
branch not taken, counter expired - 14 cpu cycles, 3 read cycles, 0 write cycles.

Let's sum it up:

using dbra - 972 cpu cycles, 163 read cycles, 64 write cycles
not using dbra - 640 CPU cycles, 96 read cycles and 64 write cycles.

using dbra, you would waste 25% cpu cycles in total, and 70% read cycles. Remember, this is done during the VBlank - so the timing DOES count.

Hope that clears the matter a little.

#13 User is offline Rika Chou 

Posted 03 December 2006 - 11:49 AM

  • Posts: 5197
  • Joined: 11-January 03
  • Gender:Not Telling
  • Wiki edits:4
What would you recommend as the best assembeler to use for this?

#14 User is offline drx 

Posted 03 December 2006 - 11:59 AM

  • <Shade> fuck MJ
  • Posts: 2170
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
I use snams68k 2.1d. I know it's not the best one, but it works for me.

I hear others use AS, but I haven't used it, so I can't tell you if it's good or not.

Also, if you're using snasm68k, use this:

snasm68k.exe -emax 0 -p -o ae- s2a.asm, s2a.bin

#15 User is offline ICEknight 

Posted 03 December 2006 - 12:04 PM

  • Posts: 10941
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Hm? What's this?

Quote

Object 43 - HPZ Roller enemy

Or did you mean SYZ?

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

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