From 995aabaeffacb969862950011776b3e0697f6e30 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sat, 6 Apr 2019 05:49:44 +0900 Subject: kaneko_spr.cpp : Updates (#4749) Simplify handlers, Fix namings, Use shorter type vales --- src/mame/drivers/expro02.cpp | 6 ++-- src/mame/drivers/kaneko16.cpp | 20 ++++++------- src/mame/video/galpani2.cpp | 2 +- src/mame/video/kaneko16.cpp | 4 +-- src/mame/video/kaneko_spr.cpp | 68 +++++++++++++++++++++---------------------- src/mame/video/kaneko_spr.h | 58 ++++++++++++++++++------------------ 6 files changed, 79 insertions(+), 79 deletions(-) diff --git a/src/mame/drivers/expro02.cpp b/src/mame/drivers/expro02.cpp index ddb56818532..56d2f0503dc 100644 --- a/src/mame/drivers/expro02.cpp +++ b/src/mame/drivers/expro02.cpp @@ -390,7 +390,7 @@ uint32_t expro02_state::screen_update_backgrounds(screen_device &screen, bitmap_ uint32_t expro02_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { screen_update_backgrounds(screen, bitmap, cliprect); - m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } @@ -691,7 +691,7 @@ void expro02_state::expro02_video_base_map(address_map &map) map(0x600000, 0x600fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // palette? map(0x680000, 0x68001f).rw(m_view2, FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x700000, 0x700fff).ram().share("spriteram"); // sprites? 0x72f words tested - map(0x780000, 0x78001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x780000, 0x78001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0xd80001, 0xd80001).w(FUNC(expro02_state::tilebank_w<1>)); /* ??? */ map(0xe80001, 0xe80001).w(FUNC(expro02_state::tilebank_w<0>)); /* ??? */ } @@ -704,7 +704,7 @@ void expro02_state::expro02_video_base_map_noview2(address_map &map) map(0x600000, 0x600fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // palette? map(0x680000, 0x68001f).noprw(); // games still makes leftover accesses map(0x700000, 0x700fff).ram().share("spriteram"); // sprites? 0x72f words tested - map(0x780000, 0x78001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x780000, 0x78001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0xd80000, 0xd80001).noprw(); // games still makes leftover accesses map(0xe80000, 0xe80001).noprw(); // games still makes leftover accesses } diff --git a/src/mame/drivers/kaneko16.cpp b/src/mame/drivers/kaneko16.cpp index abb6a95da6b..27bec3b87cd 100644 --- a/src/mame/drivers/kaneko16.cpp +++ b/src/mame/drivers/kaneko16.cpp @@ -279,7 +279,7 @@ READ16_MEMBER(kaneko16_berlwall_state::berlwall_spriteregs_r) if (offset & 0x4) return 0; offset = bitswap<8>(offset, 7, 6, 5, 2, 4, 3, 1, 0); - return m_kaneko_spr->kaneko16_sprites_regs_r(space, offset, mem_mask); + return m_kaneko_spr->regs_r(offset); } WRITE16_MEMBER(kaneko16_berlwall_state::berlwall_spriteregs_w) @@ -287,7 +287,7 @@ WRITE16_MEMBER(kaneko16_berlwall_state::berlwall_spriteregs_w) if (offset & 0x4) return; offset = bitswap<8>(offset, 7, 6, 5, 2, 4, 3, 1, 0); - m_kaneko_spr->kaneko16_sprites_regs_w(space, offset, data, mem_mask); + m_kaneko_spr->regs_w(offset, data, mem_mask); } void kaneko16_berlwall_state::berlwall_map(address_map &map) @@ -337,7 +337,7 @@ void kaneko16_state::bakubrkr_map(address_map &map) map(0x600000, 0x601fff).ram().share("spriteram"); // Sprites map(0x700000, 0x700fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0xa80000, 0xa80001).r("watchdog", FUNC(watchdog_timer_device::reset16_r)); map(0xb00000, 0xb0001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0xd00000, 0xd00001).w(FUNC(kaneko16_state::kaneko16_eeprom_w)); // EEPROM @@ -360,7 +360,7 @@ void kaneko16_state::blazeon_map(address_map &map) map(0x600000, 0x603fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map)); map(0x700000, 0x700fff).ram().share("spriteram"); // Sprites map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0x980000, 0x98001f).ram(); // Sprites Regs #2 map(0xc00000, 0xc00001).portr("DSW2_P1"); map(0xc00002, 0xc00003).portr("DSW1_P2"); @@ -405,7 +405,7 @@ void kaneko16_gtmr_state::bloodwar_map(address_map &map) map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map)); map(0x600000, 0x60001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x880001, 0x880001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x900000, 0x900039).rw("kan_hit", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); @@ -441,7 +441,7 @@ void kaneko16_gtmr_state::bonkadv_map(address_map &map) map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map)); map(0x600000, 0x60001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0x800001, 0x800001).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x880001, 0x880001).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x900000, 0x900015).rw("kan_hit", FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); @@ -500,7 +500,7 @@ void kaneko16_gtmr_state::gtmr_map(address_map &map) map(0x600000, 0x60000f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Samples map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -569,7 +569,7 @@ void kaneko16_gtmr_state::gtmr2_map(address_map &map) map(0x600000, 0x60000f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Samples map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); @@ -606,7 +606,7 @@ void kaneko16_state::mgcrystl_map(address_map &map) map(0x680000, 0x683fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map)); map(0x700000, 0x701fff).ram().share("spriteram"); // Sprites map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0xb00000, 0xb0001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); map(0xa00000, 0xa00001).r(m_watchdog, FUNC(watchdog_timer_device::reset16_r)); // Watchdog map(0xc00000, 0xc00001).portr("DSW_P1"); @@ -646,7 +646,7 @@ void kaneko16_shogwarr_state::shogwarr_map(address_map &map) map(0x580000, 0x581fff).ram().share("spriteram"); // Sprites map(0x600000, 0x603fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map)); map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w)); - map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_r), FUNC(kaneko16_sprite_device::kaneko16_sprites_regs_w)); + map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w)); map(0xa00000, 0xa0007f).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); map(0xa80000, 0xa80001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w)); map(0xb80000, 0xb80001).portr("P1"); diff --git a/src/mame/video/galpani2.cpp b/src/mame/video/galpani2.cpp index d8d24b2a9e5..ec950a0a7b6 100644 --- a/src/mame/video/galpani2.cpp +++ b/src/mame/video/galpani2.cpp @@ -140,6 +140,6 @@ if (machine().input().code_pressed(KEYCODE_Z)) if (layers_ctrl & 0x1) copybg15(screen, bitmap, cliprect); if (layers_ctrl & 0x2) copybg8(screen, bitmap, cliprect, 0); if (layers_ctrl & 0x4) copybg8(screen, bitmap, cliprect, 1); - if (layers_ctrl & 0x8) m_kaneko_spr->kaneko16_render_sprites(bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + if (layers_ctrl & 0x8) m_kaneko_spr->render_sprites(bitmap, cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } diff --git a/src/mame/video/kaneko16.cpp b/src/mame/video/kaneko16.cpp index 6223ec7bcb5..40313bdb4f2 100644 --- a/src/mame/video/kaneko16.cpp +++ b/src/mame/video/kaneko16.cpp @@ -89,7 +89,7 @@ uint32_t kaneko16_state::screen_update_kaneko16(screen_device &screen, bitmap_in if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); + m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()); return 0; } @@ -238,6 +238,6 @@ uint32_t kaneko16_berlwall_state::screen_update_berlwall(screen_device &screen, if (!m_disp_enable) return 0; screen_update_common(screen, bitmap, cliprect); - m_kaneko_spr->kaneko16_render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()/2); + m_kaneko_spr->render_sprites(bitmap,cliprect, screen.priority(), m_spriteram, m_spriteram.bytes()/2); return 0; } diff --git a/src/mame/video/kaneko_spr.cpp b/src/mame/video/kaneko_spr.cpp index 3bbd42920c0..2c756667dbc 100644 --- a/src/mame/video/kaneko_spr.cpp +++ b/src/mame/video/kaneko_spr.cpp @@ -36,7 +36,7 @@ kaneko16_sprite_device::kaneko16_sprite_device( device_type type, const char *tag, device_t *owner, - uint32_t clock) + u32 clock) : device_t(mconfig, type, tag, owner, clock) , device_video_interface(mconfig, *this) , m_gfxdecode(*this, finder_base::DUMMY_TAG) @@ -65,8 +65,8 @@ kaneko16_sprite_device::kaneko16_sprite_device( void kaneko16_sprite_device::device_start() { - m_first_sprite = std::make_unique(0x400); - m_sprites_regs = make_unique_clear(0x20/2); + m_first_sprite = std::make_unique(0x400); + m_sprites_regs = make_unique_clear(0x20/2); screen().register_screen_bitmap(m_sprites_bitmap); save_item(NAME(m_sprite_flipx)); @@ -138,7 +138,7 @@ Offset: Format: Value: #define USE_LATCHED_CODE 2 #define USE_LATCHED_COLOR 4 -void kaneko_kc002_sprite_device::get_sprite_attributes(struct kan_tempsprite *s, uint16_t attr) +void kaneko_kc002_sprite_device::get_sprite_attributes(struct tempsprite_t *s, u16 attr) { s->color = (attr & 0x003f); s->priority = (attr & 0x00c0) >> 6; @@ -147,7 +147,7 @@ void kaneko_kc002_sprite_device::get_sprite_attributes(struct kan_tempsprite *s, s->code += (s->y & 1) << 16; // bloodwar } -void kaneko_vu002_sprite_device::get_sprite_attributes(struct kan_tempsprite *s, uint16_t attr) +void kaneko_vu002_sprite_device::get_sprite_attributes(struct tempsprite_t *s, u16 attr) { s->flipy = (attr & 0x0001); s->flipx = (attr & 0x0002); @@ -156,7 +156,7 @@ void kaneko_vu002_sprite_device::get_sprite_attributes(struct kan_tempsprite *s, } -int kaneko16_sprite_device::kaneko16_parse_sprite_type012(int i, struct kan_tempsprite *s, uint16_t* spriteram16, int spriteram16_bytes) +int kaneko16_sprite_device::parse_sprite_type012(int i, struct tempsprite_t *s, u16* spriteram16, int spriteram16_bytes) { int attr, xoffs, offs; @@ -198,12 +198,12 @@ int kaneko16_sprite_device::kaneko16_parse_sprite_type012(int i, struct kan_temp template -void kaneko16_sprite_device::kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, - uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy, +void kaneko16_sprite_device::draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, + u32 code,u32 color,int flipx,int flipy,int sx,int sy, bitmap_ind8 &priority_bitmap, int priority) { pen_t pen_base = gfx->colorbase() + gfx->granularity() * (color % gfx->colors()); - const uint8_t *source_base = gfx->get_data(code % gfx->elements()); + const u8 *source_base = gfx->get_data(code % gfx->elements()); int sprite_screen_height = ((1<<16)*gfx->height()+0x8000)>>16; int sprite_screen_width = ((1<<16)*gfx->width()+0x8000)>>16; @@ -275,9 +275,9 @@ void kaneko16_sprite_device::kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp for (int y = sy; y < ey; y++) { - const uint8_t *source = source_base + (y_index >> 16) * gfx->rowbytes(); + const u8 *source = source_base + (y_index >> 16) * gfx->rowbytes(); dest = &dest_bmp.pix(y); - uint8_t *pri = &priority_bitmap.pix8(y); + u8 *pri = &priority_bitmap.pix8(y); int x_index = x_index_base; for (int x = sx; x < ex; x++) @@ -306,7 +306,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp /* Build a list of sprites to display & draw them */ template -void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { /* Sprites *must* be parsed from the first in RAM to the last, because of the multisprite feature. But they *must* be drawn @@ -320,7 +320,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const r int max = (screen().width() > 0x100) ? (0x200<<6) : (0x100<<6); int i = 0; - struct kan_tempsprite *s = m_first_sprite.get(); + struct tempsprite_t *s = m_first_sprite.get(); /* These values are latched from the last sprite. */ int x = 0; @@ -337,7 +337,7 @@ void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const r { int flags; - flags = kaneko16_parse_sprite_type012(i,s, spriteram16, spriteram16_bytes); + flags = parse_sprite_type012(i,s, spriteram16, spriteram16_bytes); if (flags == -1) // End of Sprites break; @@ -417,9 +417,9 @@ void kaneko16_sprite_device::kaneko16_draw_sprites(_BitmapClass &bitmap, const r { int curr_pri = s->priority; - uint32_t primask = m_priority.sprite[curr_pri]; + u32 primask = m_priority.sprite[curr_pri]; - kaneko16_draw_sprites_custom( + draw_sprites_custom( bitmap,cliprect,m_gfxdecode->gfx(0), s->code, s->color, @@ -500,14 +500,14 @@ FLIP ON: 900010: 0000 0400 A000 A400-1E00 2200 0000 0400 ; +1f<<6 on y */ -READ16_MEMBER(kaneko16_sprite_device::kaneko16_sprites_regs_r) +u16 kaneko16_sprite_device::regs_r(offs_t offset) { return m_sprites_regs[offset]; } -WRITE16_MEMBER(kaneko16_sprite_device::kaneko16_sprites_regs_w) +void kaneko16_sprite_device::regs_w(offs_t offset, u16 data, u16 mem_mask) { - uint16_t new_data; + u16 new_data; COMBINE_DATA(&m_sprites_regs[offset]); new_data = m_sprites_regs[offset]; @@ -531,16 +531,16 @@ WRITE16_MEMBER(kaneko16_sprite_device::kaneko16_sprites_regs_w) } -void kaneko16_sprite_device::kaneko16_copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect) +void kaneko16_sprite_device::copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect) { copybitmap_trans(bitmap,m_sprites_bitmap,0,0,0,0,cliprect,0); } -void kaneko16_sprite_device::kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) +void kaneko16_sprite_device::copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect) { const pen_t *pal = m_gfxdecode->gfx(0)->palette().pens(); - uint16_t* srcbitmap; - uint32_t* dstbitmap; + u16* srcbitmap; + u32* dstbitmap; for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { @@ -549,7 +549,7 @@ void kaneko16_sprite_device::kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rec for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - uint16_t pix = srcbitmap[x]; + u16 pix = srcbitmap[x]; if (pix) dstbitmap[x] = pal[pix]; } } @@ -557,11 +557,11 @@ void kaneko16_sprite_device::kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rec -void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } -void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } +void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } +void kaneko16_sprite_device::kaneko16_render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { kaneko16_render_sprites_common(bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } template -void kaneko16_sprite_device::kaneko16_render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::kaneko16_render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes) { /* Sprites last (rendered with pdrawgfx, so they can slip in between the layers) */ @@ -569,31 +569,31 @@ void kaneko16_sprite_device::kaneko16_render_sprites_common(_BitmapClass &bitmap if(m_keep_sprites) { /* keep sprites on screen - used by mgcrystl when you get the first gem and it shows instructions */ - kaneko16_draw_sprites(m_sprites_bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); - kaneko16_copybitmap(bitmap,cliprect); + draw_sprites(m_sprites_bitmap, cliprect, priority_bitmap, spriteram16, spriteram16_bytes); + copybitmap(bitmap,cliprect); } else { m_sprites_bitmap.fill(0, cliprect); - kaneko16_draw_sprites(bitmap,cliprect, priority_bitmap, spriteram16, spriteram16_bytes); + draw_sprites(bitmap,cliprect, priority_bitmap, spriteram16, spriteram16_bytes); } } -kaneko_vu002_sprite_device::kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +kaneko_vu002_sprite_device::kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : kaneko16_sprite_device(mconfig, KANEKO_VU002_SPRITE, tag, owner, clock) { } -kaneko_kc002_sprite_device::kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +kaneko_kc002_sprite_device::kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : kaneko16_sprite_device(mconfig, KANEKO_KC002_SPRITE, tag, owner, clock) { } // this is a bootleg implementation, used by Gals Hustler and Zip Zap, the latter not really working at all well with the original // link features (assuming the bad program roms aren't the cause) it's clearly derived from this sprite system tho. -void kaneko16_sprite_device::bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram16, int spriteram16_bytes) +void kaneko16_sprite_device::bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes) { -// uint16_t *spriteram16 = m_spriteram; +// u16 *spriteram16 = m_spriteram; int offs; int sx=0, sy=0; diff --git a/src/mame/video/kaneko_spr.h b/src/mame/video/kaneko_spr.h index 98fbc3649a4..69540575e94 100644 --- a/src/mame/video/kaneko_spr.h +++ b/src/mame/video/kaneko_spr.h @@ -8,12 +8,12 @@ /* Kaneko Sprites */ -struct kaneko16_priority_t +struct priority_t { int sprite[4]; }; -struct kan_tempsprite +struct tempsprite_t { int code,color; int x,y; @@ -46,18 +46,18 @@ public: // (legacy) used in the bitmap clear functions virtual int get_sprite_type(void) =0; - void kaneko16_render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes); - void kaneko16_render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes); + void render_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); + void render_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); template - void kaneko16_render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes); + void render_sprites_common(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); - void bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, uint16_t* spriteram16, int spriteram16_bytes); + void bootleg_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, u16* spriteram16, int spriteram16_bytes); - DECLARE_READ16_MEMBER(kaneko16_sprites_regs_r); - DECLARE_WRITE16_MEMBER(kaneko16_sprites_regs_w); + u16 regs_r(offs_t offset); + void regs_w(offs_t offset, u16 data, u16 mem_mask); protected: kaneko16_sprite_device( @@ -65,7 +65,7 @@ protected: device_type type, const char *tag, device_t *owner, - uint32_t clock); + u32 clock); virtual void device_start() override; virtual void device_reset() override; @@ -75,41 +75,41 @@ protected: int m_sprite_fliptype; // offsets (set when declaring device in MCFG ) - uint16_t m_sprite_xoffs; - uint16_t m_sprite_yoffs; + u16 m_sprite_xoffs; + u16 m_sprite_yoffs; // priority for mixing (set when declaring device in MCFG ) - kaneko16_priority_t m_priority; + priority_t m_priority; // pure virtual function for getting the attributes on sprites, the two different chip types have // them in a different order - virtual void get_sprite_attributes(struct kan_tempsprite *s, uint16_t attr) =0; + virtual void get_sprite_attributes(struct tempsprite_t *s, u16 attr) =0; private: // registers - uint16_t m_sprite_flipx; - uint16_t m_sprite_flipy; - std::unique_ptr m_sprites_regs; + u16 m_sprite_flipx; + u16 m_sprite_flipy; + std::unique_ptr m_sprites_regs; - std::unique_ptr m_first_sprite; + std::unique_ptr m_first_sprite; int m_keep_sprites; bitmap_ind16 m_sprites_bitmap; template - void kaneko16_draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, uint16_t* spriteram16, int spriteram16_bytes); + void draw_sprites(_BitmapClass &bitmap, const rectangle &cliprect, bitmap_ind8 &priority_bitmap, u16* spriteram16, int spriteram16_bytes); template - void kaneko16_draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, - uint32_t code,uint32_t color,int flipx,int flipy,int sx,int sy, + void draw_sprites_custom(_BitmapClass &dest_bmp,const rectangle &clip,gfx_element *gfx, + u32 code,u32 color,int flipx,int flipy,int sx,int sy, bitmap_ind8 &priority_bitmap, int priority); - int kaneko16_parse_sprite_type012(int i, struct kan_tempsprite *s, uint16_t* spriteram16, int spriteram16_bytes); + int parse_sprite_type012(int i, struct tempsprite_t *s, u16* spriteram16, int spriteram16_bytes); - void kaneko16_copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); - void kaneko16_copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); + void copybitmap(bitmap_ind16 &bitmap, const rectangle &cliprect); + void copybitmap(bitmap_rgb32 &bitmap, const rectangle &cliprect); required_device m_gfxdecode; @@ -123,12 +123,12 @@ class kaneko_vu002_sprite_device : public kaneko16_sprite_device { public: kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner) - : kaneko_vu002_sprite_device(mconfig, tag, owner, (uint32_t)0) + : kaneko_vu002_sprite_device(mconfig, tag, owner, (u32)0) { } - kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void get_sprite_attributes(struct kan_tempsprite *s, uint16_t attr) override; + kaneko_vu002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + void get_sprite_attributes(struct tempsprite_t *s, u16 attr) override; int get_sprite_type(void) override{ return 0; }; }; @@ -139,12 +139,12 @@ class kaneko_kc002_sprite_device : public kaneko16_sprite_device { public: kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner) - : kaneko_kc002_sprite_device(mconfig, tag, owner, (uint32_t)0) + : kaneko_kc002_sprite_device(mconfig, tag, owner, (u32)0) { } - kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void get_sprite_attributes(struct kan_tempsprite *s, uint16_t attr) override; + kaneko_kc002_sprite_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + void get_sprite_attributes(struct tempsprite_t *s, u16 attr) override; int get_sprite_type(void) override{ return 1; }; }; -- cgit v1.2.3