don't click here

Ristar stuff

Discussion in 'General Sega Discussion' started by JoseTB, Mar 21, 2008.

  1. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    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:

    Code (Text):
    1. $00 - Relative Object address (word)
    2. $02 - Object Flags
    3. $03 - Animation frame (byte)
    4. $04 - ?? (frame specific mappings defined setting) (byte)
    5. $06 - Animation number
    6. $08 - Mappings offset
    7. $0E - VRAM offset
    8. $16 - Object subroutine counter (byte)
    9. $1A - Potential speed (inertia) (word, 8.8)
    10. $1C - X speed (word, 8.8)
    11. $1E - Y speed (word, 8.8)
    12. $20 - X position (long, 16.8)
    13. $24 - Y position (long, 16.8)
    14. $28 - Plane fixed X pos (word)
    15. $2A - Plane fixed Y pos (word)
    16. $2C - Object status bitfield (Ristar)
    17. $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.

    Code (Text):
    1. $0000 - 256x256 mappings (foreground)  (Also temp cache Star Decompression routine)
    2. $4000 - 256x256 mappings (background)
    3. $8000 - 16x16 mappings (foreground)
    4. $9000 - Object Layout
    5. $A400 - Level layout (foreground)
    6. $A600 - Level layout (background)
    7. $B000 - Collision index
    8. $B200 - Secondary collision index?
    9. $B600 . 16x16 mappings (background)
    10. $C000 - Ristar Object area
    11. $E500 - Level ID (word)
    12. $E57D - Level ID (byte)
    13. $E502 - Level X Highest boundary
    14. $E504 - Level X Lowest boundary
    15. $E506 - Level Y Highest boundary
    16. $E508 - Level Y Lowest boundary
    17. $E51E - Ristar X Acceleration
    18. $E520 - Ristar Y Acceleration
    19. $E522 - Ristar Max X speed
    20. $E524 - Ristar Max Y speed
    21. $E526 - Ristar Jump Speed
    22. $E552 - Collision Hotspot Left angle
    23. $E556 - Collision Hotspot Right angle
    24. $EA00 - Game mode
    25. $EA02 - Game mode sub
    26. $EA18 - Last Played sound
    27. $EA3A - Joypad input
    28. $EA70 - Horizontal int code (usually 6 bytes)
    29. $EC00 - Sprite table mirror
    30. $EF00 - Palette
    31. $EF80 - Fade Palette
    32. $F000 - Camera Object area
    33. $FA00 - Underwater Palette
    34. $FA80 - Underwater Palette
    ROM
    ----------------

    Code (Text):
    1. $3C1E - Object list, one long per object
    2. $7D80 - Initial level position array, 4 words per level (Ristar X/Y, Camera X/Y)
    3. $810A - Level order array
    4. $11C1B8 - Level Palette pointer index. Relative addresses, uncompressed, one word per level.
    5. $129270 - 8x8 Level tiles (foreground) pointer index. 'Star' compressed. Absolute addresses, one long per level.
    6. $1292C8 - 8x8 Level tiles (background) pointer index, 'Star' compressed. Absolute addresses, one long per level.
    7. $11C764 - 16x16 level mappings (foreground) pointer index. Star compressed, absolute adresses, two longs per level*
    8. $11C814 - 16x16 level mappings (background) pointer index. Star compressed, absolute adresses, two longs per level*
    9. $163716 - 256x256 level mappings (foreground) pointer index, 'Star' compressed. Absolute addresses, one long per level.
    10. $1853B0 - 256x256 level mappings (background) pointer index, 'Star' compressed. Absolute addresses, one long per level.
    11. $188492 - Level Layout (foreground) pointer index, Uncompressed. Absolute addresses, one long per level.
    12. $188552 - Level Layout (background) pointer index, Uncompressed. Absolute addresses, one long per level.
    13. $5E4 - Object layout pointer index, Relative addresses, one word per "act".
    14. $41950 - Pattern load cues list pointer index. Relative addresses, one word per act. The Art listed for each level is Nemesis compressed.
    15. $1E97A - Collision Array 1, uncompressed
    16. $1ED3A - Collision Array 2, uncompressed
    17. $1F0FA - Angle/slope maps array, uncompressed
    18. $188BAA - Level Collision index, relative addresses, one word per "act", Star compressed.
    19. $188BAA - Secondary Level Collision index, relative addresses, one word per "act", Star compressed.
    20. $CC599 - Sound Driver
    21.  
    22. *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 ;)
     
    • Informative Informative x 1
    • List
  2. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    [​IMG]
    =P

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

    [​IMG]

    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.

    [​IMG]

    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. Tweaker

    Tweaker

    Banned
    12,387
    2
    0
    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. Spanner

    Spanner

    The Tool Member
    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. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    Bloody hell. For a second, I thought you'd found GHZ graphics in the Ristar ROM. XP
     
  6. Upthorn

    Upthorn

    TAS Tech Member
    239
    0
    0
    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. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    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. drx

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    I've done something similiar to that shot before =) Reposted from Sep 2006:

    [​IMG]

    If anyone is interested in more Ristar hacking:

    http://www.hacking-cult.org/download/feel1.0.rar - a Ristar level editor
    http://www.hacking-cult.org/ristar/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. ddrmaxromance

    ddrmaxromance

    Member
    477
    0
    0
    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. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    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.

    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. Djbrayster

    Djbrayster

    "Do you wana chat with me?" Oldbie
    74
    0
    0
    England UK.
    Classic Amy The Hedgehog
    "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. muteKi

    muteKi

    Fuck it Member
    7,850
    131
    43
    About that level 7 title card: is there a reason that the second "layer" of the background isn't displayed properly?
     
  13. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    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.

    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.
     
  14. ICEknight

    ICEknight

    Researcher Researcher
    Hmm... How about the background clouds in the outside sections of Flying Battery?
     
  15. muteKi

    muteKi

    Fuck it Member
    7,850
    131
    43

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

    JoseTB

    Tech Member
    716
    59
    28
    Hm those aren't objects, it's just a scrolling effect with the whole plane "moving" vertically.
     
  17. JoseTB

    JoseTB

    Tech Member
    716
    59
    28
    Hey, sorry for the bump but I thought I'd rather do that than opening a new thread for this. I accidentally found an animation which I don't recall to be used in-game (someone may correct me if otherwise, I can't say for sure). The fact the animation is not centered makes me think so:

    [​IMG]

    After being idle for a while, ristar would look to the left and to the right, blinking twice.
     
  18. ICEknight

    ICEknight

    Researcher Researcher
    Heh, I don't remember that being in the game, either. Pretty cool.
     
  19. muteKi

    muteKi

    Fuck it Member
    7,850
    131
    43
    I'm sure I've seen the pose before, just perhaps not part of the waiting animation.
     
  20. I was playing Ristar today thanks to my newly wiibrew hacked wii and I was thinking that it could be really cool if someone was able to make a version of it where you used the warehog to play the game instead of ristar