Author Topic: Article on programming the Saturn in 1995  (Read 122 times)

Sadler

  • Hero Member
  • *****
  • Posts: 1062
Article on programming the Saturn in 1995
« on: January 03, 2013, 04:28:08 AM »
Ran across this article on programming the Saturn in 1995. Thought it was pretty interesting so I figured I'd share it here. :D

_joshuaTurbo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4973
Re: Article on programming the Saturn in 1995
« Reply #1 on: January 04, 2013, 08:06:03 AM »
/**************************************************************/
/* Trigger jumping if needed, also variable height jump logic */

Man_JumpTrigger()
{
  if ( Man.JumpFudge )
  {
    Man.JumpFudge--;
  }

  if ( Man.Mode != M_Crouch || Man_StandingRoom() )    // ok if not crouched, or there is headroom
  {
    if (Pad_Jump->Pressed)               /* jump button pressed */
    {
      if ((Man.Contact || (Man.Mode == M_Hang) || Man.JumpFudge) && Pad_Jump->Triggered && !Man.Blocking) /* and not already jumping */
      {
        if (Man.Mode == M_Hang && Pad1.Down.Pressed)
        {
          Man.Contact=0;
          Man.Mode=M_Jump;
          Man.AnimBase = LS_Jumping;    /* Change base anim to jumping */
          Man_TriggerSeq(LS_Jump);    /* start the jumping start anim */
          Man.YV.f = 0x10000;           /* and have no YV */
          Man.Y.i += 4;           /* and have no YV */
        }
        else
        {
          Pad_Jump->Triggered = 0;
          if ( !JetPacCheat )
            Man.YV.f = -0x00080000;     /* Initial jump speed */
          else
            Man.YV.f = -0x00008000;     // Initial speed in Jetpac mode
          Man.Contact = 0;          /* not on the ground any more */
          Man.JumpTime = 0;         /* just started jumping */
          Man.AnimBase = LS_Jumping;    /* Change base anim to jumping */
          Man_TriggerSeq(LS_Jump);    /* start the jumping start anim */
          Man.XV.f+=Man.FlyVel;

          if (Man.HangEnd && Man.Mode == M_Hang)  // if hanging
          {                   // and on the end of a path
            Man.HangEnd = 0;
            Man.X.i += 12*Man.Facing; // the move past end of path
            Man.JumpTime = -3;      // bit more fixed v jump time
          }
          Man.Mode = M_Jump;    /* change mode to jumping */

        }
      }
      else                        /* Already jumping */
      {
        if (Man.JumpTime++ < MaxJumpTime) /* Still in initial jump period */
          Man.YV.f -= 0x0005000;        /* So can maintain jump YV */
      }
    }
    else                      /* jump button not pressed */
    {
      Man.JumpTime = MaxJumpTime+1;     /* so can't alter YV again until landed */
    }

  }

}

I always heard that the Saturn was hard to program for... but damn.

nodtveidt

  • Guest
Re: Article on programming the Saturn in 1995
« Reply #2 on: January 04, 2013, 07:07:39 PM »
Meh, that's pretty basic stuff right there... very clean, standard C. The code in question is clearly a state controller with some very basic math. I'm more puzzled by the fact that the forum says "Quote from: Saturn Assembly on September 16, 1973, 04:56:45 PM"... 1973? ...really?

SignOfZeta

  • Hero Member
  • *****
  • Posts: 8497
Re: Article on programming the Saturn in 1995
« Reply #3 on: January 04, 2013, 07:18:59 PM »
The Saturn is OG.

I thought you knew...

_joshuaTurbo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4973
Re: Article on programming the Saturn in 1995
« Reply #4 on: January 08, 2013, 07:22:34 AM »
Meh, that's pretty basic stuff right there... very clean, standard C. The code in question is clearly a state controller with some very basic math. I'm more puzzled by the fact that the forum says "Quote from: Saturn Assembly on September 16, 1973, 04:56:45 PM"... 1973? ...really?

LOL I was screwing around with this bit of the 'quote' section= date=1357373259

Not sure how to make it go to 1995 or 1996.  :P

Necromancer

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 20854
Re: Article on programming the Saturn in 1995
« Reply #5 on: January 08, 2013, 08:31:57 AM »
U.S. Collection: 97% complete    152/156 titles

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Article on programming the Saturn in 1995
« Reply #6 on: January 08, 2013, 08:42:12 AM »
Meh, that's pretty basic stuff right there... very clean, standard C. The code in question is clearly a state controller with some very basic math. I'm more puzzled by the fact that the forum says "Quote from: Saturn Assembly on September 16, 1973, 04:56:45 PM"... 1973? ...really?


LOL I was screwing around with this bit of the 'quote' section= date=1357373259

Not sure how to make it go to 1995 or 1996.  :P



That's Epoch time.


http://www.epochconverter.com/


GET SOME, BITCH
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

spenoza

  • Hero Member
  • *****
  • Posts: 2751
Re: Article on programming the Saturn in 1995
« Reply #7 on: January 19, 2013, 03:22:01 AM »

I always heard that the Saturn was hard to program for... but damn.

Looks pretty clean to me. I don't necessarily follow all of it, but the comments help clear much of it up. The Saturn was hard to program for if you wanted optimized code that actually took advantage of its horsepower and features (which was in abundance, if you could figure out how to use it). If you're just programming something pretty basic it is likely just like any other system.