Moved tilemap_memory into a generic memory_array class, since it is

more generally useful than just in tilemaps. Code is now in memarray.*

Converted the Atari RLE motion objects device from a half-assed
device into a full-assed device, leveraging the memory_array class.
This commit is contained in:
Aaron Giles 2013-08-07 03:18:59 +00:00
parent 1e7273341b
commit 2f1e78d892
21 changed files with 1186 additions and 1343 deletions

2
.gitattributes vendored
View File

@ -1503,6 +1503,8 @@ src/emu/mame.h svneol=native#text/plain
src/emu/mcfglgcy.h svneol=native#text/plain
src/emu/mconfig.c svneol=native#text/plain
src/emu/mconfig.h svneol=native#text/plain
src/emu/memarray.c svneol=native#text/plain
src/emu/memarray.h svneol=native#text/plain
src/emu/memory.c svneol=native#text/plain
src/emu/memory.h svneol=native#text/plain
src/emu/network.c svneol=native#text/plain

View File

@ -69,6 +69,7 @@
// memory and address spaces
#include "memory.h"
#include "addrmap.h"
#include "memarray.h"
// machine-wide utilities
#include "romload.h"

View File

@ -89,6 +89,7 @@ EMUOBJS = \
$(EMUOBJ)/mame.o \
$(EMUOBJ)/machine.o \
$(EMUOBJ)/mconfig.o \
$(EMUOBJ)/memarray.o \
$(EMUOBJ)/memory.o \
$(EMUOBJ)/network.o \
$(EMUOBJ)/output.o \

203
src/emu/memarray.c Normal file
View File

@ -0,0 +1,203 @@
/***************************************************************************
memarray.c
Generic memory array accessor helper.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
#include "emu.h"
//**************************************************************************
// MEMORY ARRAY HELPER
//**************************************************************************
//-------------------------------------------------
// memory_array - constructor
//-------------------------------------------------
memory_array::memory_array()
: m_base(NULL),
m_bytes(0),
m_membits(0),
m_bytes_per_entry(0)
{
}
//-------------------------------------------------
// set - configure the parameters
//-------------------------------------------------
void memory_array::set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe)
{
// validate inputs
assert(base != NULL);
assert(bytes > 0);
assert(membits == 8 || membits == 16 || membits == 32 || membits == 64);
assert(bpe == 1 || bpe == 2 || bpe == 4);
// populate direct data
m_base = base;
m_bytes = bytes;
m_membits = membits;
m_endianness = endianness;
m_bytes_per_entry = bpe;
// derive data
switch (bpe*1000 + membits*10 + endianness)
{
case 1*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read8_from_8; m_writer = &memory_array::write8_to_8; break;
case 1*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &memory_array::read8_from_8; m_writer = &memory_array::write8_to_8; break;
case 1*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read8_from_16le; m_writer = &memory_array::write8_to_16le; break;
case 1*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &memory_array::read8_from_16be; m_writer = &memory_array::write8_to_16be; break;
case 1*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read8_from_32le; m_writer = &memory_array::write8_to_32le; break;
case 1*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &memory_array::read8_from_32be; m_writer = &memory_array::write8_to_32be; break;
case 1*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read8_from_64le; m_writer = &memory_array::write8_to_64le; break;
case 1*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &memory_array::read8_from_64be; m_writer = &memory_array::write8_to_64be; break;
case 2*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read16_from_8le; m_writer = &memory_array::write16_to_8le; break;
case 2*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &memory_array::read16_from_8be; m_writer = &memory_array::write16_to_8be; break;
case 2*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read16_from_16; m_writer = &memory_array::write16_to_16; break;
case 2*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &memory_array::read16_from_16; m_writer = &memory_array::write16_to_16; break;
case 2*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read16_from_32le; m_writer = &memory_array::write16_to_32le; break;
case 2*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &memory_array::read16_from_32be; m_writer = &memory_array::write16_to_32be; break;
case 2*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read16_from_64le; m_writer = &memory_array::write16_to_64le; break;
case 2*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &memory_array::read16_from_64be; m_writer = &memory_array::write16_to_64be; break;
case 4*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read32_from_8le; m_writer = &memory_array::write32_to_8le; break;
case 4*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &memory_array::read32_from_8be; m_writer = &memory_array::write32_to_8be; break;
case 4*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read32_from_16le; m_writer = &memory_array::write32_to_16le; break;
case 4*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &memory_array::read32_from_16be; m_writer = &memory_array::write32_to_16be; break;
case 4*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read32_from_32; m_writer = &memory_array::write32_to_32; break;
case 4*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &memory_array::read32_from_32; m_writer = &memory_array::write32_to_32; break;
case 4*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &memory_array::read32_from_64le; m_writer = &memory_array::write32_to_64le; break;
case 4*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &memory_array::read32_from_64be; m_writer = &memory_array::write32_to_64be; break;
default: throw emu_fatalerror("Illegal memory bits/bus width combo in memory_array");
}
}
//-------------------------------------------------
// set - additional setter variants
//-------------------------------------------------
void memory_array::set(const address_space &space, void *base, UINT32 bytes, int bpe)
{
set(base, bytes, space.data_width(), space.endianness(), bpe);
}
void memory_array::set(const memory_share &share, int bpe)
{
set(share.ptr(), share.bytes(), share.width(), share.endianness(), bpe);
}
void memory_array::set(const memory_array &helper)
{
set(helper.base(), helper.bytes(), helper.membits(), helper.endianness(), helper.bytes_per_entry());
}
//-------------------------------------------------
// read8_from_*/write8_to_* - entry read/write
// heleprs for 1 byte-per-entry
//-------------------------------------------------
UINT32 memory_array::read8_from_8(int index) { return reinterpret_cast<UINT8 *>(m_base)[index]; }
void memory_array::write8_to_8(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[index] = data; }
UINT32 memory_array::read8_from_16le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_LE(index)]; }
void memory_array::write8_to_16le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 memory_array::read8_from_16be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_BE(index)]; }
void memory_array::write8_to_16be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_BE(index)] = data; }
UINT32 memory_array::read8_from_32le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)]; }
void memory_array::write8_to_32le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
UINT32 memory_array::read8_from_32be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)]; }
void memory_array::write8_to_32be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
UINT32 memory_array::read8_from_64le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)]; }
void memory_array::write8_to_64le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)] = data; }
UINT32 memory_array::read8_from_64be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)]; }
void memory_array::write8_to_64be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)] = data; }
//-------------------------------------------------
// read16_from_*/write16_to_* - entry read/write
// heleprs for 2 bytes-per-entry
//-------------------------------------------------
UINT32 memory_array::read16_from_8le(int index) { return read8_from_8(index*2) | (read8_from_8(index*2+1) << 8); }
void memory_array::write16_to_8le(int index, UINT32 data) { write8_to_8(index*2, data); write8_to_8(index*2+1, data >> 8); }
UINT32 memory_array::read16_from_8be(int index) { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); }
void memory_array::write16_to_8be(int index, UINT32 data) { write8_to_8(index*2, data >> 8); write8_to_8(index*2+1, data); }
UINT32 memory_array::read16_from_16(int index) { return reinterpret_cast<UINT16 *>(m_base)[index]; }
void memory_array::write16_to_16(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[index] = data; }
UINT32 memory_array::read16_from_32le(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_LE(index)]; }
void memory_array::write16_to_32le(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 memory_array::read16_from_32be(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_BE(index)]; }
void memory_array::write16_to_32be(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_BE(index)] = data; }
UINT32 memory_array::read16_from_64le(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_LE(index)]; }
void memory_array::write16_to_64le(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_LE(index)] = data; }
UINT32 memory_array::read16_from_64be(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_BE(index)]; }
void memory_array::write16_to_64be(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
//-------------------------------------------------
// read32_from_*/write32_to_* - entry read/write
// heleprs for 4 bytes-per-entry
//-------------------------------------------------
UINT32 memory_array::read32_from_8le(int index) { return read16_from_8le(index*2) | (read16_from_8le(index*2+1) << 16); }
void memory_array::write32_to_8le(int index, UINT32 data) { write16_to_8le(index*2, data); write16_to_8le(index*2+1, data >> 16); }
UINT32 memory_array::read32_from_8be(int index) { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); }
void memory_array::write32_to_8be(int index, UINT32 data) { write16_to_8be(index*2, data >> 16); write16_to_8be(index*2+1, data); }
UINT32 memory_array::read32_from_16le(int index) { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); }
void memory_array::write32_to_16le(int index, UINT32 data) { write16_to_16(index*2, data); write16_to_16(index*2+1, data >> 16); }
UINT32 memory_array::read32_from_16be(int index) { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); }
void memory_array::write32_to_16be(int index, UINT32 data) { write16_to_16(index*2, data >> 16); write16_to_16(index*2+1, data); }
UINT32 memory_array::read32_from_32(int index) { return reinterpret_cast<UINT32 *>(m_base)[index]; }
void memory_array::write32_to_32(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[index] = data; }
UINT32 memory_array::read32_from_64le(int index) { return reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_LE(index)]; }
void memory_array::write32_to_64le(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 memory_array::read32_from_64be(int index) { return reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_BE(index)]; }
void memory_array::write32_to_64be(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_BE(index)] = data; }

138
src/emu/memarray.h Normal file
View File

@ -0,0 +1,138 @@
/***************************************************************************
memarray.h
Generic memory array accessor helper.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
****************************************************************************
A memory array in this case is an array of 8, 16, or 32-bit data
arranged logically.
A memory array is stored in "natural" order, i.e., read/writes to it
are done via AM_RAM, or standard COMBINE_DATA, even if the width of
the CPU is different from the array width.
The read_entry/write_entry functions serve to read/write entries of
the configured size regardless of the underlay width of the CPU's
memory system.
***************************************************************************/
#pragma once
#ifndef __EMU_H__
#error Dont include this file directly; include emu.h instead.
#endif
#ifndef __MEMARRAY_H__
#define __MEMARRAY_H__
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> memory_array
// memory information
class memory_array
{
public:
// construction/destruction
memory_array();
memory_array(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe) { set(base, bytes, membits, endianness, bpe); }
memory_array(const address_space &space, void *base, UINT32 bytes, int bpe) { set(space, base, bytes, bpe); }
memory_array(const memory_share &share, int bpe) { set(share, bpe); }
memory_array(const memory_array &helper) { set(helper); }
// configuration
void set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe);
void set(const address_space &space, void *base, UINT32 bytes, int bpe);
void set(const memory_share &share, int bpe);
void set(const memory_array &helper);
// getters
void *base() const { return m_base; }
UINT32 bytes() const { return m_bytes; }
int membits() const { return m_membits; }
endianness_t endianness() const { return m_endianness; }
int bytes_per_entry() const { return m_bytes_per_entry; }
// readers and writers
UINT32 read(int index) { return (this->*m_reader)(index); }
void write(int index, UINT32 data) { (this->*m_writer)(index, data); }
private:
// internal read/write helpers for 1 byte entries
UINT32 read8_from_8(int index); void write8_to_8(int index, UINT32 data);
UINT32 read8_from_16le(int index); void write8_to_16le(int index, UINT32 data);
UINT32 read8_from_16be(int index); void write8_to_16be(int index, UINT32 data);
UINT32 read8_from_32le(int index); void write8_to_32le(int index, UINT32 data);
UINT32 read8_from_32be(int index); void write8_to_32be(int index, UINT32 data);
UINT32 read8_from_64le(int index); void write8_to_64le(int index, UINT32 data);
UINT32 read8_from_64be(int index); void write8_to_64be(int index, UINT32 data);
// internal read/write helpers for 2 byte entries
UINT32 read16_from_8le(int index); void write16_to_8le(int index, UINT32 data);
UINT32 read16_from_8be(int index); void write16_to_8be(int index, UINT32 data);
UINT32 read16_from_16(int index); void write16_to_16(int index, UINT32 data);
UINT32 read16_from_32le(int index); void write16_to_32le(int index, UINT32 data);
UINT32 read16_from_32be(int index); void write16_to_32be(int index, UINT32 data);
UINT32 read16_from_64le(int index); void write16_to_64le(int index, UINT32 data);
UINT32 read16_from_64be(int index); void write16_to_64be(int index, UINT32 data);
// internal read/write helpers for 4 byte entries
UINT32 read32_from_8le(int index); void write32_to_8le(int index, UINT32 data);
UINT32 read32_from_8be(int index); void write32_to_8be(int index, UINT32 data);
UINT32 read32_from_16le(int index); void write32_to_16le(int index, UINT32 data);
UINT32 read32_from_16be(int index); void write32_to_16be(int index, UINT32 data);
UINT32 read32_from_32(int index); void write32_to_32(int index, UINT32 data);
UINT32 read32_from_64le(int index); void write32_to_64le(int index, UINT32 data);
UINT32 read32_from_64be(int index); void write32_to_64be(int index, UINT32 data);
// internal state
void * m_base;
UINT32 m_bytes;
int m_membits;
endianness_t m_endianness;
int m_bytes_per_entry;
UINT32 (memory_array::*m_reader)(int);
void (memory_array::*m_writer)(int, UINT32);
};
#endif // __MEMARRAY_H__

View File

@ -1490,170 +1490,6 @@ void tilemap_t::draw_debug(bitmap_rgb32 &dest, UINT32 scrollx, UINT32 scrolly)
//**************************************************************************
// TILEMAP MEMORY HELPER
//**************************************************************************
//-------------------------------------------------
// tilemap_memory - constructor
//-------------------------------------------------
tilemap_memory::tilemap_memory()
: m_base(NULL),
m_bytes(0),
m_membits(0),
m_bytes_per_entry(0)
{
}
//-------------------------------------------------
// set - configure the parameters
//-------------------------------------------------
void tilemap_memory::set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe)
{
// validate inputs
assert(base != NULL);
assert(bytes > 0);
assert(membits == 8 || membits == 16 || membits == 32 || membits == 64);
assert(bpe == 1 || bpe == 2 || bpe == 4);
// populate direct data
m_base = base;
m_bytes = bytes;
m_membits = membits;
m_endianness = endianness;
m_bytes_per_entry = bpe;
// derive data
switch (bpe*1000 + membits*10 + endianness)
{
case 1*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read8_from_8; m_writer = &tilemap_memory::write8_to_8; break;
case 1*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read8_from_8; m_writer = &tilemap_memory::write8_to_8; break;
case 1*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read8_from_16le; m_writer = &tilemap_memory::write8_to_16le; break;
case 1*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read8_from_16be; m_writer = &tilemap_memory::write8_to_16be; break;
case 1*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read8_from_32le; m_writer = &tilemap_memory::write8_to_32le; break;
case 1*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read8_from_32be; m_writer = &tilemap_memory::write8_to_32be; break;
case 1*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read8_from_64le; m_writer = &tilemap_memory::write8_to_64le; break;
case 1*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read8_from_64be; m_writer = &tilemap_memory::write8_to_64be; break;
case 2*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read16_from_8le; m_writer = &tilemap_memory::write16_to_8le; break;
case 2*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read16_from_8be; m_writer = &tilemap_memory::write16_to_8be; break;
case 2*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read16_from_16; m_writer = &tilemap_memory::write16_to_16; break;
case 2*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read16_from_16; m_writer = &tilemap_memory::write16_to_16; break;
case 2*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read16_from_32le; m_writer = &tilemap_memory::write16_to_32le; break;
case 2*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read16_from_32be; m_writer = &tilemap_memory::write16_to_32be; break;
case 2*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read16_from_64le; m_writer = &tilemap_memory::write16_to_64le; break;
case 2*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read16_from_64be; m_writer = &tilemap_memory::write16_to_64be; break;
case 4*1000 + 8*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read32_from_8le; m_writer = &tilemap_memory::write32_to_8le; break;
case 4*1000 + 8*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read32_from_8be; m_writer = &tilemap_memory::write32_to_8be; break;
case 4*1000 + 16*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read32_from_16le; m_writer = &tilemap_memory::write32_to_16le; break;
case 4*1000 + 16*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read32_from_16be; m_writer = &tilemap_memory::write32_to_16be; break;
case 4*1000 + 32*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read32_from_32; m_writer = &tilemap_memory::write32_to_32; break;
case 4*1000 + 32*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read32_from_32; m_writer = &tilemap_memory::write32_to_32; break;
case 4*1000 + 64*10 + ENDIANNESS_LITTLE: m_reader = &tilemap_memory::read32_from_64le; m_writer = &tilemap_memory::write32_to_64le; break;
case 4*1000 + 64*10 + ENDIANNESS_BIG: m_reader = &tilemap_memory::read32_from_64be; m_writer = &tilemap_memory::write32_to_64be; break;
default: throw emu_fatalerror("Illegal memory bits/bus width combo in tilemap_memory");
}
}
//-------------------------------------------------
// set - additional setter variants
//-------------------------------------------------
void tilemap_memory::set(const address_space &space, void *base, UINT32 bytes, int bpe)
{
set(base, bytes, space.data_width(), space.endianness(), bpe);
}
void tilemap_memory::set(const memory_share &share, int bpe)
{
set(share.ptr(), share.bytes(), share.width(), share.endianness(), bpe);
}
void tilemap_memory::set(const tilemap_memory &helper)
{
set(helper.base(), helper.bytes(), helper.membits(), helper.endianness(), helper.bytes_per_entry());
}
//-------------------------------------------------
// read8_from_*/write8_to_* - entry read/write
// heleprs for 1 byte-per-entry
//-------------------------------------------------
UINT32 tilemap_memory::read8_from_8(int index) { return reinterpret_cast<UINT8 *>(m_base)[index]; }
void tilemap_memory::write8_to_8(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[index] = data; }
UINT32 tilemap_memory::read8_from_16le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_LE(index)]; }
void tilemap_memory::write8_to_16le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 tilemap_memory::read8_from_16be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_BE(index)]; }
void tilemap_memory::write8_to_16be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE_XOR_BE(index)] = data; }
UINT32 tilemap_memory::read8_from_32le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)]; }
void tilemap_memory::write8_to_32le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
UINT32 tilemap_memory::read8_from_32be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)]; }
void tilemap_memory::write8_to_32be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
UINT32 tilemap_memory::read8_from_64le(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)]; }
void tilemap_memory::write8_to_64le(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)] = data; }
UINT32 tilemap_memory::read8_from_64be(int index) { return reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)]; }
void tilemap_memory::write8_to_64be(int index, UINT32 data) { reinterpret_cast<UINT8 *>(m_base)[BYTE8_XOR_BE(index)] = data; }
//-------------------------------------------------
// read16_from_*/write16_to_* - entry read/write
// heleprs for 2 bytes-per-entry
//-------------------------------------------------
UINT32 tilemap_memory::read16_from_8le(int index) { return read8_from_8(index*2) | (read8_from_8(index*2+1) << 8); }
void tilemap_memory::write16_to_8le(int index, UINT32 data) { write8_to_8(index*2, data); write8_to_8(index*2+1, data >> 8); }
UINT32 tilemap_memory::read16_from_8be(int index) { return (read8_from_8(index*2) << 8) | read8_from_8(index*2+1); }
void tilemap_memory::write16_to_8be(int index, UINT32 data) { write8_to_8(index*2, data >> 8); write8_to_8(index*2+1, data); }
UINT32 tilemap_memory::read16_from_16(int index) { return reinterpret_cast<UINT16 *>(m_base)[index]; }
void tilemap_memory::write16_to_16(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[index] = data; }
UINT32 tilemap_memory::read16_from_32le(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_LE(index)]; }
void tilemap_memory::write16_to_32le(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 tilemap_memory::read16_from_32be(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_BE(index)]; }
void tilemap_memory::write16_to_32be(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE_XOR_BE(index)] = data; }
UINT32 tilemap_memory::read16_from_64le(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_LE(index)]; }
void tilemap_memory::write16_to_64le(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_LE(index)] = data; }
UINT32 tilemap_memory::read16_from_64be(int index) { return reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_BE(index)]; }
void tilemap_memory::write16_to_64be(int index, UINT32 data) { reinterpret_cast<UINT16 *>(m_base)[BYTE4_XOR_BE(index)] = data; }
//-------------------------------------------------
// read32_from_*/write32_to_* - entry read/write
// heleprs for 4 bytes-per-entry
//-------------------------------------------------
UINT32 tilemap_memory::read32_from_8le(int index) { return read16_from_8le(index*2) | (read16_from_8le(index*2+1) << 16); }
void tilemap_memory::write32_to_8le(int index, UINT32 data) { write16_to_8le(index*2, data); write16_to_8le(index*2+1, data >> 16); }
UINT32 tilemap_memory::read32_from_8be(int index) { return (read16_from_8be(index*2) << 16) | read16_from_8be(index*2+1); }
void tilemap_memory::write32_to_8be(int index, UINT32 data) { write16_to_8be(index*2, data >> 16); write16_to_8be(index*2+1, data); }
UINT32 tilemap_memory::read32_from_16le(int index) { return read16_from_16(index*2) | (read16_from_16(index*2+1) << 16); }
void tilemap_memory::write32_to_16le(int index, UINT32 data) { write16_to_16(index*2, data); write16_to_16(index*2+1, data >> 16); }
UINT32 tilemap_memory::read32_from_16be(int index) { return (read16_from_16(index*2) << 16) | read16_from_16(index*2+1); }
void tilemap_memory::write32_to_16be(int index, UINT32 data) { write16_to_16(index*2, data >> 16); write16_to_16(index*2+1, data); }
UINT32 tilemap_memory::read32_from_32(int index) { return reinterpret_cast<UINT32 *>(m_base)[index]; }
void tilemap_memory::write32_to_32(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[index] = data; }
UINT32 tilemap_memory::read32_from_64le(int index) { return reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_LE(index)]; }
void tilemap_memory::write32_to_64le(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_LE(index)] = data; }
UINT32 tilemap_memory::read32_from_64be(int index) { return reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_BE(index)]; }
void tilemap_memory::write32_to_64be(int index, UINT32 data) { reinterpret_cast<UINT32 *>(m_base)[BYTE_XOR_BE(index)] = data; }
//**************************************************************************
// TILEMAP MANAGER
//**************************************************************************

View File

@ -434,6 +434,7 @@ enum tilemap_standard_mapper
MCFG_TILEMAP_TRANSPARENT_PEN(_transpen)
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@ -485,73 +486,6 @@ typedef device_delegate<void (tilemap_t &, tile_data &, tilemap_memory_index)> t
typedef device_delegate<tilemap_memory_index (UINT32, UINT32, UINT32, UINT32)> tilemap_mapper_delegate;
// ======================> tilemap_memory
// memory information
class tilemap_memory
{
friend class tilemap_t;
// construction/destruction
tilemap_memory();
public:
// configuration
void set(void *base, UINT32 bytes, int membits, endianness_t endianness, int bpe);
void set(const address_space &space, void *base, UINT32 bytes, int bpe);
void set(const memory_share &share, int bpe);
void set(const tilemap_memory &helper);
// getters
void *base() const { return m_base; }
UINT32 bytes() const { return m_bytes; }
int membits() const { return m_membits; }
endianness_t endianness() const { return m_endianness; }
int bytes_per_entry() const { return m_bytes_per_entry; }
private:
// readers and writers
UINT32 read(int index) { return (this->*m_reader)(index); }
void write(int index, UINT32 data) { (this->*m_writer)(index, data); }
// internal read/write helpers for 1 byte entries
UINT32 read8_from_8(int index); void write8_to_8(int index, UINT32 data);
UINT32 read8_from_16le(int index); void write8_to_16le(int index, UINT32 data);
UINT32 read8_from_16be(int index); void write8_to_16be(int index, UINT32 data);
UINT32 read8_from_32le(int index); void write8_to_32le(int index, UINT32 data);
UINT32 read8_from_32be(int index); void write8_to_32be(int index, UINT32 data);
UINT32 read8_from_64le(int index); void write8_to_64le(int index, UINT32 data);
UINT32 read8_from_64be(int index); void write8_to_64be(int index, UINT32 data);
// internal read/write helpers for 2 byte entries
UINT32 read16_from_8le(int index); void write16_to_8le(int index, UINT32 data);
UINT32 read16_from_8be(int index); void write16_to_8be(int index, UINT32 data);
UINT32 read16_from_16(int index); void write16_to_16(int index, UINT32 data);
UINT32 read16_from_32le(int index); void write16_to_32le(int index, UINT32 data);
UINT32 read16_from_32be(int index); void write16_to_32be(int index, UINT32 data);
UINT32 read16_from_64le(int index); void write16_to_64le(int index, UINT32 data);
UINT32 read16_from_64be(int index); void write16_to_64be(int index, UINT32 data);
// internal read/write helpers for 4 byte entries
UINT32 read32_from_8le(int index); void write32_to_8le(int index, UINT32 data);
UINT32 read32_from_8be(int index); void write32_to_8be(int index, UINT32 data);
UINT32 read32_from_16le(int index); void write32_to_16le(int index, UINT32 data);
UINT32 read32_from_16be(int index); void write32_to_16be(int index, UINT32 data);
UINT32 read32_from_32(int index); void write32_to_32(int index, UINT32 data);
UINT32 read32_from_64le(int index); void write32_to_64le(int index, UINT32 data);
UINT32 read32_from_64be(int index); void write32_to_64be(int index, UINT32 data);
// internal state
void * m_base;
UINT32 m_bytes;
int m_membits;
endianness_t m_endianness;
int m_bytes_per_entry;
UINT32 (tilemap_memory::*m_reader)(int);
void (tilemap_memory::*m_writer)(int, UINT32);
};
// ======================> tilemap_t
// core tilemap structure
@ -589,8 +523,8 @@ public:
tilemap_device *device() const { return m_device; }
tilemap_t *next() const { return m_next; }
void *user_data() const { return m_user_data; }
tilemap_memory &basemem() { return m_basemem; }
tilemap_memory &extmem() { return m_extmem; }
memory_array &basemem() { return m_basemem; }
memory_array &extmem() { return m_extmem; }
UINT32 width() const { return m_width; }
UINT32 height() const { return m_height; }
bool enabled() const { return m_enable; }
@ -712,8 +646,8 @@ private:
void * m_user_data; // user data value
// optional memory info
tilemap_memory m_basemem; // info about base memory
tilemap_memory m_extmem; // info about extension memory
memory_array m_basemem; // info about base memory
memory_array m_extmem; // info about extension memory
// basic tilemap metrics
UINT32 m_rows; // number of tile rows

View File

@ -58,19 +58,10 @@ MACHINE_RESET_MEMBER(atarig1_state,atarig1)
*
*************************************/
WRITE16_MEMBER(atarig1_state::mo_control_w)
{
if (ACCESSING_BITS_0_7)
{
atarirle_control_w(m_rle, data & 7);
}
}
WRITE16_MEMBER(atarig1_state::mo_command_w)
{
COMBINE_DATA(m_mo_command);
atarirle_command_w(m_rle, (data == 0 && m_is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
m_rle->command_write(space, offset, (data == 0 && m_is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -203,7 +194,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0xf88000, 0xf8ffff) AM_WRITE(eeprom_enable_w)
AM_RANGE(0xf90000, 0xf90001) AM_DEVWRITE8("jsa", atari_jsa_ii_device, main_command_w, 0xff00)
AM_RANGE(0xf98000, 0xf98001) AM_DEVWRITE("jsa", atari_jsa_ii_device, sound_reset_w)
AM_RANGE(0xfa0000, 0xfa0001) AM_WRITE(mo_control_w)
AM_RANGE(0xfa0000, 0xfa0001) AM_DEVWRITE8("rle", atari_rle_objects_device, control_write, 0x00ff)
AM_RANGE(0xfb0000, 0xfb0001) AM_WRITE(video_int_ack_w)
AM_RANGE(0xfc0000, 0xfc0001) AM_READ(special_port0_r)
AM_RANGE(0xfc8000, 0xfc8007) AM_READWRITE(a2d_data_r, a2d_select_w)
@ -211,7 +202,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig1_state )
AM_RANGE(0xfd8000, 0xfdffff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
/* AM_RANGE(0xfe0000, 0xfe7fff) AM_READ(from_r)*/
AM_RANGE(0xfe8000, 0xfe89ff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")
AM_RANGE(0xff0000, 0xff0fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram_r, atarirle_spriteram_w)
AM_RANGE(0xff0000, 0xff0fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xff2000, 0xff2001) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
AM_RANGE(0xff4000, 0xff5fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xff6000, 0xff6fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
@ -388,15 +379,11 @@ GFXDECODE_END
static const atarirle_desc modesc_hydra =
static const atari_rle_objects_config modesc_hydra =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
255, /* right clip coordinate */
0x200, /* base palette entry */
0x100, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x00f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -409,15 +396,11 @@ static const atarirle_desc modesc_hydra =
{{ 0 }} /* mask for the VRAM target */
};
static const atarirle_desc modesc_pitfight =
static const atari_rle_objects_config modesc_pitfight =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
40, /* left clip coordinate */
295, /* right clip coordinate */
0x200, /* base palette entry */
0x100, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x00f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -460,7 +443,6 @@ static MACHINE_CONFIG_START( atarig1, atarig1_state )
/* note: these parameters are from published specs, not derived */
MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
MCFG_SCREEN_UPDATE_DRIVER(atarig1_state, screen_update_atarig1)
MCFG_SCREEN_VBLANK_DRIVER(atarig1_state, screen_eof_atarig1)
MCFG_VIDEO_START_OVERRIDE(atarig1_state,atarig1)
@ -473,11 +455,11 @@ static MACHINE_CONFIG_START( atarig1, atarig1_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hydra, atarig1 )
MCFG_ATARIRLE_ADD( "rle", modesc_hydra )
MCFG_ATARIRLE_ADD("rle", modesc_hydra)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( pitfight, atarig1 )
MCFG_ATARIRLE_ADD( "rle", modesc_pitfight )
MCFG_ATARIRLE_ADD("rle", modesc_pitfight)
MACHINE_CONFIG_END
@ -517,7 +499,7 @@ ROM_START( hydra )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136079-1027.bin", 0x000000, 0x20000, CRC(f9135b9b) SHA1(48c0ad0d3e592d191d1385e30530bdb69a095452) ) /* alphanumerics */
ROM_REGION16_BE( 0x100000, "gfx3", 0 )
ROM_REGION16_BE( 0x100000, "rle", 0 )
ROM_LOAD16_BYTE( "136079-1001.bin", 0x00001, 0x10000, CRC(3f757a53) SHA1(be2b7f8b907ef9ea24b24b7210ead70cdbad3506) )
ROM_LOAD16_BYTE( "136079-1002.bin", 0x00000, 0x10000, CRC(a1169469) SHA1(b5ab65ca9d98ef1e79518eaa519fba0cee92c86e) )
ROM_LOAD16_BYTE( "136079-1003.bin", 0x20001, 0x10000, CRC(aa21ec33) SHA1(dec65b670c64b3630f6ccbbcc3212f6771908de9) )
@ -577,7 +559,7 @@ ROM_START( hydrap )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "hydalph.bin", 0x000000, 0x20000, CRC(7dd2b062) SHA1(789b35b1e8cce73e2314d1b6688b5066df91b604) ) /* alphanumerics */
ROM_REGION16_BE( 0x100000, "gfx3", 0 )
ROM_REGION16_BE( 0x100000, "rle", 0 )
ROM_LOAD16_BYTE( "hydmhi0.bin", 0x00001, 0x10000, CRC(3c83b42d) SHA1(3c6de7e6aab08a673227f06b04e000714a9111b1) )
ROM_LOAD16_BYTE( "hydmlo0.bin", 0x00000, 0x10000, CRC(6d49650c) SHA1(97f9dbdfa5cc620705eec1da2398b2ac63cef30f) )
ROM_LOAD16_BYTE( "hydmhi1.bin", 0x20001, 0x10000, CRC(689b3376) SHA1(85ffa31f10483317db615cf8e520a8c8a40d6013) )
@ -637,7 +619,7 @@ ROM_START( hydrap2 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136079-1027.bin", 0x000000, 0x20000, CRC(f9135b9b) SHA1(48c0ad0d3e592d191d1385e30530bdb69a095452) ) /* alphanumerics */
ROM_REGION16_BE( 0x100000, "gfx3", 0 )
ROM_REGION16_BE( 0x100000, "rle", 0 )
ROM_LOAD16_BYTE( "136079-1001.bin", 0x00001, 0x10000, BAD_DUMP CRC(3f757a53) SHA1(be2b7f8b907ef9ea24b24b7210ead70cdbad3506) ) // not dumped from this pcb, rom taken from another set instead
ROM_LOAD16_BYTE( "136079-1002.bin", 0x00000, 0x10000, BAD_DUMP CRC(a1169469) SHA1(b5ab65ca9d98ef1e79518eaa519fba0cee92c86e) ) // "
ROM_LOAD16_BYTE( "136079-1003.bin", 0x20001, 0x10000, BAD_DUMP CRC(aa21ec33) SHA1(dec65b670c64b3630f6ccbbcc3212f6771908de9) ) // "
@ -721,7 +703,7 @@ ROM_START( pitfight )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )
@ -817,7 +799,7 @@ ROM_START( pitfight7 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )
@ -880,7 +862,7 @@ ROM_START( pitfight6 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1065.65r", 0x000001, 0x80000, CRC(6d3a834f) SHA1(6e153fee39b6a932aeb101e69e3557355a637c76) ) /* Same data as other sets, but in four mask roms */
ROM_LOAD16_BYTE( "136081-1066.65n", 0x000000, 0x80000, CRC(0f7f5117) SHA1(e9d3d0db388a5f7d76de363018d92fa59bf8113a) )
ROM_LOAD16_BYTE( "136081-1067.70r", 0x100001, 0x80000, CRC(ca4f75a8) SHA1(f8b8b03df4ad043a48970a0f8a4c3b85c7140493) )
@ -931,7 +913,7 @@ ROM_START( pitfight5 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1065.65r", 0x000001, 0x80000, CRC(6d3a834f) SHA1(6e153fee39b6a932aeb101e69e3557355a637c76) ) /* Same data as other sets, but in four mask roms */
ROM_LOAD16_BYTE( "136081-1066.65n", 0x000000, 0x80000, CRC(0f7f5117) SHA1(e9d3d0db388a5f7d76de363018d92fa59bf8113a) )
ROM_LOAD16_BYTE( "136081-1067.70r", 0x100001, 0x80000, CRC(ca4f75a8) SHA1(f8b8b03df4ad043a48970a0f8a4c3b85c7140493) )
@ -982,7 +964,7 @@ ROM_START( pitfight4 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )
@ -1045,7 +1027,7 @@ ROM_START( pitfight3 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )
@ -1108,7 +1090,7 @@ ROM_START( pitfightj )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1427.dat", 0x000000, 0x20000, CRC(b2c51dff) SHA1(7ad82a6a55d3a68e39d113c92f9e89a43408b5b2) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )
@ -1171,7 +1153,7 @@ ROM_START( pitfightb )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136081-1027.15l", 0x000000, 0x10000, CRC(a59f381d) SHA1(b14e878340ad2adbf4f6d4fc331c58f62037c7c7) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136081-1001.65r", 0x000001, 0x20000, CRC(3af31444) SHA1(91fc02786b82abdf12ebdbaacdd1f158f8ce6d06) )
ROM_LOAD16_BYTE( "136081-1002.65n", 0x000000, 0x20000, CRC(f1d76a4c) SHA1(ca769d2cdd096f4a54f7bcaa4840fc9ffaabf499) )
ROM_LOAD16_BYTE( "136081-1003.70r", 0x040001, 0x20000, CRC(28c41c2a) SHA1(75cd527f98c8475e3b880f53c5a355d6c3bd8766) )

View File

@ -93,7 +93,7 @@ WRITE16_MEMBER(atarig42_state::io_latch_w)
asic65_reset(machine(), (~data >> 14) & 1);
/* bits 13-11 are the MO control bits */
atarirle_control_w(m_rle, (data >> 11) & 7);
m_rle->control_write(space, 0, (data >> 11) & 7);
}
/* lower byte */
@ -114,7 +114,7 @@ WRITE16_MEMBER(atarig42_state::io_latch_w)
WRITE16_MEMBER(atarig42_state::mo_command_w)
{
COMBINE_DATA(m_mo_command);
atarirle_command_w(m_rle, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
m_rle->command_write(space, offset, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -347,7 +347,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, atarig42_state )
AM_RANGE(0xf80000, 0xf80003) AM_WRITE_LEGACY(asic65_data_w)
AM_RANGE(0xfa0000, 0xfa0fff) AM_READWRITE(eeprom_r, eeprom_w) AM_SHARE("eeprom")
AM_RANGE(0xfc0000, 0xfc0fff) AM_RAM_WRITE(paletteram_666_w) AM_SHARE("paletteram")
AM_RANGE(0xff0000, 0xff0fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram_r, atarirle_spriteram_w)
AM_RANGE(0xff0000, 0xff0fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xff2000, 0xff5fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xff6000, 0xff6fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xff7000, 0xff7001) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
@ -487,15 +487,11 @@ static GFXDECODE_START( atarig42 )
GFXDECODE_END
static const atarirle_desc modesc_0x200 =
static const atari_rle_objects_config modesc_0x200 =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
0, /* right clip coordinate */
0x200, /* base palette entry */
0x400, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x01f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -509,15 +505,11 @@ static const atarirle_desc modesc_0x200 =
};
static const atarirle_desc modesc_0x400 =
static const atari_rle_objects_config modesc_0x400 =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
0, /* right clip coordinate */
0x400, /* base palette entry */
0x400, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x03f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -565,7 +557,6 @@ static MACHINE_CONFIG_START( atarig42, atarig42_state )
/* the board uses an SOS chip to generate video signals */
MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
MCFG_SCREEN_UPDATE_DRIVER(atarig42_state, screen_update_atarig42)
MCFG_SCREEN_VBLANK_DRIVER(atarig42_state, screen_eof_atarig42)
MCFG_VIDEO_START_OVERRIDE(atarig42_state,atarig42)
@ -578,11 +569,11 @@ static MACHINE_CONFIG_START( atarig42, atarig42_state )
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( atarig42_0x200, atarig42 )
MCFG_ATARIRLE_ADD( "rle", modesc_0x200 )
MCFG_ATARIRLE_ADD("rle", modesc_0x200)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( atarig42_0x400, atarig42 )
MCFG_ATARIRLE_ADD( "rle", modesc_0x400 )
MCFG_ATARIRLE_ADD("rle", modesc_0x400)
MACHINE_CONFIG_END
@ -619,7 +610,7 @@ ROM_START( roadriot )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136089-1046.22j", 0x000000, 0x20000, CRC(0005bab0) SHA1(257e1b23eea117fe6701a67134b96d9d9fe10caf) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136089-1018.2s", 0x000000, 0x20000, CRC(19590a94) SHA1(e375b7e01a8b1f366bb4e7750e33f0b6d9ae2042) )
ROM_LOAD16_BYTE( "136089-1017.2p", 0x000001, 0x20000, CRC(c2bf3f69) SHA1(f822359070b1907973ee7ee35469f4a59f720830) )
ROM_LOAD16_BYTE( "136089-1020.3s", 0x040000, 0x20000, CRC(bab110e4) SHA1(0c4e3521474249517e7832df1bc63aca6d6a6c91) )
@ -677,7 +668,7 @@ ROM_START( roadrioto )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136089-1046.22j", 0x000000, 0x20000, CRC(0005bab0) SHA1(257e1b23eea117fe6701a67134b96d9d9fe10caf) ) /* alphanumerics */
ROM_REGION16_BE( 0x200000, "gfx3", 0 )
ROM_REGION16_BE( 0x200000, "rle", 0 )
ROM_LOAD16_BYTE( "136089-1018.2s", 0x000000, 0x20000, CRC(19590a94) SHA1(e375b7e01a8b1f366bb4e7750e33f0b6d9ae2042) )
ROM_LOAD16_BYTE( "136089-1017.2p", 0x000001, 0x20000, CRC(c2bf3f69) SHA1(f822359070b1907973ee7ee35469f4a59f720830) )
ROM_LOAD16_BYTE( "136089-1020.3s", 0x040000, 0x20000, CRC(bab110e4) SHA1(0c4e3521474249517e7832df1bc63aca6d6a6c91) )
@ -733,7 +724,7 @@ ROM_START( guardian )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136092-0030.23k", 0x000000, 0x20000, CRC(0fd7baa1) SHA1(7802d732e5173291628ed498ad0fab71aeef4688) ) /* alphanumerics */
ROM_REGION16_BE( 0x600000, "gfx3", 0 )
ROM_REGION16_BE( 0x600000, "rle", 0 )
ROM_LOAD16_BYTE( "136092-0041.2s", 0x000000, 0x80000, CRC(a2a5ae08) SHA1(d99f925bbc9a72432e13328ee8422fde615db90f) )
ROM_LOAD16_BYTE( "136092-0040.2p", 0x000001, 0x80000, CRC(ef95132e) SHA1(288de1d15956a612b7d19ceb2cf853490bf42b05) )
ROM_LOAD16_BYTE( "136092-0043.3s", 0x100000, 0x80000, CRC(6438b8e4) SHA1(ee1446209fbcab8b17c88c53b65e754a85f279d1) )

View File

@ -219,7 +219,7 @@ WRITE32_MEMBER(atarigt_state::latch_w)
if (ACCESSING_BITS_24_31)
{
/* bits 13-11 are the MO control bits */
atarirle_control_w(m_rle, (data >> 27) & 7);
m_rle->control_write(space, offset, (data >> 27) & 7);
}
if (ACCESSING_BITS_16_23)
@ -235,7 +235,7 @@ WRITE32_MEMBER(atarigt_state::mo_command_w)
{
COMBINE_DATA(m_mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(m_rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
m_rle->command_write(space, offset, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -620,7 +620,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigt_state )
AM_RANGE(0xd40000, 0xd4ffff) AM_WRITE16(eeprom_enable_w, 0xffffffff)
AM_RANGE(0xd72000, 0xd75fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xd76000, 0xd76fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xd78000, 0xd78fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram32_r, atarirle_spriteram32_w)
AM_RANGE(0xd78000, 0xd78fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
AM_RANGE(0xd80000, 0xdfffff) AM_READWRITE(colorram_protection_r, colorram_protection_w) AM_SHARE("colorram")
@ -790,15 +790,11 @@ static GFXDECODE_START( atarigt )
GFXDECODE_END
static const atarirle_desc modesc =
static const atari_rle_objects_config modesc =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
0, /* right clip coordinate */
0x0000, /* base palette entry */
0x1000, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x0ff0,0,0,0,0,0,0 }}, /* mask for the color */
@ -843,7 +839,6 @@ static MACHINE_CONFIG_START( atarigt, atarigt_state )
/* the board uses a pair of GALs to determine H and V parameters */
MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
MCFG_SCREEN_UPDATE_DRIVER(atarigt_state, screen_update_atarigt)
MCFG_SCREEN_VBLANK_DRIVER(atarigt_state, screen_eof_atarigt)
MCFG_VIDEO_START_OVERRIDE(atarigt_state,atarigt)
@ -891,7 +886,7 @@ ROM_START( tmek )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */
ROM_REGION16_BE( 0x1000000, "gfx3", 0 )
ROM_REGION16_BE( 0x1000000, "rle", 0 )
ROM_LOAD16_BYTE( "0300", 0x000001, 0x100000, CRC(8367ddac) SHA1(9ca77962259284cef8a261b652ab1327817ee8d0) )
ROM_LOAD16_BYTE( "0301", 0x000000, 0x100000, CRC(94524b5b) SHA1(db401fd7ba56658fcb614406672c02569d845930) )
ROM_LOAD16_BYTE( "0302", 0x200001, 0x100000, CRC(c03f1aa7) SHA1(c68b52280d0695629c843b9c90f7a39713e063b0) )
@ -946,7 +941,7 @@ ROM_START( tmek51p )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */
ROM_REGION16_BE( 0x1000000, "gfx3", 0 )
ROM_REGION16_BE( 0x1000000, "rle", 0 )
ROM_LOAD16_BYTE( "0300", 0x000001, 0x100000, CRC(8367ddac) SHA1(9ca77962259284cef8a261b652ab1327817ee8d0) )
ROM_LOAD16_BYTE( "0301", 0x000000, 0x100000, CRC(94524b5b) SHA1(db401fd7ba56658fcb614406672c02569d845930) )
ROM_LOAD16_BYTE( "0302", 0x200001, 0x100000, CRC(c03f1aa7) SHA1(c68b52280d0695629c843b9c90f7a39713e063b0) )
@ -1001,7 +996,7 @@ ROM_START( tmek45 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */
ROM_REGION16_BE( 0x1000000, "gfx3", 0 )
ROM_REGION16_BE( 0x1000000, "rle", 0 )
ROM_LOAD16_BYTE( "0300", 0x000001, 0x100000, CRC(8367ddac) SHA1(9ca77962259284cef8a261b652ab1327817ee8d0) )
ROM_LOAD16_BYTE( "0301", 0x000000, 0x100000, CRC(94524b5b) SHA1(db401fd7ba56658fcb614406672c02569d845930) )
ROM_LOAD16_BYTE( "0302", 0x200001, 0x100000, CRC(c03f1aa7) SHA1(c68b52280d0695629c843b9c90f7a39713e063b0) )
@ -1056,7 +1051,7 @@ ROM_START( tmek44 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "0045a", 0x000000, 0x20000, CRC(057a5304) SHA1(d44c0cf885a1324888b7e8118f124c0dae616859) ) /* alphanumerics */
ROM_REGION16_BE( 0x1000000, "gfx3", 0 )
ROM_REGION16_BE( 0x1000000, "rle", 0 )
ROM_LOAD16_BYTE( "0300", 0x000001, 0x100000, CRC(8367ddac) SHA1(9ca77962259284cef8a261b652ab1327817ee8d0) )
ROM_LOAD16_BYTE( "0301", 0x000000, 0x100000, CRC(94524b5b) SHA1(db401fd7ba56658fcb614406672c02569d845930) )
ROM_LOAD16_BYTE( "0302", 0x200001, 0x100000, CRC(c03f1aa7) SHA1(c68b52280d0695629c843b9c90f7a39713e063b0) )
@ -1111,7 +1106,7 @@ ROM_START( tmek20 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "alpha", 0x000000, 0x20000, CRC(8f57a604) SHA1(f076636430ff73ea11e4687ef7b21a7bac1d8e34) ) /* alphanumerics */
ROM_REGION16_BE( 0x1000000, "gfx3", 0 )
ROM_REGION16_BE( 0x1000000, "rle", 0 )
ROM_LOAD16_BYTE( "0300", 0x000001, 0x100000, CRC(8367ddac) SHA1(9ca77962259284cef8a261b652ab1327817ee8d0) )
ROM_LOAD16_BYTE( "0301", 0x000000, 0x100000, CRC(94524b5b) SHA1(db401fd7ba56658fcb614406672c02569d845930) )
ROM_LOAD16_BYTE( "0302", 0x200001, 0x100000, CRC(c03f1aa7) SHA1(c68b52280d0695629c843b9c90f7a39713e063b0) )
@ -1158,7 +1153,7 @@ ROM_START( primrage )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136102-1045b.23p", 0x000000, 0x20000, CRC(1d3260bf) SHA1(85d9db8499cbe180c8d52710f3cfe64453a530ff) ) /* alphanumerics */
ROM_REGION16_BE( 0x2000000, "gfx3", 0 )
ROM_REGION16_BE( 0x2000000, "rle", 0 )
ROM_LOAD16_BYTE( "136102-1100a.2v", 0x0000001, 0x080000, CRC(6e9c80b5) SHA1(ec724011527dd8707c733211b1a6c51b22f580c7) )
ROM_LOAD16_BYTE( "136102-1101a.2w", 0x0000000, 0x080000, CRC(bb7ee624) SHA1(0de6385aee7d25b41fd5bf232e44e5da536504ac) )
ROM_LOAD16_BYTE( "136102-0332.mol1.0", 0x0800001, 0x100000, CRC(610cfcb4) SHA1(bed1bd0d11c0a7cc48d020fc0acec34daf48c5ac) )
@ -1244,7 +1239,7 @@ ROM_START( primrage20 )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136102-0045a.23p", 0x000000, 0x20000, CRC(c8b39b1c) SHA1(836c0ccf96b2beccacf6d8ac23981fc2d1f09803) ) /* alphanumerics */
ROM_REGION16_BE( 0x2000000, "gfx3", 0 )
ROM_REGION16_BE( 0x2000000, "rle", 0 )
ROM_LOAD16_BYTE( "136102-0100a.2v", 0x0000001, 0x080000, CRC(5299fb2a) SHA1(791378215ab6ffff3ab2ae7192ce9f88dae4090d) )
ROM_LOAD16_BYTE( "136102-0101a.2w", 0x0000000, 0x080000, CRC(3e234711) SHA1(6a9f19db2b4c8c34d3d7b4984206e3d5c4398d7f) )
ROM_LOAD16_BYTE( "136102-0332.mol1.0", 0x0800001, 0x100000, CRC(610cfcb4) SHA1(bed1bd0d11c0a7cc48d020fc0acec34daf48c5ac) )

View File

@ -103,7 +103,7 @@ WRITE32_MEMBER(atarigx2_state::latch_w)
if (ACCESSING_BITS_24_31)
{
/* bits 13-11 are the MO control bits */
atarirle_control_w(m_rle, (data >> 27) & 7);
m_rle->control_write(space, offset, (data >> 27) & 7);
}
/* lower byte */
@ -116,7 +116,7 @@ WRITE32_MEMBER(atarigx2_state::mo_command_w)
{
COMBINE_DATA(m_mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(m_rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
m_rle->command_write(space, offset, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@ -1139,7 +1139,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 32, atarigx2_state )
AM_RANGE(0xd40000, 0xd40fff) AM_RAM_WRITE(paletteram32_666_w) AM_SHARE("paletteram")
AM_RANGE(0xd72000, 0xd75fff) AM_DEVWRITE("playfield", tilemap_device, write) AM_SHARE("playfield")
AM_RANGE(0xd76000, 0xd76fff) AM_DEVWRITE("alpha", tilemap_device, write) AM_SHARE("alpha")
AM_RANGE(0xd78000, 0xd78fff) AM_DEVREADWRITE_LEGACY("rle", atarirle_spriteram32_r, atarirle_spriteram32_w)
AM_RANGE(0xd78000, 0xd78fff) AM_RAM AM_SHARE("rle")
AM_RANGE(0xd7a200, 0xd7a203) AM_WRITE(mo_command_w) AM_SHARE("mo_command")
AM_RANGE(0xd70000, 0xd7ffff) AM_RAM
AM_RANGE(0xd80000, 0xd9ffff) AM_WRITE16(eeprom_enable_w, 0xffffffff)
@ -1356,15 +1356,11 @@ static GFXDECODE_START( atarigx2 )
GFXDECODE_ENTRY( "gfx1", 0, pftoplayout, 0x000, 64 )
GFXDECODE_END
static const atarirle_desc modesc_0x200 =
static const atari_rle_objects_config modesc_0x200 =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
0, /* right clip coordinate */
0x200, /* base palette entry */
0x400, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x01f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -1377,15 +1373,11 @@ static const atarirle_desc modesc_0x200 =
{{ 0 }} /* mask for the VRAM target */
};
static const atarirle_desc modesc_0x400 =
static const atari_rle_objects_config modesc_0x400 =
{
"gfx3", /* region where the GFX data lives */
256, /* number of entries in sprite RAM */
0, /* left clip coordinate */
0, /* right clip coordinate */
0x400, /* base palette entry */
0x400, /* maximum number of colors */
{{ 0x7fff,0,0,0,0,0,0,0 }}, /* mask for the code index */
{{ 0,0x03f0,0,0,0,0,0,0 }}, /* mask for the color */
@ -1429,7 +1421,6 @@ static MACHINE_CONFIG_START( atarigx2, atarigx2_state )
/* the board uses a pair of GALs to determine H and V parameters */
MCFG_SCREEN_RAW_PARAMS(ATARI_CLOCK_14MHz/2, 456, 0, 336, 262, 0, 240)
MCFG_SCREEN_UPDATE_DRIVER(atarigx2_state, screen_update_atarigx2)
MCFG_SCREEN_VBLANK_DRIVER(atarigx2_state, screen_eof_atarigx2)
MCFG_VIDEO_START_OVERRIDE(atarigx2_state,atarigx2)
@ -1444,11 +1435,11 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( atarigx2_0x200, atarigx2 )
MCFG_ATARIRLE_ADD( "rle", modesc_0x200 )
MCFG_ATARIRLE_ADD("rle", modesc_0x200)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( atarigx2_0x400, atarigx2 )
MCFG_ATARIRLE_ADD( "rle", modesc_0x400 )
MCFG_ATARIRLE_ADD("rle", modesc_0x400)
MACHINE_CONFIG_END
@ -1478,7 +1469,7 @@ ROM_START( spclords )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */
ROM_REGION16_BE( 0x600000, "gfx3", 0 )
ROM_REGION16_BE( 0x600000, "rle", 0 )
ROM_LOAD16_BYTE( "136095.41b", 0x000000, 0x80000, CRC(02ce7e07) SHA1(a48a6930c8ca4e2d0e4bc77a558730fa790be3b5) )
ROM_LOAD16_BYTE( "136095.40b", 0x000001, 0x80000, CRC(abb80720) SHA1(0e02688454f59b90d38d548808f794294f5c9e7e) )
ROM_LOAD16_BYTE( "136095.43b", 0x100000, 0x80000, CRC(26526345) SHA1(30ef83f63aca3a846dfc2828e3147208e3e350ca) )
@ -1524,7 +1515,7 @@ ROM_START( spclordsb )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */
ROM_REGION16_BE( 0x600000, "gfx3", 0 )
ROM_REGION16_BE( 0x600000, "rle", 0 )
ROM_LOAD16_BYTE( "136095.41b", 0x000000, 0x80000, CRC(02ce7e07) SHA1(a48a6930c8ca4e2d0e4bc77a558730fa790be3b5) )
ROM_LOAD16_BYTE( "136095.40b", 0x000001, 0x80000, CRC(abb80720) SHA1(0e02688454f59b90d38d548808f794294f5c9e7e) )
ROM_LOAD16_BYTE( "136095.43b", 0x100000, 0x80000, CRC(26526345) SHA1(30ef83f63aca3a846dfc2828e3147208e3e350ca) )
@ -1570,7 +1561,7 @@ ROM_START( spclordsg )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */
ROM_REGION16_BE( 0x600000, "gfx3", 0 )
ROM_REGION16_BE( 0x600000, "rle", 0 )
ROM_LOAD16_BYTE( "136095.41a", 0x000000, 0x80000, CRC(5f9743ee) SHA1(fa521572f8dd2eda566f90d1345adba3d0b8c48f) )
ROM_LOAD16_BYTE( "136095.40a", 0x000001, 0x80000, CRC(99b26863) SHA1(21682771d310c73d4431dde5e72398a69a6f3d53) )
ROM_LOAD16_BYTE( "136095.43a", 0x100000, 0x80000, CRC(9c0e09a5) SHA1(039dc52318935f686230f57a7b39b9c62280cbf9) )
@ -1616,7 +1607,7 @@ ROM_START( spclordsa )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136095.25a", 0x000000, 0x20000, CRC(1669496e) SHA1(005deaafd6156505e3a27966123e58928837ad9f) ) /* alphanumerics */
ROM_REGION16_BE( 0x600000, "gfx3", 0 )
ROM_REGION16_BE( 0x600000, "rle", 0 )
ROM_LOAD16_BYTE( "136095.41a", 0x000000, 0x80000, CRC(5f9743ee) SHA1(fa521572f8dd2eda566f90d1345adba3d0b8c48f) )
ROM_LOAD16_BYTE( "136095.40a", 0x000001, 0x80000, CRC(99b26863) SHA1(21682771d310c73d4431dde5e72398a69a6f3d53) )
ROM_LOAD16_BYTE( "136095.43a", 0x100000, 0x80000, CRC(9c0e09a5) SHA1(039dc52318935f686230f57a7b39b9c62280cbf9) )
@ -1662,7 +1653,7 @@ ROM_START( motofren )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1710,7 +1701,7 @@ ROM_START( motofrenmd )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1762,7 +1753,7 @@ ROM_START( motofrei )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1811,7 +1802,7 @@ ROM_START( motofreg )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1860,7 +1851,7 @@ ROM_START( motofmdg )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1908,7 +1899,7 @@ ROM_START( motofrenft )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -1956,7 +1947,7 @@ ROM_START( motofrenmf )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "136094-0025a.13n", 0x000000, 0x20000, CRC(6ab762ad) SHA1(c52dd207ff5adaffa458e020e7d452a1d1e65194) ) /* alphanumerics */
ROM_REGION16_BE( 0x700000, "gfx3", 0 )
ROM_REGION16_BE( 0x700000, "rle", 0 )
ROM_LOAD16_BYTE( "136094-0041a.31n", 0x000000, 0x80000, CRC(474770e9) SHA1(507dac654d1c350ab530892e3ec19793629d3a07) )
ROM_LOAD16_BYTE( "136094-0040a.31l", 0x000001, 0x80000, CRC(cb777468) SHA1(aa199bc02ab966b9f270057857aec50add8d684c) )
ROM_LOAD16_BYTE( "136094-0043a.33n", 0x100000, 0x80000, CRC(353d2dc3) SHA1(82c2c862404ea4c94c9baee1d0ac32696fcf78bd) )
@ -2000,7 +1991,7 @@ ROM_START( rrreveng )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "alpha.13n", 0x000000, 0x20000, CRC(f2efbd66) SHA1(d5339f0b3de7a102d659f7459b5f4800cab31829) ) /* alphanumerics */
ROM_REGION16_BE( 0x500000, "gfx3", 0 )
ROM_REGION16_BE( 0x500000, "rle", 0 )
ROM_LOAD16_BYTE( "mo0h.31n", 0x000000, 0x80000, CRC(fc2755d5) SHA1(e24319161307efbb3828b21a6250869051f1ccc1) )
ROM_LOAD16_BYTE( "mo0l.31l", 0x000001, 0x80000, CRC(f9f6bfe3) SHA1(c7e1479bb86646691d5ca7ee9127553cfd86571e) )
ROM_LOAD16_BYTE( "rrmo1h.33n", 0x100000, 0x80000, CRC(c7a48389) SHA1(a263aa4829cb243440ebe0496dd4f0158d97e2cc) )
@ -2066,7 +2057,7 @@ ROM_START( rrrevenga ) /* Same program roms as the set below, but shares more ro
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "alpha.13n", 0x000000, 0x20000, CRC(f2efbd66) SHA1(d5339f0b3de7a102d659f7459b5f4800cab31829) ) /* alphanumerics */
ROM_REGION16_BE( 0x500000, "gfx3", 0 )
ROM_REGION16_BE( 0x500000, "rle", 0 )
ROM_LOAD16_BYTE( "mo0h.31n", 0x000000, 0x80000, CRC(fc2755d5) SHA1(e24319161307efbb3828b21a6250869051f1ccc1) )
ROM_LOAD16_BYTE( "mo0l.31l", 0x000001, 0x80000, CRC(f9f6bfe3) SHA1(c7e1479bb86646691d5ca7ee9127553cfd86571e) )
ROM_LOAD16_BYTE( "rrmo1h.33n", 0x100000, 0x80000, CRC(c7a48389) SHA1(a263aa4829cb243440ebe0496dd4f0158d97e2cc) )
@ -2126,7 +2117,7 @@ ROM_START( rrrevengb )
ROM_REGION( 0x020000, "gfx2", 0 )
ROM_LOAD( "rralalph.13n", 0x000000, 0x20000, CRC(7ca93790) SHA1(5e2f069be4b15d63f418c8693e8550eb0ae22381) ) /* alphanumerics */
ROM_REGION16_BE( 0x500000, "gfx3", 0 )
ROM_REGION16_BE( 0x500000, "rle", 0 )
ROM_LOAD16_BYTE( "rrmo0h.31n", 0x000000, 0x80000, CRC(9b7e0315) SHA1(856804e89f586a4e777da5f47dc29c4e34175f44) )
ROM_LOAD16_BYTE( "rrmo0l.31l", 0x000001, 0x80000, CRC(10478697) SHA1(9682e82cfbdc20f63d5c49303265c598a334c15b) )
ROM_LOAD16_BYTE( "rrmo1h.33n", 0x100000, 0x80000, CRC(c7a48389) SHA1(a263aa4829cb243440ebe0496dd4f0158d97e2cc) )

View File

@ -17,12 +17,14 @@ public:
m_jsa(*this, "jsa"),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha"),
m_rle(*this, "rle"),
m_mo_command(*this, "mo_command") { }
required_device<cpu_device> m_maincpu;
required_device<atari_jsa_ii_device> m_jsa;
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
required_device<atari_rle_objects_device> m_rle;
bool m_is_pitfight;
@ -40,7 +42,6 @@ public:
UINT16 m_playfield_xscroll;
UINT16 m_playfield_yscroll;
device_t * m_rle;
virtual void device_post_load();
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
@ -64,7 +65,6 @@ public:
DECLARE_MACHINE_RESET(atarig1);
DECLARE_VIDEO_START(atarig1);
UINT32 screen_update_atarig1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_atarig1(screen_device &screen, bool state);
private:
void init_common(offs_t slapstic_base, int slapstic, bool is_pitfight);
void pitfightb_cheap_slapstic_init();

View File

@ -17,6 +17,7 @@ public:
m_jsa(*this, "jsa"),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha"),
m_rle(*this, "rle"),
m_mo_command(*this, "mo_command") { }
required_device<cpu_device> m_maincpu;
@ -24,6 +25,7 @@ public:
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
required_device<atari_rle_objects_device> m_rle;
UINT16 m_playfield_base;
@ -42,7 +44,6 @@ public:
int m_sloop_state;
UINT16 * m_sloop_base;
device_t * m_rle;
UINT32 m_last_accesses[8];
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);

View File

@ -21,6 +21,7 @@ public:
m_colorram(*this, "colorram", 32),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha"),
m_rle(*this, "rle"),
m_mo_command(*this, "mo_command") { }
UINT8 m_is_primrage;
@ -28,6 +29,7 @@ public:
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
required_device<atari_rle_objects_device> m_rle;
bitmap_ind16 * m_pf_bitmap;
bitmap_ind16 * m_an_bitmap;
@ -52,7 +54,6 @@ public:
UINT16 m_protresult;
UINT8 m_protdata[0x800];
device_t * m_rle;
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
DECLARE_READ32_MEMBER(special_port2_r);
@ -79,7 +80,6 @@ public:
DECLARE_MACHINE_RESET(atarigt);
DECLARE_VIDEO_START(atarigt);
UINT32 screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
void screen_eof_atarigt(screen_device &screen, bool state);
private:
void tmek_update_mode(offs_t offset);
void tmek_protection_w(address_space &space, offs_t offset, UINT16 data);

View File

@ -16,7 +16,8 @@ public:
m_mo_command(*this, "mo_command"),
m_protection_base(*this, "protection_base"),
m_playfield_tilemap(*this, "playfield"),
m_alpha_tilemap(*this, "alpha") { }
m_alpha_tilemap(*this, "alpha"),
m_rle(*this, "rle") { }
UINT16 m_playfield_base;
@ -27,6 +28,7 @@ public:
required_device<tilemap_device> m_playfield_tilemap;
required_device<tilemap_device> m_alpha_tilemap;
required_device<atari_rle_objects_device> m_rle;
UINT16 m_current_control;
UINT8 m_playfield_tile_bank;
@ -37,7 +39,6 @@ public:
UINT16 m_last_write;
UINT16 m_last_write_offset;
device_t * m_rle;
virtual void update_interrupts();
virtual void scanline_update(screen_device &screen, int scanline);
DECLARE_READ32_MEMBER(special_port2_r);
@ -58,6 +59,5 @@ public:
DECLARE_MACHINE_RESET(atarigx2);
DECLARE_VIDEO_START(atarigx2);
UINT32 screen_update_atarigx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_atarigx2(screen_device &screen, bool state);
DECLARE_WRITE16_MEMBER( atarigx2_mo_control_w );
};

View File

@ -47,9 +47,6 @@ VIDEO_START_MEMBER(atarig1_state,atarig1)
/* blend the playfields and free the temporary one */
blend_gfx(0, 2, 0x0f, 0x10);
/* initialize the motion objects */
m_rle = machine().device("rle");
/* reset statics */
m_pfscroll_xoffset = m_is_pitfight ? 2 : 0;
@ -134,18 +131,9 @@ UINT32 atarig1_state::screen_update_atarig1(screen_device &screen, bitmap_ind16
m_playfield_tilemap->draw(screen, bitmap, cliprect, 0, 0);
/* copy the motion objects on top */
copybitmap_trans(bitmap, *atarirle_get_vram(m_rle, 0), 0, 0, 0, 0, cliprect, 0);
copybitmap_trans(bitmap, m_rle->vram(0), 0, 0, 0, 0, cliprect, 0);
/* add the alpha on top */
m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
void atarig1_state::screen_eof_atarig1(screen_device &screen, bool state)
{
// rising edge
if (state)
{
atarirle_eof(m_rle);
}
}

View File

@ -70,9 +70,6 @@ VIDEO_START_MEMBER(atarig42_state,atarig42)
/* blend the playfields and free the temporary one */
blend_gfx(0, 2, 0x0f, 0x30);
/* initialize the motion objects */
m_rle = machine().device("rle");
/* save states */
save_item(NAME(m_current_control));
save_item(NAME(m_playfield_tile_bank));
@ -174,7 +171,7 @@ UINT32 atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_ind1
/* copy the motion objects on top */
{
bitmap_ind16 *mo_bitmap = atarirle_get_vram(m_rle, 0);
bitmap_ind16 &mo_bitmap = m_rle->vram(0);
int left = cliprect.min_x;
int top = cliprect.min_y;
int right = cliprect.max_x + 1;
@ -185,7 +182,7 @@ UINT32 atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_ind1
for (y = top; y < bottom; y++)
{
UINT16 *pf = &bitmap.pix16(y);
UINT16 *mo = &mo_bitmap->pix16(y);
UINT16 *mo = &mo_bitmap.pix16(y);
UINT8 *pri = &priority_bitmap.pix8(y);
for (x = left; x < right; x++)
if (mo[x])
@ -202,12 +199,3 @@ UINT32 atarig42_state::screen_update_atarig42(screen_device &screen, bitmap_ind1
m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
void atarig42_state::screen_eof_atarig42(screen_device &screen, bool state)
{
// rising edge
if (state)
{
atarirle_eof(m_rle);
}
}

View File

@ -82,9 +82,6 @@ VIDEO_START_MEMBER(atarigt_state,atarigt)
/* blend the playfields and free the temporary one */
blend_gfx(0, 2, 0x0f, 0x30);
/* initialize the motion objects */
m_rle = machine().device("rle");
/* allocate temp bitmaps */
width = m_screen->width();
height = m_screen->height();
@ -499,8 +496,8 @@ PrimRage GALs:
UINT32 atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
bitmap_ind16 *mo_bitmap = atarirle_get_vram(m_rle, 0);
bitmap_ind16 *tm_bitmap = atarirle_get_vram(m_rle, 1);
bitmap_ind16 &mo_bitmap = m_rle->vram(0);
bitmap_ind16 &tm_bitmap = m_rle->vram(1);
UINT16 *cram, *tram;
int color_latch;
UINT32 *mram;
@ -523,8 +520,8 @@ UINT32 atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb32
{
UINT16 *an = &m_an_bitmap->pix16(y);
UINT16 *pf = &m_pf_bitmap->pix16(y);
UINT16 *mo = &mo_bitmap->pix16(y);
UINT16 *tm = &tm_bitmap->pix16(y);
UINT16 *mo = &mo_bitmap.pix16(y);
UINT16 *tm = &tm_bitmap.pix16(y);
UINT32 *dst = &bitmap.pix32(y);
/* Primal Rage: no TRAM, slightly different priorities */
@ -621,12 +618,3 @@ UINT32 atarigt_state::screen_update_atarigt(screen_device &screen, bitmap_rgb32
}
return 0;
}
void atarigt_state::screen_eof_atarigt(screen_device &screen, bool state)
{
// rising edge
if (state)
{
atarirle_eof(m_rle);
}
}

View File

@ -70,9 +70,6 @@ VIDEO_START_MEMBER(atarigx2_state,atarigx2)
/* blend the playfields and free the temporary one */
blend_gfx(0, 2, 0x0f, 0x30);
/* initialize the motion objects */
m_rle = machine().device("rle");
/* save states */
save_item(NAME(m_current_control));
save_item(NAME(m_playfield_tile_bank));
@ -182,7 +179,7 @@ UINT32 atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_ind1
/* copy the motion objects on top */
{
bitmap_ind16 *mo_bitmap = atarirle_get_vram(m_rle, 0);
bitmap_ind16 &mo_bitmap = m_rle->vram(0);
int left = cliprect.min_x;
int top = cliprect.min_y;
int right = cliprect.max_x + 1;
@ -193,7 +190,7 @@ UINT32 atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_ind1
for (y = top; y < bottom; y++)
{
UINT16 *pf = &bitmap.pix16(y);
UINT16 *mo = &mo_bitmap->pix16(y);
UINT16 *mo = &mo_bitmap.pix16(y);
UINT8 *pri = &priority_bitmap.pix8(y);
for (x = left; x < right; x++)
if (mo[x] && (mo[x] >> ATARIRLE_PRIORITY_SHIFT) >= pri[x])
@ -205,12 +202,3 @@ UINT32 atarigx2_state::screen_update_atarigx2(screen_device &screen, bitmap_ind1
m_alpha_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
void atarigx2_state::screen_eof_atarigx2(screen_device &screen, bool state)
{
// rising edge
if (state)
{
atarirle_eof(m_rle);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -5,15 +5,56 @@
Common RLE-based motion object management functions for early 90's
Atari raster games.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
#ifndef __ATARIRLE__
#define __ATARIRLE__
/***************************************************************************
CONSTANTS
***************************************************************************/
//**************************************************************************
// DEVICE CONFIGURATION MACROS
//**************************************************************************
#define MCFG_ATARIRLE_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, ATARI_RLE_OBJECTS, 0) \
atari_rle_objects_device::static_set_config(*device, _interface);
//**************************************************************************
// CONSTANTS
//**************************************************************************
#define ATARIRLE_PRIORITY_SHIFT 12
#define ATARIRLE_BANK_SHIFT 15
@ -30,80 +71,144 @@
/***************************************************************************
TYPES & STRUCTURES
***************************************************************************/
//**************************************************************************
// TYPES & STRUCTURES
//**************************************************************************
/* description for an eight-word mask */
struct atarirle_entry
// description of the motion objects
struct atari_rle_objects_config
{
UINT16 data[8];
};
struct entry { UINT16 data[8]; };
/* description of the motion objects */
struct atarirle_desc
{
const char * region; /* region where the GFX data lives */
UINT16 spriteramentries; /* number of entries in sprite RAM */
UINT16 leftclip; /* left clip coordinate */
UINT16 rightclip; /* right clip coordinate */
UINT16 m_leftclip; // left clip coordinate
UINT16 m_rightclip; // right clip coordinate
UINT16 m_palettebase; // base palette entry
UINT16 palettebase; /* base palette entry */
UINT16 maxcolors; /* maximum number of colors */
atarirle_entry codemask; /* mask for the code index */
atarirle_entry colormask; /* mask for the color */
atarirle_entry xposmask; /* mask for the X position */
atarirle_entry yposmask; /* mask for the Y position */
atarirle_entry scalemask; /* mask for the scale factor */
atarirle_entry hflipmask; /* mask for the horizontal flip */
atarirle_entry ordermask; /* mask for the order */
atarirle_entry prioritymask; /* mask for the priority */
atarirle_entry vrammask; /* mask for the VRAM target */
entry m_code_entry; // mask for the code index
entry m_color_entry; // mask for the color
entry m_xpos_entry; // mask for the X position
entry m_ypos_entry; // mask for the Y position
entry m_scale_entry; // mask for the scale factor
entry m_hflip_entry; // mask for the horizontal flip
entry m_order_entry; // mask for the order
entry m_priority_entry; // mask for the priority
entry m_vram_entry; // mask for the VRAM target
};
// ======================> atari_rle_objects_device
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
// device type definition
extern const device_type ATARI_RLE_OBJECTS;
class atarirle_device : public device_t
class atari_rle_objects_device : public device_t,
public device_video_interface,
public atari_rle_objects_config
{
public:
atarirle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
~atarirle_device() { global_free(m_token); }
// construction/destruction
atari_rle_objects_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
// static configuration helpers
static void static_set_config(device_t &device, const atari_rle_objects_config &config);
// control handlers
DECLARE_WRITE8_MEMBER(control_write);
DECLARE_WRITE8_MEMBER(command_write);
// render helpers
void vblank_callback(screen_device &screen, bool state);
// getters
bitmap_ind16 &vram(int idx) { return m_vram[idx][(m_control_bits & ATARIRLE_CONTROL_FRAME) >> 2]; }
// access to legacy token
void *token() const { assert(m_token != NULL); return m_token; }
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
private:
// internal state
void *m_token;
// a sprite parameter, which is a word index + shift + mask
class sprite_parameter
{
public:
sprite_parameter();
bool set(const atari_rle_objects_config::entry &input) { return set(input.data); }
bool set(const UINT16 input[8]);
UINT16 extract(memory_array &array, int offset) const { return (array.read(offset + m_word) >> m_shift) & m_mask; }
UINT16 shift() const { return m_shift; }
UINT16 mask() const { return m_mask; }
private:
UINT16 m_word; // word index
UINT16 m_shift; // shift amount
UINT16 m_mask; // final mask
};
// internal structure describing each object in the ROMs
struct object_info
{
INT16 width;
INT16 height;
INT16 xoffs;
INT16 yoffs;
UINT8 bpp;
const UINT16 * table;
const UINT16 * data;
};
// internal helpers
inline int round_to_powerof2(int value);
void build_rle_tables();
int count_objects();
void prescan_rle(int which);
void compute_checksum();
void sort_and_render();
void draw_rle(bitmap_ind16 &bitmap, const rectangle &clip, int code, int color, int hflip, int vflip, int x, int y, int xscale, int yscale);
void draw_rle_zoom(bitmap_ind16 &bitmap, const rectangle &clip, const object_info &info, UINT32 palette, int sx, int sy, int scalex, int scaley);
void draw_rle_zoom_hflip(bitmap_ind16 &bitmap, const rectangle &clip, const object_info &info, UINT32 palette, int sx, int sy, int scalex, int scaley);
void hilite_object(bitmap_ind16 &bitmap, int hilite);
// derived state
int m_bitmapwidth; // width of the full playfield bitmap
int m_bitmapheight; // height of the full playfield bitmap
int m_bitmapxmask; // x coordinate mask for the playfield bitmap
int m_bitmapymask; // y coordinate mask for the playfield bitmap
rectangle m_cliprect; // clipping rectangle
// masks
sprite_parameter m_codemask; // mask for the code index
sprite_parameter m_colormask; // mask for the color
sprite_parameter m_xposmask; // mask for the X position
sprite_parameter m_yposmask; // mask for the Y position
sprite_parameter m_scalemask; // mask for the scale factor
sprite_parameter m_hflipmask; // mask for the horizontal flip
sprite_parameter m_ordermask; // mask for the order
sprite_parameter m_prioritymask; // mask for the priority
sprite_parameter m_vrammask; // mask for the VRAM target
// ROM information
const UINT16 * m_rombase; // pointer to the base of the GFX ROM
int m_romlength; // length of the GFX ROM
int m_objectcount; // number of objects in the ROM
dynamic_array<object_info> m_info; // list of info records
// rendering state
bitmap_ind16 m_vram[2][2]; // pointers to VRAM bitmaps and backbuffers
int m_partial_scanline; // partial update scanline
// control state
UINT8 m_control_bits; // current control bits
UINT8 m_command; // current command
UINT16 m_checksums[256]; // checksums for each 0x40000 bytes
memory_array m_ram;
// tables
UINT8 m_rle_bpp[8];
UINT16 * m_rle_table[8];
UINT16 m_rle_table_data[0x500];
};
extern const device_type ATARIRLE;
#define MCFG_ATARIRLE_ADD(_tag, _interface) \
MCFG_DEVICE_ADD(_tag, ATARIRLE, 0) \
MCFG_DEVICE_CONFIG(_interface)
/* control handlers */
void atarirle_control_w(device_t *device, UINT8 bits);
void atarirle_command_w(device_t *device, UINT8 command);
/* read/write handlers */
DECLARE_READ16_DEVICE_HANDLER( atarirle_spriteram_r );
DECLARE_READ32_DEVICE_HANDLER( atarirle_spriteram32_r );
DECLARE_WRITE16_DEVICE_HANDLER( atarirle_spriteram_w );
DECLARE_WRITE32_DEVICE_HANDLER( atarirle_spriteram32_w );
/* render helpers */
void atarirle_eof(device_t *device);
bitmap_ind16 *atarirle_get_vram(device_t *device, int idx);
#endif