mirror of
https://github.com/rt64/rt64.git
synced 2025-12-05 01:00:13 +00:00
Added gEXSetNearClipping command (#212)
* Added gEXSetNearClipping command * flush rsp state
This commit is contained in:
@@ -73,7 +73,8 @@
|
||||
#define G_EX_POPGEOMETRYMODE_V1 0x00002A
|
||||
#define G_EX_SETDITHERNOISESTRENGTH_V1 0x00002B
|
||||
#define G_EX_SETRDRAMEXTENDED_V1 0x00002C
|
||||
#define G_EX_MAX 0x00002D
|
||||
#define G_EX_SETNEARCLIPPING_V1 0x00002D
|
||||
#define G_EX_MAX 0x00002E
|
||||
|
||||
#define G_EX_ORIGIN_NONE 0x800
|
||||
#define G_EX_ORIGIN_LEFT 0x0
|
||||
@@ -515,4 +516,10 @@ typedef union {
|
||||
PARAM(isExtended, 1, 0) \
|
||||
)
|
||||
|
||||
#define gEXSetNearClipping(cmd, isEnabled) \
|
||||
G_EX_COMMAND1(cmd, \
|
||||
PARAM(RT64_EXTENDED_OPCODE, 8, 24) | PARAM(G_EX_SETNEARCLIPPING_V1, 24, 0), \
|
||||
PARAM(isEnabled, 1, 0) \
|
||||
)
|
||||
|
||||
#endif // RT64_EXTENDED_GBI
|
||||
|
||||
@@ -291,6 +291,11 @@ namespace RT64 {
|
||||
state->setExtendedRDRAM(extended);
|
||||
}
|
||||
|
||||
void setNearClippingV1(State *state, DisplayList **dl) {
|
||||
const uint8_t nearClipping = (*dl)->p1(0, 1);
|
||||
state->rsp->setNoN(!nearClipping);
|
||||
}
|
||||
|
||||
void noOpHook(State *state, DisplayList **dl) {
|
||||
uint32_t magicNumber = (*dl)->p0(0, 24);
|
||||
if (magicNumber == RT64_HOOK_MAGIC_NUMBER) {
|
||||
@@ -392,6 +397,7 @@ namespace RT64 {
|
||||
Map[G_EX_POPGEOMETRYMODE_V1] = &popGeometryModeV1;
|
||||
Map[G_EX_SETDITHERNOISESTRENGTH_V1] = &setDitherNoiseStrengthV1;
|
||||
Map[G_EX_SETRDRAMEXTENDED_V1] = &setRDRAMExtendedV1;
|
||||
Map[G_EX_SETNEARCLIPPING_V1] = &setNearClippingV1;
|
||||
MapInitialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1185,4 +1185,11 @@ namespace RT64 {
|
||||
pushMask = gbi->constants[F3DENUM::G_MTX_PUSH];
|
||||
shadingSmoothMask = gbi->constants[F3DENUM::G_SHADING_SMOOTH];
|
||||
}
|
||||
|
||||
void RSP::setNoN(bool NoN) {
|
||||
if (this->NoN != NoN) {
|
||||
state->flush();
|
||||
this->NoN = NoN;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -282,5 +282,6 @@ namespace RT64 {
|
||||
void extendRDRAM(bool isExtended);
|
||||
void clearExtended();
|
||||
void setGBI(GBI *gbi);
|
||||
void setNoN(bool NoN);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user