Previous 15994 Revisions Next

r3710 Friday 28th November, 2008 at 19:35:30 UTC by Miodrag Milanović
[SCORPION] Fixed regression
[src/mess/drivers]scorpion.c

src/mess/drivers/scorpion.c
r3709r3710
194194
195195static int ROMSelection;
196196
197//static UINT8 *rom_pointer;
198
197199static void scorpion_update_memory(running_machine *machine)
198200{
199201   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
r3709r3710
204206   if ((scorpion_256_port_1ffd_data & 0x01)==0x01)
205207   {
206208      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
207      memory_set_bankptr(machine, 1, mess_ram+(8<<14));     
209      memory_set_bankptr(machine, 1, mess_ram+(8<<14));   
210      logerror("RAM\n");   
208211   }
209212   else
210213   {
r3709r3710
212215      {
213216         ROMSelection = 2;         
214217      } else {
215         /* ROM switching */
216218         ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0;
217219      }         
218220      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
r3709r3710
224226
225227static DIRECT_UPDATE_HANDLER( scorpion_direct )
226228{   
229   UINT16 pc = cpu_get_reg(space->machine->cpu[0], REG_PREVIOUSPC);
227230   if (betadisk_is_active()) {
228      if (cpu_get_pc(space->machine->cpu[0]) >= 0x4000) {
231      if (pc >= 0x4000) {
229232         ROMSelection = ((spectrum_128_port_7ffd_data>>4) & 0x01) ? 1 : 0;
230233         betadisk_disable();
231         memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x010000 + 0x4000*ROMSelection); // Set BASIC ROM
232234         memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
235         memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x010000 + (ROMSelection<<14));
233236      }   
234   } else if (((cpu_get_pc(space->machine->cpu[0]) & 0xff00) == 0x3d00) && (ROMSelection==1))
237   } else if (((pc & 0xff00) == 0x3d00) && (ROMSelection==1))
235238   {
236239      ROMSelection = 3;
237240      betadisk_enable();
238      memory_set_bankptr(space->machine, 1, memory_region(space->machine, "main") + 0x01c000); // Set TRDOS ROM         
241     
242   }
243   if((address>=0x0000) && (address<=0x3fff)) {
239244      memory_install_write8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_UNMAP);
240   }
245      direct->raw = direct->decrypted =  memory_region(space->machine, "main") + 0x010000 + (ROMSelection<<14);
246      memory_set_bankptr(space->machine, 1, direct->raw);
247      return ~0;
248   }
241249   return address;
242250}
243251
r3709r3710
290298
291299static MACHINE_RESET( scorpion )
292300{   
293   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
301   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);   
294302   
295   memory_install_read8_handler(space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
303   memory_install_read8_handler (space, 0x0000, 0x3fff, 0, 0, SMH_BANK1);
296304   
297305   betadisk_disable();
298306   betadisk_clear_status();

Previous 15994 Revisions Next


© 1998-2018 The MESS Team