(MESS) Tagmap lookup cleanup. (nw)

This commit is contained in:
Curt Coder 2013-01-27 21:29:55 +00:00
parent ad954cd92e
commit 15a2c4ff62
11 changed files with 85 additions and 104 deletions

View File

@ -202,7 +202,7 @@ void abc800_state::bankswitch()
else
{
// BASIC ROM selected
program.install_rom(0x0000, 0x3fff, memregion(Z80_TAG)->base());
program.install_rom(0x0000, 0x3fff, m_rom->base());
}
}
@ -218,7 +218,7 @@ void abc802_state::bankswitch()
if (m_lrs)
{
// ROM and video RAM selected
program.install_rom(0x0000, 0x77ff, memregion(Z80_TAG)->base());
program.install_rom(0x0000, 0x77ff, m_rom->base());
program.install_ram(0x7800, 0x7fff, m_char_ram);
}
else
@ -1077,7 +1077,7 @@ void abc806_state::machine_start()
m_ctc_timer->adjust(attotime::from_hz(ABC800_X01/2/2/2), 0, attotime::from_hz(ABC800_X01/2/2/2));
// setup memory banking
UINT8 *mem = memregion(Z80_TAG)->base();
UINT8 *mem = m_rom->base();
UINT32 videoram_size = m_ram->size() - (32 * 1024);
int bank;
char bank_name[10];
@ -1348,9 +1348,6 @@ ROM_START( abc800c )
ROM_LOAD( "abc 6-1.2k", 0x6000, 0x1000, CRC(4bd5e808) SHA1(5ca0a60571de6cfa3d6d166e0cde3c78560569f3) ) // 1981-01-12
ROM_LOAD( "abc 7-22.2j", 0x7000, 0x1000, CRC(774511ab) SHA1(5171e43213a402c2d96dee33453c8306ac1aafc8) )
ROM_REGION( 0x1000, "gfx1", 0 )
ROM_LOAD( "saa5052.5c", 0x0140, 0x08c0, BAD_DUMP CRC(cda3bf79) SHA1(cf5ea94459c09001d422dadc212bc970b4b4aa20) )
ROM_REGION( 0x20, "hru", 0 )
ROM_LOAD( "hru i.4g", 0x0000, 0x0020, CRC(d970a972) SHA1(c47fdd61fccc68368d42f03a01c7af90ab1fe1ab) )
@ -1476,7 +1473,7 @@ DIRECT_UPDATE_MEMBER( abc800c_state::direct_update_handler )
{
if (address >= 0x7c00 && address < 0x8000)
{
direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, memregion(Z80_TAG)->base() + 0x7c00);
direct.explicit_configure(0x7c00, 0x7fff, 0x3ff, m_rom->base() + 0x7c00);
if (!m_fetch_charram)
{
@ -1510,7 +1507,7 @@ DIRECT_UPDATE_MEMBER( abc800m_state::direct_update_handler )
{
if (address >= 0x7800 && address < 0x8000)
{
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800);
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800);
if (!m_fetch_charram)
{
@ -1546,7 +1543,7 @@ DIRECT_UPDATE_MEMBER( abc802_state::direct_update_handler )
{
if (address >= 0x7800 && address < 0x8000)
{
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800);
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800);
return ~0;
}
}
@ -1568,7 +1565,7 @@ DIRECT_UPDATE_MEMBER( abc806_state::direct_update_handler )
{
if (address >= 0x7800 && address < 0x8000)
{
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, memregion(Z80_TAG)->base() + 0x7800);
direct.explicit_configure(0x7800, 0x7fff, 0x7ff, m_rom->base() + 0x7800);
if (!m_fetch_charram)
{

View File

@ -129,7 +129,7 @@ UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int
}
if (!charom)
{
data = m_charom[offset & 0xfff];
data = m_charom->base()[offset & 0xfff];
}
if (!io)
{
@ -1104,7 +1104,6 @@ void c64_state::machine_start()
// find memory regions
m_basic = memregion("basic")->base();
m_kernal = memregion("kernal")->base();
m_charom = memregion("charom")->base();
// allocate memory
m_color_ram.allocate(0x400);

View File

@ -197,11 +197,11 @@ READ8_MEMBER( cbm2_state::read )
}
if (!basiccs || !knbcs)
{
data = m_basic[offset & 0x3fff];
data = m_basic->base()[offset & 0x3fff];
}
if (!kernalcs)
{
data = m_kernal[offset & 0x1fff];
data = m_kernal->base()[offset & 0x1fff];
}
if (!crtccs)
{
@ -587,15 +587,15 @@ UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, in
}
if (!basiclocs || !basichics)
{
data = m_basic[offset & 0x3fff];
data = m_basic->base()[offset & 0x3fff];
}
if (!kernalcs)
{
data = m_kernal[offset & 0x1fff];
data = m_kernal->base()[offset & 0x1fff];
}
if (!charomcs && !vsysaden && !viddaten && viddat_tr)
{
data = m_charom[offset & 0xfff];
data = m_charom->base()[offset & 0xfff];
}
if (!viccs && !viddaten && viddat_tr)
{
@ -779,7 +779,7 @@ READ8_MEMBER( p500_state::vic_videoram_r )
}
if (!charomcs)
{
data = m_charom[offset & 0xfff];
data = m_charom->base()[offset & 0xfff];
}
}
@ -1089,7 +1089,7 @@ static MC6845_UPDATE_ROW( crtc_update_row )
{
UINT8 code = state->m_video_ram[(ma + column) & 0x7ff];
offs_t char_rom_addr = (ma & 0x1000) | (state->m_graphics << 11) | ((code & 0x7f) << 4) | (ra & 0x0f);
UINT8 data = state->m_charom[char_rom_addr & 0xfff];
UINT8 data = state->m_charom->base()[char_rom_addr & 0xfff];
for (int bit = 0; bit < 9; bit++)
{
@ -1945,11 +1945,6 @@ void cbm2_state::device_timer(emu_timer &timer, device_timer_id id, int param, v
MACHINE_START_MEMBER( cbm2_state, cbm2 )
{
// find memory regions
m_basic = memregion("basic")->base();
m_kernal = memregion("kernal")->base();
m_charom = memregion("charom")->base();
// allocate memory
m_video_ram.allocate(m_video_ram_size);
m_buffer_ram.allocate(0x800);

View File

@ -181,13 +181,13 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
switch (m_addr & 0x03)
{
case CS0_BASIC:
data = m_kernal[offset & 0x7fff];
data = m_kernal->base()[offset & 0x7fff];
break;
case CS0_FUNCTION_LO:
if (m_function != NULL)
{
data = m_function[offset & 0x7fff];
data = m_function->base()[offset & 0x7fff];
}
break;
@ -200,7 +200,7 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
if (m_c2 != NULL)
{
data = m_c2[offset & 0x7fff];
data = m_c2->base()[offset & 0x7fff];
}
break;
}
@ -209,20 +209,20 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
{
if (kernal)
{
data = m_kernal[offset & 0x7fff];
data = m_kernal->base()[offset & 0x7fff];
}
else
{
switch ((m_addr >> 2) & 0x03)
{
case CS1_KERNAL:
data = m_kernal[offset & 0x7fff];
data = m_kernal->base()[offset & 0x7fff];
break;
case CS1_FUNCTION_HI:
if (m_function != NULL)
{
data = m_function[offset & 0x7fff];
data = m_function->base()[offset & 0x7fff];
}
break;
@ -235,7 +235,7 @@ UINT8 plus4_state::read_memory(address_space &space, offs_t offset, int ba, int
if (m_c2 != NULL)
{
data = m_c2[offset & 0x7fff];
data = m_c2->base()[offset & 0x7fff];
}
break;
}
@ -814,19 +814,6 @@ void plus4_state::machine_start()
{
cbm_common_init();
// find memory regions
m_kernal = memregion("kernal")->base();
if (memregion("function") != NULL)
{
m_function = memregion("function")->base();
}
if (memregion("c2") != NULL)
{
m_c2 = memregion("c2")->base();
}
// initialize memory
UINT8 data = 0xff;
@ -841,6 +828,8 @@ void plus4_state::machine_start()
save_item(NAME(m_ted_irq));
save_item(NAME(m_acia_irq));
save_item(NAME(m_exp_irq));
save_item(NAME(m_port6529));
save_item(NAME(m_keyline));
}

View File

@ -78,6 +78,7 @@ public:
m_discrete(*this, "discrete"),
m_cassette(*this, CASSETTE_TAG),
m_ram(*this, RAM_TAG),
m_rom(*this, Z80_TAG),
m_video_ram(*this, "video_ram"),
m_char_ram(*this, "char_ram"),
m_ctc_z0(0),
@ -96,6 +97,9 @@ public:
optional_device<discrete_sound_device> m_discrete;
optional_device<cassette_image_device> m_cassette;
required_device<ram_device> m_ram;
required_memory_region m_rom;
optional_shared_ptr<UINT8> m_video_ram;
optional_shared_ptr<UINT8> m_char_ram;
enum
{
@ -133,10 +137,6 @@ public:
int m_fetch_charram; // opcode fetched from character RAM region (0x7800-0x7fff)
// video state
optional_shared_ptr<UINT8> m_video_ram;
optional_shared_ptr<UINT8> m_char_ram;
const UINT8 *m_char_rom; // character generator ROM
const UINT8 *m_fgctl_prom; // foreground control PROM
UINT8 m_hrs; // HR picture start scanline
UINT8 m_fgctl; // HR foreground control
@ -165,10 +165,14 @@ class abc800m_state : public abc800_state
public:
abc800m_state(const machine_config &mconfig, device_type type, const char *tag)
: abc800_state(mconfig, type, tag),
m_crtc(*this, MC6845_TAG)
m_crtc(*this, MC6845_TAG),
m_fgctl_prom(*this, "hru2"),
m_char_rom(*this, MC6845_TAG)
{ }
required_device<mc6845_device> m_crtc;
required_memory_region m_fgctl_prom;
required_memory_region m_char_rom;
DECLARE_DRIVER_INIT(driver_init);
@ -184,10 +188,12 @@ class abc800c_state : public abc800_state
public:
abc800c_state(const machine_config &mconfig, device_type type, const char *tag)
: abc800_state(mconfig, type, tag),
m_trom(*this, SAA5052_TAG)
m_trom(*this, SAA5052_TAG),
m_fgctl_prom(*this, "hru2")
{ }
required_device<saa5052_device> m_trom;
required_memory_region m_fgctl_prom;
DECLARE_DRIVER_INIT(driver_init);
@ -208,11 +214,13 @@ public:
abc802_state(const machine_config &mconfig, device_type type, const char *tag)
: abc800_state(mconfig, type, tag),
m_crtc(*this, MC6845_TAG),
m_abc77(*this, ABC77_TAG)
m_abc77(*this, ABC77_TAG),
m_char_rom(*this, MC6845_TAG)
{ }
required_device<mc6845_device> m_crtc;
optional_device<abc77_device> m_abc77;
required_memory_region m_char_rom;
DECLARE_DRIVER_INIT(driver_init);
virtual void machine_start();
@ -233,8 +241,6 @@ public:
int m_lrs; // low RAM select
// video state
const UINT8 *m_char_rom; // character generator ROM
int m_flshclk_ctr; // flash clock counter
int m_flshclk; // flash clock
int m_80_40_mux; // 40/80 column mode
@ -250,12 +256,18 @@ public:
: abc800_state(mconfig, type, tag),
m_crtc(*this, MC6845_TAG),
m_rtc(*this, E0516_TAG),
m_abc77(*this, ABC77_TAG)
m_abc77(*this, ABC77_TAG),
m_rad_prom(*this, "rad"),
m_hru2_prom(*this, "hru"),
m_char_rom(*this, MC6845_TAG)
{ }
required_device<mc6845_device> m_crtc;
required_device<e0516_device> m_rtc;
optional_device<abc77_device> m_abc77;
required_memory_region m_rad_prom;
required_memory_region m_hru2_prom;
required_memory_region m_char_rom;
DECLARE_DRIVER_INIT(driver_init);
virtual void machine_start();
@ -292,9 +304,6 @@ public:
// video state
UINT8 *m_color_ram; // attribute RAM
const UINT8 *m_rad_prom; // line address PROM
const UINT8 *m_hru2_prom; // HR palette PROM
const UINT8 *m_char_rom; // character generator ROM
int m_txoff; // text display enable
int m_40; // 40/80 column mode

View File

@ -48,6 +48,8 @@ public:
m_user(*this, C64_USER_PORT_TAG),
m_ram(*this, RAM_TAG),
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
m_charom(*this, "charom"),
m_color_ram(*this, "color_ram"),
m_row0(*this, "ROW0"),
m_row1(*this, "ROW1"),
m_row2(*this, "ROW2"),
@ -61,7 +63,6 @@ public:
m_loram(1),
m_hiram(1),
m_charen(1),
m_color_ram(*this, "color_ram"),
m_va14(1),
m_va15(1),
m_cia1_irq(CLEAR_LINE),
@ -86,6 +87,8 @@ public:
required_device<c64_user_port_device> m_user;
required_device<ram_device> m_ram;
optional_device<pet_datassette_port_device> m_cassette;
required_memory_region m_charom;
optional_shared_ptr<UINT8> m_color_ram;
optional_ioport m_row0;
optional_ioport m_row1;
optional_ioport m_row2;
@ -144,10 +147,8 @@ public:
int m_charen;
UINT8 *m_basic;
UINT8 *m_kernal;
UINT8 *m_charom;
// video state
optional_shared_ptr<UINT8> m_color_ram;
int m_va14;
int m_va15;

View File

@ -70,6 +70,16 @@ public:
m_ram(*this, RAM_TAG),
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
m_ieee(*this, IEEE488_TAG),
m_ext_cpu(*this, EXT_I8088_TAG),
m_ext_pic(*this, EXT_I8259A_TAG),
m_ext_cia(*this, EXT_MOS6526_TAG),
m_ext_tpi(*this, EXT_MOS6525_TAG),
m_basic(*this, "basic"),
m_kernal(*this, "kernal"),
m_charom(*this, "charom"),
m_buffer_ram(*this, "buffer_ram"),
m_extbuf_ram(*this, "extbuf_ram"),
m_video_ram(*this, "video_ram"),
m_pa0(*this, "PA0"),
m_pa1(*this, "PA1"),
m_pa2(*this, "PA2"),
@ -87,14 +97,7 @@ public:
m_pb6(*this, "PB6"),
m_pb7(*this, "PB7"),
m_lock(*this, "LOCK"),
m_ext_cpu(*this, EXT_I8088_TAG),
m_ext_pic(*this, EXT_I8259A_TAG),
m_ext_cia(*this, EXT_MOS6526_TAG),
m_ext_tpi(*this, EXT_MOS6525_TAG),
m_buffer_ram(*this, "buffer_ram"),
m_extbuf_ram(*this, "extbuf_ram"),
m_dramon(1),
m_video_ram(*this, "video_ram"),
m_video_ram_size(0x800),
m_graphics(1),
m_todclk(0),
@ -122,6 +125,16 @@ public:
required_device<ram_device> m_ram;
required_device<pet_datassette_port_device> m_cassette;
required_device<ieee488_device> m_ieee;
optional_device<cpu_device> m_ext_cpu;
optional_device<pic8259_device> m_ext_pic;
optional_device<mos6526_device> m_ext_cia;
optional_device<tpi6525_device> m_ext_tpi;
required_memory_region m_basic;
required_memory_region m_kernal;
required_memory_region m_charom;
optional_shared_ptr<UINT8> m_buffer_ram;
optional_shared_ptr<UINT8> m_extbuf_ram;
optional_shared_ptr<UINT8> m_video_ram;
required_ioport m_pa0;
required_ioport m_pa1;
required_ioport m_pa2;
@ -140,11 +153,6 @@ public:
required_ioport m_pb7;
required_ioport m_lock;
optional_device<cpu_device> m_ext_cpu;
optional_device<pic8259_device> m_ext_pic;
optional_device<mos6526_device> m_ext_cia;
optional_device<tpi6525_device> m_ext_tpi;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
DECLARE_MACHINE_START( cbm2 );
@ -199,17 +207,11 @@ public:
DECLARE_WRITE8_MEMBER( ext_cia_pb_w );
// memory state
optional_shared_ptr<UINT8> m_buffer_ram;
optional_shared_ptr<UINT8> m_extbuf_ram;
UINT8 *m_basic;
UINT8 *m_kernal;
UINT8 *m_charom;
int m_dramon;
int m_busen1;
int m_busy2;
// video state
optional_shared_ptr<UINT8> m_video_ram;
size_t m_video_ram_size;
int m_graphics;
int m_ntsc;
@ -261,6 +263,7 @@ public:
required_device<pls100_device> m_pla2;
required_device<mos6566_device> m_vic;
optional_shared_ptr<UINT8> m_color_ram;
DECLARE_MACHINE_START( p500 );
DECLARE_MACHINE_START( p500_ntsc );
@ -297,7 +300,6 @@ public:
DECLARE_WRITE8_MEMBER( tpi2_pc_w );
// video state
optional_shared_ptr<UINT8> m_color_ram;
int m_statvid;
int m_vicdotsel;
int m_vicbnksel;

View File

@ -45,8 +45,9 @@ public:
m_user(*this, PLUS4_USER_PORT_TAG),
m_ram(*this, RAM_TAG),
m_cassette(*this, PET_DATASSETTE_PORT_TAG),
m_function(NULL),
m_c2(NULL),
m_kernal(*this, "kernal"),
m_function(*this, "function"),
m_c2(*this, "c2"),
m_addr(0),
m_ted_irq(CLEAR_LINE),
m_acia_irq(CLEAR_LINE),
@ -65,6 +66,9 @@ public:
optional_device<plus4_user_port_device> m_user;
required_device<ram_device> m_ram;
required_device<pet_datassette_port_device> m_cassette;
required_memory_region m_kernal;
optional_memory_region m_function;
optional_memory_region m_c2;
virtual void machine_start();
virtual void machine_reset();
@ -95,9 +99,6 @@ public:
DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
// memory state
const UINT8 *m_kernal;
const UINT8 *m_function;
const UINT8 *m_c2;
UINT8 m_addr;
// interrupt state

View File

@ -94,7 +94,7 @@ void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for (int dot = 0; dot < 4; dot++)
{
UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
UINT8 fgctl = m_fgctl_prom[fgctl_addr];
UINT8 fgctl = m_fgctl_prom->base()[fgctl_addr];
int color = fgctl & 0x07;
if (color)
@ -126,10 +126,6 @@ void abc800c_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
void abc800_state::video_start()
{
// find memory regions
m_char_rom = memregion(MC6845_TAG)->base();
m_fgctl_prom = memregion("hru2")->base();
// register for state saving
save_item(NAME(m_hrs));
save_item(NAME(m_fgctl));
@ -215,7 +211,7 @@ void abc800m_state::hr_update(bitmap_rgb32 &bitmap, const rectangle &cliprect)
for (int dot = 0; dot < 4; dot++)
{
UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
int color = (m_fgctl_prom[fgctl_addr] & 0x07) ? 1 : 0;
int color = (m_fgctl_prom->base()[fgctl_addr] & 0x07) ? 1 : 0;
bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color];
bitmap.pix32(y, x++) = RGB_MONOCHROME_YELLOW[color];
@ -247,7 +243,7 @@ static MC6845_UPDATE_ROW( abc800m_update_row )
int bit;
UINT16 address = (state->m_char_ram[(ma + column) & 0x7ff] << 4) | (ra & 0x0f);
UINT8 data = (state->m_char_rom[address & 0x7ff] & 0x3f);
UINT8 data = (state->m_char_rom->base()[address & 0x7ff] & 0x3f);
if (column == cursor_x)
{
@ -301,7 +297,7 @@ UINT32 abc800m_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
screen.set_visible_area(0, 767, 0, 311);
// clear screen
bitmap.fill(get_black_pen(machine()), cliprect);
bitmap.fill(RGB_BLACK, cliprect);
// draw HR graphics
hr_update(bitmap, cliprect);

View File

@ -93,7 +93,7 @@ static MC6845_UPDATE_ROW( abc802_update_row )
address |= 0x800;
}
data = state->m_char_rom[(address + ra_latch) & 0xfff];
data = state->m_char_rom->base()[(address + ra_latch) & 0xfff];
if (data & ABC802_ATE)
{
@ -209,9 +209,6 @@ static MC6845_INTERFACE( crtc_intf )
void abc802_state::video_start()
{
// find memory regions
m_char_rom = memregion(MC6845_TAG)->base();
// register for state saving
save_item(NAME(m_flshclk_ctr));
save_item(NAME(m_flshclk));

View File

@ -140,7 +140,7 @@ READ8_MEMBER( abc806_state::cli_r )
*/
UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8);
UINT8 data = m_hru2_prom[hru2_addr] & 0x0f;
UINT8 data = m_hru2_prom->base()[hru2_addr] & 0x0f;
logerror("HRU II %03x : %01x\n", hru2_addr, data);
@ -314,13 +314,13 @@ static MC6845_UPDATE_ROW( abc806_update_row )
else
{
rad_addr = (e6 << 8) | (e5 << 7) | (flash << 6) | (underline << 5) | (state->m_flshclk << 4) | ra;
rad_data = state->m_rad_prom[rad_addr] & 0x0f;
rad_data = state->m_rad_prom->base()[rad_addr] & 0x0f;
rad_data = ra; // HACK because the RAD prom is not dumped yet
}
UINT16 chargen_addr = (th << 12) | (data << 4) | rad_data;
UINT8 chargen_data = state->m_char_rom[chargen_addr & 0xfff] << 2;
UINT8 chargen_data = state->m_char_rom->base()[chargen_addr & 0xfff] << 2;
int x = HORIZONTAL_PORCH_HACK + (column + 4) * ABC800_CHAR_WIDTH;
for (int bit = 0; bit < ABC800_CHAR_WIDTH; bit++)
@ -473,11 +473,6 @@ void abc806_state::video_start()
m_vsync = 1;
m_40 = 1;
// find memory regions
m_char_rom = memregion(MC6845_TAG)->base();
m_rad_prom = memregion("rad")->base();
m_hru2_prom = memregion("hru2")->base();
// allocate memory
m_char_ram.allocate(ABC806_CHAR_RAM_SIZE);
m_color_ram = auto_alloc_array(machine(), UINT8, ABC806_ATTR_RAM_SIZE);