summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/snes_ppu.h
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-22 13:13:17 +0200
commitddb290d5f615019c33c42b8d94e5a5254cabcf33 (patch)
treea70f688b0df3acd19da7b1151e5902e3c6af3fa5 /src/devices/video/snes_ppu.h
parent333bff8de64dfaeb98134000412796b4fdef970b (diff)
NOTICE (TYPE NAME CONSOLIDATION)
Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
Diffstat (limited to 'src/devices/video/snes_ppu.h')
-rw-r--r--src/devices/video/snes_ppu.h278
1 files changed, 139 insertions, 139 deletions
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index 79bcf34f7b7..d8ca3fee814 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -57,10 +57,10 @@ struct SNES_SCANLINE
{
int enable, clip;
- UINT16 buffer[SNES_SCR_WIDTH];
- UINT8 priority[SNES_SCR_WIDTH];
- UINT8 layer[SNES_SCR_WIDTH];
- UINT8 blend_exception[SNES_SCR_WIDTH];
+ uint16_t buffer[SNES_SCR_WIDTH];
+ uint8_t priority[SNES_SCR_WIDTH];
+ uint8_t layer[SNES_SCR_WIDTH];
+ uint8_t blend_exception[SNES_SCR_WIDTH];
};
// ======================> snes_ppu_device
@@ -70,98 +70,98 @@ class snes_ppu_device : public device_t,
{
public:
// construction/destruction
- snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration helpers
template<class _Object> static devcb_base &static_set_open_bus_callback(device_t &device, _Object object) { return downcast<snes_ppu_device &>(device).m_openbus_cb.set_callback(object); }
- UINT8 m_regs[0x40];
+ uint8_t m_regs[0x40];
SNES_SCANLINE m_scanlines[2];
struct
{
/* clipmasks */
- UINT8 window1_enabled, window1_invert;
- UINT8 window2_enabled, window2_invert;
- UINT8 wlog_mask;
+ uint8_t window1_enabled, window1_invert;
+ uint8_t window2_enabled, window2_invert;
+ uint8_t wlog_mask;
/* color math enabled */
- UINT8 color_math;
+ uint8_t color_math;
- UINT8 charmap;
- UINT8 tilemap;
- UINT8 tilemap_size;
+ uint8_t charmap;
+ uint8_t tilemap;
+ uint8_t tilemap_size;
- UINT8 tile_size;
- UINT8 mosaic_enabled; // actually used only for layers 0->3!
+ uint8_t tile_size;
+ uint8_t mosaic_enabled; // actually used only for layers 0->3!
- UINT8 main_window_enabled;
- UINT8 sub_window_enabled;
- UINT8 main_bg_enabled;
- UINT8 sub_bg_enabled;
+ uint8_t main_window_enabled;
+ uint8_t sub_window_enabled;
+ uint8_t main_bg_enabled;
+ uint8_t sub_bg_enabled;
- UINT16 hoffs;
- UINT16 voffs;
+ uint16_t hoffs;
+ uint16_t voffs;
} m_layer[6]; // this is for the BG1 - BG2 - BG3 - BG4 - OBJ - color layers
struct
{
- UINT8 address_low;
- UINT8 address_high;
- UINT8 saved_address_low;
- UINT8 saved_address_high;
- UINT16 address;
- UINT16 priority_rotation;
- UINT8 next_charmap;
- UINT8 next_size;
- UINT8 size;
- UINT32 next_name_select;
- UINT32 name_select;
- UINT8 first_sprite;
- UINT8 flip;
- UINT16 write_latch;
+ uint8_t address_low;
+ uint8_t address_high;
+ uint8_t saved_address_low;
+ uint8_t saved_address_high;
+ uint16_t address;
+ uint16_t priority_rotation;
+ uint8_t next_charmap;
+ uint8_t next_size;
+ uint8_t size;
+ uint32_t next_name_select;
+ uint32_t name_select;
+ uint8_t first_sprite;
+ uint8_t flip;
+ uint16_t write_latch;
} m_oam;
struct
{
- UINT16 latch_horz;
- UINT16 latch_vert;
- UINT16 current_vert;
- UINT8 last_visible_line;
- UINT8 interlace_count;
+ uint16_t latch_horz;
+ uint16_t latch_vert;
+ uint16_t current_vert;
+ uint8_t last_visible_line;
+ uint8_t interlace_count;
} m_beam;
struct
{
- UINT8 repeat;
- UINT8 hflip;
- UINT8 vflip;
- INT16 matrix_a;
- INT16 matrix_b;
- INT16 matrix_c;
- INT16 matrix_d;
- INT16 origin_x;
- INT16 origin_y;
- UINT16 hor_offset;
- UINT16 ver_offset;
- UINT8 extbg;
+ uint8_t repeat;
+ uint8_t hflip;
+ uint8_t vflip;
+ int16_t matrix_a;
+ int16_t matrix_b;
+ int16_t matrix_c;
+ int16_t matrix_d;
+ int16_t origin_x;
+ int16_t origin_y;
+ uint16_t hor_offset;
+ uint16_t ver_offset;
+ uint8_t extbg;
} m_mode7;
struct OAM
{
- UINT16 tile;
- INT16 x, y;
- UINT8 size, vflip, hflip, priority_bits, pal;
+ uint16_t tile;
+ int16_t x, y;
+ uint8_t size, vflip, hflip, priority_bits, pal;
int height, width;
};
struct OAM m_oam_spritelist[SNES_SCR_WIDTH / 2];
- UINT8 m_oam_itemlist[32];
+ uint8_t m_oam_itemlist[32];
struct TILELIST {
- INT16 x;
- UINT16 priority, pal, tileaddr;
+ int16_t x;
+ uint16_t priority, pal, tileaddr;
int hflip;
};
@@ -170,96 +170,96 @@ public:
#if SNES_LAYER_DEBUG
struct DEBUGOPTS
{
- UINT8 bg_disabled[5];
- UINT8 mode_disabled[8];
- UINT8 draw_subscreen;
- UINT8 windows_disabled;
- UINT8 mosaic_disabled;
- UINT8 colormath_disabled;
- UINT8 sprite_reversed;
- UINT8 select_pri[5];
+ uint8_t bg_disabled[5];
+ uint8_t mode_disabled[8];
+ uint8_t draw_subscreen;
+ uint8_t windows_disabled;
+ uint8_t mosaic_disabled;
+ uint8_t colormath_disabled;
+ uint8_t sprite_reversed;
+ uint8_t select_pri[5];
};
struct DEBUGOPTS m_debug_options;
- UINT8 dbg_video( UINT16 curline );
+ uint8_t dbg_video( uint16_t curline );
#endif
- UINT8 m_mosaic_size;
- UINT8 m_clip_to_black;
- UINT8 m_prevent_color_math;
- UINT8 m_sub_add_mode;
- UINT8 m_bg3_priority_bit;
- UINT8 m_direct_color;
- UINT8 m_ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same
+ uint8_t m_mosaic_size;
+ uint8_t m_clip_to_black;
+ uint8_t m_prevent_color_math;
+ uint8_t m_sub_add_mode;
+ uint8_t m_bg3_priority_bit;
+ uint8_t m_direct_color;
+ uint8_t m_ppu_last_scroll; /* as per Anomie's doc and Theme Park, all scroll regs shares (but mode 7 ones) the same
'previous' scroll value */
- UINT8 m_mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */
-
- UINT8 m_ppu1_open_bus, m_ppu2_open_bus;
- UINT8 m_ppu1_version, m_ppu2_version;
- UINT8 m_window1_left, m_window1_right, m_window2_left, m_window2_right;
-
- UINT16 m_mosaic_table[16][4096];
- UINT8 m_clipmasks[6][SNES_SCR_WIDTH];
- UINT8 m_update_windows;
- UINT8 m_update_offsets;
- UINT8 m_update_oam_list;
- UINT8 m_mode;
- UINT8 m_interlace; //doubles the visible resolution
- UINT8 m_obj_interlace;
- UINT8 m_screen_brightness;
- UINT8 m_screen_disabled;
- UINT8 m_pseudo_hires;
- UINT8 m_color_modes;
- UINT8 m_stat77;
- UINT8 m_stat78;
-
- UINT16 m_htmult; /* in 512 wide, we run HTOTAL double and halve it on latching */
- UINT16 m_cgram_address; /* CGRAM address */
- UINT8 m_read_ophct;
- UINT8 m_read_opvct;
- UINT16 m_vram_fgr_high;
- UINT16 m_vram_fgr_increment;
- UINT16 m_vram_fgr_count;
- UINT16 m_vram_fgr_mask;
- UINT16 m_vram_fgr_shift;
- UINT16 m_vram_read_buffer;
- UINT16 m_vmadd;
-
- inline UINT16 get_bgcolor(UINT8 direct_colors, UINT16 palette, UINT8 color);
- inline void set_scanline_pixel(int screen, INT16 x, UINT16 color, UINT8 priority, UINT8 layer, int blend);
- inline void draw_bgtile_lores(UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority);
- inline void draw_bgtile_hires(UINT8 layer, INT16 ii, UINT8 colour, UINT16 pal, UINT8 direct_colors, UINT8 priority);
- inline void draw_oamtile(INT16 ii, UINT8 colour, UINT16 pal, UINT8 priority);
- inline void draw_tile(UINT8 planes, UINT8 layer, UINT32 tileaddr, INT16 x, UINT8 priority, UINT8 flip, UINT8 direct_colors, UINT16 pal, UINT8 hires);
- inline UINT32 get_tmap_addr(UINT8 layer, UINT8 tile_size, UINT32 base, UINT32 x, UINT32 y);
- inline void update_line(UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a, UINT8 color_depth, UINT8 hires, UINT8 offset_per_tile, UINT8 direct_colors);
- void update_line_mode7(UINT16 curline, UINT8 layer, UINT8 priority_b, UINT8 priority_a);
+ uint8_t m_mode7_last_scroll; /* as per Anomie's doc mode 7 scroll regs use a different value, shared with mode 7 matrix! */
+
+ uint8_t m_ppu1_open_bus, m_ppu2_open_bus;
+ uint8_t m_ppu1_version, m_ppu2_version;
+ uint8_t m_window1_left, m_window1_right, m_window2_left, m_window2_right;
+
+ uint16_t m_mosaic_table[16][4096];
+ uint8_t m_clipmasks[6][SNES_SCR_WIDTH];
+ uint8_t m_update_windows;
+ uint8_t m_update_offsets;
+ uint8_t m_update_oam_list;
+ uint8_t m_mode;
+ uint8_t m_interlace; //doubles the visible resolution
+ uint8_t m_obj_interlace;
+ uint8_t m_screen_brightness;
+ uint8_t m_screen_disabled;
+ uint8_t m_pseudo_hires;
+ uint8_t m_color_modes;
+ uint8_t m_stat77;
+ uint8_t m_stat78;
+
+ uint16_t m_htmult; /* in 512 wide, we run HTOTAL double and halve it on latching */
+ uint16_t m_cgram_address; /* CGRAM address */
+ uint8_t m_read_ophct;
+ uint8_t m_read_opvct;
+ uint16_t m_vram_fgr_high;
+ uint16_t m_vram_fgr_increment;
+ uint16_t m_vram_fgr_count;
+ uint16_t m_vram_fgr_mask;
+ uint16_t m_vram_fgr_shift;
+ uint16_t m_vram_read_buffer;
+ uint16_t m_vmadd;
+
+ inline uint16_t get_bgcolor(uint8_t direct_colors, uint16_t palette, uint8_t color);
+ inline void set_scanline_pixel(int screen, int16_t x, uint16_t color, uint8_t priority, uint8_t layer, int blend);
+ inline void draw_bgtile_lores(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority);
+ inline void draw_bgtile_hires(uint8_t layer, int16_t ii, uint8_t colour, uint16_t pal, uint8_t direct_colors, uint8_t priority);
+ inline void draw_oamtile(int16_t ii, uint8_t colour, uint16_t pal, uint8_t priority);
+ inline void draw_tile(uint8_t planes, uint8_t layer, uint32_t tileaddr, int16_t x, uint8_t priority, uint8_t flip, uint8_t direct_colors, uint16_t pal, uint8_t hires);
+ inline uint32_t get_tmap_addr(uint8_t layer, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y);
+ inline void update_line(uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a, uint8_t color_depth, uint8_t hires, uint8_t offset_per_tile, uint8_t direct_colors);
+ void update_line_mode7(uint16_t curline, uint8_t layer, uint8_t priority_b, uint8_t priority_a);
void update_obsel(void);
void oam_list_build(void);
- int is_sprite_on_scanline(UINT16 curline, UINT8 sprite);
- void update_objects_rto(UINT16 curline);
- void update_objects(UINT8 priority_oam0, UINT8 priority_oam1, UINT8 priority_oam2, UINT8 priority_oam3);
- void update_mode_0(UINT16 curline);
- void update_mode_1(UINT16 curline);
- void update_mode_2(UINT16 curline);
- void update_mode_3(UINT16 curline);
- void update_mode_4(UINT16 curline);
- void update_mode_5(UINT16 curline);
- void update_mode_6(UINT16 curline);
- void update_mode_7(UINT16 curline);
- void draw_screens(UINT16 curline);
+ int is_sprite_on_scanline(uint16_t curline, uint8_t sprite);
+ void update_objects_rto(uint16_t curline);
+ void update_objects(uint8_t priority_oam0, uint8_t priority_oam1, uint8_t priority_oam2, uint8_t priority_oam3);
+ void update_mode_0(uint16_t curline);
+ void update_mode_1(uint16_t curline);
+ void update_mode_2(uint16_t curline);
+ void update_mode_3(uint16_t curline);
+ void update_mode_4(uint16_t curline);
+ void update_mode_5(uint16_t curline);
+ void update_mode_6(uint16_t curline);
+ void update_mode_7(uint16_t curline);
+ void draw_screens(uint16_t curline);
void update_windowmasks(void);
void update_offsets(void);
- inline void draw_blend(UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens);
- void refresh_scanline(bitmap_rgb32 &bitmap, UINT16 curline);
+ inline void draw_blend(uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens);
+ void refresh_scanline(bitmap_rgb32 &bitmap, uint16_t curline);
- inline INT16 current_x() { return m_screen->hpos() / m_htmult; }
- inline INT16 current_y() { return m_screen->vpos(); }
- void set_latch_hv(INT16 x, INT16 y);
+ inline int16_t current_x() { return m_screen->hpos() / m_htmult; }
+ inline int16_t current_y() { return m_screen->vpos(); }
+ void set_latch_hv(int16_t x, int16_t y);
void dynamic_res_change();
- inline UINT32 get_vram_address();
+ inline uint32_t get_vram_address();
- UINT8 read(address_space &space, UINT32 offset, UINT8 wrio_bit7);
- void write(address_space &space, UINT32 offset, UINT8 data);
+ uint8_t read(address_space &space, uint32_t offset, uint8_t wrio_bit7);
+ void write(address_space &space, uint32_t offset, uint8_t data);
DECLARE_READ8_MEMBER( oam_read );
DECLARE_WRITE8_MEMBER( oam_write );
@@ -267,9 +267,9 @@ public:
DECLARE_WRITE8_MEMBER( cgram_write );
DECLARE_READ8_MEMBER( vram_read );
DECLARE_WRITE8_MEMBER( vram_write );
- std::unique_ptr<UINT16[]> m_oam_ram; /* Object Attribute Memory */
- std::unique_ptr<UINT16[]> m_cgram; /* Palette RAM */
- std::unique_ptr<UINT8[]> m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
+ std::unique_ptr<uint16_t[]> m_oam_ram; /* Object Attribute Memory */
+ std::unique_ptr<uint16_t[]> m_cgram; /* Palette RAM */
+ std::unique_ptr<uint8_t[]> m_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
protected:
// device-level overrides