Previous 199869 Revisions Next

r32660 Saturday 11th October, 2014 at 16:42:53 UTC by Fabio Priuli
(MESS) let's try to workaround coleco cart problems from fullpath
by using a rom region instead of the shared pointer... so to also
avoid ROM data into save states while at it. nw

for the record, the code at fault in this case is the call of
m_rom.allocate(size), which in turn invokes code from
devfind.h and tries to save the pointer...

of course, Curt, if you find a better solution feel free to revert
this as you prefer :)
[src/emu/bus/coleco]exp.c exp.h std.c

trunk/src/emu/bus/coleco/exp.c
r32659r32660
3131
3232device_colecovision_cartridge_interface::device_colecovision_cartridge_interface(const machine_config &mconfig, device_t &device) :
3333   device_slot_card_interface(mconfig, device),
34   m_rom(*this, "rom")
34   m_rom(NULL),
35   m_rom_size(0)
3536{
3637   m_slot = dynamic_cast<colecovision_cartridge_slot_device *>(device.owner());
3738}
3839
40void device_colecovision_cartridge_interface::rom_alloc(size_t size)
41{
42   if (m_rom == NULL)
43   {
44      m_rom = device().machine().memory().region_alloc("coleco_cart:rom", size, 1, ENDIANNESS_LITTLE)->base();
45      m_rom_size = size;
46   }
47}
3948
4049
4150//**************************************************************************
r32659r32660
7281{
7382   if (m_card)
7483   {
84      size_t size = (software_entry() == NULL) ? length() : get_software_region_length("rom");
85      m_card->rom_alloc(size);
86
7587      if (software_entry() == NULL)
7688      {
77         size_t size = length();
78         m_card->m_rom.allocate(size);
7989         fread(m_card->m_rom, size);
8090      }
8191      else
8292      {
8393         // TODO 8000/a000/c000/e000
84         load_software_region("rom", m_card->m_rom);
94         memcpy(m_card->m_rom, get_software_region("rom"), size);
8595      }
8696   }
8797
trunk/src/emu/bus/coleco/exp.h
r32659r32660
115115
116116   virtual UINT8 bd_r(address_space &space, offs_t offset, UINT8 data, int _8000, int _a000, int _c000, int _e000) { return 0xff; }
117117
118   void rom_alloc(size_t size);
119
118120protected:
119   optional_shared_ptr<UINT8> m_rom;
121   UINT8 *m_rom;
122   size_t m_rom_size;
120123
121124   colecovision_cartridge_slot_device *m_slot;
122125};
trunk/src/emu/bus/coleco/std.c
r32659r32660
5353{
5454   if (!_8000 || !_a000 || !_c000 || !_e000)
5555   {
56      if (offset < m_rom.bytes())
56      if (offset < m_rom_size)
5757         data = m_rom[offset];
5858      else
5959         data = 0xff;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team