sn74s262: Implement device_gfx_interface

This commit is contained in:
Curt Coder 2023-03-28 21:21:25 +03:00
parent fca33ea1cf
commit 234907ae34
3 changed files with 37 additions and 5 deletions

View File

@ -18,13 +18,39 @@ DEFINE_DEVICE_TYPE(SN74S262, sn74s262_device, "sn74s262", "SN74S262N Row Output
DEFINE_DEVICE_TYPE(SN74S263, sn74s263_device, "sn74s263", "SN74S263N Row Output Character Generator")
//-------------------------------------------------
// gfx_layout charlayout
//-------------------------------------------------
const gfx_layout sn74s262_device::charlayout =
{
6, 10,
128,
1,
{ 0 },
{ 0, 1, 2, 3, 4, 5 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
10*8
};
//-------------------------------------------------
// GFXDECODE( sn74s262 )
//-------------------------------------------------
GFXDECODE_MEMBER( sn74s262_device::gfxinfo )
GFXDECODE_DEVICE("chargen", 0, charlayout, 0, 1 ) // normal characters
GFXDECODE_DEVICE("chargen", 0x500, charlayout, 0, 1 ) // graphics characters
GFXDECODE_END
//-------------------------------------------------
// ROM( sn74s262 )
//-------------------------------------------------
ROM_START( sn74s262 )
ROM_REGION( 0xa00, "chargen", 0 )
ROM_LOAD( "sn74s262.h2", 0x000, 0xa00, NO_DUMP )
ROM_LOAD( "sn74s262", 0x000, 0xa00, NO_DUMP )
ROM_END
@ -34,7 +60,7 @@ ROM_END
ROM_START( sn74s263 )
ROM_REGION( 0xa00, "chargen", 0 )
ROM_LOAD( "sn74s263.h2", 0x000, 0xa00, BAD_DUMP CRC(9e064e91) SHA1(354783c8f2865f73dc55918c9810c66f3aca751f) ) // created by hand
ROM_LOAD( "sn74s263", 0x000, 0xa00, BAD_DUMP CRC(9e064e91) SHA1(354783c8f2865f73dc55918c9810c66f3aca751f) ) // created by hand
ROM_END
@ -73,6 +99,7 @@ void sn74s262_device::device_start()
sn74s262_device::sn74s262_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
device_gfx_interface(mconfig, *this, gfxinfo),
m_char_rom(*this, "chargen")
{
}

View File

@ -31,7 +31,8 @@
// ======================> sn74s262_device
class sn74s262_device : public device_t
class sn74s262_device : public device_t,
public device_gfx_interface
{
public:
// construction/destruction
@ -49,6 +50,9 @@ protected:
virtual const tiny_rom_entry *device_rom_region() const override;
private:
static const gfx_layout charlayout;
DECLARE_GFXDECODE_MEMBER(gfxinfo);
required_region_ptr<uint8_t> m_char_rom;
};

View File

@ -161,11 +161,12 @@ uint32_t abc80_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
void abc80_state::abc80_video(machine_config &config)
{
SN74S263(config, m_rocg, 0);
PALETTE(config, m_palette, palette_device::MONOCHROME);
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_screen_update(FUNC(abc80_state::screen_update));
m_screen->set_raw(XTAL(11'980'800)/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART);
PALETTE(config, m_palette, palette_device::MONOCHROME);
SN74S263(config, m_rocg, 0);
m_rocg->set_palette(m_palette);
}