Mess byteswapping and comment out 3D render code
This commit is contained in:
parent
8dfda41cb2
commit
7e0b12048c
3 changed files with 58 additions and 12 deletions
|
|
@ -189,6 +189,10 @@ static void objCall(ModelData *arg0, HsfObject *arg1)
|
||||||
|
|
||||||
static void objMesh(ModelData *arg0, HsfObject *arg1)
|
static void objMesh(ModelData *arg0, HsfObject *arg1)
|
||||||
{
|
{
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
// TODO PC
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
HsfDrawObject *temp_r29;
|
HsfDrawObject *temp_r29;
|
||||||
HsfConstData *temp_r25;
|
HsfConstData *temp_r25;
|
||||||
HsfTransform *var_r30;
|
HsfTransform *var_r30;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
#include "dolphin.h"
|
#include "dolphin.h"
|
||||||
|
|
||||||
|
#include <port/byteswap.h>
|
||||||
|
|
||||||
static void *MessData_MesDataGet(void *messdata, u32 id)
|
static void *MessData_MesDataGet(void *messdata, u32 id)
|
||||||
{
|
{
|
||||||
s32 i;
|
s32 i;
|
||||||
|
|
@ -7,22 +9,50 @@ static void *MessData_MesDataGet(void *messdata, u32 id)
|
||||||
u16 *banks;
|
u16 *banks;
|
||||||
u16 bank;
|
u16 bank;
|
||||||
s32 *data;
|
s32 *data;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
s32 ofs;
|
||||||
|
u16 bank_pc;
|
||||||
|
#endif
|
||||||
bank = id >> 16;
|
bank = id >> 16;
|
||||||
data = messdata;
|
data = messdata;
|
||||||
max_bank = *data;
|
max_bank = *data;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
byteswap_s32(&max_bank);
|
||||||
|
#endif
|
||||||
data++;
|
data++;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
ofs = *data;
|
||||||
|
byteswap_s32(&ofs);
|
||||||
|
banks = (u16 *)(((u8 *)messdata) + ofs);
|
||||||
|
#else
|
||||||
banks = (u16 *)(((u8 *)messdata)+(*data));
|
banks = (u16 *)(((u8 *)messdata)+(*data));
|
||||||
for(i=max_bank; i != 0; i--, banks += 2) {
|
#endif
|
||||||
|
for(i = max_bank; i != 0; i--, banks += 2) {
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
bank_pc = *banks;
|
||||||
|
byteswap_u16(&bank_pc);
|
||||||
|
if(bank_pc == bank) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if(*banks == bank) {
|
if(*banks == bank) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if(i == 0) {
|
if (i == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
|
||||||
data += banks[1];
|
|
||||||
return (((u8 *)messdata)+(*data));
|
|
||||||
}
|
}
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
bank_pc = banks[1];
|
||||||
|
byteswap_u16(&bank_pc);
|
||||||
|
ofs = data[bank_pc];
|
||||||
|
byteswap_s32(&ofs);
|
||||||
|
return (((u8 *)messdata) + ofs);
|
||||||
|
#else
|
||||||
|
data += banks[1];
|
||||||
|
return (((u8 *)messdata) + (*data));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *_MessData_MesPtrGet(void *messbank, u32 id)
|
static void *_MessData_MesPtrGet(void *messbank, u32 id)
|
||||||
|
|
@ -30,16 +60,28 @@ static void *_MessData_MesPtrGet(void *messbank, u32 id)
|
||||||
u16 index;
|
u16 index;
|
||||||
s32 max_index;
|
s32 max_index;
|
||||||
s32 *data;
|
s32 *data;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
s32 ofs;
|
||||||
|
#endif
|
||||||
|
|
||||||
index = id & 0xFFFF;
|
index = id & 0xFFFF;
|
||||||
data = messbank;
|
data = messbank;
|
||||||
max_index = *data;
|
max_index = *data;
|
||||||
|
#if TARGET_PC
|
||||||
|
byteswap_s32(&max_index);
|
||||||
|
#endif
|
||||||
data++;
|
data++;
|
||||||
if(max_index <= index) {
|
if(max_index <= index) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
data = data+index;
|
data = data+index;
|
||||||
|
#ifdef TARGET_PC
|
||||||
|
ofs = *data;
|
||||||
|
byteswap_s32(&ofs);
|
||||||
|
return (((u8 *)messbank)+(ofs));
|
||||||
|
#else
|
||||||
return (((u8 *)messbank)+(*data));
|
return (((u8 *)messbank)+(*data));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -402,8 +402,8 @@ static void MesDispFunc(HuSprite *sprite)
|
||||||
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
|
||||||
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
|
||||||
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
|
||||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_RGBA6, 0);
|
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
|
||||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_RGBA6, 0);
|
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
|
||||||
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGB, GX_RGBA8, 0);
|
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_CLR0, GX_CLR_RGB, GX_RGBA8, 0);
|
||||||
GXSetCullMode(GX_CULL_NONE);
|
GXSetCullMode(GX_CULL_NONE);
|
||||||
GXSetNumTexGens(1);
|
GXSetNumTexGens(1);
|
||||||
|
|
@ -453,16 +453,16 @@ static void MesDispFunc(HuSprite *sprite)
|
||||||
}
|
}
|
||||||
GXPosition3f32(char_x + 1.0f, char_y, 0.0f);
|
GXPosition3f32(char_x + 1.0f, char_y, 0.0f);
|
||||||
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
||||||
GXPosition2f32(uv_minx, uv_miny);
|
GXTexCoord2f32(uv_minx, uv_miny);
|
||||||
GXPosition3f32(char_x + char_w, char_y, 0.0f);
|
GXPosition3f32(char_x + char_w, char_y, 0.0f);
|
||||||
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
||||||
GXPosition2f32(uv_maxx, uv_miny);
|
GXTexCoord2f32(uv_maxx, uv_miny);
|
||||||
GXPosition3f32(char_x + char_w, char_y + 24.0f, 0.0f);
|
GXPosition3f32(char_x + char_w, char_y + 24.0f, 0.0f);
|
||||||
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
||||||
GXPosition2f32(uv_maxx, uv_maxy);
|
GXTexCoord2f32(uv_maxx, uv_maxy);
|
||||||
GXPosition3f32(char_x + 1.0f, char_y + 24.0f, 0.0f);
|
GXPosition3f32(char_x + 1.0f, char_y + 24.0f, 0.0f);
|
||||||
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
GXColor4u8(window->mess_pal[color][0], window->mess_pal[color][1], window->mess_pal[color][2], alpha);
|
||||||
GXPosition2f32(uv_minx, uv_maxy);
|
GXTexCoord2f32(uv_minx, uv_maxy);
|
||||||
}
|
}
|
||||||
GXEnd();
|
GXEnd();
|
||||||
mesCharCnt++;
|
mesCharCnt++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue