mirror of
https://github.com/holub/mame
synced 2025-06-07 05:13:46 +03:00
Clean-up and consistency fixes after memory system changes.
This commit is contained in:
parent
0683248955
commit
349265533d
@ -57,7 +57,7 @@ Memory banks are zones that indirect memory access, giving the
|
||||
possibility to dynamically and efficiently change where a zone
|
||||
actually points to.
|
||||
|
||||
Memory regions are read-only memory zones in which roms are loaded.
|
||||
Memory regions are read-only memory zones in which ROMs are loaded.
|
||||
|
||||
All of these have names allowing to access them.
|
||||
|
||||
@ -100,8 +100,8 @@ object.
|
||||
|
||||
A memory share can be created if it doesn't exist in a memory map
|
||||
through that creator class. If it already exists it is just
|
||||
retrieved. That class behaves like a pointer but also has the share()
|
||||
method to get th memory_share object and the bytes(), endianness(),
|
||||
retrieved. That class behaves like a pointer but also has the target()
|
||||
method to get the memory_share object and the bytes(), endianness(),
|
||||
bitwidth() and bytewidth() methods for share information.
|
||||
|
||||
| memory_share \*memshare(string tag) const;
|
||||
@ -304,11 +304,11 @@ both for the current entry.
|
||||
4.3.3 Lambda function
|
||||
'''''''''''''''''''''
|
||||
|
||||
| (...).lr{8,16,32,64}(FUNC([...](address_space &space, offs_t offset, uNN mem_mask) -> uNN { ... }))
|
||||
| (...).lr{8,16,32,64}(NAME([...](address_space &space, offs_t offset, uNN mem_mask) -> uNN { ... }))
|
||||
| (...).lr{8,16,32,64}([...](address_space &space, offs_t offset, uNN mem_mask) -> uNN { ... }, "name")
|
||||
| (...).lw{8,16,32,64}(FUNC([...](address_space &space, offs_t offset, uNN data, uNN mem_mask) -> void { ... }))
|
||||
| (...).lw{8,16,32,64}(NAME([...](address_space &space, offs_t offset, uNN data, uNN mem_mask) -> void { ... }))
|
||||
| (...).lw{8,16,32,64}([...](address_space &space, offs_t offset, uNN data, uNN mem_mask) -> void { ... }, "name")
|
||||
| (...).lrw{8,16,32,64}(FUNC(read), FUNC(write))
|
||||
| (...).lrw{8,16,32,64}(NAME(read), NAME(write))
|
||||
| (...).lrw{8,16,32,64}(read, "name_r", write, "name_w")
|
||||
|
||||
Sets a lambda called on read, write or both. The lambda prototype can
|
||||
@ -324,22 +324,22 @@ number is the data width of the access, e.g. the NN.
|
||||
| (...).writeonly()
|
||||
| (...).ram()
|
||||
|
||||
Selects the range to access a memory zone as readonly, writeonly or
|
||||
readwrite respectively. Specific handle qualifiers allow to tell
|
||||
Selects the range to access a memory zone as read-only, write-only or
|
||||
read/write respectively. Specific handle qualifiers allow to tell
|
||||
where this memory zone should be. There are two cases when no
|
||||
qualifier is acceptable:
|
||||
|
||||
* ram() gives an anonymous ram zone not accessibles outside of the
|
||||
* ram() gives an anonymous ram zone not accessible outside of the
|
||||
address space.
|
||||
|
||||
* rom() when the memory map is used in an AS_PROGRAM
|
||||
space of a (cpu) device which names is also the name of a region.
|
||||
space of a (CPU) device which names is also the name of a region.
|
||||
Then the memory zone points to that region at the offset
|
||||
corresponding to the start of the zone.
|
||||
|
||||
| (...).rom().region("name", offset)
|
||||
|
||||
The region qualifier allows to make a readonly zone point to the
|
||||
The region qualifier allows to make a read-only zone point to the
|
||||
contents of a given region at a given offset.
|
||||
|
||||
| (...).rom().share("name")
|
||||
@ -485,7 +485,7 @@ The parameter is that trigger width (would be 16 in the 68000 case).
|
||||
|
||||
A series of methods allow to change the bus decoding of an address
|
||||
space on the fly. They're powerful but have some issues:
|
||||
* changing the mappings repeateadly can be slow
|
||||
* changing the mappings repeatedly can be slow
|
||||
* the address space state is not saved in the saved states, so it has to be rebuilt after state load
|
||||
* they can be hidden anywhere rather that be grouped in an address map, which can be less readable
|
||||
|
||||
@ -538,8 +538,8 @@ Note that as all delegates they can also wrap lambdas.
|
||||
| space.install_readwrite_handler(addrstart, addrend, addrmask, addrmirror, addrselect, read_delegate, write_delegate, *unitmask*, *cswidth*)
|
||||
|
||||
These six methods allow to install delegate-wrapped handlers in a live
|
||||
address space. either plain of with mask, mirror and select. In the
|
||||
readwrite case both delegates must be of the same flavor (smo stuff)
|
||||
address space. Either plain or with mask, mirror and select. In the
|
||||
read/write case both delegates must be of the same flavor (smo stuff)
|
||||
to avoid a combinatorial explosion of method types.
|
||||
|
||||
5.3 Direct memory range mapping
|
||||
@ -553,7 +553,7 @@ to avoid a combinatorial explosion of method types.
|
||||
| space.install_ram(addrstart, addrend, addrmirror, void \*pointer)
|
||||
|
||||
Installs a memory block in an address space, with or without mirror.
|
||||
rom is readonly, ram is read/write, writeonly is write only. The
|
||||
rom is read-only, ram is read/write, writeonly is write-only. The
|
||||
pointer must be non-null, this method will not allocate the memory.
|
||||
|
||||
5.4 Bank mapping
|
||||
|
@ -41,8 +41,8 @@ protected:
|
||||
|
||||
// device_nvram_interface overrides
|
||||
virtual void nvram_default() override { }
|
||||
virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.share()->bytes()); } }
|
||||
virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.share()->bytes()); } }
|
||||
virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
|
||||
virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
|
||||
|
||||
// device_abcbus_interface overrides
|
||||
virtual void abcbus_cs(uint8_t data) override { m_bus->write_cs(data); }
|
||||
|
@ -98,9 +98,9 @@ c64_final_chesscard_device::c64_final_chesscard_device(const machine_config &mco
|
||||
void c64_final_chesscard_device::device_start()
|
||||
{
|
||||
m_nvram = std::make_unique<uint8_t[]>(0x2000);
|
||||
save_pointer(NAME(m_nvram), 0x2000);
|
||||
|
||||
// state saving
|
||||
save_pointer(NAME(m_nvram), 0x2000);
|
||||
save_item(NAME(m_bank));
|
||||
save_item(NAME(m_hidden));
|
||||
}
|
||||
|
@ -71,9 +71,7 @@ image_init_result portfolio_memory_card_slot_device::call_load()
|
||||
if (m_card)
|
||||
{
|
||||
if (!loaded_through_softlist())
|
||||
{
|
||||
fread(m_card->m_rom, length());
|
||||
}
|
||||
else
|
||||
load_software_region("rom", m_card->m_rom);
|
||||
}
|
||||
|
@ -36,8 +36,8 @@ protected:
|
||||
|
||||
// device_nvram_interface overrides
|
||||
virtual void nvram_default() override { }
|
||||
virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.share()->bytes()); } }
|
||||
virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.share()->bytes()); } }
|
||||
virtual void nvram_read(emu_file &file) override { if (m_nvram != nullptr) { file.read(m_nvram, m_nvram.bytes()); } }
|
||||
virtual void nvram_write(emu_file &file) override { if (m_nvram != nullptr) { file.write(m_nvram, m_nvram.bytes()); } }
|
||||
|
||||
// device_portfolio_memory_card_slot_interface overrides
|
||||
virtual bool cdet() override { return 0; }
|
||||
|
@ -73,13 +73,13 @@ void *finder_base::find_memregion(u8 width, size_t &length, bool required) const
|
||||
if (region->bytewidth() != width)
|
||||
{
|
||||
if (required)
|
||||
osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->bitwidth(), width*8);
|
||||
osd_printf_warning("Region '%s' found but is width %d, not %d as requested\n", m_tag, region->bitwidth(), width * 8);
|
||||
length = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// return results
|
||||
length = region->bytes()/width;
|
||||
length = region->bytes() / width;
|
||||
return region->base();
|
||||
}
|
||||
|
||||
@ -316,6 +316,7 @@ bool ioport_finder<Required>::findit(validity_checker *valid)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// ADDRESS SPACE FINDER
|
||||
//**************************************************************************
|
||||
@ -342,6 +343,7 @@ bool address_space_finder<Required>::findit(validity_checker *valid)
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MEMORY BANK CREATOR
|
||||
//**************************************************************************
|
||||
@ -353,46 +355,48 @@ bool memory_bank_creator::findit(validity_checker *valid)
|
||||
|
||||
device_t &dev = m_base.get();
|
||||
memory_manager &manager = dev.machine().memory();
|
||||
std::string tag = dev.subtag(m_tag);
|
||||
memory_bank *bank = manager.bank_find(tag);
|
||||
if (bank)
|
||||
m_target = bank;
|
||||
else
|
||||
m_target = manager.bank_alloc(dev, tag);
|
||||
std::string const tag = dev.subtag(m_tag);
|
||||
memory_bank *const bank = manager.bank_find(tag);
|
||||
m_target = bank ? bank : manager.bank_alloc(dev, tag);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void memory_bank_creator::end_configuration()
|
||||
{
|
||||
m_target = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// MEMORY SHARE CREATOR
|
||||
//**************************************************************************
|
||||
|
||||
template<typename uX> memory_share_creator<uX>::memory_share_creator(device_t &base, char const *tag, size_t bytes, endianness_t endianness)
|
||||
template <typename PointerType>
|
||||
memory_share_creator<PointerType>::memory_share_creator(device_t &base, char const *tag, size_t bytes, endianness_t endianness)
|
||||
: finder_base(base, tag)
|
||||
, m_width(sizeof(uX)*8)
|
||||
, m_width(sizeof(PointerType) * 8)
|
||||
, m_bytes(bytes)
|
||||
, m_endianness(endianness)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename uX> bool memory_share_creator<uX>::findit(validity_checker *valid)
|
||||
|
||||
template <typename PointerType>
|
||||
bool memory_share_creator<PointerType>::findit(validity_checker *valid)
|
||||
{
|
||||
if (valid)
|
||||
return true;
|
||||
|
||||
device_t &dev = m_base.get();
|
||||
memory_manager &manager = dev.machine().memory();
|
||||
std::string tag = dev.subtag(m_tag);
|
||||
memory_share *share = manager.share_find(tag);
|
||||
std::string const tag = dev.subtag(m_tag);
|
||||
memory_share *const share = manager.share_find(tag);
|
||||
if (share)
|
||||
{
|
||||
m_target = share;
|
||||
std::string result = share->compare(m_width, m_bytes, m_endianness);
|
||||
std::string const result = share->compare(m_width, m_bytes, m_endianness);
|
||||
if (!result.empty())
|
||||
{
|
||||
osd_printf_error("%s\n", result);
|
||||
@ -400,11 +404,15 @@ template<typename uX> bool memory_share_creator<uX>::findit(validity_checker *va
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_target = manager.share_alloc(dev, tag, m_width, m_bytes, m_endianness);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename uX> void memory_share_creator<uX>::end_configuration()
|
||||
|
||||
template <typename PointerType>
|
||||
void memory_share_creator<PointerType>::end_configuration()
|
||||
{
|
||||
m_target = nullptr;
|
||||
}
|
||||
@ -489,7 +497,13 @@ template class shared_ptr_finder<s32, false>;
|
||||
template class shared_ptr_finder<s32, true>;
|
||||
template class shared_ptr_finder<s64, false>;
|
||||
template class shared_ptr_finder<s64, true>;
|
||||
|
||||
template class memory_share_creator<u8>;
|
||||
template class memory_share_creator<u16>;
|
||||
template class memory_share_creator<u32>;
|
||||
template class memory_share_creator<u64>;
|
||||
|
||||
template class memory_share_creator<s8>;
|
||||
template class memory_share_creator<s16>;
|
||||
template class memory_share_creator<s32>;
|
||||
template class memory_share_creator<s64>;
|
||||
|
@ -753,9 +753,10 @@ template <unsigned Count, bool Required> using memory_bank_array_finder = object
|
||||
template <unsigned Count> using optional_memory_bank_array = memory_bank_array_finder<Count, false>;
|
||||
template <unsigned Count> using required_memory_bank_array = memory_bank_array_finder<Count, true>;
|
||||
|
||||
|
||||
/// \brief Memory bank creator
|
||||
///
|
||||
/// Creates a memory bank or picks up an existing one.
|
||||
/// Creates a memory bank or finds an existing one.
|
||||
class memory_bank_creator : finder_base
|
||||
{
|
||||
public:
|
||||
@ -792,10 +793,11 @@ protected:
|
||||
|
||||
template <unsigned Count> using memory_bank_array_creator = object_array_finder<memory_bank_creator, Count>;
|
||||
|
||||
/// \brief Memory share creator
|
||||
|
||||
/// \brief Memory share creator template
|
||||
///
|
||||
/// Creates a memory share or picks up an existing one.
|
||||
template<typename uX> class memory_share_creator : finder_base
|
||||
/// Creates a memory share or finds an existing one.
|
||||
template <typename PointerType> class memory_share_creator : finder_base
|
||||
{
|
||||
public:
|
||||
memory_share_creator(device_t &base, char const *tag, size_t bytes, endianness_t endianness);
|
||||
@ -803,17 +805,17 @@ public:
|
||||
|
||||
/// \brief Get pointer to the share object
|
||||
/// \return Pointer to share object.
|
||||
memory_share *share() const { return m_target; }
|
||||
memory_share *target() const { return m_target; }
|
||||
|
||||
/// \brief Get pointer to the share object backing ram
|
||||
/// \return Pointer to the ram.
|
||||
uX *ptr() const { return reinterpret_cast<uX *>(m_target->ptr()); }
|
||||
/// \brief Get pointer to the share object backing RAM
|
||||
/// \return Pointer to the RAM.
|
||||
PointerType *ptr() const { return reinterpret_cast<PointerType *>(m_target->ptr()); }
|
||||
|
||||
/// \brief Cast-to-pointer operator
|
||||
///
|
||||
/// Allows implicit casting to a pointer to the target bank object.
|
||||
/// Allows implicit casting to a pointer to the target backing RAM.
|
||||
/// \return Pointer to target bank object
|
||||
operator uX *() const { return reinterpret_cast<uX *>(m_target->ptr()); }
|
||||
operator PointerType *() const { return reinterpret_cast<PointerType *>(m_target->ptr()); }
|
||||
|
||||
/// \brief Pointer member access operator
|
||||
///
|
||||
@ -842,6 +844,7 @@ protected:
|
||||
const endianness_t m_endianness; // endianness of the memory
|
||||
};
|
||||
|
||||
|
||||
/// \brief I/O port finder template
|
||||
///
|
||||
/// Template argument is whether the I/O port is required. It is a
|
||||
@ -1239,5 +1242,15 @@ extern template class shared_ptr_finder<s32, true>;
|
||||
extern template class shared_ptr_finder<s64, false>;
|
||||
extern template class shared_ptr_finder<s64, true>;
|
||||
|
||||
extern template class memory_share_creator<u8>;
|
||||
extern template class memory_share_creator<u16>;
|
||||
extern template class memory_share_creator<u32>;
|
||||
extern template class memory_share_creator<u64>;
|
||||
|
||||
extern template class memory_share_creator<s8>;
|
||||
extern template class memory_share_creator<s16>;
|
||||
extern template class memory_share_creator<s32>;
|
||||
extern template class memory_share_creator<s64>;
|
||||
|
||||
#endif // MAME_EMU_DEVFIND_H
|
||||
/// \}
|
||||
|
@ -906,8 +906,6 @@ memory_manager::memory_manager(running_machine &machine)
|
||||
|
||||
memory_manager::~memory_manager()
|
||||
{
|
||||
for(void *ptr : m_datablocks)
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
@ -1036,10 +1034,9 @@ void memory_manager::initialize()
|
||||
|
||||
void *memory_manager::allocate_memory(device_t &dev, int spacenum, std::string name, u8 width, size_t bytes)
|
||||
{
|
||||
void *ptr = malloc(bytes);
|
||||
void *const ptr = m_datablocks.emplace(m_datablocks.end(), malloc(bytes))->get();
|
||||
memset(ptr, 0, bytes);
|
||||
m_datablocks.push_back(ptr);
|
||||
machine().save().save_memory(&dev, "memory", dev.tag(), spacenum, name.c_str(), ptr, width/8, (u32)bytes / (width/8));
|
||||
machine().save().save_memory(&dev, "memory", dev.tag(), spacenum, name.c_str(), ptr, width/8, u32(bytes) / (width/8));
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -1709,8 +1706,8 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
|
||||
install_bank_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror,
|
||||
(readorwrite == read_or_write::READ) ? bank : nullptr,
|
||||
(readorwrite == read_or_write::WRITE) ? bank : nullptr);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case AMH_DEVICE_SUBMAP:
|
||||
throw emu_fatalerror("Internal mapping error: leftover mapping of '%s'.\n", data.m_tag);
|
||||
|
@ -1787,10 +1787,12 @@ public:
|
||||
void region_free(std::string name);
|
||||
|
||||
private:
|
||||
struct stdlib_deleter { void operator()(void *p) const { free(p); } };
|
||||
|
||||
// internal state
|
||||
running_machine & m_machine; // reference to the machine
|
||||
|
||||
std::vector<void *> m_datablocks; // list of memory blocks to free on exit
|
||||
std::vector<std::unique_ptr<void, stdlib_deleter>> m_datablocks; // list of memory blocks to free on exit
|
||||
std::unordered_map<std::string, std::unique_ptr<memory_bank>> m_banklist; // data gathered for each bank
|
||||
std::unordered_map<std::string, std::unique_ptr<memory_share>> m_sharelist; // map for share lookups
|
||||
std::unordered_map<std::string, std::unique_ptr<memory_region>> m_regionlist; // list of memory regions
|
||||
|
@ -1278,7 +1278,7 @@ void rom_load_manager::load_software_part_region(device_t &device, software_list
|
||||
machine().memory().region_free(memregion->name());
|
||||
}
|
||||
|
||||
/* remember the base and length */
|
||||
// remember the base and length
|
||||
m_region = machine().memory().region_alloc(regiontag, regionlength, width, endianness);
|
||||
LOG("Allocated %X bytes @ %p\n", m_region->bytes(), m_region->base());
|
||||
|
||||
|
@ -67,7 +67,6 @@ public:
|
||||
: amiga_state(mconfig, type, tag)
|
||||
, m_bios_region(*this, "user2")
|
||||
, m_rom_board(*this, "user3")
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
@ -90,9 +89,13 @@ public:
|
||||
void init_dlta();
|
||||
void init_argh();
|
||||
|
||||
void arcadia_multibios_change_game(uint16_t data);
|
||||
template <int Coin> DECLARE_CUSTOM_INPUT_MEMBER(coin_counter_r);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(coin_changed_callback);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
|
||||
void arcadia_multibios_change_game(uint16_t data);
|
||||
void arcadia_cia_0_portb_w(uint8_t data);
|
||||
|
||||
private:
|
||||
@ -103,8 +106,6 @@ private:
|
||||
void argh_map(address_map &map);
|
||||
void overlay_512kb_map(address_map &map);
|
||||
|
||||
virtual void machine_reset() override;
|
||||
|
||||
optional_memory_region m_bios_region, m_rom_board;
|
||||
|
||||
uint8_t m_coin_counter[2];
|
||||
|
@ -713,7 +713,10 @@ void hp3478a_state::hp3478a(machine_config &config)
|
||||
******************************************************************************/
|
||||
ROM_START( hp3478a )
|
||||
ROM_REGION( 0x2000, "maincpu", 0 )
|
||||
ROM_LOAD("rom_dc118.bin", 0, 0x2000, CRC(10097ced) SHA1(bd665cf7e07e63f825b2353c8322ed8a4376b3bd)) //main CPU ROM, can match other datecodes too
|
||||
ROM_LOAD("rom_dc118.bin", 0, 0x2000, CRC(10097ced) SHA1(bd665cf7e07e63f825b2353c8322ed8a4376b3bd)) // main CPU ROM, can match other datecodes too
|
||||
|
||||
ROM_REGION( 0x100, "nvram", 0 ) // default data for battery-backed Calibration RAM
|
||||
ROM_LOAD( "calram.bin", 0, 0x100, NO_DUMP)
|
||||
ROM_END
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -92,7 +92,6 @@ private:
|
||||
class jtces40_state : public jtc_state
|
||||
{
|
||||
public:
|
||||
using jtc_state::jtc_state;
|
||||
jtces40_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: jtc_state(mconfig, type, tag)
|
||||
, m_video_ram_40(*this, "videoram40", JTC_ES40_VIDEORAM_SIZE, ENDIANNESS_BIG)
|
||||
|
@ -89,7 +89,7 @@ void klax_bootleg_state::machine_start()
|
||||
m_audio_sample[0] = m_audio_sample[1] = 0x00;
|
||||
m_audio_nibble = 0;
|
||||
|
||||
save_pointer(NAME(m_audio_sample), 2);
|
||||
save_item(NAME(m_audio_sample));
|
||||
save_item(NAME(m_audio_nibble));
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ private:
|
||||
void mk3b_soc_state::map(address_map &map)
|
||||
{
|
||||
// 64MB external NOR flash
|
||||
map(0x08000000, 0x0BFFFFFF).rom().share("norflash");;
|
||||
map(0x08000000, 0x0BFFFFFF).rom().share("norflash");
|
||||
// unknown amount and configuration of internal RAM
|
||||
map(0x00000000, 0x0000FFFF).ram().share("iram0");
|
||||
// This section of RAM seems to contain the stack
|
||||
|
@ -112,6 +112,7 @@ void tigeroad_state::main_map(address_map &map)
|
||||
map(0xfe8000, 0xfe8003).w(FUNC(tigeroad_state::scroll_w));
|
||||
map(0xfe800e, 0xfe800f).nopw(); // fe800e = watchdog or IRQ acknowledge
|
||||
map(0xfec000, 0xfec7ff).ram().w(FUNC(tigeroad_state::videoram_w)).share("videoram");
|
||||
|
||||
map(0xff8000, 0xff87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette");
|
||||
map(0xffc000, 0xffffff).ram().share("ram16");
|
||||
}
|
||||
|
@ -983,7 +983,7 @@ void v1050_state::machine_start()
|
||||
program.install_readwrite_bank(0x2000, 0x3fff, membank("bank2"));
|
||||
membank("bank2")->configure_entries(0, 2, ram + 0x2000, 0x10000);
|
||||
membank("bank2")->configure_entry(2, ram + 0x1e000);
|
||||
|
||||
|
||||
program.install_readwrite_bank(0x4000, 0x7fff, membank("bank3"));
|
||||
membank("bank3")->configure_entries(0, 2, ram + 0x4000, 0x10000);
|
||||
|
||||
|
@ -263,7 +263,7 @@ void voyager_state::voyager_map(address_map &map)
|
||||
map(0x000a0000, 0x000bffff).rw("vga", FUNC(trident_vga_device::mem_r), FUNC(trident_vga_device::mem_w)); // VGA VRAM
|
||||
map(0x000c0000, 0x000c7fff).rom().region("video_bios", 0);
|
||||
map(0x000c8000, 0x000cffff).noprw();
|
||||
//map(0x000d0000, 0x000d0003).ram(); // XYLINX - Synchronus serial communication
|
||||
//map(0x000d0000, 0x000d0003).ram(); // XYLINX - Synchronous serial communication
|
||||
map(0x000d0008, 0x000d000b).nopw(); // ???
|
||||
map(0x000d0800, 0x000d0fff).rw(FUNC(voyager_state::nvram_r), FUNC(voyager_state::nvram_w)); // GAME_CMOS
|
||||
|
||||
|
@ -18,6 +18,16 @@
|
||||
class ojankohs_state : public driver_device
|
||||
{
|
||||
public:
|
||||
ojankohs_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
ojankohs_state(mconfig, type, tag, 0x1000, 0x800)
|
||||
{ }
|
||||
|
||||
void ojankohs(machine_config &config);
|
||||
void ccasino(machine_config &config);
|
||||
void ojankoc(machine_config &config);
|
||||
void ojankoy(machine_config &config);
|
||||
|
||||
protected:
|
||||
ojankohs_state(const machine_config &mconfig, device_type type, const char *tag, uint32_t vramsize, uint32_t pramsize) :
|
||||
driver_device(mconfig, type, tag),
|
||||
m_videoram(*this, "videoram", vramsize, ENDIANNESS_LITTLE),
|
||||
@ -37,16 +47,6 @@ public:
|
||||
m_dsw3(*this, "dsw3"), m_dsw4(*this, "dsw4")
|
||||
{ }
|
||||
|
||||
ojankohs_state(const machine_config &mconfig, device_type type, const char *tag) :
|
||||
ojankohs_state(mconfig, type, tag, 0x1000, 0x800)
|
||||
{ }
|
||||
|
||||
void ojankohs(machine_config &config);
|
||||
void ccasino(machine_config &config);
|
||||
void ojankoc(machine_config &config);
|
||||
void ojankoy(machine_config &config);
|
||||
|
||||
protected:
|
||||
virtual void machine_reset() override;
|
||||
|
||||
private:
|
||||
|
@ -564,7 +564,7 @@ void *sega_315_5195_mapper_device::decrypt_bank::set(offs_t start, offs_t end, o
|
||||
m_start = start;
|
||||
m_end = end;
|
||||
m_rgnoffs = rgnoffs;
|
||||
m_srcptr = static_cast<u8 *>(src);
|
||||
m_srcptr = reinterpret_cast<u8 *>(src);
|
||||
|
||||
// configure the fd1094 cache
|
||||
if (m_fd1094_cache != nullptr)
|
||||
|
@ -233,8 +233,8 @@ void toaplan1_rallybik_state::video_start()
|
||||
create_tilemaps();
|
||||
vram_alloc();
|
||||
|
||||
m_buffered_spriteram = make_unique_clear<u16[]>(m_spriteram.share()->bytes() / 2);
|
||||
save_pointer(NAME(m_buffered_spriteram), m_spriteram.share()->bytes() / 2);
|
||||
m_buffered_spriteram = make_unique_clear<u16[]>(m_spriteram.bytes() / 2);
|
||||
save_pointer(NAME(m_buffered_spriteram), m_spriteram.bytes() / 2);
|
||||
|
||||
m_tilemap[0]->set_scrolldx(-0x00d - 6, -0x80 + 6);
|
||||
m_tilemap[1]->set_scrolldx(-0x00d - 4, -0x80 + 4);
|
||||
@ -771,7 +771,7 @@ void toaplan1_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, c
|
||||
u16 *size = (u16 *)m_buffered_spritesizeram.get();
|
||||
int fcu_flipscreen = m_fcu_flipscreen;
|
||||
|
||||
for (int offs = m_spriteram.share()->bytes() / 2 - 4; offs >= 0; offs -= 4)
|
||||
for (int offs = m_spriteram.bytes() / 2 - 4; offs >= 0; offs -= 4)
|
||||
{
|
||||
if (!(source[offs] & 0x8000))
|
||||
{
|
||||
@ -839,7 +839,7 @@ u32 toaplan1_rallybik_state::screen_update(screen_device &screen, bitmap_rgb32 &
|
||||
{
|
||||
log_vram();
|
||||
|
||||
m_spritegen->draw_sprites_to_tempbitmap(cliprect, m_buffered_spriteram.get(), m_spriteram.share()->bytes());
|
||||
m_spritegen->draw_sprites_to_tempbitmap(cliprect, m_buffered_spriteram.get(), m_spriteram.bytes());
|
||||
|
||||
// first draw everything, including "disabled" tiles and priority 0
|
||||
m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE | TILEMAP_DRAW_ALL_CATEGORIES, 0);
|
||||
@ -895,7 +895,7 @@ WRITE_LINE_MEMBER(toaplan1_rallybik_state::screen_vblank)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.share()->bytes());
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
|
||||
interrupt();
|
||||
}
|
||||
}
|
||||
@ -905,7 +905,7 @@ WRITE_LINE_MEMBER(toaplan1_state::screen_vblank)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.share()->bytes());
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
|
||||
memcpy(m_buffered_spritesizeram.get(), m_spritesizeram.get(), TOAPLAN1_SPRITESIZERAM_SIZE);
|
||||
interrupt();
|
||||
}
|
||||
@ -916,7 +916,7 @@ WRITE_LINE_MEMBER(toaplan1_samesame_state::screen_vblank)
|
||||
// rising edge
|
||||
if (state)
|
||||
{
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.share()->bytes());
|
||||
memcpy(m_buffered_spriteram.get(), m_spriteram, m_spriteram.bytes());
|
||||
memcpy(m_buffered_spritesizeram.get(), m_spritesizeram.get(), TOAPLAN1_SPRITESIZERAM_SIZE);
|
||||
interrupt();
|
||||
m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); /* Frame done */
|
||||
|
Loading…
Reference in New Issue
Block a user