Sonic and Sega Retro Message Board: Ristar stuff - Sonic and Sega Retro Message Board

Jump to content

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

Ristar stuff

#1 User is offline JoseTB 

Posted 20 March 2008 - 09:13 PM

  • Posts: 623
  • Joined: 01-June 04
  • Location:Spain
  • Wiki edits:4
So I finally got some time to look into Ristar. The following info is still kind of a mess to be a decent guide, but I figured someone might still find it interesting so here it goes. I'll be updating the thread as I find new stuff for it.

Note: Information relative to ROM addresses come from Ristar (J)

Objects
----------------

Quick info: $40 bytes per object in RAM, Object list is located at $3C1E (rom), first object (ristar) is loaded at $C000 (ram). Similar to sonic engines for most part, except the SST is completely changed. Namely, the main object counter is now at $16, and a relative address to the object list is used instead of the object id.

Here's the list I have so far of the Ristar SST:

$00 - Relative Object address (word)
$02 - Object Flags
$03 - Animation frame (byte)
$04 - ?? (frame specific mappings defined setting) (byte)
$06 - Animation number
$08 - Mappings offset
$0E - VRAM offset
$16 - Object subroutine counter (byte)
$1A - Potential speed (inertia) (word, 8.8)
$1C - X speed (word, 8.8)
$1E - Y speed (word, 8.8)
$20 - X position (long, 16.8)
$24 - Y position (long, 16.8)
$28 - Plane fixed X pos (word)
$2A - Plane fixed Y pos (word)
$2C - Object status bitfield (Ristar)
$2D - Angle (byte)


RAM
----------------

Add $2478 to get the savestate address as usual. The list is obviously incomplete, but hopefully it'll grow with the time.

$0000 - 256x256 mappings (foreground)  (Also temp cache Star Decompression routine)
$4000 - 256x256 mappings (background)
$8000 - 16x16 mappings (foreground)
$9000 - Object Layout
$A400 - Level layout (foreground)
$A600 - Level layout (background)
$B000 - Collision index
$B200 - Secondary collision index?
$B600 . 16x16 mappings (background)
$C000 - Ristar Object area
$E500 - Level ID (word)
$E57D - Level ID (byte)
$E502 - Level X Highest boundary
$E504 - Level X Lowest boundary
$E506 - Level Y Highest boundary
$E508 - Level Y Lowest boundary
$E51E - Ristar X Acceleration
$E520 - Ristar Y Acceleration
$E522 - Ristar Max X speed
$E524 - Ristar Max Y speed
$E526 - Ristar Jump Speed
$E552 - Collision Hotspot Left angle
$E556 - Collision Hotspot Right angle
$EA00 - Game mode
$EA02 - Game mode sub
$EA18 - Last Played sound
$EA3A - Joypad input
$EA70 - Horizontal int code (usually 6 bytes)
$EC00 - Sprite table mirror
$EF00 - Palette
$EF80 - Fade Palette
$F000 - Camera Object area
$FA00 - Underwater Palette
$FA80 - Underwater Palette


ROM
----------------

$3C1E - Object list, one long per object
$7D80 - Initial level position array, 4 words per level (Ristar X/Y, Camera X/Y)
$810A - Level order array
$11C1B8 - Level Palette pointer index. Relative addresses, uncompressed, one word per level.
$129270 - 8x8 Level tiles (foreground) pointer index. 'Star' compressed. Absolute addresses, one long per level.
$1292C8 - 8x8 Level tiles (background) pointer index, 'Star' compressed. Absolute addresses, one long per level.
$11C764 - 16x16 level mappings (foreground) pointer index. Star compressed, absolute adresses, two longs per level*
$11C814 - 16x16 level mappings (background) pointer index. Star compressed, absolute adresses, two longs per level*
$163716 - 256x256 level mappings (foreground) pointer index, 'Star' compressed. Absolute addresses, one long per level.
$1853B0 - 256x256 level mappings (background) pointer index, 'Star' compressed. Absolute addresses, one long per level.
$188492 - Level Layout (foreground) pointer index, Uncompressed. Absolute addresses, one long per level.
$188552 - Level Layout (background) pointer index, Uncompressed. Absolute addresses, one long per level.
$5E4 - Object layout pointer index, Relative addresses, one word per "act".
$41950 - Pattern load cues list pointer index. Relative addresses, one word per act. The Art listed for each level is Nemesis compressed.
$1E97A - Collision Array 1, uncompressed
$1ED3A - Collision Array 2, uncompressed
$1F0FA - Angle/slope maps array, uncompressed
$188BAA - Level Collision index, relative addresses, one word per "act", Star compressed.
$188BAA - Secondary Level Collision index, relative addresses, one word per "act", Star compressed.
$CC599 - Sound Driver

*XX XX XX XX YY YY 00 00, where the X are the actual address and the Y the size


That's it for now. Decent explanations of everything to follow ;)
This post has been edited by JoseTB: 21 March 2008 - 03:44 PM

#2 User is offline JoseTB 

Posted 21 March 2008 - 01:47 PM

  • Posts: 623
  • Joined: 01-June 04
  • Location:Spain
  • Wiki edits:4
Posted Image
=P

Also, some other stuff I found in process I didn't mention earlier:

Posted Image

This seems to be a prototype zone title card. The code is still in the final, but it's ignored. I've restored it in the image since forcing it to show won't load the whole ascii text properly.

Posted Image

Round 7 title card. Not only the text is in the rom but actually you can force it to show and works just fine.

#3 User is offline Tweaker 

Posted 21 March 2008 - 01:51 PM

  • Posts: 12389
  • Joined: 27-June 04
  • Gender:Male
This is awesome! The potential in this information is wild—cross-porting stuff from Sonic and Ristar might even be a close reality!

Excellent work!

#4 User is offline Spanner 

Posted 21 March 2008 - 02:03 PM

  • Not much I can do on here nowadays...
  • Posts: 2873
  • Joined: 02-June 07
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic the Hedgehog Hacking Contest, Other Stuff
  • Wiki edits:2,193
Good work, JoseTB. Sonic stuff in Ristar could soon be a possibility.
Although this is kinda off-topic, how would porting music from Sonic 1 > Ristar work?

#5 User is offline Overlord 

Posted 21 March 2008 - 02:17 PM

  • Cat-herder
  • Posts: 14494
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
Bloody hell. For a second, I thought you'd found GHZ graphics in the Ristar ROM. XP

#6 User is offline Upthorn 

Posted 21 March 2008 - 03:19 PM

  • TAS
  • Posts: 239
  • Joined: 23-October 06
  • Gender:Male
  • Wiki edits:23

View PostJoseTB, on Mar 20 2008, 07:13 PM, said:

$20 - X position (word)
$24 - Y position (word)

Actually, the X and Y position you show here are the same format as Sonic 1 -- 16.8 bit fixed point
so you have a word of pixel component followed immediately by a byte of subpixel component, followed by an empty byte.

#7 User is offline JoseTB 

Posted 21 March 2008 - 04:00 PM

  • Posts: 623
  • Joined: 01-June 04
  • Location:Spain
  • Wiki edits:4
Hm yeah, you're right. The usage of those two as words in most cases is what made me thought otherwise, but indeed the functions used to translate the speed in the position of the objects do use longs to store the result as usual. You might as well call it 16.16 though, the "empty" byte is the result of the operations not being precise enough, but the code is likely to threat that as either a whole number (word) or a 16.16 fixed point value.

Regarding music stuff.. well, both use similar sound drivers, it shouldn't be too much of a problem I guess.

#8 User is offline drx 

Posted 21 March 2008 - 04:27 PM

  • <Shade> fuck MJ
  • Posts: 2119
  • Joined: 02-March 04
  • Gender:Male
  • Project::rolleyes:
  • Wiki edits:8
I've done something similiar to that shot before =) Reposted from Sep 2006:

Posted Image

If anyone is interested in more Ristar hacking:

http://www.hacking-c...oad/feel1.0.rar - a Ristar level editor
http://www.hacking-c...stardec-src.rar - the source code to the Star decompressor (first release of it)

I have a partial disassembly of Ristar that was done for the purposes of my level editor and whatnot, if you have any questions/whatever just ask.

I was going to write a compressor for Star but nobody seemed to care at the time (or about any aspect of Ristar hacking, to be honest). If there's demand, I could do it.

Anyways, enough of thread hijacking.

#9 User is offline ddrmaxromance 

Posted 21 March 2008 - 09:50 PM

  • Posts: 477
  • Joined: 06-January 06
  • Wiki edits:40
One question I've always had regarding the backgrounds of Ristar (especially Level 1's) was about the flying birds. Were the flying birds in the background that randomly appear and fly across the screen a part of the background or just an object? Because Sonic 1 had moving clouds but those were away from the ground. Is there like separate data that tells how the background to work in Ristar, or is it really simple to duplicate?

#10 User is offline JoseTB 

Posted 21 March 2008 - 10:41 PM

  • Posts: 623
  • Joined: 01-June 04
  • Location:Spain
  • Wiki edits:4

View Post.:troyoda:., on Mar 22 2008, 03:50 AM, said:

Were the flying birds in the background that randomly appear and fly across the screen a part of the background or just an object?


An object =) It would be too much of a harsh to dynamically change the background tiles in this case, sprites are a better option for that effect. GHZ clouds on rev01 only have a scrolling effect, something that can be done somehow easily toying with the scanlines.

View Post.:troyoda:., on Mar 22 2008, 03:50 AM, said:

Is there like separate data that tells how the background to work in Ristar, or is it really simple to duplicate?


Think of it as if you split the data of Sonic 1 in two sets and load/handle them separately. Technically you can simply join the two to use them in Sonic 1 if that's what you were thinking on, though not all sizes match, and there are some sight differences in the formats.

I'm surprised nobody asked what's up with the similarities between the ristar/sonic engines btw. But just to clear it up, they are close, but not exactly the same. I think either someone got the original source and reworked it completely from there, or they had the original "concepts" and implemented them differently.

#11 User is offline Djbrayster 

Posted 22 March 2008 - 03:36 PM

  • "Do you wana chat with me?"
  • Posts: 74
  • Joined: 25-January 05
  • Location:England UK.
  • Project:Classic Amy The Hedgehog
  • Wiki edits:7

View PostJoseTB, on Mar 20 2008, 09:13 PM, said:

So I finally got some time to look into Ristar. The following info is still kind of a mess to be a decent guide, but I figured someone might still find it interesting so here it goes. I'll be updating the thread as I find new stuff for it.

Note: Information relative to ROM addresses come from Ristar (J)

"Someone" is here =P

wow getting the greedy title card working is really impressive. Any chance you could check the earliest proto and see if there is any leftovers from Feel where a sprite of Ristar/Feel would be on the title card above the world number?

#12 User is offline muteKi 

Posted 22 March 2008 - 05:13 PM

  • Fuck it
  • Posts: 7427
  • Joined: 03-March 05
  • Gender:Male
  • Wiki edits:91
About that level 7 title card: is there a reason that the second "layer" of the background isn't displayed properly?
This post has been edited by The 無敵: 22 March 2008 - 05:14 PM

#13 User is offline JoseTB 

Posted 22 March 2008 - 05:13 PM

  • Posts: 623
  • Joined: 01-June 04
  • Location:Spain
  • Wiki edits:4

View PostDjbrayster, on Mar 22 2008, 09:36 PM, said:

View PostJoseTB, on Mar 20 2008, 09:13 PM, said:

So I finally got some time to look into Ristar. The following info is still kind of a mess to be a decent guide, but I figured someone might still find it interesting so here it goes. I'll be updating the thread as I find new stuff for it.

Note: Information relative to ROM addresses come from Ristar (J)

"Someone" is here =P

wow getting the greedy title card working is really impressive. Any chance you could check the earliest proto and see if there is any leftovers from Feel where a sprite of Ristar/Feel would be on the title card above the world number?


Hm the drx's protos are somehow near to the final so I'd say chances of that are slim.. but yeah, I'll take a look. On a somehow related note, I checked all the frames mapped by the default mappings of the ristar object, but I didn't find anything interesting. Also the text "OPENING DEMO" is actually being used in the same way than the proto title card I posted, with that ascii font. Which is weird because it is actually located in the "level" code, rather than the "demo" code which, differently to sonic engines, is separated. I suppose the "opening demo" title card was implemented before the demo was split from the actual level code.

View PostThe 無敵, on Mar 22 2008, 11:13 PM, said:

About that level 7 title card: is there a reason that the second "layer" of the background isn't displayed properly?


I'd have to check, but I think that "layer" is actually part of the Layer A which is the same the title card graphics do use.
This post has been edited by JoseTB: 22 March 2008 - 05:23 PM

#14 User is offline ICEknight 

Posted 22 March 2008 - 07:29 PM

  • Posts: 9289
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18

View PostJoseTB, on Mar 21 2008, 10:41 PM, said:

View Post.:troyoda:., on Mar 22 2008, 03:50 AM, said:

Were the flying birds in the background that randomly appear and fly across the screen a part of the background or just an object?
An object =) It would be too much of a harsh to dynamically change the background tiles in this case, sprites are a better option for that effect. GHZ clouds on rev01 only have a scrolling effect, something that can be done somehow easily toying with the scanlines.
Hmm... How about the background clouds in the outside sections of Flying Battery?

#15 User is offline muteKi 

Posted 22 March 2008 - 08:25 PM

  • Fuck it
  • Posts: 7427
  • Joined: 03-March 05
  • Gender:Male
  • Wiki edits:91

Quote

View PostThe 無敵, on Mar 22 2008, 11:13 PM, said:

About that level 7 title card: is there a reason that the second "layer" of the background isn't displayed properly?


I'd have to check, but I think that "layer" is actually part of the Layer A which is the same the title card graphics do use.



You're right. That would explain why they didn't implement it in game then.

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

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