Giter Club home page Giter Club logo

Comments (3)

zdimension avatar zdimension commented on May 30, 2024

The methods are code-identical on PC and PSX. I don't see a reason for moving them to specific branch.

PC:

int GetRandomControl()
{
  rand_1 = 0x41C64E6D * rand_1 + 12345;
  return (rand_1 >> 16) & 0x7FFF;
}

PSX:

lw      $v0, 0x188($gp)
li      $at, 0x41C64E6D
mult    $v0, $at
mflo    $at
addiu   $v0, $at, 0x3039
sw      $v0, 0x188($gp)
sra     $v0, 16
jr      $ra
andi    $v0, 0x7FFF

To C:

int GetRandomControl()
{
    int v0 = rand_1;
    v0 *= 0x41C64E6D;
    v0 += 12345;
    rand_1 = v0;
     v0 >>= 16;
    return v0 & 0x7FFF;
}

from tomb5.

Gh0stBlade avatar Gh0stBlade commented on May 30, 2024

Must be moved to specific code. or #ifdef'd out for PSX

Reason: PSX uses pure "ASM" for those functions really, and my goal is to keep it as similar to the original codebase as possible.

from tomb5.

Gh0stBlade avatar Gh0stBlade commented on May 30, 2024

For PC if code doesn't exist in MAIN.sym (decl) strip it out for psx with ifdef since it's likely an asm function for psx

from tomb5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.