Net Yaroze

 

 

 

 

 

 

 

My Net Yaroze site http://www.netyaroze-europe.com/~mgarcia/

Index

Special Techniques. 1

Changing TMD colour values on the fly. 2

objController_c. 2

world_c. 2

Textured heads. 3

 

The Net Yaroze is the official Sony Hobbyist programmable Playstation.

 

Project: UN-NAMED.

Description: 2d scroller fighter using 3d objects in C++.

 

This is far from complete but I thought I would put some stuff up and to share some ideas that I hack out ........

So here it is (Current Versions -world v40 -obj v20).

 

 

Special Techniques.

Displays TMD objects with TOD animation.

( TOD is an animation file format that 3d4 (DOS) supports using a plugin from the Yaroze dev page)

 

Reuses identical TMD saving memory, e.g. legs & feet.

 

Changing TMD colour values on the fly.

 

Reuses identical TMD saving memory, e.g. legs & feet. - The Object List

 

An array of GsDOBJ2  (I call it olist - object list ) is passed to the init function for the obj_c.

 

The first number tells the size of the objects list and how many GsDOBJ2 to create and link,

  the following numbers are used as references to link GsDOBJ2 to TMD data.

 

.e.g. TMD file has 4 3d objects (TMD ID's start from 0).

 

/************ TMD FILE *********

 ID 0  FOOT

 ID 1  LOWER LEG

 ID 2   UPPER LEG

 ID 3     WAIST

************ TMD FILE *********/

 

To save memory foot and leg parts can be reused instead of being included in the TMD file redundantly.

 

 the object list looks like this ( GsDOBJ2 pointers are used after initialisation)

 GsDOBJ2 *olist[]={

    (GsDOBJ2 *)      7, // Number of GsDOBJ2 objects in class but not it TMD, the TMD file only has 4 not 7.

    (GsDOBJ2 *)      0, // GsDOBJ2 0 link to TMD ID 0 - foot LEFT

    (GsDOBJ2 *)      1, // GsDOBJ2 1 link to TMD ID 1 - lower leg LEFT

    (GsDOBJ2 *)      2, // GsDOBJ2 2 link to TMD ID 2 - upper leg LEFT

    (GsDOBJ2 *)      3, // GsDOBJ2 3 link to TMD ID 3 - waist

    (GsDOBJ2 *)      2, // GsDOBJ2 4 link to TMD ID 2 - upper leg  RIGHT

    (GsDOBJ2 *)     1, // GsDOBJ2 5 link to TMD ID 1 - lower leg RIGHT

    (GsDOBJ2 *)      0 // GsDOBJ2  6 link to TMD ID 0 - foot RIGHT

   }

 

It links the TMD data to GsDOBJ2 in an array - OBJ_DATA_m .

Then instead of using the OBJ_DATA_m array to reference the objects the olist is used.

 

 for(int i = 0; i < OBJ_nobj_m;  i++)

  olist[i] =  &OBJ_DATA_m[ (u_long)( olist[ i+1] ) ];   //converts to list to pointers - the +1 is to skip the first number

 

 

 

Changing TMD colour values on the fly.

 

Each obj_c manipulates a type of tmd object and changes its appearance according to the objController_c.

All TMD's colour values that are white can be change on the fly, giving the appearance of many TMD objs

eg white legs and waist ( see pictures- only 2 TMD files used - top and bottom).

 

Obj_c stores the memory address of  the TMD colour value (that equals white) in a  array called clist_m.

Before displaying the TMD the class changes the values of the dereferenced pointers in the list with a given colour.

 

To get a colour list going I just give it the size of the TMD,  it searches from the start of the TMD to the end, looking for any

0x00FFFFFF.

 for(int i=0; i<tmdSize; i++)

{

      if( *tmd  == 0x00FFFFFF)

       {

           clist_m[i] = (colourTMD_t *)tmd;

       }

    tmd++;

}

 

objController_c

 

The class controls  a person (I should have called it person_c or something....)..

 

A person is spilt into two,  top (head , chest, upper arms and lower arms) and bottom (waist, upper legs and lower legs).

 

Each part has its own TMD & TOD data (see obj_c).

 

here is my init function

init(

    obj_c *top_obj, // pointer to the top obj

    obj_c *bot_obj, // pointer to the bottom obj

 

    // top colour values

    u_char tr,

    u_char tg,

    u_char tb,

 

    // bottom colour values

    u_char br,

    u_char bg,

    u_char bb

);

 

This class controls the a person's top and bottom-

    TMD colour.

    TOD Action (run, jump, kick etc) and Frame.

and  the person's  life value, coordinate, rotation, speed, name etc.

 

I will rename this class too.

NOT FINISHED

 

 

world_c

 

Dynamic TMD objects.

Changing TMD colour values on the fly.

 

Dynamic TMD objects.

The world so far only uses flat coloured and textured quads with no lights.

The world is split into three sections - the floor, wall and background.

the background is one big flat textured starting at UV 32 0 to 69 255 in tpage 1

 

 

Changing TMD colour values on the fly.

This is the all of the textures used in the world (so far).

All textures have been taken on a GB camera (2bit 4colours) saved as one large 4bit 256 x  252 tim.

 

 

 

each cell (if textured) has it's own CBA (clut for textures).

 

 

 

The original CLUT  is loaded under the image and 15 others are added after it to fill

the the rest of the tpage.

 

The red and green strips are my empty colours (easier to debug).

 

 

The world also moves the people and checks that its a valid move.

 

 

Textured heads

Me on the Game boy



Staring Jim!

 

 

The world and the 8 people

 

 

max is 28 so far, all walking randomly!

 

 

 

 

half the world with the original CBA

 

 

 

 

Close up.

 

 

 

 

 

 

Normal view.