/* 
 * 変換日付 Wed Aug 30 13:42:45 2000
 * 2000/6/28 var2.04
 * パレット有効
 * XXコードの頂点破棄
 * 使用テキスチャ─チェック
 * 頂点カラーを評価しない
 * ビュア─の設定対応
 */
#include <mbi.h>
#include <u64macro.h>

extern unsigned char hi_light_txt[];
extern Mtx	softsprite_mtx;

extern u64	act_m_monki_start = 0;

/* ビュア─設定のパレット */
/* ビュア─設定のテキスチャ─ */
/* vretex = 12 */
static Vtx act_m_monki_v[] = {
/* 0番目 */ {-625,    0,  375,    0, 1024,    0,  -44,  111,    0,  206},
/* 1番目 */ {   0,  250,  375,    0,  512,    0,    0,  120,    0,  255},
/* 2番目 */ {   0,  250, -375,    0,  512,  512,    0,  120,    0,  255},
/* 3番目 */ {-625,    0, -375,    0, 1024,  512,  -44,  111,    0,  206},
/* 4番目 */ { 625,    0,  375,    0,    0,    0,   44,  111,    0,  255},
/* 5番目 */ { 625,    0, -375,    0,    0,  512,   44,  111,    0,  255},
/* 6番目 */ {   0,  250,  375,    0,  512,    0,    0,  120,    0,  255},
/* 7番目 */ { 438,  813,  375,    0,    0,    0,  -44,  111,    0,  206},
/* 8番目 */ { 438,  813, -375,    0,    0,  512,  -44,  111,    0,  206},
/* 9番目 */ {   0,  250, -375,    0,  512,  512,    0,  120,    0,  255},
/* 10番目 */ {-438,  813,  375,    0, 1024,    0,   44,  111,    0,  255},
/* 11番目 */ {-438,  813, -375,    0, 1024,  512,   44,  111,    0,  255},

};

static unsigned short act_m_monki_pal[] = {
0x6ac4,0xd5cb,0xee8d,0xff4f,0x49c3,0x7b47,0xac8b,0xfd29,
0xdef7,0xfd29,0x418d,0x7bd9,0xfd29,0xa4ef,0x946b,0x7ba5,
};
static unsigned char act_m_monki[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x44,0x44,0x00,0x00,0x0a,0x00,
0x00,0x44,0x45,0x14,0x44,0x00,0x00,0xb0,0x04,0x45,0x14,0x56,0x11,0x66,0x00,0xb0,
0x04,0x54,0x45,0x13,0x33,0x32,0x30,0x0a,0x04,0x14,0x51,0x33,0x54,0x33,0x13,0x0f,
0x04,0x45,0x13,0x33,0x45,0x33,0x36,0x2d,0x00,0x45,0x33,0x33,0x33,0x33,0x32,0x6d,
0x00,0x45,0x33,0x33,0x33,0x33,0x33,0x6e,0x00,0x05,0x33,0x33,0x33,0x33,0x33,0x1e,
0x00,0x00,0x13,0x33,0x33,0x33,0x12,0x2e,0x00,0x00,0x01,0x33,0x33,0x12,0x23,0x1f,
0x00,0x00,0x05,0x61,0x11,0x23,0x31,0x0f,0x00,0x00,0x00,0x56,0x12,0x32,0x10,0x00,
0x00,0x00,0x00,0x00,0x56,0x11,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
}; /* act_m_monki */

extern Gfx act_m_monki1T_model[] = {
	gsSPTexture( 0xffff, 0xffff, 0, 0, G_ON),
	gsDPPipeSync(),
	gsDPSetCombineLERP(
		TEXEL0, 0, PRIMITIVE, 0,
		TEXEL0, 0, ENVIRONMENT, 0,
		COMBINED, 0, SHADE, 0,
		0, 0, 0, COMBINED
	),
	gsDPSetPrimColor(0, 255, 255, 255, 255, 255),
//	gsDPSetEnvColor(255, 255, 255, 255),
	gsDPSetRenderMode(G_RM_FOG_SHADE_A,G_RM_ZB_XLU_SURF2),
/* repeat = (1,1)  mirror = (1,1) clamp = (0,1) */
	gsDPPipeSync(),
	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal16(15,act_m_monki_pal),
	gsDPLoadTextureBlock_4b(
			act_m_monki,
			G_IM_FMT_CI,
			16, 16, 15,
			G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_CLAMP,
			4, 4, 0, 0),
/* act_m_monki1T_1 */
	gsSPLoadGeometryMode(G_LIGHTING | G_FOG | G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER),
	gsSPVertex(&act_m_monki_v[0],6,0),
	gsSP2Triangles( 0, 1, 2, 0, 0, 2, 3, 0 ),
	gsSP2Triangles( 1, 4, 5, 0, 1, 5, 2, 0 ),
	gsSPEndDisplayList(),
};

extern Gfx act_m_monki2T_model[] = {
	gsSPTexture( 0xffff, 0xffff, 0, 0, G_ON),
	gsDPPipeSync(),
	gsDPSetCombineLERP(
		TEXEL0, 0, PRIMITIVE, 0,
		TEXEL0, 0, ENVIRONMENT, 0,
		COMBINED, 0, SHADE, 0,
		0, 0, 0, COMBINED
	),
	gsDPSetPrimColor(0, 255, 255, 255, 255, 255),
//	gsDPSetEnvColor(255, 255, 255, 255),
	gsDPSetRenderMode(G_RM_FOG_SHADE_A,G_RM_ZB_XLU_SURF2),
/* repeat = (1,1)  mirror = (1,1) clamp = (0,1) */
	gsDPPipeSync(),
	gsDPSetTextureLUT(G_TT_RGBA16),
	gsDPLoadTLUT_pal16(15,act_m_monki_pal),
	gsDPLoadTextureBlock_4b(
			act_m_monki,
			G_IM_FMT_CI,
			16, 16, 15,
			G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_CLAMP,
			4, 4, 0, 0),
/* act_m_monki2T_1 */
	gsSPLoadGeometryMode(G_LIGHTING | G_FOG | G_SHADE | G_SHADING_SMOOTH | G_ZBUFFER),
	gsSPVertex(&act_m_monki_v[6],6,0),
	gsSP2Triangles( 0, 1, 2, 0, 0, 2, 3, 0 ),
	gsSP2Triangles( 4, 0, 3, 0, 4, 3, 5, 0 ),
	gsSPEndDisplayList(),
};


extern u64	act_m_monki_end = 0;
