GithubHelp home page GithubHelp logo

gsSP1Triangle not parsed correctly about n64 HOT 5 CLOSED

glankk avatar glankk commented on July 17, 2024
gsSP1Triangle not parsed correctly

from n64.

Comments (5)

glankk avatar glankk commented on July 17, 2024

Where did you get this input data? It seems to be malformed, the vertex indices are supposed to go in the high word for F3DEX.

glank@glank-pc:~$ cat test.c
#include <stdio.h>
#define F3DEX_GBI
#include "gbi.h"

int main()
{
        Gfx gfx = gsSP1Triangle(30, 28, 31, 0);

        printf("%08X %08X\n", gfx.hi, gfx.lo);
}
glank@glank-pc:~$ gcc -o test test.c && ./test
BF3C383E 00000000
glank@glank-pc:~$ gfxdis.f3dex -d BF3C383E 00000000
{
    gsSP1Triangle(30, 28, 31, 0),
}

It's possible that this is meant to be Fast3D GBI, which does have vertex indices in the low word, but even then it seems to be malformed because the indices are multiplied by ten in the macro, and therefore need to be multiples of ten in the binary;

glank@glank-pc:~$ gfxdis.f3d -i -d BF000000 002C3A3E
{
    gsSP1Triangle(4 /* INVALID */, 5 /* INVALID */, 6 /* INVALID */, 0),
}

from n64.

krimtonz avatar krimtonz commented on July 17, 2024

It's not the best source, but the project 64 f3dex source reads it from the lo word for f3dex.

from n64.

mkst avatar mkst commented on July 17, 2024

I'm working on decompiling Space Station Silicon Valley.

In the US 1.0 ROM:

006924a0: 0400 81ff 802e e650 b100 0204 0006 0008  .......P........
006924b0: b102 000a 0000 060c b10e 1012 0006 1416  ................
006924c0: b118 0e1a 0010 021c b11e 2022 0024 1e26  .......... ".$.&
006924d0: b128 242a 001e 242c b120 2e30 0020 1e32  .($*..$,. .0. .2
006924e0: b134 2836 0038 343a bf00 0000 003c 383e  .4(6.84:.....<8>
006924f0: 0400 81ff 802e e850 b100 0204 0006 0208  .......P........
00692500: b102 000a 000c 0e10 b100 1214 0016 0c18  ................
00692510: b10e 061a 001c 1e20 b122 1c24 0026 2228  ....... .".$.&"(
00692520: b11c 222a 001e 2c2e b11e 1c30 0032 2634  .."*..,....0.2&4
00692530: b136 3238 003a 363c bf00 0000 002c 3a3e  .628.:6<.....,:>

from n64.

krimtonz avatar krimtonz commented on July 17, 2024

/***
 ***  1 Triangle
 ***/	
#define gSP1Triangle(pkt, v0, v1, v2, flag)				\
{									\
	Gfx *_g = (Gfx *)(pkt);						\
									\
	_g->words.w0 = _SHIFTL(G_TRI1, 24, 8);				\
	_g->words.w1 = __gsSP1Triangle_w1f(v0, v1, v2, flag);		\
}
#define gsSP1Triangle(v0, v1, v2, flag)					\
{									\
	_SHIFTL(G_TRI1, 24, 8),						\
	__gsSP1Triangle_w1f(v0, v1, v2, flag)				\
}

from n64.

glankk avatar glankk commented on July 17, 2024

You're right, this seems to stem from a incorrect implementation of SP1Triangle for F3DEX in the GBI header.

from n64.

Related Issues (10)

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.