summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-26 21:28:15 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-26 21:28:50 +0000
commit579edbc9b9e838474a01968b80197dfd2626133e (patch)
tree92f52498eade47b7a2be023e91de536523d39b37
parent3f3433c49b52504a1cef4f308e83d481062da09e (diff)
hwtest/pgraph: Nailed down celsius_nv17 new methods.
-rw-r--r--hwtest/pgraph_class_celsius.cc396
-rw-r--r--hwtest/pgraph_state.cc46
-rw-r--r--hwtest/pgraph_state_tests.cc4
-rw-r--r--include/nvhw/pgraph.h30
4 files changed, 426 insertions, 50 deletions
diff --git a/hwtest/pgraph_class_celsius.cc b/hwtest/pgraph_class_celsius.cc
index c5bacfba..a71cf9d8 100644
--- a/hwtest/pgraph_class_celsius.cc
+++ b/hwtest/pgraph_class_celsius.cc
@@ -93,7 +93,7 @@ class MthdDmaVtx : public SingleMthdTest {
}
if (prot_err)
nv04_pgraph_blowup(&exp, 4);
- insrt(exp.celsius_unkf4c, 0, 16, rval);
+ insrt(exp.celsius_dma, 0, 16, rval);
}
using SingleMthdTest::SingleMthdTest;
};
@@ -110,7 +110,364 @@ class MthdDmaState : public SingleMthdTest {
bad = true;
if (bad && extr(exp.debug[3], 23, 1))
nv04_pgraph_blowup(&exp, 2);
- insrt(exp.celsius_unkf4c, 16, 16, rval);
+ insrt(exp.celsius_dma, 16, 16, rval);
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdDmaClipid : public SingleMthdTest {
+ bool takes_dma() override { return true; }
+ void emulate_mthd() override {
+ uint32_t offset_mask = pgraph_offset_mask(&chipset) | 0xf;
+ uint32_t base = (pobj[2] & ~0xfff) | extr(pobj[0], 20, 12);
+ uint32_t limit = pobj[1];
+ uint32_t dcls = extr(pobj[0], 0, 12);
+ exp.celsius_surf_limit_clipid = (limit & offset_mask) | (dcls != 0x30) << 31;
+ exp.celsius_surf_base_clipid = base & offset_mask;
+ bool bad = true;
+ if (dcls == 0x30 || dcls == 0x3d)
+ bad = false;
+ if (dcls == 3 && (cls == 0x38 || cls == 0x88))
+ bad = false;
+ if (extr(exp.debug[3], 23, 1) && bad) {
+ nv04_pgraph_blowup(&exp, 0x2);
+ }
+ bool prot_err = false;
+ if (extr(base, 0, 6))
+ prot_err = true;
+ if (extr(pobj[0], 16, 2))
+ prot_err = true;
+ if (dcls == 0x30)
+ prot_err = false;
+ if (prot_err)
+ nv04_pgraph_blowup(&exp, 4);
+ insrt(exp.ctx_valid, 28, 1, dcls != 0x30 && !(bad && extr(exp.debug[3], 23, 1)));
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdDmaZcull : public SingleMthdTest {
+ bool takes_dma() override { return true; }
+ void emulate_mthd() override {
+ uint32_t offset_mask = 0x3fffffff;
+ uint32_t base = (pobj[2] & ~0xfff) | extr(pobj[0], 20, 12);
+ uint32_t limit = pobj[1];
+ uint32_t dcls = extr(pobj[0], 0, 12);
+ exp.celsius_surf_limit_zcull = (limit & offset_mask) | (dcls != 0x30) << 31;
+ exp.celsius_surf_base_zcull = base & offset_mask;
+ bool bad = true;
+ if (dcls == 0x30 || dcls == 0x3d)
+ bad = false;
+ if (dcls == 3 && (cls == 0x38 || cls == 0x88))
+ bad = false;
+ if (extr(exp.debug[3], 23, 1) && bad) {
+ nv04_pgraph_blowup(&exp, 0x2);
+ }
+ bool prot_err = false;
+ if (extr(base, 0, 6))
+ prot_err = true;
+ if (extr(pobj[0], 16, 2))
+ prot_err = true;
+ if (dcls == 0x30)
+ prot_err = false;
+ if (prot_err)
+ nv04_pgraph_blowup(&exp, 4);
+ insrt(exp.ctx_valid, 29, 1, dcls != 0x30 && !(bad && extr(exp.debug[3], 23, 1)));
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdSurfPitchClipid : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xff80;
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ if (!(rnd() & 3)) {
+ val = (rnd() & 1) << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0xff80) && !!val;
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1))
+ exp.celsius_surf_pitch_clipid = val & 0xffff;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdSurfOffsetClipid : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xffffffc0;
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ if (!(rnd() & 3)) {
+ val = (rnd() & 1) << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0xffffffc0);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1))
+ exp.celsius_surf_offset_clipid = val & 0x07ffffff;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdSurfPitchZcull : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xff80;
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ if (!(rnd() & 3)) {
+ val = (rnd() & 1) << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0xff80) && !!val;
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1))
+ exp.celsius_surf_pitch_zcull = val & 0xffff;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdSurfOffsetZcull : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xffffffc0;
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ if (!(rnd() & 3)) {
+ val = (rnd() & 1) << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0xffffffc0);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1))
+ exp.celsius_surf_offset_zcull = val & 0x3fffffff;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdInvalidateZcull : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return val < 4 || val == 6;
+ }
+ void emulate_mthd() override {
+ // XXX completely broken
+ skip = true;
+ if (!extr(exp.nsource, 1, 1)) {
+ if (val & 1) {
+ exp.zcull_unka00[0] = 0;
+ exp.zcull_unka00[1] = 0;
+ } else {
+ insrt(exp.zcull_unka00[0], 0, 13, 0x1000);
+ insrt(exp.zcull_unka00[1], 0, 13, 0x1000);
+ insrt(exp.zcull_unka00[0], 16, 13, extr(exp.celsius_clear_hv[0], 16, 16) + 1);
+ insrt(exp.zcull_unka00[1], 16, 13, extr(exp.celsius_clear_hv[1], 16, 16) + 1);
+ }
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdClearZeta : public SingleMthdTest {
+ bool is_valid_val() override {
+ return !extr(exp.celsius_unkf48, 8, 1);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ exp.celsius_clear_zeta = val;
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdClipidEnable : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return val < 2 && !extr(exp.celsius_unkf48, 8, 1);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ insrt(exp.celsius_config_d, 6, 1, val);
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdClipidId : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0xf) && !extr(exp.celsius_unkf48, 8, 1);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ exp.celsius_clipid_id = val & 0xf;
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdClearHv : public SingleMthdTest {
+ int which;
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xffff;
+ val *= 0x10001;
+ }
+ if (rnd() & 1) {
+ val &= 0x0fff0fff;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0x0fff0fff) && !extr(exp.celsius_unkf48, 8, 1) &&
+ extr(val, 0, 16) <= extr(val, 16, 16);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ exp.celsius_clear_hv[which] = val & 0x0fff0fff;
+ }
+ }
+public:
+ MthdClearHv(hwtest::TestOptions &opt, uint32_t seed, const std::string &name, int trapbit, uint32_t cls, uint32_t mthd, int which)
+ : SingleMthdTest(opt, seed, name, trapbit, cls, mthd), which(which) {}
+};
+
+class MthdCelsiusUnkd84 : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0x8000000f;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return !(val & ~0x80000003) && !extr(exp.celsius_unkf48, 8, 1);
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ insrt(exp.celsius_config_d, 1, 2, val);
+ insrt(exp.celsius_config_d, 31, 1, extr(val, 31, 1));
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusTexUnk258 : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return val < 2;
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ insrt(exp.celsius_tex_format[idx], 3, 1, val);
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusSurfUnk2b8 : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ if (extr(val, 4, 28))
+ return false;
+ if (extr(val, 0, 2) > 2)
+ return false;
+ if (extr(val, 2, 2) > 2)
+ return false;
+ return true;
+ }
+ void emulate_mthd() override {
+ insrt(exp.surf_type, 2, 2, extr(val, 0, 2));
+ insrt(exp.surf_type, 6, 2, extr(val, 2, 2));
+ insrt(exp.unka10, 29, 1, extr(exp.debug[4], 2, 1) && !!extr(exp.surf_type, 2, 2));
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusSurfUnk2bc : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return val < 2;
+ }
+ void emulate_mthd() override {
+ insrt(exp.surf_type, 31, 1, val);
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusUnk3f8 : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ if (rnd() & 1) {
+ val &= 0xf;
+ if (rnd() & 1)
+ val ^= 1 << (rnd() & 0x1f);
+ }
+ }
+ bool is_valid_val() override {
+ return val < 2;
+ }
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ insrt(exp.celsius_config_a, 31, 1, val);
+ }
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCelsiusUnk3fc : public SingleMthdTest {
+ void emulate_mthd() override {
+ if (!extr(exp.nsource, 1, 1)) {
+ exp.celsius_mthd_unk3fc = val;
+ }
}
using SingleMthdTest::SingleMthdTest;
};
@@ -142,7 +499,7 @@ std::vector<SingleMthdTest *> Celsius::mthds() {
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x260, 8), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x280, 0xe), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x2c0, 0x10), // XXX
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x300, 0x3f), // XXX
+ new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x300, 0x3e), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x400, 0x70), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x600, 0x20), // XXX
new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x680, 7), // XXX
@@ -204,17 +561,36 @@ std::vector<SingleMthdTest *> Celsius::mthds() {
new MthdFlipSet(opt, rnd(), "flip_modulo", -1, cls, 0x128, 1, 2),
new MthdFlipBumpWrite(opt, rnd(), "flip_bump_write", -1, cls, 0x12c, 1),
new UntestedMthd(opt, rnd(), "flip", -1, cls, 0x130),
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0xd40, 2), // XXX
+ new UntestedMthd(opt, rnd(), "color_logic_op_enable", -1, cls, 0xd40), // XXX
+ new UntestedMthd(opt, rnd(), "color_logic_op_op", -1, cls, 0xd44), // XXX
});
}
if (cls == 0x99) {
res.insert(res.end(), {
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x1ac),
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x1b0),
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0xd54, 13), // XXX
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x258, 2),
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x2b8, 2),
- new UntestedMthd(opt, rnd(), "meh", -1, cls, 0x3fc),
+ new MthdDmaClipid(opt, rnd(), "dma_clipid", -1, cls, 0x1ac),
+ new MthdDmaZcull(opt, rnd(), "dma_zcull", -1, cls, 0x1b0),
+ new MthdSurfPitchClipid(opt, rnd(), "surf_pitch_clipid", -1, cls, 0xd54),
+ new MthdSurfOffsetClipid(opt, rnd(), "surf_offset_clipid", -1, cls, 0xd58),
+ new MthdSurfPitchZcull(opt, rnd(), "surf_pitch_zcull", -1, cls, 0xd5c),
+ new MthdSurfOffsetZcull(opt, rnd(), "surf_offset_zcull", -1, cls, 0xd60),
+ new MthdInvalidateZcull(opt, rnd(), "invalidate_zcull", -1, cls, 0xd64),
+ new MthdClearZeta(opt, rnd(), "clear_zeta", -1, cls, 0xd68),
+ new UntestedMthd(opt, rnd(), "clear_zeta_trigger", -1, cls, 0xd6c), // XXX
+ new UntestedMthd(opt, rnd(), "clear_clipid_trigger", -1, cls, 0xd70), // XXX
+ new MthdClipidEnable(opt, rnd(), "clipid_enable", -1, cls, 0xd74),
+ new MthdClipidId(opt, rnd(), "clipid_id", -1, cls, 0xd78),
+ new MthdClearHv(opt, rnd(), "clear_h", -1, cls, 0xd7c, 0),
+ new MthdClearHv(opt, rnd(), "clear_v", -1, cls, 0xd80, 1),
+ new MthdCelsiusUnkd84(opt, rnd(), "unkd84", -1, cls, 0xd84),
+ new MthdCelsiusTexUnk258(opt, rnd(), "tex_unk258", -1, cls, 0x258, 2),
+ new MthdCelsiusSurfUnk2b8(opt, rnd(), "surf_unk2b8", -1, cls, 0x2b8),
+ new MthdCelsiusSurfUnk2bc(opt, rnd(), "surf_unk2bc", -1, cls, 0x2bc),
+ new MthdCelsiusUnk3f8(opt, rnd(), "unk3f8", -1, cls, 0x3f8),
+ new MthdCelsiusUnk3fc(opt, rnd(), "unk3fc", -1, cls, 0x3fc),
+ });
+ } else {
+ res.insert(res.end(), {
+ new UntestedMthd(opt, rnd(), "old_unk3f8", -1, cls, 0x3f8),
});
}
return res;
diff --git a/hwtest/pgraph_state.cc b/hwtest/pgraph_state.cc
index 8576387a..f57b11e1 100644
--- a/hwtest/pgraph_state.cc
+++ b/hwtest/pgraph_state.cc
@@ -393,20 +393,20 @@ std::vector<std::unique_ptr<Register>> pgraph_celsius_regs(const chipset_info &c
IREG(0x400ea4, 0xffffffff, "CELSIUS_TEX_COLOR_KEY", celsius_tex_color_key, 1, 2);
REG(0x400ea8, 0x000001ff, "CELSIUS_UNKEA8", celsius_unkea8);
if (is_nv17p) {
- IREG(0x400eac, 0x0fff0fff, "CELSIUS_UNKEAC", celsius_unkeac, 0, 2);
- IREG(0x400eb0, 0x0fff0fff, "CELSIUS_UNKEAC", celsius_unkeac, 1, 2);
- REG(0x400eb4, 0x3fffffff, "CELSIUS_UNKEB4", celsius_unkeb4);
- REG(0x400eb8, 0xbfffffff, "CELSIUS_UNKEB8", celsius_unkeb8);
- REG(0x400ebc, 0x3fffffff, "CELSIUS_UNKEBC", celsius_unkebc);
- REG(0x400ec0, 0x0000ffff, "CELSIUS_UNKEC0", celsius_unkec0);
- REG(0x400ec4, 0x07ffffff, "CELSIUS_UNKEC4", celsius_unkec4);
- REG(0x400ec8, 0x87ffffff, "CELSIUS_UNKEC8", celsius_unkec8);
- REG(0x400ecc, 0x07ffffff, "CELSIUS_UNKECC", celsius_unkecc);
- REG(0x400ed0, 0x0000ffff, "CELSIUS_UNKED0", celsius_unked0);
- REG(0x400ed4, 0x0000000f, "CELSIUS_UNKED4", celsius_unked4);
- REG(0x400ed8, 0x80000046, "CELSIUS_UNKED8", celsius_unked8);
- IREG(0x400edc, 0xffffffff, "CELSIUS_UNKEDC", celsius_unkedc, 0, 2);
- IREG(0x400ee0, 0xffffffff, "CELSIUS_UNKEDC", celsius_unkedc, 1, 2);
+ IREG(0x400eac, 0x0fff0fff, "CELSIUS_CLEAR_HV[0]", celsius_clear_hv, 0, 2);
+ IREG(0x400eb0, 0x0fff0fff, "CELSIUS_CLEAR_HV[1]", celsius_clear_hv, 1, 2);
+ REG(0x400eb4, 0x3fffffff, "CELSIUS_SURF_BASE_ZCULL", celsius_surf_base_zcull);
+ REG(0x400eb8, 0xbfffffff, "CELSIUS_SURF_LIMIT_ZCULL", celsius_surf_limit_zcull);
+ REG(0x400ebc, 0x3fffffff, "CELSIUS_SURF_OFFSET_ZCULL", celsius_surf_offset_zcull);
+ REG(0x400ec0, 0x0000ffff, "CELSIUS_SURF_PITCH_ZCULL", celsius_surf_pitch_zcull);
+ REG(0x400ec4, 0x07ffffff, "CELSIUS_SURF_BASE_CLIPID", celsius_surf_base_clipid);
+ REG(0x400ec8, 0x87ffffff, "CELSIUS_SURF_LIMIT_CLIPID", celsius_surf_limit_clipid);
+ REG(0x400ecc, 0x07ffffff, "CELSIUS_SURF_OFFSET_CLIPID", celsius_surf_offset_clipid);
+ REG(0x400ed0, 0x0000ffff, "CELSIUS_SURF_PITCH_CLIPID", celsius_surf_pitch_clipid);
+ REG(0x400ed4, 0x0000000f, "CELSIUS_CLIPID_ID", celsius_clipid_id);
+ REG(0x400ed8, 0x80000046, "CELSIUS_CONFIG_D", celsius_config_d);
+ REG(0x400edc, 0xffffffff, "CELSIUS_CLEAR_ZETA", celsius_clear_zeta);
+ REG(0x400ee0, 0xffffffff, "CELSIUS_MTHD_UNK3FC", celsius_mthd_unk3fc);
}
for (int i = 0; i < 16; i++) {
IREG(0x400f00 + i * 4, 0x0fff0fff, "CELSIUS_UNKF00", celsius_unkf00, i, 16);
@@ -414,7 +414,7 @@ std::vector<std::unique_ptr<Register>> pgraph_celsius_regs(const chipset_info &c
REG(0x400f40, 0x3bffffff, "CELSIUS_UNKF40", celsius_unkf40);
REG(0x400f44, 0xffffffff, "CELSIUS_UNKF44", celsius_unkf44);
REG(0x400f48, 0x17ff0117, "CELSIUS_UNKF48", celsius_unkf48);
- REG(0x400f4c, 0xffffffff, "CELSIUS_UNKF4C", celsius_unkf4c);
+ REG(0x400f4c, 0xffffffff, "CELSIUS_DMA", celsius_dma);
return res;
}
@@ -568,8 +568,8 @@ void pgraph_gen_state_control(int cnum, std::mt19937 &rnd, struct pgraph_state *
state->unk6b0 = rnd();
state->unk838 = rnd();
state->unk83c = rnd();
- state->unka00 = rnd() & 0x1fff1fff;
- state->unka04 = rnd() & 0x1fff1fff;
+ state->zcull_unka00[0] = rnd() & 0x1fff1fff;
+ state->zcull_unka00[1] = rnd() & 0x1fff1fff;
state->unka10 = rnd() & 0xdfff3fff;
}
state->ctx_switch[0] = rnd() & ctxs_mask;
@@ -861,8 +861,8 @@ void pgraph_load_control(int cnum, struct pgraph_state *state) {
nva_wr32(cnum, 0x4006b0, state->unk6b0);
nva_wr32(cnum, 0x400838, state->unk838);
nva_wr32(cnum, 0x40083c, state->unk83c);
- nva_wr32(cnum, 0x400a00, state->unka00);
- nva_wr32(cnum, 0x400a04, state->unka04);
+ nva_wr32(cnum, 0x400a00, state->zcull_unka00[0]);
+ nva_wr32(cnum, 0x400a04, state->zcull_unka00[1]);
nva_wr32(cnum, 0x400a10, state->unka10);
}
}
@@ -1154,8 +1154,8 @@ void pgraph_dump_control(int cnum, struct pgraph_state *state) {
state->unk6b0 = nva_rd32(cnum, 0x4006b0);
state->unk838 = nva_rd32(cnum, 0x400838);
state->unk83c = nva_rd32(cnum, 0x40083c);
- state->unka00 = nva_rd32(cnum, 0x400a00);
- state->unka04 = nva_rd32(cnum, 0x400a04);
+ state->zcull_unka00[0] = nva_rd32(cnum, 0x400a00);
+ state->zcull_unka00[1] = nva_rd32(cnum, 0x400a04);
state->unka10 = nva_rd32(cnum, 0x400a10);
}
}
@@ -1435,8 +1435,8 @@ restart:
CMP(unk6b0, "UNK6B0")
CMP(unk838, "UNK838")
CMP(unk83c, "UNK83C")
- CMP(unka00, "UNKA00")
- CMP(unka04, "UNKA04")
+ CMP(zcull_unka00[0], "ZCULL_UNKA00[0]")
+ CMP(zcull_unka00[1], "ZCULL_UNKA00[1]")
CMP(unka10, "UNKA10")
}
CMP(fifo_enable, "FIFO_ENABLE")
diff --git a/hwtest/pgraph_state_tests.cc b/hwtest/pgraph_state_tests.cc
index f47d9731..867db8c2 100644
--- a/hwtest/pgraph_state_tests.cc
+++ b/hwtest/pgraph_state_tests.cc
@@ -549,13 +549,13 @@ protected:
if (!is_nv17p)
return;
reg = 0x400a00;
- exp.unka00 = val & 0x1fff1fff;
+ exp.zcull_unka00[0] = val & 0x1fff1fff;
break;
case 27:
if (!is_nv17p)
return;
reg = 0x400a04;
- exp.unka04 = val & 0x1fff1fff;
+ exp.zcull_unka00[1] = val & 0x1fff1fff;
break;
case 28:
if (!is_nv17p)
diff --git a/include/nvhw/pgraph.h b/include/nvhw/pgraph.h
index 978c2ac7..8674d826 100644
--- a/include/nvhw/pgraph.h
+++ b/include/nvhw/pgraph.h
@@ -68,8 +68,7 @@ struct pgraph_state {
uint32_t unk6b0;
uint32_t unk838;
uint32_t unk83c;
- uint32_t unka00;
- uint32_t unka04;
+ uint32_t zcull_unka00[2];
uint32_t unka10;
uint32_t access;
uint32_t fifo_enable;
@@ -201,23 +200,24 @@ struct pgraph_state {
uint32_t celsius_unke9c;
uint32_t celsius_tex_color_key[2];
uint32_t celsius_unkea8;
- uint32_t celsius_unkeac[2];
- uint32_t celsius_unkeb4;
- uint32_t celsius_unkeb8;
- uint32_t celsius_unkebc;
- uint32_t celsius_unkec0;
- uint32_t celsius_unkec4;
- uint32_t celsius_unkec8;
- uint32_t celsius_unkecc;
- uint32_t celsius_unked0;
- uint32_t celsius_unked4;
- uint32_t celsius_unked8;
- uint32_t celsius_unkedc[2];
+ uint32_t celsius_clear_hv[2];
+ uint32_t celsius_surf_base_zcull;
+ uint32_t celsius_surf_limit_zcull;
+ uint32_t celsius_surf_offset_zcull;
+ uint32_t celsius_surf_pitch_zcull;
+ uint32_t celsius_surf_base_clipid;
+ uint32_t celsius_surf_limit_clipid;
+ uint32_t celsius_surf_offset_clipid;
+ uint32_t celsius_surf_pitch_clipid;
+ uint32_t celsius_clipid_id;
+ uint32_t celsius_config_d;
+ uint32_t celsius_clear_zeta;
+ uint32_t celsius_mthd_unk3fc;
uint32_t celsius_unkf00[16];
uint32_t celsius_unkf40;
uint32_t celsius_unkf44;
uint32_t celsius_unkf48;
- uint32_t celsius_unkf4c;
+ uint32_t celsius_dma;
};
enum {