digfx: mark gfx ram dirty after load state

This commit is contained in:
hap 2025-01-03 15:58:08 +01:00
parent 03af26bfe2
commit 9c3566728e
54 changed files with 269 additions and 348 deletions

View File

@ -98,6 +98,24 @@ void device_gfx_interface::interface_post_start()
}
//-------------------------------------------------
// interface_post_load - mark RAM-based entries
// dirty after loading save state
//-------------------------------------------------
void device_gfx_interface::interface_post_load()
{
if (!m_gfxdecodeinfo)
return;
for (int curgfx = 0; curgfx < MAX_GFX_ELEMENTS && m_gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++)
{
if (GFXENTRY_ISRAM(m_gfxdecodeinfo[curgfx].flags))
m_gfx[curgfx]->mark_all_dirty();
}
}
//-------------------------------------------------
// decode_gfx - parse gfx decode info and
// create gfx elements
@ -106,7 +124,7 @@ void device_gfx_interface::interface_post_start()
void device_gfx_interface::decode_gfx(const gfx_decode_entry *gfxdecodeinfo)
{
// skip if nothing to do
if (gfxdecodeinfo == nullptr)
if (!gfxdecodeinfo)
return;
// local variables to hold mutable copies of gfx layout data
@ -298,9 +316,9 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
return;
// validate graphics decoding entries
for (int gfxnum = 0; gfxnum < MAX_GFX_ELEMENTS && m_gfxdecodeinfo[gfxnum].gfxlayout != nullptr; gfxnum++)
for (int curgfx = 0; curgfx < MAX_GFX_ELEMENTS && m_gfxdecodeinfo[curgfx].gfxlayout != nullptr; curgfx++)
{
const gfx_decode_entry &gfx = m_gfxdecodeinfo[gfxnum];
const gfx_decode_entry &gfx = m_gfxdecodeinfo[curgfx];
const gfx_layout &layout = *gfx.gfxlayout;
// currently we are unable to validate RAM-based entries
@ -316,7 +334,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
u32 region_length = valid.region_length(gfxregion.c_str());
if (region_length == 0)
osd_printf_error("gfx[%d] references nonexistent region '%s'\n", gfxnum, gfxregion);
osd_printf_error("gfx[%d] references nonexistent region '%s'\n", curgfx, gfxregion);
// if we have a valid region, and we're not using auto-sizing, check the decode against the region length
else if (!IS_FRAC(layout.total))
@ -336,7 +354,7 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
// if not, this is an error
if ((start + len) / 8 > avail)
osd_printf_error("gfx[%d] extends past allocated memory of region '%s'\n", gfxnum, region);
osd_printf_error("gfx[%d] extends past allocated memory of region '%s'\n", curgfx, region);
}
}
@ -347,9 +365,9 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
if (layout.planeoffset[0] == GFX_RAW)
{
if (layout.total != RGN_FRAC(1,1))
osd_printf_error("gfx[%d] RAW layouts can only be RGN_FRAC(1,1)\n", gfxnum);
osd_printf_error("gfx[%d] RAW layouts can only be RGN_FRAC(1,1)\n", curgfx);
if (xscale != 1 || yscale != 1)
osd_printf_error("gfx[%d] RAW layouts do not support xscale/yscale\n", gfxnum);
osd_printf_error("gfx[%d] RAW layouts do not support xscale/yscale\n", curgfx);
}
// verify traditional decode doesn't have too many planes,
@ -357,11 +375,11 @@ void device_gfx_interface::interface_validity_check(validity_checker &valid) con
else
{
if (layout.planes > MAX_GFX_PLANES)
osd_printf_error("gfx[%d] planes > %d\n", gfxnum, MAX_GFX_PLANES);
osd_printf_error("gfx[%d] planes > %d\n", curgfx, MAX_GFX_PLANES);
if (layout.width > MAX_GFX_SIZE && layout.extxoffs == nullptr)
osd_printf_error("gfx[%d] width > %d but missing extended xoffset info\n", gfxnum, MAX_GFX_SIZE);
osd_printf_error("gfx[%d] width > %d but missing extended xoffset info\n", curgfx, MAX_GFX_SIZE);
if (layout.height > MAX_GFX_SIZE && layout.extyoffs == nullptr)
osd_printf_error("gfx[%d] height > %d but missing extended yoffset info\n", gfxnum, MAX_GFX_SIZE);
osd_printf_error("gfx[%d] height > %d but missing extended yoffset info\n", curgfx, MAX_GFX_SIZE);
}
}
}

View File

@ -72,7 +72,7 @@ const gfx_layout name = { width, height, RGN_FRAC(1,1), 8, { GFX_RAW }, { 0 }, {
#define STEP2048(START,STEP) STEP1024(START,STEP),STEP1024((START)+1024*(STEP),STEP)
#define STEP2_INV(START,STEP) (START)+(STEP),(START)
#define STEP4_INV(START,STEP) STEP2_INV(START+2*STEP,STEP),STEP2_INV(START,STEP)
#define STEP4_INV(START,STEP) STEP2_INV(START+2*STEP,STEP),STEP2_INV(START,STEP)
//**************************************************************************
// GRAPHICS INFO MACROS
@ -186,17 +186,18 @@ protected:
virtual void interface_validity_check(validity_checker &valid) const override;
virtual void interface_pre_start() override;
virtual void interface_post_start() override;
virtual void interface_post_load() override;
private:
optional_device<device_palette_interface> m_palette; // configured tag for palette device
std::unique_ptr<gfx_element> m_gfx[MAX_GFX_ELEMENTS]; // array of pointers to graphic sets
optional_device<device_palette_interface> m_palette; // configured tag for palette device
std::unique_ptr<gfx_element> m_gfx[MAX_GFX_ELEMENTS]; // array of pointers to graphic sets
// configuration
const gfx_decode_entry * m_gfxdecodeinfo; // pointer to array of gfx decode information
bool m_palette_is_disabled; // no palette associated with this gfx decode
const gfx_decode_entry * m_gfxdecodeinfo; // pointer to array of gfx decode information
bool m_palette_is_disabled; // no palette associated with this gfx decode
// internal state
bool m_decoded; // have we processed our decode info yet?
bool m_decoded; // have we processed our decode info yet?
};
// iterator

View File

@ -66,63 +66,61 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta
/***************************************************************************
GRAPHICS ELEMENTS
***************************************************************************/
//-------------------------------------------------
// gfx_element - constructor
//-------------------------------------------------
gfx_element::gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity)
: m_palette(palette),
m_width(width),
m_height(height),
m_startx(0),
m_starty(0),
m_origwidth(width),
m_origheight(height),
m_total_elements(1),
m_color_base(color_base),
m_color_depth(color_granularity),
m_color_granularity(color_granularity),
m_total_colors((total_colors - color_base) / color_granularity),
m_line_modulo(rowbytes),
m_char_modulo(0),
m_srcdata(base),
m_dirtyseq(1),
m_gfxdata(base),
m_layout_is_raw(true),
m_layout_planes(0),
m_layout_xormask(0),
m_layout_charincrement(0)
gfx_element::gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity) :
m_palette(palette),
m_width(width),
m_height(height),
m_startx(0),
m_starty(0),
m_origwidth(width),
m_origheight(height),
m_total_elements(1),
m_color_base(color_base),
m_color_depth(color_granularity),
m_color_granularity(color_granularity),
m_total_colors((total_colors - color_base) / color_granularity),
m_line_modulo(rowbytes),
m_char_modulo(0),
m_srcdata(base),
m_dirtyseq(1),
m_gfxdata(base),
m_layout_is_raw(true),
m_layout_planes(0),
m_layout_xormask(0),
m_layout_charincrement(0)
{
}
gfx_element::gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base)
: m_palette(palette),
m_width(0),
m_height(0),
m_startx(0),
m_starty(0),
m_origwidth(0),
m_origheight(0),
m_total_elements(0),
m_color_base(color_base),
m_color_depth(0),
m_color_granularity(0),
m_total_colors(total_colors),
m_line_modulo(0),
m_char_modulo(0),
m_srcdata(nullptr),
m_dirtyseq(1),
m_gfxdata(nullptr),
m_layout_is_raw(false),
m_layout_planes(0),
m_layout_xormask(xormask),
m_layout_charincrement(0)
gfx_element::gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base) :
m_palette(palette),
m_width(0),
m_height(0),
m_startx(0),
m_starty(0),
m_origwidth(0),
m_origheight(0),
m_total_elements(0),
m_color_base(color_base),
m_color_depth(0),
m_color_granularity(0),
m_total_colors(total_colors),
m_line_modulo(0),
m_char_modulo(0),
m_srcdata(nullptr),
m_dirtyseq(1),
m_gfxdata(nullptr),
m_layout_is_raw(false),
m_layout_planes(0),
m_layout_xormask(xormask),
m_layout_charincrement(0)
{
// set the layout
set_layout(gl, srcdata);

View File

@ -538,8 +538,8 @@ class gfxdecode_device : public device_t, public device_gfx_interface
public:
// construction/destruction
template <typename T>
gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&palette_tag, const gfx_decode_entry *gfxinfo)
: gfxdecode_device(mconfig, tag, owner, 0)
gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&palette_tag, const gfx_decode_entry *gfxinfo) :
gfxdecode_device(mconfig, tag, owner, 0)
{
set_palette(std::forward<T>(palette_tag));
set_info(gfxinfo);
@ -547,7 +547,7 @@ public:
gfxdecode_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
protected:
virtual void device_start() override {}
virtual void device_start() override { }
};
#endif // MAME_EMU_DRAWGFX_H

View File

@ -68,16 +68,17 @@ public:
void ace(machine_config &config);
protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
private:
void ace_objpos_w(offs_t offset, uint8_t data);
void ace_characterram_w(offs_t offset, uint8_t data);
void ace_scoreram_w(offs_t offset, uint8_t data);
uint8_t unk_r();
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
uint32_t screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void ace_postload();
void main_map(address_map &map) ATTR_COLD;
required_device<cpu_device> m_maincpu;
@ -301,24 +302,15 @@ static const gfx_layout scorelayout =
static GFXDECODE_START( gfx_ace )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 2 )
GFXDECODE_ENTRY( nullptr, 0x8000, charlayout0, 0, 2 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( nullptr, 0x8000, charlayout1, 0, 2 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( nullptr, 0x8000, charlayout2, 0, 2 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( nullptr, 0x8000, scorelayout, 0, 2 ) /* the game dynamically modifies this */
GFXDECODE_RAM( nullptr, 0x8000, charlayout0, 0, 2 )
GFXDECODE_RAM( nullptr, 0x8000, charlayout1, 0, 2 )
GFXDECODE_RAM( nullptr, 0x8000, charlayout2, 0, 2 )
GFXDECODE_RAM( nullptr, 0x8000, scorelayout, 0, 2 )
GFXDECODE_END
void aceal_state::ace_postload()
{
m_gfxdecode->gfx(1)->mark_dirty(0);
m_gfxdecode->gfx(2)->mark_dirty(0);
m_gfxdecode->gfx(3)->mark_dirty(0);
m_gfxdecode->gfx(4)->mark_dirty(0);
}
void aceal_state::machine_start()
{
save_item(NAME(m_objpos));
machine().save().register_postload(save_prepost_delegate(FUNC(aceal_state::ace_postload), this));
}
void aceal_state::machine_reset()

View File

@ -137,7 +137,6 @@ private:
TIMER_DEVICE_CALLBACK_MEMBER(scanline_cb);
void postload();
void main_map(address_map &map) ATTR_COLD;
};
@ -188,11 +187,6 @@ template <unsigned N> TILE_GET_INFO_MEMBER(popobear_state::get_tile_info)
tileinfo.set(0, tileno & 0x3fff, 0, TILE_FLIPYX(flipyx));
}
void popobear_state::postload()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
}
void popobear_state::video_start()
{
m_vram_rearranged.resize(0x100000 / 2);
@ -210,7 +204,6 @@ void popobear_state::video_start()
m_bg_tilemap[3]->set_transparent_pen(0);
save_item(NAME(m_vram_rearranged));
machine().save().register_postload(save_prepost_delegate(FUNC(popobear_state::postload), this));
}

View File

@ -1190,7 +1190,7 @@ u32 cps3_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const
if (ysize2 == 0)
{
// logerror("invalid sprite ysize of 0 tiles\n");
//logerror("invalid sprite ysize of 0 tiles\n");
continue;
}
@ -2341,7 +2341,7 @@ void cps3_state::copy_from_nvram()
data = ((m_simm[0][0]->read_raw(i/4)<<24) | (m_simm[0][1]->read_raw(i/4)<<16) | (m_simm[0][2]->read_raw(i/4)<<8) | (m_simm[0][3]->read_raw(i/4)<<0));
// logerror("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4], data ^ cps3_mask(i+0x6000000, m_key1, m_key2));
//logerror("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4], data ^ cps3_mask(i+0x6000000, m_key1, m_key2));
romdata[i/4] = data;
romdata2[i/4] = data ^ cps3_mask(i+0x6000000, m_key1, m_key2);
@ -2357,7 +2357,7 @@ void cps3_state::copy_from_nvram()
data = ((m_simm[1][0]->read_raw(i/4)<<24) | (m_simm[1][1]->read_raw(i/4)<<16) | (m_simm[1][2]->read_raw(i/4)<<8) | (m_simm[1][3]->read_raw(i/4)<<0));
// logerror("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4], data ^ cps3_mask(i+0x6800000, m_key1, m_key2) );
//logerror("%08x %08x %08x %08x\n",romdata[i/4],data, romdata2[i/4], data ^ cps3_mask(i+0x6800000, m_key1, m_key2) );
romdata[i/4] = data;
romdata2[i/4] = data ^ cps3_mask(i+0x6800000, m_key1, m_key2);
}
@ -2371,7 +2371,7 @@ void cps3_state::copy_from_nvram()
romdata = (u32*)m_user5;
for (u32 thebase = 0; thebase < len/2; thebase += 0x200000)
{
// logerror("flashnums %d. %d\n",flashnum, flashnum+1);
//logerror("flashnums %d. %d\n",flashnum, flashnum+1);
fujitsu_29f016a_device *flash0 = m_simm[2 + flashnum/8][flashnum % 8 + 0];
fujitsu_29f016a_device *flash1 = m_simm[2 + flashnum/8][flashnum % 8 + 1];

View File

@ -16,6 +16,7 @@
****************************************************************************/
#include "emu.h"
#include "cpu/i86/i86.h"
#include "machine/pic8259.h"
#include "machine/pit8253.h"
@ -24,6 +25,7 @@
#include "bus/centronics/ctronics.h"
#include "fp6000_kbd.h"
#include "imagedev/cassette.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@ -38,8 +40,8 @@ namespace {
class fp6000_state : public driver_device
{
public:
fp6000_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
fp6000_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_pic(*this, "pic"),
m_pit(*this, "pit"),

View File

@ -1205,8 +1205,8 @@ static GFXDECODE_START( gfx_zoar )
GFXDECODE_END
static GFXDECODE_START( gfx_disco )
GFXDECODE_ENTRY( nullptr, 0, disco_tile8layout, 0, 4 ) /* char set #1 */
GFXDECODE_ENTRY( nullptr, 0, disco_tile16layout, 0, 4 ) /* sprites */
GFXDECODE_RAM( nullptr, 0, disco_tile8layout, 0, 4 ) /* char set #1 */
GFXDECODE_RAM( nullptr, 0, disco_tile16layout, 0, 4 ) /* sprites */
GFXDECODE_END
/***************************************************************************

View File

@ -69,7 +69,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override;
private:
required_device<cpu_device> m_maincpu;
@ -641,12 +640,6 @@ void bwing_state::machine_reset()
m_p3_u8f_d = 0;
}
void bwing_state::device_post_load()
{
m_gfxdecode->gfx(2)->mark_all_dirty();
m_gfxdecode->gfx(3)->mark_all_dirty();
}
void bwing_state::bwing(machine_config &config)
{

View File

@ -995,10 +995,10 @@ static const gfx_layout objlayout =
};
static GFXDECODE_START( gfx_decocass )
GFXDECODE_ENTRY( nullptr, 0x6000, charlayout, 0, 4 ) /* char set #1 */
GFXDECODE_ENTRY( nullptr, 0x6000, spritelayout, 0, 4 ) /* sprites */
GFXDECODE_ENTRY( nullptr, 0xd000, tilelayout, 0, 8 ) /* background tiles */
GFXDECODE_ENTRY( nullptr, 0xd800, objlayout, 0, 64 ) /* object */
GFXDECODE_RAM( nullptr, 0x6000, charlayout, 0, 4 ) /* char set #1 */
GFXDECODE_RAM( nullptr, 0x6000, spritelayout, 0, 4 ) /* sprites */
GFXDECODE_RAM( nullptr, 0xd000, tilelayout, 0, 8 ) /* background tiles */
GFXDECODE_RAM( nullptr, 0xd800, objlayout, 0, 64 ) /* object */
GFXDECODE_END
void decocass_state::decocass_palette(palette_device &palette) const

View File

@ -433,7 +433,7 @@ static const gfx_layout sprite_layout =
};
static GFXDECODE_START( gfx_lemmings )
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 16 ) // Dynamically modified
GFXDECODE_RAM( nullptr, 0, charlayout, 0, 16 ) // Dynamically modified
GFXDECODE_END
static GFXDECODE_START( gfx_lemmings_spr1 )

View File

@ -422,8 +422,6 @@ ROM_START( madalienb )
ROM_REGION( 0x0400, "gfx2", 0 ) /* headlight */
ROM_LOAD( "ma-.2bc", 0x0000, 0x0400, CRC(aab16446) SHA1(d2342627cc2766004343f27515d8a7989d5fe932) )
ROM_REGION( 0x0400, "user1", 0 ) // background tile map
ROM_LOAD( "mf-1.4h", 0x0000, 0x0400, CRC(9b04c446) SHA1(918013f3c0244ab6a670b9d1b6b642298e2c5ab8) )
@ -449,7 +447,7 @@ ROM_START( madalienb )
ROM_LOAD( "prom.7e", 0x0000, 0x0020, CRC(e622396a) SHA1(8972704bd25fed462e25c453771cc5ca4fc74034) )
ROM_END
/* set parent machine inp init */
GAME( 1980, madalien, 0, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1980, madaliena,madalien, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1980, madalienb,madalien, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 2, alt gfx)", MACHINE_SUPPORTS_SAVE )
/* set parent machine inp init */
GAME( 1980, madalien, 0, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1980, madaliena, madalien, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1980, madalienb, madalien, madalien, madalien, madalien_state, empty_init, ROT270, "Data East Corporation", "Mad Alien (set 2, alt gfx)", MACHINE_SUPPORTS_SAVE )

View File

@ -353,7 +353,7 @@ static const gfx_layout tilelayout =
static GFXDECODE_START( gfx_madalien )
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0x20, 2 ) /* foreground characters, stored in RAM */
GFXDECODE_RAM( nullptr, 0, charlayout, 0x20, 2 ) /* foreground characters, stored in RAM */
GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0, 4 )
GFXDECODE_ENTRY( "gfx2", 0, headlightlayout, 0, 1 )
GFXDECODE_END

View File

@ -271,7 +271,7 @@ static const gfx_layout charlayout_3_bit =
static GFXDECODE_START( gfx_polyplay )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout_1_bit, 0, 1 )
GFXDECODE_ENTRY( nullptr, 0xec00, charlayout_3_bit, 2, 1 )
GFXDECODE_RAM( nullptr, 0xec00, charlayout_3_bit, 2, 1 )
GFXDECODE_END

View File

@ -515,7 +515,7 @@ static const gfx_layout char_16x16_layout =
static GFXDECODE_START( gfx_dblcrown )
GFXDECODE_ENTRY( "gfx1", 0, char_16x16_layout, 0, 0x10 )
GFXDECODE_ENTRY( nullptr, 0, gfx_8x8x4_packed_lsb, 0, 0x10 )
GFXDECODE_RAM( nullptr, 0, gfx_8x8x4_packed_lsb, 0, 0x10 )
GFXDECODE_END

View File

@ -592,7 +592,7 @@ GFXDECODE_END
static GFXDECODE_START( gfx_imago )
GFXDECODE_ENTRY( "gfx1", 0, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( nullptr, 0xb800, imago_spritelayout, 0, 32 )
GFXDECODE_RAM( nullptr, 0xb800, imago_spritelayout, 0, 32 )
GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x3_planar, 0, 32 )
GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x1, 0x140, 1 )
GFXDECODE_END

View File

@ -284,7 +284,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override { m_gfxdecode->gfx(0)->mark_all_dirty(); }
private:
void analog_reset_w(u8 data);

View File

@ -410,7 +410,7 @@ static const gfx_layout kanjilayout =
static GFXDECODE_START( gfx_b16 )
GFXDECODE_ENTRY( "kanji", 0x0000, kanjilayout, 0, 1 )
GFXDECODE_ENTRY( nullptr, 0x0000, charlayout, 0, 1 )
GFXDECODE_RAM( nullptr, 0x0000, charlayout, 0, 1 )
GFXDECODE_END
uint8_t b16_state::memory_read_byte(offs_t offset)

View File

@ -839,7 +839,7 @@ static const gfx_layout ig_charlayout =
};
static GFXDECODE_START( gfx_bml3mk5 )
GFXDECODE_ENTRY( nullptr, 0, ig_charlayout, 0, 1 )
GFXDECODE_RAM( nullptr, 0, ig_charlayout, 0, 1 )
GFXDECODE_END

View File

@ -37,7 +37,6 @@ protected:
m_io_wheel(*this, "WHEEL")
{ }
virtual void device_post_load() override ATTR_COLD;
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;

View File

@ -181,15 +181,6 @@ void gx400_base_state::charram_w(offs_t offset, uint16_t data, uint16_t mem_mask
}
void gx400_base_state::device_post_load()
{
for (int i = 0; i < 8; i++)
{
m_gfxdecode->gfx(i)->mark_all_dirty();
}
}
void gx400_base_state::video_start()
{
m_spriteram_words = m_spriteram.bytes() / 2;

View File

@ -64,15 +64,15 @@ protected:
uint16_t m_CPUA_register = 0;
uint16_t m_CPUB_register = 0;
bool m_is_fround = false;
uint16_t m_sprite_buffer[0x800]{};
uint16_t m_sprite_buffer[0x800] { };
emu_timer *m_sprite_timer = nullptr;
int m_sprite_busy = 0;
int m_need_process_spriteram = 0;
uint16_t m_scrollx[3]{};
uint16_t m_scrolly[3]{};
uint16_t m_scrollx[3] { };
uint16_t m_scrolly[3] { };
uint16_t m_video_register = 0;
tilemap_t *m_fixed_tmap = nullptr;
tilemap_t *m_scroll_tmap[2]{};
tilemap_t *m_scroll_tmap[2] { };
void CPUA_register_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void CPUB_register_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
@ -108,15 +108,14 @@ protected:
void spriteram_process();
void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
int spriteram_process_enable();
void twin16_postload();
};
class fround_state : public twin16_state
{
public:
fround_state(const machine_config &mconfig, device_type type, const char *tag)
: twin16_state(mconfig, type, tag)
{}
fround_state(const machine_config &mconfig, device_type type, const char *tag) :
twin16_state(mconfig, type, tag)
{ }
void fround(machine_config &config);
@ -131,15 +130,15 @@ private:
virtual void video_start() override ATTR_COLD;
virtual void tile_get_info(tile_data &tileinfo, uint16_t data, int color_base) override;
uint8_t m_gfx_bank[4]{};
uint8_t m_gfx_bank[4] { };
};
class cuebrickj_state : public twin16_state
{
public:
cuebrickj_state(const machine_config &mconfig, device_type type, const char *tag)
: twin16_state(mconfig, type, tag)
{}
cuebrickj_state(const machine_config &mconfig, device_type type, const char *tag) :
twin16_state(mconfig, type, tag)
{ }
void cuebrickj(machine_config &config);

View File

@ -17,8 +17,6 @@
#include "twin16.h"
enum
{
TWIN16_SCREEN_FLIPY = 0x01,
@ -64,11 +62,6 @@ void twin16_state::zipram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
m_gfxdecode->gfx(1)->mark_dirty(offset / 16);
}
void twin16_state::twin16_postload()
{
m_gfxdecode->gfx(1)->mark_all_dirty();
}
void fround_state::gfx_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
int changed = 0;
@ -103,12 +96,12 @@ void twin16_state::video_register_w(offs_t offset, uint16_t data, uint16_t mem_m
case 0:
{
int old = m_video_register;
COMBINE_DATA( &m_video_register );
COMBINE_DATA(&m_video_register);
int changed = old ^ m_video_register;
if (changed & (TWIN16_SCREEN_FLIPX | TWIN16_SCREEN_FLIPY))
{
int flip = (m_video_register&TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
flip |= (m_video_register&TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
int flip = (m_video_register & TWIN16_SCREEN_FLIPX) ? TILEMAP_FLIPX : 0;
flip |= (m_video_register & TWIN16_SCREEN_FLIPY) ? TILEMAP_FLIPY : 0;
machine().tilemap().set_flip_all(flip);
}
if (changed & TWIN16_TILE_FLIPY)
@ -119,22 +112,22 @@ void twin16_state::video_register_w(offs_t offset, uint16_t data, uint16_t mem_m
break;
}
case 1: COMBINE_DATA( &m_scrollx[0] ); break;
case 2: COMBINE_DATA( &m_scrolly[0] ); break;
case 1: COMBINE_DATA(&m_scrollx[0]); break;
case 2: COMBINE_DATA(&m_scrolly[0]); break;
case 3:
COMBINE_DATA( &m_scrollx[1] );
COMBINE_DATA(&m_scrollx[1]);
m_scroll_tmap[0]->set_scrollx(0, m_scrollx[1]);
break;
case 4:
COMBINE_DATA( &m_scrolly[1] );
COMBINE_DATA(&m_scrolly[1]);
m_scroll_tmap[0]->set_scrolly(0, m_scrolly[1]);
break;
case 5:
COMBINE_DATA( &m_scrollx[2] );
COMBINE_DATA(&m_scrollx[2]);
m_scroll_tmap[1]->set_scrollx(0, m_scrollx[2]);
break;
case 6:
COMBINE_DATA( &m_scrolly[2] );
COMBINE_DATA(&m_scrolly[2]);
m_scroll_tmap[1]->set_scrolly(0, m_scrolly[2]);
break;
@ -200,7 +193,7 @@ TIMER_CALLBACK_MEMBER(twin16_state::sprite_tick)
m_sprite_busy = 0;
}
int twin16_state::set_sprite_timer( )
int twin16_state::set_sprite_timer()
{
if (m_sprite_busy) return 1;
@ -211,7 +204,7 @@ int twin16_state::set_sprite_timer( )
return 0;
}
void twin16_state::spriteram_process( )
void twin16_state::spriteram_process()
{
uint16_t *spriteram16 = m_spriteram->live();
uint16_t dx = m_scrollx[0];
@ -221,17 +214,17 @@ void twin16_state::spriteram_process( )
const uint16_t *finish = &spriteram16[0x1800];
set_sprite_timer();
memset(&spriteram16[0x1800],0xff,0x800*sizeof(uint16_t));
memset(&spriteram16[0x1800], 0xff, 0x800 * sizeof(uint16_t));
while( source<finish )
while (source<finish)
{
uint16_t priority = source[0];
if( priority & 0x8000 )
if (priority & 0x8000)
{
uint16_t *dest = &spriteram16[0x1800|(priority&0xff)<<2];
uint16_t *dest = &spriteram16[0x1800|(priority & 0xff) << 2];
uint32_t xpos = (0x10000*source[4])|source[5];
uint32_t ypos = (0x10000*source[6])|source[7];
uint32_t xpos = (0x10000 * source[4]) | source[5];
uint32_t ypos = (0x10000 * source[6]) | source[7];
/* notes on sprite attributes:
@ -248,11 +241,11 @@ void twin16_state::spriteram_process( )
fround, hpuncher, miaj, cuebrickj, don't use the preprocessor.
*/
uint16_t attributes = 0x8000 | (source[2]&0x03ff); // scale,size,color
uint16_t attributes = 0x8000 | (source[2] & 0x03ff); // scale,size,color
dest[0] = source[3]; /* gfx data */
dest[1] = ((xpos>>8) - dx)&0xffff;
dest[2] = ((ypos>>8) - dy)&0xffff;
dest[1] = ((xpos>>8) - dx) & 0xffff;
dest[2] = ((ypos>>8) - dy) & 0xffff;
dest[3] = attributes;
}
source += 0x50/2;
@ -260,35 +253,36 @@ void twin16_state::spriteram_process( )
m_need_process_spriteram = 0;
}
void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
void twin16_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
const uint16_t *source = 0x1800+m_spriteram->buffer() + 0x800 - 4;
const uint16_t *finish = 0x1800+m_spriteram->buffer();
const uint16_t *source = 0x1800 + m_spriteram->buffer() + 0x800 - 4;
const uint16_t *finish = 0x1800 + m_spriteram->buffer();
for (; source >= finish; source -= 4)
{
uint16_t attributes = source[3];
uint16_t code = source[0];
if((code!=0xffff) && (attributes&0x8000))
if ((code != 0xffff) && (attributes & 0x8000))
{
int xpos = source[1];
int ypos = source[2];
int pal_base = ((attributes&0xf)+0x10)*16;
int height = 16<<((attributes>>6)&0x3);
int width = 16<<((attributes>>4)&0x3);
int pal_base = ((attributes & 0xf) + 0x10) * 16;
int height = 16 << ((attributes >> 6) & 0x3);
int width = 16 << ((attributes >> 4) & 0x3);
const uint16_t *pen_data = nullptr;
int flipy = attributes&0x0200;
int flipx = attributes&0x0100;
int flipy = attributes & 0x0200;
int flipx = attributes & 0x0100;
if( m_is_fround ) {
if (m_is_fround)
{
/* fround board */
pen_data = m_gfxrom;
}
else
{
switch( (code>>12)&0x3 )
switch ((code >> 12) & 0x3)
{
/* bank select */
case 0:
@ -301,7 +295,7 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, co
case 2:
pen_data = m_gfxrom + 0x80000;
if( code&0x4000 ) pen_data += 0x40000;
if (code & 0x4000) pen_data += 0x40000;
break;
case 3:
@ -312,48 +306,48 @@ void twin16_state::draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, co
}
/* some code masking */
if ((height&width) == 64) code &= ~8; // gradius2 ending sequence 64*64
else if ((height&width) == 32) code &= ~3; // devilw 32*32
else if ((height|width) == 48) code &= ~1; // devilw 32*16 / 16*32
if ((height & width) == 64) code &= ~8; // gradius2 ending sequence 64*64
else if ((height & width) == 32) code &= ~3; // devilw 32*32
else if ((height | width) == 48) code &= ~1; // devilw 32*16 / 16*32
pen_data += code*0x40;
pen_data += code * 0x40;
if( m_video_register&TWIN16_SCREEN_FLIPY )
if (m_video_register & TWIN16_SCREEN_FLIPY)
{
if (ypos>65000) ypos=ypos-65536; /* Bit hacky */
ypos = 256-ypos-height;
if (ypos > 65000) ypos = ypos - 65536; /* Bit hacky */
ypos = 256 - ypos - height;
flipy = !flipy;
}
if( m_video_register&TWIN16_SCREEN_FLIPX )
if (m_video_register & TWIN16_SCREEN_FLIPX)
{
if (xpos>65000) xpos=xpos-65536; /* Bit hacky */
xpos = 320-xpos-width;
if (xpos > 65000) xpos = xpos - 65536; /* Bit hacky */
xpos = 320 - xpos - width;
flipx = !flipx;
}
if( xpos>=320 ) xpos -= 65536;
if( ypos>=256 ) ypos -= 65536;
if (xpos >= 320) xpos -= 65536;
if (ypos >= 256) ypos -= 65536;
/* slow slow slow, but it's ok for now */
for( int y=0; y<height; y++, pen_data += width/4 )
for (int y = 0; y < height; y++, pen_data += width/4)
{
int sy = (flipy)?(ypos+height-1-y):(ypos+y);
if( sy>=cliprect.min_y && sy<=cliprect.max_y )
int sy = (flipy) ? (ypos + height - 1 - y) : (ypos + y);
if (sy >= cliprect.min_y && sy <= cliprect.max_y)
{
uint16_t *const dest = &bitmap.pix(sy);
uint8_t *const pdest = &screen.priority().pix(sy);
for( int x=0; x<width; x++ )
for (int x = 0; x < width; x++)
{
int sx = (flipx)?(xpos+width-1-x):(xpos+x);
if( sx>=cliprect.min_x && sx<=cliprect.max_x )
int sx = (flipx) ? (xpos + width - 1 - x) : (xpos + x);
if (sx >= cliprect.min_x && sx <= cliprect.max_x)
{
uint16_t pen = pen_data[x>>2]>>((~x&3)<<2)&0xf;
uint16_t pen = pen_data[x >> 2] >> ((~x & 3) << 2) & 0xf;
if( pen && !(pdest[sx] & TWIN16_SPRITE_OCCUPIED))
if (pen && !(pdest[sx] & TWIN16_SPRITE_OCCUPIED))
{
pdest[sx] |= TWIN16_SPRITE_OCCUPIED;
if (pen==0xf) // shadow
if (pen == 0xf) // shadow
{
if (!(pdest[sx] & TWIN16_BG_NO_SHADOW))
dest[sx] = m_palette->shadow_table()[dest[sx]];
@ -386,8 +380,8 @@ TILE_GET_INFO_MEMBER(twin16_state::fix_tile_info)
int color = (attr >> 9) & 0x0f;
int flags=0;
if (attr&0x2000) flags|=TILE_FLIPX;
if (attr&0x4000) flags|=TILE_FLIPY;
if (attr & 0x2000) flags |= TILE_FLIPX;
if (attr & 0x4000) flags |= TILE_FLIPY;
tileinfo.set(0, code, color, flags);
}
@ -444,7 +438,7 @@ void twin16_state::video_start()
m_palette->set_shadow_factor(0.4); // screenshots estimate
memset(m_sprite_buffer,0xff,0x800*sizeof(uint16_t));
memset(m_sprite_buffer, 0xff, 0x800 * sizeof(uint16_t));
m_video_register = 0;
m_sprite_busy = 0;
m_sprite_timer = timer_alloc(FUNC(twin16_state::sprite_tick),this);
@ -458,9 +452,6 @@ void twin16_state::video_start()
save_item(NAME(m_need_process_spriteram));
save_item(NAME(m_video_register));
save_item(NAME(m_sprite_busy));
if (!m_is_fround)
machine().save().register_postload(save_prepost_delegate(FUNC(twin16_state::twin16_postload), this));
}
void fround_state::video_start()
@ -537,7 +528,7 @@ uint32_t twin16_state::screen_update_twin16(screen_device &screen, bitmap_ind16
break;
}
draw_sprites( screen, bitmap, cliprect );
draw_sprites(screen, bitmap, cliprect);
m_fixed_tmap->draw(screen, bitmap, cliprect, 0);
return 0;
@ -550,19 +541,19 @@ void twin16_state::screen_vblank_twin16(int state)
{
set_sprite_timer();
if (spriteram_process_enable()) {
if (spriteram_process_enable())
{
if (m_need_process_spriteram) spriteram_process();
m_need_process_spriteram = 1;
/* if the sprite preprocessor is used, sprite ram is copied to an external buffer first,
as evidenced by 1-frame sprite lag in gradius2 and devilw otherwise, though there's probably
more to it than that */
memcpy(&m_spriteram->buffer()[0x1800],m_sprite_buffer,0x800*sizeof(uint16_t));
memcpy(m_sprite_buffer,&m_spriteram->live()[0x1800],0x800*sizeof(uint16_t));
memcpy(&m_spriteram->buffer()[0x1800], m_sprite_buffer, 0x800 * sizeof(uint16_t));
memcpy(m_sprite_buffer, &m_spriteram->live()[0x1800], 0x800 * sizeof(uint16_t));
}
else {
else
m_spriteram->copy();
}
// IRQ generation
if (m_CPUA_register & 0x20)

View File

@ -92,6 +92,10 @@ public:
void jr200(machine_config &config);
DECLARE_INPUT_CHANGED_MEMBER(nmi_button);
protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
private:
required_shared_ptr<uint8_t> m_vram;
required_shared_ptr<uint8_t> m_cram;
@ -110,8 +114,6 @@ private:
void jr200_border_col_w(uint8_t data);
uint8_t mn1271_io_r(offs_t offset);
void mn1271_io_w(offs_t offset, uint8_t data);
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
uint32_t screen_update_jr200(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(timer_d_callback);

View File

@ -177,7 +177,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override { m_gfxdecode->gfx(1)->mark_all_dirty(); }
private:
// max stars is more than it needs to be, to allow experimenting with the star generator

View File

@ -133,8 +133,6 @@ private:
void unknown_w(uint8_t data);
void lamps_w(uint8_t data);
void postload();
void gfxram_w(offs_t offset, uint8_t data);
void palette_w(offs_t offset, uint8_t data);
void tileram_w(offs_t offset, uint8_t data);
@ -299,15 +297,9 @@ void trvmadns_state::lamps_w(uint8_t data)
void trvmadns_state::machine_start()
{
machine().save().register_postload(save_prepost_delegate(FUNC(trvmadns_state::postload), this));
m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(trvmadns_state::tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
}
void trvmadns_state::postload()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
}
//**************************************************************************
// MACHINE DEFINTIONS

View File

@ -196,7 +196,8 @@ void namcona1_state::simulate_mcu()
void namcona1_state::write_version_info()
{
static const u16 source[0x8] =
{ /* "NSA-BIOS ver"... */
{
/* "NSA-BIOS ver"... */
0x534e,0x2d41,0x4942,0x534f,0x7620,0x7265,0x2e31,0x3133
};
for (int i = 0; i < 8; i++)
@ -301,11 +302,11 @@ u16 namcona1_state::custom_key_r(offs_t offset)
return 0;
}
return machine().rand()&0xffff;
} /* custom_key_r */
}
void namcona1_state::custom_key_w(u16 data)
{
} /* custom_key_w */
}
/***************************************************************/
@ -357,12 +358,13 @@ int namcona1_state::transfer_dword(u32 dest, u32 source)
return -1;
}
return 0;
} /* transfer_dword */
}
void namcona1_state::blit_setup(int format, int *bytes_per_row, int *pitch, int mode)
{
if (mode == 3)
{ /* TILE DATA */
{
/* TILE DATA */
switch (format)
{
case 0x0001:
@ -385,7 +387,8 @@ void namcona1_state::blit_setup(int format, int *bytes_per_row, int *pitch, int
}
}
else
{ /* SHAPE DATA */
{
/* SHAPE DATA */
switch (format)
{
case 0x00bd: /* Numan Athletics */
@ -428,7 +431,7 @@ void namcona1_state::blit_setup(int format, int *bytes_per_row, int *pitch, int
break;
}
}
} /* blit_setup */
}
void namcona1_state::blit()
{
@ -505,7 +508,7 @@ void namcona1_state::blit()
src_offset = 0;
}
}
} /* blit */
}
void namcona1_state::vreg_w(offs_t offset, u16 data, u16 mem_mask)
{
@ -542,7 +545,7 @@ void namcona1_state::vreg_w(offs_t offset, u16 data, u16 mem_mask)
}
break;
}
} /* vreg_w */
}
/***************************************************************/

View File

@ -64,7 +64,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override;
TIMER_CALLBACK_MEMBER(set_scanline_interrupt);
void scanline_interrupt(int scanline);

View File

@ -41,7 +41,7 @@ void namcona1_state::tilemap_get_info(
tileinfo.set(gfx, tile, color, 0);
tileinfo.mask_data = &m_shaperam[tile << 3];
}
} /* tilemap_get_info */
}
TILE_GET_INFO_MEMBER(namcona1_state::tilemap_get_info0)
{
@ -83,7 +83,7 @@ TILE_GET_INFO_MEMBER(namcona1_state::roz_get_info)
tileinfo.set(gfx, tile, color, 0);
tileinfo.mask_data = &m_shaperam[tile << 3];
}
} /* roz_get_info */
}
/*************************************************************************/
@ -107,7 +107,7 @@ void namcona1_state::videoram_w(offs_t offset, u16 data, u16 mem_mask)
}
}
}
} /* videoram_w */
}
/*************************************************************************/
@ -132,7 +132,8 @@ void namcona1_state::paletteram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_paletteram[offset]);
if (m_vreg[0x8e / 2])
{ /* graphics enabled; update palette immediately */
{
/* graphics enabled; update palette immediately */
update_palette(offset);
}
else
@ -158,7 +159,7 @@ u16 namcona1_state::gfxram_r(offs_t offset)
return m_cgram[offset];
}
return 0x0000;
} /* gfxram_r */
}
void namcona1_state::gfxram_w(offs_t offset, u16 data, u16 mem_mask)
{
@ -186,7 +187,7 @@ void namcona1_state::gfxram_w(offs_t offset, u16 data, u16 mem_mask)
m_gfxdecode->gfx(1)->mark_dirty(offset >> 5);
}
}
} /* gfxram_w */
}
void namcona1_state::video_start()
{
@ -205,12 +206,6 @@ void namcona1_state::video_start()
save_item(NAME(m_shaperam));
save_item(NAME(m_palette_is_dirty));
} /* video_start */
void namcona1_state::device_post_load()
{
for (int i = 0; i < 3; i++)
m_gfxdecode->gfx(i)->mark_all_dirty();
}
@ -268,31 +263,36 @@ void namcona1_state::pdraw_tile(
}
if (sx < clip.min_x)
{ /* clip left */
{
/* clip left */
int pixels = clip.min_x - sx;
sx += pixels;
x_index_base += pixels * dx;
}
if (sy < clip.min_y)
{ /* clip top */
{
/* clip top */
int pixels = clip.min_y - sy;
sy += pixels;
y_index += pixels * dy;
}
/* NS 980211 - fixed incorrect clipping */
if (ex > clip.max_x + 1)
{ /* clip right */
{
/* clip right */
int pixels = ex - clip.max_x - 1;
ex -= pixels;
}
if (ey > clip.max_y + 1)
{ /* clip bottom */
{
/* clip bottom */
int pixels = ey - clip.max_y - 1;
ey -= pixels;
}
if (ex > sx)
{ /* skip if inner loop doesn't draw anything */
{
/* skip if inner loop doesn't draw anything */
for (int y = sy; y < ey; y++)
{
u8 const *const source = source_base + y_index * gfx->rowbytes();
@ -348,7 +348,7 @@ void namcona1_state::pdraw_tile(
y_index += dy;
}
}
} /* pdraw_tile */
}
void namcona1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
@ -358,7 +358,8 @@ void namcona1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c
if (sprite_control & 1) source += 0x400; /* alternate spriteram bank */
for (int which = 0; which < 0x100; which++)
{ /* max 256 sprites */
{
/* max 256 sprites */
int bpp4,palbase;
const u16 ypos = source[0]; /* FHHH---Y YYYYYYYY flipy, height, ypos */
const u16 tile = source[1]; /* O???TTTT TTTTTTTT opaque tile */
@ -423,7 +424,7 @@ void namcona1_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, c
} /* next row */
source += 4;
}
} /* draw_sprites */
}
void namcona1_state::draw_pixel_line(const rectangle &cliprect, u16 *pDest, u8 *pPri, u16 *pSource, const pen_t *paldata)
{
@ -437,7 +438,7 @@ void namcona1_state::draw_pixel_line(const rectangle &cliprect, u16 *pDest, u8 *
if (x+1 >= cliprect.min_x && x+1 <= cliprect.max_x)
pDest[x+1] = paldata[data&0xff];
} /* next x */
} /* draw_pixel_line */
}
void namcona1_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int which, int primask)
{
@ -520,7 +521,7 @@ void namcona1_state::draw_background(screen_device &screen, bitmap_ind16 &bitmap
}
}
}
} /* draw_background */
}
// CRTC safety checks
bool namcona1_state::screen_enabled(const rectangle &cliprect)

View File

@ -3598,12 +3598,12 @@ static const gfx_layout namcos22_cg_layout =
static GFXLAYOUT_RAW(sprite_layout, 32, 32, 32*8, 32*32*8)
static GFXDECODE_START( gfx_namcos22 )
GFXDECODE_ENTRY( nullptr, 0, namcos22_cg_layout, 0, 0x800 )
GFXDECODE_RAM( nullptr, 0, namcos22_cg_layout, 0, 0x800 )
GFXDECODE_ENTRY( "textile", 0, gfx_16x16x8_raw, 0, 0x80 )
GFXDECODE_END
static GFXDECODE_START( gfx_super )
GFXDECODE_ENTRY( nullptr, 0, namcos22_cg_layout, 0, 0x800 )
GFXDECODE_RAM( nullptr, 0, namcos22_cg_layout, 0, 0x800 )
GFXDECODE_ENTRY( "textile", 0, gfx_16x16x8_raw, 0, 0x80 )
GFXDECODE_ENTRY( "sprite", 0, sprite_layout, 0, 0x80 )
GFXDECODE_END
@ -3618,11 +3618,6 @@ void namcos22_state::machine_reset()
m_mcu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
void namcos22_state::device_post_load()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
}
// allow save_item on a non-fundamental type
ALLOW_SAVE_TYPE(namcos22_dsp_upload_state);

View File

@ -275,7 +275,6 @@ protected:
virtual void machine_reset() override ATTR_COLD;
virtual void machine_start() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override;
void namcos22_textram_w(offs_t offset, u32 data, u32 mem_mask = ~0);
u16 namcos22_tilemapattr_r(offs_t offset);

View File

@ -6117,12 +6117,12 @@ static const gfx_layout namcos23_cg_layout =
static GFXLAYOUT_RAW(namcos23_sprite_layout, 32, 32, 32*8, 32*32*8)
static GFXDECODE_START( gfx_namcos23 )
GFXDECODE_ENTRY( nullptr, 0, namcos23_cg_layout, 0, 0x800 )
GFXDECODE_RAM( nullptr, 0, namcos23_cg_layout, 0, 0x800 )
GFXDECODE_ENTRY( "textile", 0, gfx_16x16x8_raw, 0, 0x80 )
GFXDECODE_END
static GFXDECODE_START( gfx_gorgon )
GFXDECODE_ENTRY( nullptr, 0, namcos23_cg_layout, 0, 0x800 )
GFXDECODE_RAM( nullptr, 0, namcos23_cg_layout, 0, 0x800 )
GFXDECODE_ENTRY( "textile", 0, gfx_16x16x8_raw, 0, 0x80 )
GFXDECODE_ENTRY( "sprites", 0, namcos23_sprite_layout, 0, 0x80 )
GFXDECODE_END

View File

@ -952,8 +952,8 @@ static const gfx_layout pc88va_kanji_16x16 =
static GFXDECODE_START( gfx_pc88va )
GFXDECODE_ENTRY( "kanji", 0x00000, pc88va_chars_8x8, 0, 16 )
GFXDECODE_ENTRY( "kanji", 0x00000, pc88va_chars_16x16, 0, 16 )
GFXDECODE_ENTRY( nullptr, 0x00000, pc88va_kanji_8x8, 0, 16 )
GFXDECODE_ENTRY( nullptr, 0x00000, pc88va_kanji_16x16, 0, 16 )
GFXDECODE_RAM( nullptr, 0x00000, pc88va_kanji_8x8, 0, 16 )
GFXDECODE_RAM( nullptr, 0x00000, pc88va_kanji_16x16, 0, 16 )
GFXDECODE_END

View File

@ -35,10 +35,12 @@
****************************************************************************/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/z80sio.h"
#include "bus/centronics/ctronics.h"
#include "bus/rs232/rs232.h"
#include "emupal.h"
#include "screen.h"

View File

@ -2982,11 +2982,6 @@ void coolridr_state::scsp_map(address_map &map)
}
static GFXDECODE_START( gfx_coolridr )
// GFXDECODE_ENTRY( nullptr, 0, tiles16x16_layout, 0, 0x100 )
GFXDECODE_END
static INPUT_PORTS_START( coolridr )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("P1 Coin")
@ -3253,7 +3248,7 @@ void coolridr_state::coolridr(machine_config &config)
io.an_port_callback<5>().set_ioport("AN5");
io.an_port_callback<6>().set_ioport("AN6");
GFXDECODE(config, m_gfxdecode, m_palette, gfx_coolridr);
GFXDECODE(config, m_gfxdecode, m_palette, gfxdecode_device::empty);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(57); // measured at 57.0426Hz

View File

@ -811,19 +811,19 @@ static const gfx_layout charlayout =
static GFXDECODE_START( gfx_segag80r )
GFXDECODE_ENTRY( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_RAM( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_END
static GFXDECODE_START( gfx_spaceod )
GFXDECODE_ENTRY( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x6_planar, 64, 1 )
GFXDECODE_RAM( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x6_planar, 64, 1 )
GFXDECODE_END
static GFXDECODE_START( gfx_monsterb )
GFXDECODE_ENTRY( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x2_planar, 64, 16 )
GFXDECODE_RAM( nullptr, 0x0000, charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, gfx_8x8x2_planar, 64, 16 )
GFXDECODE_END

View File

@ -221,10 +221,6 @@ void macs_state::macs_io(address_map &map)
//map(0xf0, 0xf0).rw(FUNC(macs_state::st0016_dma_r));
}
//static GFXDECODE_START( macs )
// GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 16*4 )
//GFXDECODE_END
static INPUT_PORTS_START( macs_base )
PORT_START("DSW0")
PORT_DIPNAME( 0x01, 0x01, "DSW0 - BIT 1" )

View File

@ -2358,7 +2358,7 @@ static const gfx_layout layout_16x8x8_ram =
};
static GFXDECODE_START( gfx_eaglshot )
GFXDECODE_ENTRY( nullptr, 0, layout_16x8x8_ram, 0, 0x8000/64 ) // [0] Sprites (256 colors, decoded from RAM)
GFXDECODE_RAM( nullptr, 0, layout_16x8x8_ram, 0, 0x8000/64 ) // [0] Sprites (256 colors, decoded from RAM)
GFXDECODE_END
static GFXDECODE_START( gfx_gdfs )

View File

@ -772,18 +772,18 @@ static const gfx_layout charlayout_memory =
static GFXDECODE_START( gfx_sasuke )
GFXDECODE_ENTRY( nullptr, 0x1000, swapcharlayout, 0, 4 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( "gfx1", 0x0000, swapcharlayout, 4*4, 4 )
GFXDECODE_RAM( nullptr, 0x1000, swapcharlayout, 0, 4 )
GFXDECODE_ENTRY( "gfx1", 0x0000, swapcharlayout, 4*4, 4 )
GFXDECODE_END
static GFXDECODE_START( gfx_satansat )
GFXDECODE_ENTRY( nullptr, 0x1000, charlayout_memory, 0, 4 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 4*4, 4 )
GFXDECODE_RAM( nullptr, 0x1000, charlayout_memory, 0, 4 )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 4*4, 4 )
GFXDECODE_END
static GFXDECODE_START( gfx_vanguard )
GFXDECODE_ENTRY( nullptr, 0x1000, charlayout_memory, 0, 8 ) /* the game dynamically modifies this */
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 8*4, 8 )
GFXDECODE_RAM( nullptr, 0x1000, charlayout_memory, 0, 8 )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 8*4, 8 )
GFXDECODE_END

View File

@ -90,7 +90,6 @@ protected:
TIMER_DEVICE_CALLBACK_MEMBER(sasuke_update_counter);
void sasuke_start_counter();
void postload();
void sasuke_map(address_map &map) ATTR_COLD;
void satansat_map(address_map &map) ATTR_COLD;

View File

@ -168,12 +168,6 @@ VIDEO_START_MEMBER(snk6502_state,snk6502)
m_fg_tilemap->set_transparent_pen(0);
m_gfxdecode->gfx(0)->set_source(m_charram);
machine().save().register_postload(save_prepost_delegate(FUNC(snk6502_state::postload), this));
}
void snk6502_state::postload()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
}
VIDEO_START_MEMBER(snk6502_state,pballoon)
@ -290,5 +284,4 @@ VIDEO_START_MEMBER(snk6502_state,satansat)
m_fg_tilemap->set_transparent_pen(0);
m_gfxdecode->gfx(0)->set_source(m_charram);
machine().save().register_postload(save_prepost_delegate(FUNC(snk6502_state::postload), this));
}

View File

@ -303,8 +303,8 @@ static const gfx_layout layout_6bpp_tile_hi =
};
static GFXDECODE_START( gfx_2mindril )
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_RAM( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) // dynamically modified
GFXDECODE_RAM( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) // dynamically modified
GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) // low 4bpp of 6bpp sprite data
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) // low 4bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, layout_6bpp_tile_hi, 0x0000, 0x2000>>4 ) // hi 2bpp of 6bpp tilemap data

View File

@ -395,8 +395,8 @@ static const gfx_layout layout_6bpp_tile_hi = {
};
static GFXDECODE_START( gfx_taito_f3 )
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) /* Dynamically modified */
GFXDECODE_RAM( nullptr, 0, charlayout, 0x0000, 0x0400>>4 ) // dynamically modified
GFXDECODE_RAM( nullptr, 0, pivotlayout, 0x0000, 0x400>>4 ) // dynamically modified
GFXDECODE_ENTRY( "sprites", 0, gfx_16x16x4_packed_lsb, 0x1000, 0x1000>>4 ) // low 4bpp of 6bpp sprite data
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0x0000, 0x2000>>4 ) // low 4bpp of 6bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, layout_6bpp_tile_hi, 0x0000, 0x2000>>4 ) // hi 2bpp of 6bpp tilemap data
@ -513,9 +513,9 @@ static const gfx_layout bubsympb_layout_5bpp_tile_hi = {
static GFXDECODE_START( gfx_bubsympb )
GFXDECODE_ENTRY( nullptr, 0, charlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( nullptr, 0, pivotlayout, 0, 64 ) /* Dynamically modified */
GFXDECODE_ENTRY( "sprites", 0, bubsympb_sprite_layout, 4096, 256 ) /* Sprites area (6bpp planar) */
GFXDECODE_RAM( nullptr, 0, charlayout, 0, 64 ) // dynamically modified
GFXDECODE_RAM( nullptr, 0, pivotlayout, 0, 64 ) // dynamically modified
GFXDECODE_ENTRY( "sprites", 0, bubsympb_sprite_layout, 4096, 256 ) /* sprites area (6bpp planar) */
GFXDECODE_ENTRY( "tilemap", 0, gfx_16x16x4_packed_lsb, 0, 512 ) // low 4bpp of 5bpp tilemap data
GFXDECODE_ENTRY( "tilemap_hi", 0, bubsympb_layout_5bpp_tile_hi, 0, 512 ) // hi 1bpp of 5bpp tilemap data
GFXDECODE_ENTRY( "sprites", 0, bubsympb_sprite_layout, 4096, 256 ) // dummy gfx duplicate for avoid crash

View File

@ -347,15 +347,11 @@ const taito_f3_state::F3config taito_f3_state::f3_config_table[] = {
{ POPNPOP, 1, 1 },
{ LANDMAKR, 1, 1 },
{ TMDRILL, 1, 0 },
{0}
{ 0 }
};
void taito_f3_state::device_post_load()
{
// force a reread of the dynamic tiles in the pixel layer
m_gfxdecode->gfx(0)->mark_all_dirty();
m_gfxdecode->gfx(1)->mark_all_dirty();
// refresh tile usage indexes
std::fill_n(*m_tilemap_row_usage, 32 * 8, 0);
std::fill_n(m_textram_row_usage, 64, 0);

View File

@ -1739,10 +1739,10 @@ static const gfx_layout spritelayout =
static GFXDECODE_START( gfx_taitosj )
GFXDECODE_ENTRY( nullptr, 0x9000, charlayout, 0, 8 ) // the game dynamically modifies this
GFXDECODE_ENTRY( nullptr, 0x9000, spritelayout, 0, 8 ) // the game dynamically modifies this
GFXDECODE_ENTRY( nullptr, 0xa800, charlayout, 0, 8 ) // the game dynamically modifies this
GFXDECODE_ENTRY( nullptr, 0xa800, spritelayout, 0, 8 ) // the game dynamically modifies this
GFXDECODE_RAM( nullptr, 0x9000, charlayout, 0, 8 )
GFXDECODE_RAM( nullptr, 0x9000, spritelayout, 0, 8 )
GFXDECODE_RAM( nullptr, 0xa800, charlayout, 0, 8 )
GFXDECODE_RAM( nullptr, 0xa800, spritelayout, 0, 8 )
GFXDECODE_END
static const discrete_dac_r1_ladder taitosj_dacvol_ladder =

View File

@ -61,7 +61,6 @@ protected:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override;
private:
required_shared_ptr_array<uint8_t, 3> m_videoram;

View File

@ -161,14 +161,6 @@ void taitosj_state::compute_draw_order()
}
}
void taitosj_state::device_post_load()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
m_gfxdecode->gfx(1)->mark_all_dirty();
m_gfxdecode->gfx(2)->mark_all_dirty();
m_gfxdecode->gfx(3)->mark_all_dirty();
}
void taitosj_state::video_start()
{
m_sprite_layer_collbitmap1.allocate(16, 16);

View File

@ -835,7 +835,7 @@ GFXDECODE_END
static GFXDECODE_START( gfx_roundup5 )
GFXDECODE_ENTRY( "sprites", 0, spritelayout, 1024, 256)
GFXDECODE_ENTRY( nullptr, 0, roundup5_vramlayout, 0, 16)
GFXDECODE_RAM( nullptr, 0, roundup5_vramlayout, 0, 16)
GFXDECODE_END
static GFXDECODE_START( gfx_cyclwarr )

View File

@ -86,8 +86,6 @@ protected:
virtual void machine_reset() override ATTR_COLD;
virtual void video_start() override ATTR_COLD;
virtual void device_post_load() override ATTR_COLD;
void fixeight_68k_mem(address_map &map) ATTR_COLD;
void fixeight_v25_mem(address_map &map) ATTR_COLD;
@ -284,12 +282,6 @@ void fixeight_state::tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask)
}
}
void fixeight_state::device_post_load()
{
if (m_tx_gfxram != nullptr)
m_gfxdecode->gfx(0)->mark_all_dirty();
}
static INPUT_PORTS_START( fixeight )
// The Suicide buttons are technically P1 and P2 Button 3, but we hook
@ -512,7 +504,7 @@ static const gfx_layout truxton2_tx_tilelayout =
static GFXDECODE_START( gfx )
GFXDECODE_ENTRY( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 )
GFXDECODE_RAM( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 )
GFXDECODE_END
static GFXDECODE_START( gfx_textrom )

View File

@ -790,7 +790,7 @@ static const gfx_layout batrider_tx_tilelayout =
};
static GFXDECODE_START( gfx_batrider )
GFXDECODE_ENTRY( nullptr, 0, batrider_tx_tilelayout, 64*16, 64 )
GFXDECODE_RAM( nullptr, 0, batrider_tx_tilelayout, 64*16, 64 )
GFXDECODE_END

View File

@ -58,7 +58,6 @@ protected:
u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void create_tx_tilemap(int dx = 0, int dx_flipped = 0);
virtual void device_post_load() override;
void screen_vblank(int state);
void tx_gfxram_w(offs_t offset, u16 data, u16 mem_mask = ~0);
@ -101,12 +100,6 @@ private:
---- ---x xxxx xxxx = X scroll for each line
*/
void truxton2_state::device_post_load()
{
m_gfxdecode->gfx(0)->mark_all_dirty();
}
TILE_GET_INFO_MEMBER(truxton2_state::get_text_tile_info)
{
const u16 attrib = m_tx_videoram[tile_index];
@ -317,7 +310,7 @@ static const gfx_layout truxton2_tx_tilelayout =
static GFXDECODE_START( gfx )
GFXDECODE_ENTRY( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 )
GFXDECODE_RAM( nullptr, 0, truxton2_tx_tilelayout, 64*16, 64 )
GFXDECODE_END

View File

@ -317,12 +317,12 @@ static const gfx_layout char_rom_layout =
};
static GFXDECODE_START( gfx_tiamc1 )
GFXDECODE_ENTRY( nullptr, 0x0000, char_layout, 0, 16 )
GFXDECODE_RAM( nullptr, 0x0000, char_layout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, sprites16x16_layout, 0, 16 )
GFXDECODE_END
static GFXDECODE_START( gfx_kot )
GFXDECODE_ENTRY( nullptr, 0x0000, char_rom_layout, 0, 16 )
GFXDECODE_RAM( nullptr, 0x0000, char_rom_layout, 0, 16 )
GFXDECODE_ENTRY( "gfx1", 0x0000, sprites16x16_layout, 0, 16 )
GFXDECODE_END

View File

@ -221,7 +221,6 @@ TILE_GET_INFO_MEMBER(f1gp2_state::get_roz_tile_info)
***************************************************************************/
void f1gp_state::video_start()
{
m_roz_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(f1gp_state::get_roz_tile_info)), TILEMAP_SCAN_ROWS, 16, 16, 64, 64);
@ -361,6 +360,7 @@ uint32_t f1gp2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
return 0;
}
/***************************************************************************
BOOTLEG SUPPORT