Skip to content

Commit

Permalink
nv2a: basic pattern object
Browse files Browse the repository at this point in the history
  • Loading branch information
espes committed Sep 25, 2018
1 parent 4d9107e commit b5fcebf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hw/xbox/nv2a.c
Expand Up @@ -2652,6 +2652,12 @@ static void pgraph_method(NV2AState *d,
/* ugly switch for now */
switch (graphics_class) {

case NV_CONTEXT_PATTERN: { switch (method) {
case NV044_SET_MONOCHROME_COLOR0:
pg->regs[NV_PGRAPH_PATT_COLOR0] = parameter;
break;
} break; }

case NV_CONTEXT_SURFACES_2D: { switch (method) {
case NV062_SET_OBJECT:
context_surfaces_2d->object_instance = parameter;
Expand Down Expand Up @@ -6143,6 +6149,9 @@ static void pgraph_method_log(unsigned int subchannel,
case NV_CONTEXT_SURFACES_2D:
nmethod = method | (0x6d << 16);
break;
case NV_CONTEXT_PATTERN:
nmethod = method | (0x68 << 16);
break;
default:
break;
}
Expand Down
5 changes: 5 additions & 0 deletions hw/xbox/nv2a_int.h
Expand Up @@ -260,6 +260,7 @@
#define NV_PGRAPH_CHANNEL_CTX_TRIGGER 0x00000788
# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_READ_IN (1 << 0)
# define NV_PGRAPH_CHANNEL_CTX_TRIGGER_WRITE_OUT (1 << 1)
#define NV_PGRAPH_PATT_COLOR0 0x00000B10
#define NV_PGRAPH_CSV0_D 0x00000FB4
# define NV_PGRAPH_CSV0_D_LIGHTS 0x0000FFFF
# define NV_PGRAPH_CSV0_D_LIGHT0 0x00000003
Expand Down Expand Up @@ -691,6 +692,10 @@
/* graphic classes and methods */
#define NV_SET_OBJECT 0x00000000

#define NV_MEMORY_TO_MEMORY_FORMAT 0x0039

#define NV_CONTEXT_PATTERN 0x0044
# define NV044_SET_MONOCHROME_COLOR0 0x00000310

#define NV_CONTEXT_SURFACES_2D 0x0062
# define NV062_SET_OBJECT 0x00000000
Expand Down

1 comment on commit b5fcebf

@PatrickvL
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, how did you discover this root cause?

Please sign in to comment.