Actions

SCHG

Difference between revisions of "Sonic Jam"

From Sonic Retro

(3D Vectors: Fixed wording for negative conversion)
(Changed 3D Vectors and Euler Angles explanations to the more generic Fixed Point Numbers and Angles.)
 
Line 12: Line 12:
 
Pieces of the guide not big enough for their own page should be left here.
 
Pieces of the guide not big enough for their own page should be left here.
  
===3D Vectors===
+
===Fixed Point Numbers===
 +
A fixed point number is how fractional numbers were handled in most games in this era, as opposed to floating point numbers.
  
3D Vectors consist of 3 longwords. The upper word of each long can be seen as the integer value of the component; $0001 is 1 unit. The lower word is fractional, out of 65536; $8000 becomes 0.5 units (32768 / 65536 = 0.5). In essence, it's like there's a decimal point after the first word.
+
In Sonic Jam, a fixed point number consists of two words. The upper word is the integer part, while the lower word is the fractional part, out of 65536; there's essentially a decimal point between the two words. For example, 1.0 would be written $0001 0000, whereas 0.5 would be written $0000 8000, 0.25 would be $0000 4000, and so on.
  
This is a bit different for negative values. Like all negative numbers, you're counting downwards, so to convert to decimal, you add 1 to the upper word unless the lower word is $0000, and you subtract 65536 by the lower word, and divide by that. For example, $FFFF0000 is -1.0, but $FFFFC000 is -0.25 (65536 - 49152 = 16384; 16384 / 65536 = 0.25).
+
Negatives are handled just like integers. This means that -1.0 would be written $FFFF 0000, whereas -0.5 would be $FFFF 8000, -0.25 would be $FFFF C000, and so on.
  
===Euler Rotation===
+
===Angles===
 
+
Angles in this game appear to always be words, where 0 degrees is $0000, 90 degrees is $4000, 180 degrees is $8000, and so on.
An Euler Rotation consists of 3 words. Each word rotates around one axis: X, Y, and Z in order (though the three don't always point how you'd expect). $0000 is 0 degrees of rotation, $8000 is 180 degrees of rotation.
 
 
 
I've yet to confirm if all Euler Rotations have the same handedness.
 
  
 
==External Links==
 
==External Links==

Latest revision as of 10:04, 22 November 2022

SCHG: Sonic Jam
Main Article
Sonic World

Models
Animations
Textures
Sounds
RAM Editing

This is the Sonic Community Hacking Guide for Sonic Jam.

Contributors

(In alphabetical order; if you are a contributor and have worked on a specific part of the guide, feel free to note that.)


Miscellaneous

Pieces of the guide not big enough for their own page should be left here.

Fixed Point Numbers

A fixed point number is how fractional numbers were handled in most games in this era, as opposed to floating point numbers.

In Sonic Jam, a fixed point number consists of two words. The upper word is the integer part, while the lower word is the fractional part, out of 65536; there's essentially a decimal point between the two words. For example, 1.0 would be written $0001 0000, whereas 0.5 would be written $0000 8000, 0.25 would be $0000 4000, and so on.

Negatives are handled just like integers. This means that -1.0 would be written $FFFF 0000, whereas -0.5 would be $FFFF 8000, -0.25 would be $FFFF C000, and so on.

Angles

Angles in this game appear to always be words, where 0 degrees is $0000, 90 degrees is $4000, 180 degrees is $8000, and so on.

External Links

References


Sonic Community Hacking Guide
General
SonED2 Manual | Subroutine Equivalency List
Game-Specific
Sonic the Hedgehog (16-bit) | Sonic the Hedgehog (8-bit) | Sonic CD (prototype 510) | Sonic CD | Sonic CD (PC) | Sonic CD (2011) | Sonic 2 (Simon Wai prototype) | Sonic 2 (16-bit) | Sonic 2 (Master System) | Sonic 3 | Sonic 3 & Knuckles | Chaotix | Sonic Jam | Sonic Jam 6 | Sonic Adventure | Sonic Adventure DX: Director's Cut | Sonic Adventure DX: PC | Sonic Adventure (2010) | Sonic Adventure 2 | Sonic Adventure 2: Battle | Sonic Adventure 2 (PC) | Sonic Heroes | Sonic Riders | Sonic the Hedgehog (2006) | Sonic & Sega All-Stars Racing | Sonic Unleashed (Xbox 360/PS3) | Sonic Colours | Sonic Generations | Sonic Forces
Technical information
Sonic Eraser | Sonic 2 (Nick Arcade prototype) | Sonic CD (prototype; 1992-12-04) | Dr. Robotnik's Mean Bean Machine | Sonic Triple Trouble | Tails Adventures | Sonic Crackers | Sonic 3D: Flickies' Island | Sonic & Knuckles Collection | Sonic R | Sonic Shuffle | Sonic Advance | Sonic Advance 3 | Sonic Battle | Shadow the Hedgehog | Sonic Rush | Sonic Classic Collection | Sonic Free Riders | Sonic Lost World
Legacy Guides
The Nemesis Hacking Guides The Esrael Hacking Guides
ROM: Sonic 1 | Sonic 2 | Sonic 2 Beta | Sonic 3

Savestate: Sonic 1 | Sonic 2 Beta/Final | Sonic 3

Sonic 1 (English / Portuguese) | Sonic 2 Beta (English / Portuguese) | Sonic 2 and Knuckles (English / Portuguese)
Move to Sega Retro
Number Systems (or scrap) | Assembly Hacking Guide | 68000 Instruction Set | 68000 ASM-to-Hex Code Reference | SMPS Music Hacking Guide | Mega Drive technical information