summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/includes/hng64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/includes/hng64.h')
-rw-r--r--src/mame/includes/hng64.h106
1 files changed, 86 insertions, 20 deletions
diff --git a/src/mame/includes/hng64.h b/src/mame/includes/hng64.h
index 797fe9b53a9..2460644db4e 100644
--- a/src/mame/includes/hng64.h
+++ b/src/mame/includes/hng64.h
@@ -10,7 +10,42 @@ enum
BURIKI_MCU
};
+enum hng64trans_t
+{
+ HNG64_TILEMAP_NORMAL = 1,
+ HNG64_TILEMAP_ADDITIVE,
+ HNG64_TILEMAP_ALPHA
+};
+
+
+struct blit_parameters
+{
+ bitmap_rgb32 * bitmap;
+ rectangle cliprect;
+ UINT32 tilemap_priority_code;
+ UINT8 mask;
+ UINT8 value;
+ UINT8 alpha;
+ hng64trans_t drawformat;
+};
+
+
+///////////////////////
+// polygon rendering //
+///////////////////////
+
+struct polygonRasterOptions
+{
+ UINT8 texType;
+ UINT8 texIndex;
+ UINT8 texPageSmall;
+ UINT8 texPageHorizOffset;
+ UINT8 texPageVertOffset;
+ int palOffset;
+ int palPageSize;
+ int debugColor;
+};
class hng64_state : public driver_device
{
@@ -40,8 +75,9 @@ public:
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_generic_paletteram_32(*this, "paletteram")
- { }
+ { }
+
required_device<mips3_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<cpu_device> m_comm;
@@ -70,6 +106,7 @@ public:
required_device<palette_device> m_palette;
required_shared_ptr<UINT32> m_generic_paletteram_32;
+
int m_mcu_type;
UINT16 *m_soundram;
@@ -97,20 +134,13 @@ public:
UINT8 m_screen_dis;
- tilemap_t *m_tilemap0_8x8;
- tilemap_t *m_tilemap1_8x8;
- tilemap_t *m_tilemap2_8x8;
- tilemap_t *m_tilemap3_8x8;
+ struct hng64_tilemap {
+ tilemap_t *m_tilemap_8x8;
+ tilemap_t *m_tilemap_16x16;
+ tilemap_t *m_tilemap_16x16_alt;
+ };
- tilemap_t *m_tilemap0_16x16;
- tilemap_t *m_tilemap1_16x16;
- tilemap_t *m_tilemap2_16x16;
- tilemap_t *m_tilemap3_16x16;
-
- tilemap_t *m_tilemap0_16x16_alt;
- tilemap_t *m_tilemap1_16x16_alt;
- tilemap_t *m_tilemap2_16x16_alt;
- tilemap_t *m_tilemap3_16x16_alt;
+ hng64_tilemap m_tilemap[4];
UINT8 m_additive_tilemap_debug;
@@ -121,10 +151,7 @@ public:
UINT32 m_old_animmask;
UINT32 m_old_animbits;
- UINT16 m_old_tileflags0;
- UINT16 m_old_tileflags1;
- UINT16 m_old_tileflags2;
- UINT16 m_old_tileflags3;
+ UINT16 m_old_tileflags[4];
UINT32 m_dls[2][0x81];
@@ -166,6 +193,7 @@ public:
DECLARE_READ32_MEMBER(unk_vreg_r);
DECLARE_WRITE32_MEMBER(hng64_soundram_w);
DECLARE_READ32_MEMBER(hng64_soundram_r);
+ DECLARE_WRITE32_MEMBER(hng64_vregs_w);
// not actually used, but left in code so you can turn it and see the (possibly undesired?) behavior, see notes in memory map
DECLARE_WRITE32_MEMBER(hng64_soundram2_w);
@@ -226,7 +254,45 @@ public:
DECLARE_CUSTOM_INPUT_MEMBER(brake_down_r);
void clear3d();
TIMER_CALLBACK_MEMBER(hng64_3dfifo_processed);
+
+ void FillSmoothTexPCHorizontalLine(
+ const polygonRasterOptions& prOptions,
+ int x_start, int x_end, int y, float z_start, float z_delta,
+ float w_start, float w_delta, float r_start, float r_delta,
+ float g_start, float g_delta, float b_start, float b_delta,
+ float s_start, float s_delta, float t_start, float t_delta);
+
+ void hng64_command3d(const UINT16* packet);
+ void draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ void transition_control( bitmap_rgb32 &bitmap, const rectangle &cliprect);
+ void hng64_tilemap_draw_roz_core(screen_device &screen, tilemap_t *tmap, const blit_parameters *blit,
+ UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound);
+ void hng64_drawtilemap(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int tm);
+ void setCameraTransformation(const UINT16* packet);
+ void setLighting(const UINT16* packet);
+ void set3dFlags(const UINT16* packet);
+ void setCameraProjectionMatrix(const UINT16* packet);
+ void recoverPolygonBlock(const UINT16* packet, struct polygon* polys, int* numPolys);
+ void hng64_mark_all_tiles_dirty(int tilemap);
+ void hng64_mark_tile_dirty(int tilemap, int tile_index);
+
+ void hng64_tilemap_draw_roz(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, tilemap_t *tmap,
+ UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
+ int wraparound, UINT32 flags, UINT8 priority, hng64trans_t drawformat);
+
+ void hng64_tilemap_draw_roz_primask(screen_device &screen, bitmap_rgb32 &dest, const rectangle &cliprect, tilemap_t *tmap,
+ UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy,
+ int wraparound, UINT32 flags, UINT8 priority, UINT8 priority_mask, hng64trans_t drawformat);
+
+ void RasterizeTriangle_SMOOTH_TEX_PC(
+ float A[4], float B[4], float C[4],
+ float Ca[3], float Cb[3], float Cc[3], // PER-VERTEX RGB COLORS
+ float Ta[2], float Tb[2], float Tc[2], // PER-VERTEX (S,T) TEX-COORDS
+ const polygonRasterOptions& prOptions);
+
+ void drawShaded( struct polygon *p);
+
+ void hng64_patch_bios_region(int region);
+
};
-/*----------- defined in video/hng64.c -----------*/
-void hng64_command3d(running_machine& machine, const UINT16* packet);