started implementing some GPU abstractions and moved test to C
[psx_test1] / src / gpu.h
diff --git a/src/gpu.h b/src/gpu.h
new file mode 100644 (file)
index 0000000..81d341f
--- /dev/null
+++ b/src/gpu.h
@@ -0,0 +1,30 @@
+#ifndef GPU_H_
+#define GPU_H_
+
+typedef short int16_t;
+typedef unsigned long uint32_t;
+
+/* flat vertex */
+struct gpu_vert {
+       int16_t x, y;
+};
+
+/* gouraud vertex */
+struct gpu_gvert {
+       uint32_t color;
+       int16_t x, y;
+};
+
+
+void gpu_reset(void);
+void gpu_setmode(int xsz, int ysz, int bpp, int rate);
+void gpu_display(int en);
+void gpu_cliprect(int x, int y, int w, int h);
+void gpu_origin(int x, int y);
+
+void gpu_fillrect(int x, int y, int w, int h, unsigned int col);
+
+void gpu_draw_flat(int cmd, uint32_t color, struct gpu_vert *data, int vcount);
+void gpu_draw_gouraud(int cmd, struct gpu_gvert *data, int vcount);
+
+#endif /* GPU_H_ */