diff options
Diffstat (limited to 'src/mame/drivers/taitowlf.cpp')
-rw-r--r-- | src/mame/drivers/taitowlf.cpp | 116 |
1 files changed, 50 insertions, 66 deletions
diff --git a/src/mame/drivers/taitowlf.cpp b/src/mame/drivers/taitowlf.cpp index b523873d72b..0fa7d7b05f7 100644 --- a/src/mame/drivers/taitowlf.cpp +++ b/src/mame/drivers/taitowlf.cpp @@ -30,13 +30,13 @@ TODO: #include "emu.h" -#define ENABLE_VGA 0 +#define TAITOWLF_ENABLE_VGA 0 #include "cpu/i386/i386.h" #include "machine/lpci.h" #include "machine/pcshare.h" #include "machine/pckeybrd.h" -#if ENABLE_VGA +#if TAITOWLF_ENABLE_VGA #include "video/pc_vga.h" #endif #include "emupal.h" @@ -45,16 +45,21 @@ TODO: class taitowlf_state : public pcat_base_state { public: - taitowlf_state(const machine_config &mconfig, device_type type, const char *tag) - : pcat_base_state(mconfig, type, tag), + taitowlf_state(const machine_config &mconfig, device_type type, const char *tag) : + pcat_base_state(mconfig, type, tag), m_bootscreen_rom(*this, "bootscreen"), m_bank1(*this, "bank1"), - m_palette(*this, "palette") { } + m_palette(*this, "palette") + { } void taitowlf(machine_config &config); void init_taitowlf(); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + private: required_region_ptr<uint8_t> m_bootscreen_rom; required_memory_bank m_bank1; @@ -63,11 +68,9 @@ private: DECLARE_WRITE32_MEMBER(pnp_data_w); DECLARE_WRITE32_MEMBER(bios_ram_w); - virtual void machine_start() override; - virtual void machine_reset() override; - #if !ENABLE_VGA - DECLARE_PALETTE_INIT(taitowlf); - #endif +#if !TAITOWLF_ENABLE_VGA + void taitowlf_palette(palette_device &palette) const; +#endif uint32_t screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void intel82439tx_init(); void taitowlf_io(address_map &map); @@ -87,7 +90,7 @@ private: uint8_t m_piix4_config_reg[4][256]; }; -#if !ENABLE_VGA +#if !TAITOWLF_ENABLE_VGA uint32_t taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int x,y,count; @@ -162,42 +165,33 @@ uint32_t taitowlf_state::intel82439tx_pci_r(int function, int reg, uint32_t mem_ { uint32_t r = 0; if (ACCESSING_BITS_24_31) - { r |= mtxc_config_r(function, reg + 3) << 24; - } + if (ACCESSING_BITS_16_23) - { r |= mtxc_config_r(function, reg + 2) << 16; - } + if (ACCESSING_BITS_8_15) - { r |= mtxc_config_r(function, reg + 1) << 8; - } + if (ACCESSING_BITS_0_7) - { r |= mtxc_config_r(function, reg + 0) << 0; - } + return r; } void taitowlf_state::intel82439tx_pci_w(int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) - { mtxc_config_w(function, reg + 3, (data >> 24) & 0xff); - } + if (ACCESSING_BITS_16_23) - { mtxc_config_w(function, reg + 2, (data >> 16) & 0xff); - } + if (ACCESSING_BITS_8_15) - { mtxc_config_w(function, reg + 1, (data >> 8) & 0xff); - } + if (ACCESSING_BITS_0_7) - { mtxc_config_w(function, reg + 0, (data >> 0) & 0xff); - } } // Intel 82371AB PCI-to-ISA / IDE bridge (PIIX4) @@ -218,42 +212,33 @@ uint32_t taitowlf_state::intel82371ab_pci_r(int function, int reg, uint32_t mem_ { uint32_t r = 0; if (ACCESSING_BITS_24_31) - { r |= piix4_config_r(function, reg + 3) << 24; - } + if (ACCESSING_BITS_16_23) - { r |= piix4_config_r(function, reg + 2) << 16; - } + if (ACCESSING_BITS_8_15) - { r |= piix4_config_r(function, reg + 1) << 8; - } + if (ACCESSING_BITS_0_7) - { r |= piix4_config_r(function, reg + 0) << 0; - } + return r; } void taitowlf_state::intel82371ab_pci_w(int function, int reg, uint32_t data, uint32_t mem_mask) { if (ACCESSING_BITS_24_31) - { piix4_config_w(function, reg + 3, (data >> 24) & 0xff); - } + if (ACCESSING_BITS_16_23) - { piix4_config_w(function, reg + 2, (data >> 16) & 0xff); - } + if (ACCESSING_BITS_8_15) - { piix4_config_w(function, reg + 1, (data >> 8) & 0xff); - } + if (ACCESSING_BITS_0_7) - { piix4_config_w(function, reg + 0, (data >> 0) & 0xff); - } } // ISA Plug-n-Play @@ -287,16 +272,16 @@ WRITE32_MEMBER(taitowlf_state::bios_ram_w) void taitowlf_state::taitowlf_map(address_map &map) { map(0x00000000, 0x0009ffff).ram(); - #if ENABLE_VGA +#if TAITOWLF_ENABLE_VGA map(0x000a0000, 0x000bffff).rw("vga", FUNC(vga_device::mem_r), FUNC(vga_device::mem_w)); - #else +#else map(0x000a0000, 0x000bffff).ram(); - #endif - #if ENABLE_VGA +#endif +#if TAITOWLF_ENABLE_VGA map(0x000c0000, 0x000c7fff).ram().region("video_bios", 0); - #else +#else map(0x000c0000, 0x000c7fff).noprw(); - #endif +#endif map(0x000e0000, 0x000effff).ram(); map(0x000f0000, 0x000fffff).bankr("bank1"); map(0x000f0000, 0x000fffff).w(FUNC(taitowlf_state::bios_ram_w)); @@ -312,13 +297,13 @@ void taitowlf_state::taitowlf_io(address_map &map) map(0x00e8, 0x00eb).noprw(); map(0x0300, 0x03af).noprw(); map(0x0278, 0x027b).w(FUNC(taitowlf_state::pnp_config_w)); - #if ENABLE_VGA +#if TAITOWLF_ENABLE_VGA map(0x03b0, 0x03bf).rw("vga", FUNC(vga_device::port_03b0_r), FUNC(vga_device::port_03b0_w)); map(0x03c0, 0x03cf).rw("vga", FUNC(vga_device::port_03c0_r), FUNC(vga_device::port_03c0_w)); map(0x03d0, 0x03df).rw("vga", FUNC(vga_device::port_03d0_r), FUNC(vga_device::port_03d0_w)); - #else +#else map(0x03b0, 0x03df).noprw(); - #endif +#endif map(0x0a78, 0x0a7b).w(FUNC(taitowlf_state::pnp_data_w)); map(0x0cf8, 0x0cff).rw("pcibus", FUNC(pci_bus_legacy_device::read), FUNC(pci_bus_legacy_device::write)); } @@ -372,15 +357,15 @@ void taitowlf_state::machine_reset() } -#if !ENABLE_VGA +#if !TAITOWLF_ENABLE_VGA /* debug purpose*/ -PALETTE_INIT_MEMBER(taitowlf_state, taitowlf) +void taitowlf_state::taitowlf_palette(palette_device &palette) const { - palette.set_pen_color(0x70,rgb_t(0xff,0xff,0xff)); - palette.set_pen_color(0x71,rgb_t(0xff,0xff,0xff)); - palette.set_pen_color(0x01,rgb_t(0x55,0x00,0x00)); - palette.set_pen_color(0x10,rgb_t(0xaa,0x00,0x00)); - palette.set_pen_color(0x00,rgb_t(0x00,0x00,0x00)); + palette.set_pen_color(0x70, rgb_t(0xff, 0xff, 0xff)); + palette.set_pen_color(0x71, rgb_t(0xff, 0xff, 0xff)); + palette.set_pen_color(0x01, rgb_t(0x55, 0x00, 0x00)); + palette.set_pen_color(0x10, rgb_t(0xaa, 0x00, 0x00)); + palette.set_pen_color(0x00, rgb_t(0x00, 0x00, 0x00)); } #endif @@ -400,9 +385,9 @@ MACHINE_CONFIG_START(taitowlf_state::taitowlf) pcat_common(config); /* video hardware */ - #if ENABLE_VGA +#if TAITOWLF_ENABLE_VGA pcvideo_vga(config); - #else +#else /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) @@ -410,9 +395,8 @@ MACHINE_CONFIG_START(taitowlf_state::taitowlf) MCFG_SCREEN_SIZE(512, 256) MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 0, 256-1) MCFG_SCREEN_UPDATE_DRIVER(taitowlf_state, screen_update_taitowlf) - MCFG_PALETTE_ADD("palette", 256) - MCFG_PALETTE_INIT_OWNER(taitowlf_state, taitowlf) - #endif + PALETTE(config, m_palette, FUNC(taitowlf_state::taitowlf_palette), 256); +#endif MACHINE_CONFIG_END void taitowlf_state::init_taitowlf() @@ -430,11 +414,11 @@ ROM_START(pf2012) ROM_REGION32_LE(0x40000, "bios", 0) ROM_LOAD("p5tx-la.bin", 0x00000, 0x40000, CRC(072e6d51) SHA1(70414349b37e478fc28ecbaba47ad1033ae583b7)) - #if ENABLE_VGA +#if TAITOWLF_ENABLE_VGA ROM_REGION( 0x8000, "video_bios", 0 ) // debug ROM_LOAD16_BYTE( "trident_tgui9680_bios.bin", 0x0000, 0x4000, BAD_DUMP CRC(1eebde64) SHA1(67896a854d43a575037613b3506aea6dae5d6a19) ) ROM_CONTINUE( 0x0001, 0x4000 ) - #endif +#endif ROM_REGION(0x400000, "user3", 0) // Program ROM disk ROM_LOAD("u1.bin", 0x000000, 0x200000, CRC(8f4c09cb) SHA1(0969a92fec819868881683c580f9e01cbedf4ad2)) |