367 SetOrder(GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0, GX_TEV_SWAP0,
370 SetColorIn(GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_RASC);
371 SetAlphaIn(GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_RASA);
373 SetColorOp(GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1,
true, GX_TEVPREV,
375 SetAlphaOp(GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1,
true, GX_TEVPREV,
378 SetIndirect(GX_INDTEXSTAGE0, GX_ITF_8, GX_ITB_NONE, GX_ITM_OFF,
379 GX_ITW_OFF, GX_ITW_OFF,
false,
false, GX_ITBA_OFF);
382 void SetOrder(GXTexCoordID gen, GXTexMapID map, GXChannelID chan,
383 GXTevSwapSel ras, GXTevSwapSel tex) {
388 swapSel = (ras & 0b111) << 1 | (tex & 0b111) << 3 | (map >> 8);
391 void SetColorIn(GXTevColorArg a, GXTevColorArg b, GXTevColorArg c,
394 colIn.SetIn(a, b, c, d);
396 void SetColorOp(GXTevOp op, GXTevBias bias, GXTevScale scale,
bool clamp,
397 GXTevRegID outReg, GXTevKColorSel ksel) {
399 colIn.SetOp(op, bias, scale, clamp, outReg, ksel);
402 void SetAlphaIn(GXTevAlphaArg a, GXTevAlphaArg b, GXTevAlphaArg c,
405 alpIn.SetIn(a, b, c, d);
407 void SetAlphaOp(GXTevOp op, GXTevBias bias, GXTevScale scale,
bool clamp,
408 GXTevRegID outReg, GXTevKAlphaSel ksel) {
410 alpIn.SetOp(op, bias, scale, clamp, outReg, ksel);
413 void SetIndirect(GXIndTexStageID stage, GXIndTexFormat format,
414 GXIndTexBiasSel bias, GXIndTexMtxID mtx,
415 GXIndTexWrap wrapS, GXIndTexWrap wrapT,
bool addPrev,
416 bool utcLod, GXIndTexAlphaSel alphaSel) {
419 indBiMt = bias & 0b111 | (mtx & 0b1111) << 4;
420 indWrap = wrapS & 0b111 | (wrapT & 0b111) << 3;
422 indFoAdUtAl = format & 0b111 | (addPrev ? 1 : 0) << 2 | utcLod << 3 |
423 (alphaSel & 0b11) << 4;
426 GXTexCoordID GetTexCoordGen()
const {
427 return static_cast<GXTexCoordID
>(texCoordGen);
430 GXChannelID GetColorChan()
const {
431 return static_cast<GXChannelID
>(colChan);
434 GXTexMapID GetTexMap()
const {
435 return static_cast<GXTexMapID
>(texMap | (swapSel & 0b1) << 8);
438 GXTevSwapSel GetRasSwapSel()
const {
439 return static_cast<GXTevSwapSel
>(swapSel >> 1 & 0b11);
441 GXTevSwapSel GetTexSwapSel()
const {
442 return static_cast<GXTevSwapSel
>(swapSel >> 3 & 0b11);
445 GXTevColorArg GetColorInA()
const {
446 return static_cast<GXTevColorArg
>(colIn.GetA());
448 GXTevColorArg GetColorInB()
const {
449 return static_cast<GXTevColorArg
>(colIn.GetB());
451 GXTevColorArg GetColorInC()
const {
452 return static_cast<GXTevColorArg
>(colIn.GetC());
454 GXTevColorArg GetColorInD()
const {
455 return static_cast<GXTevColorArg
>(colIn.GetD());
458 GXTevOp GetColorOp()
const {
459 return static_cast<GXTevOp
>(colIn.GetOp());
461 GXTevBias GetColorBias()
const {
462 return static_cast<GXTevBias
>(colIn.GetBias());
464 GXTevScale GetColorScale()
const {
465 return static_cast<GXTevScale
>(colIn.GetScale());
468 bool IsColorClamp()
const {
469 return colIn.IsClamp();
471 GXTevRegID GetColorOutReg()
const {
472 return static_cast<GXTevRegID
>(colIn.GetOutReg());
474 GXTevKColorSel GetKColorSel()
const {
475 return static_cast<GXTevKColorSel
>(colIn.GetKSel());
478 GXTevAlphaArg GetAlphaInA()
const {
479 return static_cast<GXTevAlphaArg
>(alpIn.GetA());
481 GXTevAlphaArg GetAlphaInB()
const {
482 return static_cast<GXTevAlphaArg
>(alpIn.GetB());
484 GXTevAlphaArg GetAlphaInC()
const {
485 return static_cast<GXTevAlphaArg
>(alpIn.GetC());
487 GXTevAlphaArg GetAlphaInD()
const {
488 return static_cast<GXTevAlphaArg
>(alpIn.GetD());
491 GXTevOp GetAlphaOp()
const {
492 return static_cast<GXTevOp
>(alpIn.GetOp());
494 GXTevBias GetAlphaBias()
const {
495 return static_cast<GXTevBias
>(alpIn.GetBias());
497 GXTevScale GetAlphaScale()
const {
498 return static_cast<GXTevScale
>(alpIn.GetScale());
501 bool IsAlphaClamp()
const {
502 return alpIn.IsClamp();
504 GXTevRegID GetAlphaOutReg()
const {
505 return static_cast<GXTevRegID
>(alpIn.GetOutReg());
507 GXTevKAlphaSel GetKAlphaSel()
const {
508 return static_cast<GXTevKAlphaSel
>(alpIn.GetKSel());
511 GXIndTexStageID GetIndStage()
const {
512 return static_cast<GXIndTexStageID
>(indStage);
515 GXIndTexBiasSel GetIndBiasSel()
const {
516 return static_cast<GXIndTexBiasSel
>(indBiMt & 0b111);
518 GXIndTexMtxID GetIndMtxSel()
const {
519 return static_cast<GXIndTexMtxID
>(indBiMt >> 3 & 0b1111);
522 GXIndTexWrap GetIndWrapS()
const {
523 return static_cast<GXIndTexWrap
>(indWrap & 0b111);
525 GXIndTexWrap GetIndWrapT()
const {
526 return static_cast<GXIndTexWrap
>(indWrap >> 3 & 0b111);
529 GXIndTexFormat GetIndFormat()
const {
530 return static_cast<GXIndTexFormat
>(indFoAdUtAl & 0b11);
532 bool IsIndAddPrev()
const {
533 return indFoAdUtAl >> 2 & 0b1;
535 bool IsIndUtcLod()
const {
536 return indFoAdUtAl >> 3 & 0b1;
538 GXIndTexAlphaSel GetIndAlphaSel()
const {
539 return static_cast<GXIndTexAlphaSel
>(indFoAdUtAl >> 4 & 0b11);