trunk/src/emu/bus/ql/trumpcard.c
| r30831 | r30832 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:Curt Coder, Phill Harvey-Smith |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Miracle Systems QL Trump Card emulation |
| r30831 | r30832 | |
| 9 | 9 | |
| 10 | 10 | **********************************************************************/ |
| 11 | 11 | |
| 12 | | /* |
| 13 | | |
| 14 | | TODO: |
| 15 | | |
| 16 | | - RAM always 128KB on boot screen |
| 17 | | |
| 18 | | */ |
| 19 | | |
| 20 | 12 | #include "trumpcard.h" |
| 21 | 13 | |
| 22 | 14 | |
| r30831 | r30832 | |
| 167 | 159 | |
| 168 | 160 | // state saving |
| 169 | 161 | save_item(NAME(m_rom_en)); |
| 170 | | save_item(NAME(m_ram_en)); |
| 171 | 162 | } |
| 172 | 163 | |
| 173 | 164 | |
| r30831 | r30832 | |
| 181 | 172 | m_fdc->dden_w(0); |
| 182 | 173 | |
| 183 | 174 | m_rom_en = false; |
| 184 | | m_ram_en = false; |
| 185 | 175 | } |
| 186 | 176 | |
| 187 | 177 | |
| r30831 | r30832 | |
| 191 | 181 | |
| 192 | 182 | UINT8 ql_trump_card_t::read(address_space &space, offs_t offset, UINT8 data) |
| 193 | 183 | { |
| 194 | | if (!m_rom_en && offset >= 0xc000 && offset < 0x10000) |
| 184 | if (offset >= 0xc000 && offset < 0x10000) |
| 195 | 185 | { |
| 196 | 186 | m_rom_en = true; |
| 197 | | |
| 198 | | data = m_rom->base()[offset & 0x3fff]; |
| 199 | 187 | } |
| 200 | 188 | |
| 201 | 189 | if (offset >= 0x10000 && offset < 0x18000) |
| 202 | 190 | { |
| 203 | | if (m_ram_size == 768*1024) |
| 204 | | { |
| 205 | | m_ram_en = true; |
| 206 | | } |
| 191 | m_rom_en = false; |
| 207 | 192 | |
| 208 | 193 | data = m_rom->base()[offset & 0x7fff]; |
| 209 | 194 | } |
| r30831 | r30832 | |
| 213 | 198 | data = m_fdc->read(space, offset & 0x03); |
| 214 | 199 | } |
| 215 | 200 | |
| 216 | | if (offset >= 0x60000 && offset < 0xc0000) |
| 201 | if (offset >= 0x40000 && offset < 0xc0000) |
| 217 | 202 | { |
| 218 | | if ((offset - 0x60000) < m_ram_size) |
| 203 | if ((offset - 0x40000) < m_ram_size) |
| 219 | 204 | { |
| 220 | | data = m_ram[offset - 0x60000]; |
| 205 | data = m_ram[offset - 0x40000]; |
| 221 | 206 | } |
| 222 | 207 | } |
| 223 | 208 | |
| 224 | 209 | if (offset >= 0xc0000) |
| 225 | 210 | { |
| 226 | | if (m_rom_en && offset < 0xc8000) |
| 211 | if (m_rom_en) |
| 227 | 212 | { |
| 228 | | data = m_rom->base()[offset & 0x7fff]; |
| 213 | if (offset < 0xc8000) |
| 214 | { |
| 215 | data = m_rom->base()[offset & 0x7fff]; |
| 216 | } |
| 229 | 217 | } |
| 230 | | |
| 231 | | if (m_ram_en) |
| 218 | else |
| 232 | 219 | { |
| 233 | | data = m_ram[offset - 0x60000]; |
| 220 | if ((offset - 0x40000) < m_ram_size) |
| 221 | { |
| 222 | data = m_ram[offset - 0x40000]; |
| 223 | } |
| 234 | 224 | } |
| 235 | 225 | } |
| 236 | 226 | |
| r30831 | r30832 | |
| 286 | 276 | } |
| 287 | 277 | } |
| 288 | 278 | |
| 289 | | if (offset >= 0x60000 && offset < 0xc0000) |
| 279 | if (offset >= 0x40000 && offset < 0xc0000) |
| 290 | 280 | { |
| 291 | | if ((offset - 0x60000) < m_ram_size) |
| 281 | if ((offset - 0x40000) < m_ram_size) |
| 292 | 282 | { |
| 293 | | m_ram[offset - 0x60000] = data; |
| 283 | m_ram[offset - 0x40000] = data; |
| 294 | 284 | } |
| 295 | 285 | } |
| 296 | 286 | |
| 297 | 287 | if (offset >= 0xc0000) |
| 298 | 288 | { |
| 299 | | if (m_ram_en) |
| 289 | if (!m_rom_en) |
| 300 | 290 | { |
| 301 | | m_ram[offset - 0x60000] = data; |
| 291 | m_ram[offset - 0x40000] = data; |
| 302 | 292 | } |
| 303 | 293 | } |
| 304 | 294 | } |
trunk/src/emu/bus/ql/sandy_superqboard.c
| r30831 | r30832 | |
| 1 | 1 | // license:BSD-3-Clause |
| 2 | | // copyright-holders:Curt Coder |
| 2 | // copyright-holders:Curt Coder, Phill Harvey-Smith |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | Sandy SuperQBoard (with HD upgrade) emulation |
| r30831 | r30832 | |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | | if (offset >= 0x60000 && offset < 0xc0000) |
| 260 | if (offset >= 0x40000 && offset < 0xc0000) |
| 261 | 261 | { |
| 262 | | if ((offset - 0x60000) < m_ram_size) |
| 262 | if ((offset - 0x40000) < m_ram_size) |
| 263 | 263 | { |
| 264 | | data = m_ram[offset - 0x60000]; |
| 264 | data = m_ram[offset - 0x40000]; |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| r30831 | r30832 | |
| 348 | 348 | } |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | | if (offset >= 0x60000 && offset < 0xc0000) |
| 351 | if (offset >= 0x40000 && offset < 0xc0000) |
| 352 | 352 | { |
| 353 | | if ((offset - 0x60000) < m_ram_size) |
| 353 | if ((offset - 0x40000) < m_ram_size) |
| 354 | 354 | { |
| 355 | | m_ram[offset - 0x60000] = data; |
| 355 | m_ram[offset - 0x40000] = data; |
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | } |