(MESS) isa_cga.c: Reduced ioport tagmap lookups. (nw)

This commit is contained in:
Wilbert Pol 2013-01-31 21:52:05 +00:00
parent 52033de933
commit 0609a5cee5
2 changed files with 7 additions and 3 deletions

View File

@ -143,10 +143,10 @@ INPUT_PORTS_END
/* Dipswitch for font selection */
#define CGA_FONT (ioport("cga_config")->read() & m_font_selection_mask)
#define CGA_FONT (m_cga_config->read() & m_font_selection_mask)
/* Dipswitch for monitor selection */
#define CGA_MONITOR (ioport("cga_config")->read()&0x1C)
#define CGA_MONITOR (m_cga_config->read()&0x1C)
#define CGA_MONITOR_RGB 0x00 /* Colour RGB */
#define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */
#define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */
@ -156,7 +156,7 @@ INPUT_PORTS_END
/* Dipswitch for chipset selection */
/* TODO: Get rid of this; these should be handled by separate classes */
#define CGA_CHIPSET (ioport("cga_config")->read() & 0xE0)
#define CGA_CHIPSET (m_cga_config->read() & 0xE0)
#define CGA_CHIPSET_IBM 0x00 /* Original IBM CGA */
#define CGA_CHIPSET_PC1512 0x20 /* PC1512 CGA subset */
#define CGA_CHIPSET_PC200 0x40 /* PC200 in CGA mode */
@ -679,6 +679,7 @@ const rom_entry *isa8_cga_device::device_rom_region() const
isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_CGA, "IBM Color/Graphics Monitor Adapter", tag, owner, clock),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
m_vram_size( 0x4000 )
{
m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;
@ -690,6 +691,7 @@ isa8_cga_device::isa8_cga_device(const machine_config &mconfig, const char *tag,
isa8_cga_device::isa8_cga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, type, name, tag, owner, clock),
device_isa8_card_interface(mconfig, *this),
m_cga_config(*this, "cga_config"),
m_vram_size( 0x4000 )
{
m_chr_gen_offset[0] = m_chr_gen_offset[2] = 0x1800;

View File

@ -34,6 +34,8 @@ public:
virtual const rom_entry *device_rom_region() const;
protected:
required_ioport m_cga_config;
// device-level overrides
virtual void device_start();
virtual void device_reset();