Skip to content

Commit

Permalink
bus/isa/svga_tseng: add ET4000/W32i variant
Browse files Browse the repository at this point in the history
  • Loading branch information
angelosa committed Nov 16, 2024
1 parent f0080fc commit 0ad4341
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/devices/bus/isa/isa_cards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ void pc_isa16_cards(device_slot_interface &device)
device.option_add("pvga1a_jk", ISA16_PVGA1A_JK);
device.option_add("svga_et4k", ISA16_SVGA_ET4K);
device.option_add("svga_et4k_kasan16", ISA16_SVGA_ET4K_KASAN16);
device.option_add("svga_et4kw32i", ISA16_SVGA_ET4K_W32I);
device.option_add("wd90c00_jk", ISA16_WD90C00_JK);
device.option_add("wd90c11_lr", ISA16_WD90C11_LR);
device.option_add("wd90c30_lr", ISA16_WD90C30_LR);
Expand Down
129 changes: 90 additions & 39 deletions src/devices/bus/isa/svga_tseng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@
#include "emu.h"
#include "svga_tseng.h"


//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************

DEFINE_DEVICE_TYPE(ISA16_SVGA_ET4K, isa16_svga_et4k_device, "et4000", "SVGA Tseng ET4000AX Graphics Card")
DEFINE_DEVICE_TYPE(ISA16_SVGA_ET4K_KASAN16, isa16_svga_et4k_kasan16_device, "et4000_kasan16", "SVGA Kasan Hangulmadang-16 ET4000AX Graphics Card")
DEFINE_DEVICE_TYPE(ISA16_SVGA_ET4K_W32I, isa16_svga_et4k_w32i_device, "et4kw32i", "SVGA Tseng ET4000/W32i Graphics Card")

//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------

/*
* (tseng labs famous et4000 isa vga card (oem))
* ROM_LOAD("et4000b.bin", 0xc0000, 0x8000, CRC(a903540d) SHA1(unknown) )
Expand All @@ -21,20 +34,17 @@
* ROM_LOAD("et4000.bin.other", 0xc0000, 0x8000, CRC(f01e4be0) SHA1(95d75ff41bcb765e50bd87a8da01835fd0aa01d5) )
*/
ROM_START( et4000 )
ROM_REGION(0x8000,"et4000", 0)
ROM_REGION(0x8000,"vga_rom", 0)
ROM_SYSTEM_BIOS(0, "v801x", "Tseng Version 8.01X 04/07/93")
ROMX_LOAD("et4000.bin", 0x00000, 0x8000, CRC(f1e817a8) SHA1(945d405b0fb4b8f26830d495881f8587d90e5ef9), ROM_BIOS(0) )
ROM_SYSTEM_BIOS(1, "v800x", "ColorImage Version 8.00X 09/18/90")
ROMX_LOAD("cvet4kax.bin", 0x00000, 0x8000, CRC(a3ab496c) SHA1(8644b4178cd0e841139bfa06c9da493dd74d22e8), ROM_BIOS(1) )
ROM_END

//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************

DEFINE_DEVICE_TYPE(ISA16_SVGA_ET4K, isa16_svga_et4k_device, "et4000", "SVGA Tseng ET4000AX Graphics Card")
DEFINE_DEVICE_TYPE(ISA16_SVGA_ET4K_KASAN16, isa16_svga_et4k_kasan16_device, "et4000_kasan16", "SVGA Kasan Hangulmadang-16 ET4000AX Graphics Card")

const tiny_rom_entry *isa16_svga_et4k_device::device_rom_region() const
{
return ROM_NAME( et4000 );
}

//-------------------------------------------------
// device_add_mconfig - add device configuration
Expand All @@ -51,15 +61,6 @@ void isa16_svga_et4k_device::device_add_mconfig(machine_config &config)
m_vga->set_vram_size(0x100000);
}

//-------------------------------------------------
// rom_region - device-specific ROM region
//-------------------------------------------------

const tiny_rom_entry *isa16_svga_et4k_device::device_rom_region() const
{
return ROM_NAME( et4000 );
}

//**************************************************************************
// LIVE DEVICE
//**************************************************************************
Expand Down Expand Up @@ -89,9 +90,8 @@ void isa16_svga_et4k_device::device_start()
{
set_isa_device();

map_io();
map_ram();
map_rom();
remap(AS_PROGRAM, 0, 0xfffff);
remap(AS_IO, 0, 0x3ff);
}

//-------------------------------------------------
Expand All @@ -111,33 +111,18 @@ void isa16_svga_et4k_device::remap(int space_id, offs_t start, offs_t end)
{
if (space_id == AS_PROGRAM)
{
map_ram();
map_rom();
m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_w)));
m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga_rom");
}
else if (space_id == AS_IO)
map_io();
m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_et4k_device::io_isa_map);
}

void isa16_svga_et4k_device::io_isa_map(address_map &map)
{
map(0x00, 0x2f).m(m_vga, FUNC(tseng_vga_device::io_map));
}

void isa16_svga_et4k_device::map_io()
{
m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_et4k_device::io_isa_map);
}

void isa16_svga_et4k_device::map_ram()
{
m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_w)));
}

void isa16_svga_et4k_device::map_rom()
{
m_isa->install_rom(this, 0xc0000, 0xc7fff, "et4000");
}

/*
* Korean cards
*
Expand All @@ -151,7 +136,7 @@ isa16_svga_et4k_kasan16_device::isa16_svga_et4k_kasan16_device(const machine_con
}

ROM_START( kasan16 )
ROM_REGION(0x8000,"et4000", 0)
ROM_REGION(0x8000,"vga_rom", 0)
ROM_SYSTEM_BIOS(0, "v802x", "Version 8.02X 06/13/90, Kasan BIOS Ver 1.0a 05/01/91")
ROMX_LOAD("et4000_kasan16.bin", 0x00000, 0x8000, CRC(57bcc3ad) SHA1(a55e7eb27ef2b4f118ea2028835e88988f07cf57), ROM_BIOS(0) )

Expand All @@ -163,3 +148,69 @@ const tiny_rom_entry *isa16_svga_et4k_kasan16_device::device_rom_region() const
{
return ROM_NAME( kasan16 );
}

/*
* ET4000/w32i
*/

isa16_svga_et4k_w32i_device::isa16_svga_et4k_w32i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ISA16_SVGA_ET4K_W32I, tag, owner, clock)
, device_isa16_card_interface(mconfig, *this)
, m_vga(*this, "vga")
{
}


ROM_START( et4kw32i )
ROM_REGION(0x8000,"vga_rom", 0)
ROM_SYSTEM_BIOS(0, "v800n", "Tseng Version 8.00N 04/28/95")
ROMX_LOAD("et4kw32i.vbi", 0x00000, 0x8000, CRC(14542962) SHA1(d5aee7205af8bd1fef0ecf1db2c07308a2b10b17), ROM_BIOS(0) )
ROM_END

const tiny_rom_entry *isa16_svga_et4k_w32i_device::device_rom_region() const
{
return ROM_NAME( et4kw32i );
}

void isa16_svga_et4k_w32i_device::device_add_mconfig(machine_config &config)
{
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(25.175_MHz_XTAL, 800, 0, 640, 524, 0, 480);
screen.set_screen_update(m_vga, FUNC(tseng_vga_device::screen_update));

// TODO: bump me up
TSENG_VGA(config, m_vga, 0);
m_vga->set_screen("screen");
m_vga->set_vram_size(0x400000);
}

void isa16_svga_et4k_w32i_device::device_start()
{
set_isa_device();

remap(AS_PROGRAM, 0, 0xfffff);
remap(AS_IO, 0, 0x3ff);
}

void isa16_svga_et4k_w32i_device::device_reset()
{
}

void isa16_svga_et4k_w32i_device::remap(int space_id, offs_t start, offs_t end)
{
if (space_id == AS_PROGRAM)
{
m_isa->install_memory(0xa0000, 0xbffff, read8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_r)), write8sm_delegate(*m_vga, FUNC(tseng_vga_device::mem_w)));
m_isa->install_rom(this, 0xc0000, 0xc7fff, "vga_rom");
}
else if (space_id == AS_IO)
{
m_isa->install_device(0x03b0, 0x03df, *this, &isa16_svga_et4k_w32i_device::io_isa_map);
}
}

void isa16_svga_et4k_w32i_device::io_isa_map(address_map &map)
{
map(0x00, 0x2f).m(m_vga, FUNC(tseng_vga_device::io_map));
}

27 changes: 24 additions & 3 deletions src/devices/bus/isa/svga_tseng.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class isa16_svga_et4k_device :
void io_isa_map(address_map &map) ATTR_COLD;

private:
void map_io();
void map_ram();
void map_rom();
required_device<tseng_vga_device> m_vga;
};

Expand All @@ -63,8 +60,32 @@ class isa16_svga_et4k_kasan16_device :
required_region_ptr<uint8_t> m_hangul_rom;
};

class isa16_svga_et4k_w32i_device :
public device_t,
public device_isa16_card_interface
{
public:
isa16_svga_et4k_w32i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

virtual void remap(int space_id, offs_t start, offs_t end) override;

protected:
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;

void io_isa_map(address_map &map) ATTR_COLD;

private:
required_device<tseng_vga_device> m_vga;
};


// device type definition
DECLARE_DEVICE_TYPE(ISA16_SVGA_ET4K, isa16_svga_et4k_device)
DECLARE_DEVICE_TYPE(ISA16_SVGA_ET4K_KASAN16, isa16_svga_et4k_kasan16_device)
DECLARE_DEVICE_TYPE(ISA16_SVGA_ET4K_W32I, isa16_svga_et4k_w32i_device)

#endif // MAME_BUS_ISA_SVGA_TSENG_H
6 changes: 4 additions & 2 deletions src/devices/video/pc_vga_tseng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
* - ET4000AX
* \- No logging whatsoever;
* \- Unsupported True Color modes, also "Return current video mode failed" in VESA24_2 test;
* - ET4000/W32 (2d accelerator)
* - ET4000/W32p (PCI version)
* - ET4000/W32i (2d accelerator)
* - ET4000/W32p (PCI version of above)
* - ET6000/ET6100
*
*/

Expand Down Expand Up @@ -272,3 +273,4 @@ void tseng_vga_device::mem_w(offs_t offset, uint8_t data)
else
vga_device::mem_w(offset,data);
}

0 comments on commit 0ad4341

Please sign in to comment.