summaryrefslogtreecommitdiffstats
path: root/src/devices/video/snes_ppu.h
diff options
context:
space:
mode:
authorGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-10-17 23:40:37 +0200
committerGravatarGravatar MooglyGuy <therealmogminer@gmail.com>2019-10-17 23:55:15 +0200
commit1ff29d0a13ba8cd07f2723d0cc46551880dbfd19 (patch)
treeb4e37f7e9fb7f2a0fd8ac3fe61ed0a056f111146 /src/devices/video/snes_ppu.h
parente65d3bfb269e222b802c9746d5261377d22415c9 (diff)
-snes_ppu: Fixed background layer drawing based on higan ppu-fast. [byuu, Ryan Holtz]
Diffstat (limited to 'src/devices/video/snes_ppu.h')
-rw-r--r--src/devices/video/snes_ppu.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index baab1e264b1..91563fbdb78 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -111,7 +111,7 @@ protected:
SNES_SCANLINE m_scanlines[2];
- struct
+ struct layer_t
{
/* clipmasks */
uint8_t window1_enabled, window1_invert;
@@ -120,11 +120,12 @@ protected:
/* color math enabled */
uint8_t color_math;
- uint8_t charmap;
- uint8_t tilemap;
+ uint16_t charmap;
+ uint16_t tilemap;
uint8_t tilemap_size;
uint8_t tile_size;
+ uint8_t tile_mode;
uint8_t mosaic_enabled; // actually used only for layers 0->3!
uint8_t main_window_enabled;
@@ -134,7 +135,14 @@ protected:
uint16_t hoffs;
uint16_t voffs;
- } m_layer[6]; // this is for the BG1 - BG2 - BG3 - BG4 - OBJ - color layers
+
+ uint8_t priority[2];
+
+ uint16_t mosaic_counter;
+ uint16_t mosaic_offset;
+ };
+
+ layer_t m_layer[6]; // this is for the BG1 - BG2 - BG3 - BG4 - OBJ - color layers
struct
{
@@ -219,7 +227,7 @@ protected:
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_bg_priority;
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 */
@@ -262,9 +270,10 @@ protected:
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);
+ inline uint32_t get_tmap_addr(uint8_t layer, uint8_t hires, uint8_t tile_size, uint32_t base, uint32_t x, uint32_t y);
+ inline uint32_t get_tile(uint8_t layer_idx, uint32_t hoffset, uint32_t voffset);
+ inline void update_line(uint16_t curline, uint8_t layer, uint8_t direct_colors);
+ void update_line_mode7(uint16_t curline, uint8_t layer);
void update_obsel(void);
void oam_list_build(void);
int is_sprite_on_scanline(uint16_t curline, uint8_t sprite);
@@ -281,6 +290,9 @@ protected:
void draw_screens(uint16_t curline);
void update_windowmasks(void);
void update_offsets(void);
+ void update_video_mode(void);
+ void cache_background(void);
+ uint16_t direct_color(uint16_t palette, uint16_t group);
inline void draw_blend(uint16_t offset, uint16_t *colour, uint8_t prevent_color_math, uint8_t black_pen_clip, int switch_screens);
void dynamic_res_change();
@@ -314,4 +326,4 @@ private:
DECLARE_DEVICE_TYPE(SNES_PPU, snes_ppu_device)
-#endif // MAME_VIDEO_SNES_PPU_H
+#endif // MAME_VIDEO_SNES_PPU_H \ No newline at end of file