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 |
r32659 | r32660 | |
---|---|---|
31 | 31 | |
32 | 32 | device_colecovision_cartridge_interface::device_colecovision_cartridge_interface(const machine_config &mconfig, device_t &device) : |
33 | 33 | device_slot_card_interface(mconfig, device), |
34 | m_rom(*this, "rom") | |
34 | m_rom(NULL), | |
35 | m_rom_size(0) | |
35 | 36 | { |
36 | 37 | m_slot = dynamic_cast<colecovision_cartridge_slot_device *>(device.owner()); |
37 | 38 | } |
38 | 39 | |
40 | void 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 | } | |
39 | 48 | |
40 | 49 | |
41 | 50 | //************************************************************************** |
r32659 | r32660 | |
72 | 81 | { |
73 | 82 | if (m_card) |
74 | 83 | { |
84 | size_t size = (software_entry() == NULL) ? length() : get_software_region_length("rom"); | |
85 | m_card->rom_alloc(size); | |
86 | ||
75 | 87 | if (software_entry() == NULL) |
76 | 88 | { |
77 | size_t size = length(); | |
78 | m_card->m_rom.allocate(size); | |
79 | 89 | fread(m_card->m_rom, size); |
80 | 90 | } |
81 | 91 | else |
82 | 92 | { |
83 | 93 | // TODO 8000/a000/c000/e000 |
84 | | |
94 | memcpy(m_card->m_rom, get_software_region("rom"), size); | |
85 | 95 | } |
86 | 96 | } |
87 | 97 |
r32659 | r32660 | |
---|---|---|
115 | 115 | |
116 | 116 | virtual UINT8 bd_r(address_space &space, offs_t offset, UINT8 data, int _8000, int _a000, int _c000, int _e000) { return 0xff; } |
117 | 117 | |
118 | void rom_alloc(size_t size); | |
119 | ||
118 | 120 | protected: |
119 | optional_shared_ptr<UINT8> m_rom; | |
121 | UINT8 *m_rom; | |
122 | size_t m_rom_size; | |
120 | 123 | |
121 | 124 | colecovision_cartridge_slot_device *m_slot; |
122 | 125 | }; |
r32659 | r32660 | |
---|---|---|
53 | 53 | { |
54 | 54 | if (!_8000 || !_a000 || !_c000 || !_e000) |
55 | 55 | { |
56 | if (offset < m_rom | |
56 | if (offset < m_rom_size) | |
57 | 57 | data = m_rom[offset]; |
58 | 58 | else |
59 | 59 | data = 0xff; |
Previous | 199869 Revisions | Next |