Previous 15994 Revisions Next

r10080 Monday 17th January, 2011 at 21:42:35 UTC by Wilbert Pol
[SCORPIO] Get rid of the unmap_write calls and re-enable direct update handler.
[src/mess/drivers]scorpion.c

src/mess/drivers/scorpion.c
r10079r10080
183183
184184/* rom 0=zx128, 1=zx48, 2 = service monitor, 3=tr-dos */
185185
186static UINT8 *ram_0000;
187static UINT8 ram_disabled_by_beta;
188
186189static void scorpion_update_memory(running_machine *machine)
187190{
188191   spectrum_state *state = machine->driver_data<spectrum_state>();
189192   UINT8 *messram = ram_get_ptr(machine->device(RAM_TAG));
190   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
191193
192194   state->screen_location = messram + ((state->port_7ffd_data & 8) ? (7<<14) : (5<<14));
193195
r10079r10080
195197
196198   if ((state->port_1ffd_data & 0x01)==0x01)
197199   {
198      memory_install_write_bank(space, 0x0000, 0x3fff, 0, 0, "bank1");
200      ram_0000 = messram+(8<<14);
199201      memory_set_bankptr(machine, "bank1", messram+(8<<14));
200202      logerror("RAM\n");
201203   }
r10079r10080
209211      {
210212         state->ROMSelection = ((state->port_7ffd_data>>4) & 0x01) ? 1 : 0;
211213      }
212      memory_unmap_write(space, 0x0000, 0x3fff, 0, 0);
213214      memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14));
214215   }
215216
216217
217218}
218219
220static WRITE8_HANDLER( scorpion_0000_w )
221{
222   spectrum_state *state = space->machine->driver_data<spectrum_state>();
223
224   if ( ! ram_0000 )
225      return;
226
227   if ((state->port_1ffd_data & 0x01)==0x01)
228   {
229      if ( ! ram_disabled_by_beta )
230         ram_0000[offset] = data;
231   }
232}
233
234
219235DIRECT_UPDATE_HANDLER( scorpion_direct )
220236{
221237   spectrum_state *state = machine->driver_data<spectrum_state>();
r10079r10080
223239   UINT16 pc = cpu_get_reg(machine->device("maincpu"), STATE_GENPCBASE);
224240   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
225241
242   ram_disabled_by_beta = 0;
226243   if (betadisk_is_active(beta))
227244   {
228245      if (pc >= 0x4000)
229246      {
230247         state->ROMSelection = ((state->port_7ffd_data>>4) & 0x01) ? 1 : 0;
231248         betadisk_disable(beta);
232         memory_unmap_write(space, 0x0000, 0x3fff, 0, 0);
249         ram_disabled_by_beta = 1;
233250         memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14));
234251      }
235252   }
r10079r10080
240257   }
241258   if((address>=0x0000) && (address<=0x3fff))
242259   {
243      memory_unmap_write(space, 0x0000, 0x3fff, 0, 0);
260      ram_disabled_by_beta = 1;
244261      direct.explicit_configure(0x0000, 0x3fff, 0x3fff, space->machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14));
245262      memory_set_bankptr(machine, "bank1", space->machine->region("maincpu")->base() + 0x010000 + (state->ROMSelection<<14));
246263      return ~0;
r10079r10080
309326   device_t *beta = machine->device(BETA_DISK_TAG);
310327   address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
311328
312   memory_install_read_bank (space, 0x0000, 0x3fff, 0, 0, "bank1");
329   ram_0000 = NULL;
330   memory_install_read_bank(space, 0x0000, 0x3fff, 0, 0, "bank1");
331   memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, scorpion_0000_w);
313332
314333   betadisk_disable(beta);
315334   betadisk_clear_status(beta);
316   // This causes severe slowdown (5fps vs 750fps) removed until rewritten
317   //space->set_direct_update_handler(direct_update_delegate_create_static(scorpion_direct, *machine));
335   space->set_direct_update_handler(direct_update_delegate_create_static(scorpion_direct, *machine));
318336
319337   memset(messram,0,256*1024);
320338

Previous 15994 Revisions Next


© 1998-2018 The MESS Team