summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-26 16:33:42 +0000
committerMarcin Koƛcielnicki <koriakin@0x04.net>2016-12-26 16:33:42 +0000
commita6f8d741d7deb4f05fc83f189819364f420bda7a (patch)
treefcdc0eefeedc4bbd53dee3755d5d97d5ae25fb09
parent23063d3aace4e6e26b519cfb510bbbf7ccaf1f90 (diff)
hwtest/pgraph: Add stub tests for GDI char methods.
-rw-r--r--hwtest/pgraph_class_solid.cc48
1 files changed, 46 insertions, 2 deletions
diff --git a/hwtest/pgraph_class_solid.cc b/hwtest/pgraph_class_solid.cc
index 4fedbe09..f1238fe4 100644
--- a/hwtest/pgraph_class_solid.cc
+++ b/hwtest/pgraph_class_solid.cc
@@ -147,6 +147,50 @@ class MthdFont : public SingleMthdTest {
using SingleMthdTest::SingleMthdTest;
};
+class MthdCharXyc : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ insrt(orig.notify, 0, 1, 0);
+ // XXX: unlock it
+ insrt(orig.xy_misc_4[0], 4, 4, 0xf);
+ orig.valid[0] = 0;
+ }
+ void emulate_mthd() override {
+ pgraph_clear_vtxid(&exp);
+ pgraph_bump_vtxid(&exp);
+ insrt(exp.xy_misc_1[0], 0, 1, 0);
+ insrt(exp.xy_misc_1[1], 0, 1, 1);
+ insrt(exp.xy_misc_3, 8, 1, 0);
+ insrt(exp.valid[0], 4, 1, 1);
+ insrt(exp.valid[0], 0xc, 1, 1);
+ insrt(exp.valid[0], 19, 1, 0);
+ exp.vtx_xy[4][0] = extrs(val, 8, 12);
+ exp.vtx_xy[4][1] = extrs(val, 20, 12);
+ int xcstat = nv04_pgraph_clip_status(&exp, exp.vtx_xy[4][0], 0);
+ int ycstat = nv04_pgraph_clip_status(&exp, exp.vtx_xy[4][1], 1);
+ pgraph_set_xy_d(&exp, 0, 0, 0, false, false, false, xcstat);
+ pgraph_set_xy_d(&exp, 1, 0, 0, false, false, false, ycstat);
+ insrt(exp.dma_misc, 0, 16, extr(val, 0, 8));
+ // XXX: do it right
+ skip = true;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
+class MthdCharCode : public SingleMthdTest {
+ void adjust_orig_mthd() override {
+ insrt(orig.notify, 0, 1, 0);
+ // XXX: unlock it
+ insrt(orig.xy_misc_4[0], 4, 4, 0xf);
+ orig.valid[0] = 0;
+ }
+ void emulate_mthd() override {
+ insrt(exp.dma_misc, 0, 16, extr(val, 0, 16));
+ // XXX: do it right
+ skip = true;
+ }
+ using SingleMthdTest::SingleMthdTest;
+};
+
std::vector<SingleMthdTest *> Point::mthds() {
return {
new MthdNotify(opt, rnd(), "notify", -1, cls, 0x104),
@@ -367,13 +411,13 @@ std::vector<SingleMthdTest *> GdiNv4::mthds() {
new MthdClipXy(opt, rnd(), "f.clip_xy_0", 16, cls, 0xff4, 1, 0),
new MthdClipXy(opt, rnd(), "f.clip_xy_1", 17, cls, 0xff8, 1, 1),
new MthdBitmapColor1(opt, rnd(), "f.color", 12, cls, 0xffc),
- new UntestedMthd(opt, rnd(), "f.xyc", -1, cls, 0x1000, 0x100), // XXX
+ new MthdCharXyc(opt, rnd(), "f.xyc", 27, cls, 0x1000, 0x100),
new MthdFont(opt, rnd(), "g.font", 26, cls, 0x17f0),
new MthdClipXy(opt, rnd(), "g.clip_xy_0", 16, cls, 0x17f4, 1, 0),
new MthdClipXy(opt, rnd(), "g.clip_xy_1", 17, cls, 0x17f8, 1, 1),
new MthdBitmapColor1(opt, rnd(), "g.color", 12, cls, 0x17fc),
new MthdVtxXy(opt, rnd(), "g.xy", 20, cls, 0x1800, 0x100, 8, VTX_FIRST | VTX_IFC),
- new UntestedMthd(opt, rnd(), "g.char", -1, cls, 0x1804, 0x100, 8), // XXX
+ new MthdCharCode(opt, rnd(), "g.char", 28, cls, 0x1804, 0x100, 8),
};
}