Remove AM_SIZE entirely. AM_BASE_SIZE still exists, though.

This commit is contained in:
Aaron Giles 2012-04-11 23:14:33 +00:00
parent 4407afdb54
commit 5352ec77d8
6 changed files with 13 additions and 32 deletions

View File

@ -748,9 +748,6 @@ void _class :: _name(address_map &map, const device_t &device) \
#define AM_SIZE_LEGACY(_size) \
curentry->set_sizeptr(_size); \
#define AM_SIZE(_member) \
curentry->set_member_sizeptr(myoffsetof(drivdata_class, _member)); \
// common shortcuts
#define AM_ROMBANK(_bank) AM_READ_BANK(_bank)
@ -764,7 +761,7 @@ void _class :: _name(address_map &map, const device_t &device) \
#define AM_RAM_WRITE_LEGACY(_write) AM_READONLY AM_WRITE_LEGACY(_write)
#define AM_RAM_DEVWRITE_LEGACY(_tag, _write) AM_READONLY AM_DEVWRITE_LEGACY(_tag, _write)
#define AM_BASE_SIZE(_base, _size) AM_BASE(_base) AM_SIZE(_size)
#define AM_BASE_SIZE(_base, _size) AM_BASE(_base) curentry->set_member_sizeptr(myoffsetof(drivdata_class, _size));

View File

@ -182,22 +182,6 @@
Specifies a pointer to a pointer to the base of the memory backing
the current bucket.
AM_SIZE(size)
Specifies a pointer to a size_t variable which will be filled in
with the size, in bytes, of the current bucket.
AM_BASE_MEMBER(struct, basefield)
AM_SIZE_MEMBER(struct, sizefield)
Specifies a field within a given struct as where to store the base
or size of the current bucket. The struct is assumed to be hanging
off of the machine.driver_data pointer.
AM_BASE_GENERIC(basefield)
AM_SIZE_GENERIC(sizefield)
Specifies a field within the global generic_pointers struct as
where to store the base or size of the current bucket. The global
generic_pointer struct lives in machine.generic.
***************************************************************************/
#include <list>

View File

@ -56,15 +56,16 @@ class safarir_state : public driver_device
public:
safarir_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) ,
m_bg_scroll(*this, "bg_scroll"){ }
m_bg_scroll(*this, "bg_scroll"),
m_ram(*this, "ram") { }
UINT8 *m_ram_1;
UINT8 *m_ram_2;
size_t m_ram_size;
UINT8 m_ram_bank;
tilemap_t *m_bg_tilemap;
tilemap_t *m_fg_tilemap;
required_shared_ptr<UINT8> m_bg_scroll;
required_shared_ptr<UINT8> m_ram;
UINT8 m_port_last;
UINT8 m_port_last2;
samples_device *m_samples;
@ -316,15 +317,15 @@ static MACHINE_START( safarir )
{
safarir_state *state = machine.driver_data<safarir_state>();
state->m_ram_1 = auto_alloc_array(machine, UINT8, state->m_ram_size);
state->m_ram_2 = auto_alloc_array(machine, UINT8, state->m_ram_size);
state->m_ram_1 = auto_alloc_array(machine, UINT8, state->m_ram.bytes());
state->m_ram_2 = auto_alloc_array(machine, UINT8, state->m_ram.bytes());
state->m_port_last = 0;
state->m_port_last2 = 0;
state->m_samples = machine.device<samples_device>("samples");
/* setup for save states */
state->save_pointer(NAME(state->m_ram_1), state->m_ram_size);
state->save_pointer(NAME(state->m_ram_2), state->m_ram_size);
state->save_pointer(NAME(state->m_ram_1), state->m_ram.bytes());
state->save_pointer(NAME(state->m_ram_2), state->m_ram.bytes());
state->save_item(NAME(state->m_ram_bank));
state->save_item(NAME(state->m_port_last));
state->save_item(NAME(state->m_port_last2));
@ -340,7 +341,7 @@ static MACHINE_START( safarir )
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, safarir_state )
AM_RANGE(0x0000, 0x17ff) AM_ROM
AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SIZE(m_ram_size)
AM_RANGE(0x2000, 0x27ff) AM_READWRITE(ram_r, ram_w) AM_SHARE("ram")
AM_RANGE(0x2800, 0x2800) AM_MIRROR(0x03ff) AM_READNOP AM_WRITE(ram_bank_w)
AM_RANGE(0x2c00, 0x2cff) AM_MIRROR(0x03ff) AM_READNOP AM_WRITEONLY AM_SHARE("bg_scroll")
AM_RANGE(0x3000, 0x30ff) AM_MIRROR(0x03ff) AM_WRITE(safarir_audio_w) /* goes to SN76477 */

View File

@ -1336,7 +1336,7 @@ static ADDRESS_MAP_START( batrider_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM
// actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA
AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size)
AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") AM_SIZE(m_paletteram_size)
AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size)
AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size)
AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size)
@ -1366,7 +1366,7 @@ static ADDRESS_MAP_START( bbakraid_68k_mem, AS_PROGRAM, 16, toaplan2_state )
AM_RANGE(0x000000, 0x1fffff) AM_ROM
// actually 200000 - 20ffff is probably all main RAM, and the text and palette RAM are written via DMA
AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(toaplan2_txvideoram16_w) AM_BASE_SIZE(m_txvideoram16, m_tx_vram_size)
AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram") AM_SIZE(m_paletteram_size)
AM_RANGE(0x202000, 0x202fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x203000, 0x2031ff) AM_RAM_WRITE(toaplan2_txvideoram16_offs_w) AM_BASE_SIZE(m_txvideoram16_offs, m_tx_offs_vram_size)
AM_RANGE(0x203200, 0x2033ff) AM_RAM_WRITE(toaplan2_txscrollram16_w) AM_BASE_SIZE(m_txscrollram16, m_tx_scroll_vram_size)
AM_RANGE(0x203400, 0x207fff) AM_RAM AM_BASE_SIZE(m_mainram16, m_mainram_overlap_size)

View File

@ -45,7 +45,6 @@ public:
size_t m_tx_vram_size;
size_t m_tx_offs_vram_size;
size_t m_tx_scroll_vram_size;
size_t m_paletteram_size;
size_t m_mainram_overlap_size;
bitmap_ind8 m_custom_priority_bitmap;

View File

@ -260,8 +260,8 @@ WRITE16_MEMBER(toaplan2_state::batrider_textdata_dma_w)
memcpy(dest, m_txvideoram16, m_tx_vram_size);
dest += (m_tx_vram_size/2);
memcpy(dest, m_generic_paletteram_16, m_paletteram_size);
dest += (m_paletteram_size/2);
memcpy(dest, m_generic_paletteram_16, m_generic_paletteram_16.bytes());
dest += (m_generic_paletteram_16.bytes()/2);
memcpy(dest, m_txvideoram16_offs, m_tx_offs_vram_size);
dest += (m_tx_offs_vram_size/2);
memcpy(dest, m_txscrollram16, m_tx_scroll_vram_size);