olivieryuyu / N64-Microcode-

Testing - Phase 1
3 stars 0 forks source link

G_MOVE_HALFWORD #9

Open olivieryuyu opened 2 years ago

olivieryuyu commented 2 years ago

G_MOVE_HALFWORD

Header of the command: 0x22

As G_MOVE_HALFWORD can be used for many purposes and new macros may be created by users, it is better to explain it its structure at microcode level.

STRUCTURE:

HHDDD WWWW

HH: header of the command (8 bits)

DDD: place in DMEM where the word should be stored (12 bits)

WWWW: half word to be stored (16 bits)

On contrary of Fast3D, there is no index and offset, only the exact DMEM address where the word should be stored.

In this respect DMEM indices set in gbi.h are used, potentially with some small calculations made from parameters at running time.

DMEM indices

 #define G_MV_VIEWPORT          0x050
 #define G_MV_LIGHT         0x180
 #define G_MW_PERSPNORM         0x060

Related GBI macros:

gSPNearClip/gSPNearClip (see G_MOVEWORD for explanations) gSPNumLights/gsSPNumLights (see command G_LIGHT for explanations) gSPLookAtX/gsSPLookAtX/gSPLookAtY/gsSPLookAtY/gSPDLookAtX/gsSPDLookAtX/gSPDLookAtY/gsSPDLookAtY (see command G_LIGHT for explanations) gSPPerspNormalize/gsSPPerspNormalize (same as Fast3D)