Previous 15994 Revisions Next

r8456 Friday 9th July, 2010 at 14:55:16 UTC by Miodrag Milanović
Getting rid of :
cpu_get_clock
cpu_set_clock
cpu_get_clockscale
cpu_set_clockscale
[src/mess/drivers]socrates.c
[src/mess/machine]c1571.c coco.c europc.c pc_turbo.c primo.c tandy1t.c vic1112.c
[src/mess/video]coco6847.c spectrum.c vic4567.c

src/mess/machine/coco.c
r8455r8456
19731973     * TODO:  Make the overclock more accurate.  In dual speed, ROM was a fast
19741974     * access but RAM was not.  I don't know how to simulate this.
19751975     */
1976    cpu_set_clockscale(device->machine->device("maincpu"), val ? 2 : 1);
1976    device->machine->device("maincpu")->set_clock_scale(val ? 2 : 1);
19771977}
19781978
19791979READ8_HANDLER(dgnalpha_mapped_irq_r)
src/mess/machine/vic1112.c
r8455r8456
303303   vic1112->bus = device->machine->device(config->bus_tag);
304304
305305   /* set VIA clocks */
306   vic1112->via0->set_unscaled_clock(cpu_get_clock(device->machine->firstcpu));
307   vic1112->via1->set_unscaled_clock(cpu_get_clock(device->machine->firstcpu));
306   vic1112->via0->set_unscaled_clock(device->machine->firstcpu->unscaled_clock());
307   vic1112->via1->set_unscaled_clock(device->machine->firstcpu->unscaled_clock());
308308
309309   /* map VIAs to memory */
310310   memory_install_readwrite8_device_handler(program, vic1112->via0, 0x9800, 0x980f, 0, 0, via_r, via_w);
src/mess/machine/europc.c
r8455r8456
120120   case 4:
121121      switch(data & 0xc0)
122122      {
123      case 0x00: cpu_set_clockscale(space->machine->device("maincpu"), 1.0 / 2); break;
124      case 0x40: cpu_set_clockscale(space->machine->device("maincpu"), 3.0 / 4); break;
125      default: cpu_set_clockscale(space->machine->device("maincpu"), 1); break;
123      case 0x00: space->machine->device("maincpu")->set_clock_scale(1.0 / 2); break;
124      case 0x40: space->machine->device("maincpu")->set_clock_scale(3.0 / 4); break;
125      default: space->machine->device("maincpu")->set_clock_scale(1); break;
126126      }
127127      break;
128128   case 0xa:
src/mess/machine/tandy1t.c
r8455r8456
214214   case 2:
215215      tandy_ppi.portc = data;
216216      if (data & 8)
217         cpu_set_clockscale(space->machine->device("maincpu"), 1);
217         space->machine->device("maincpu")->set_clock_scale(1);
218218      else
219         cpu_set_clockscale(space->machine->device("maincpu"), 4.77/8);
219         space->machine->device("maincpu")->set_clock_scale(4.77/8);
220220      break;
221221   }
222222}
src/mess/machine/primo.c
r8455r8456
244244   if (input_port_read(machine, "MEMORY_EXPANSION"))
245245      primo_port_FD = 0x00;
246246   primo_update_memory(machine);
247   cpu_set_clockscale(machine->device("maincpu"), input_port_read(machine, "CPU_CLOCK") ? 1.5 : 1.0);
247   machine->device("maincpu")->set_clock_scale(input_port_read(machine, "CPU_CLOCK") ? 1.5 : 1.0);
248248}
249249
250250MACHINE_RESET( primoa )
src/mess/machine/pc_turbo.c
r8455r8456
3232   if (val != ti->cur_val)
3333   {
3434      ti->cur_val = val;
35      cpu_set_clockscale(ti->cpu, val ? ti->on_speed : ti->off_speed);
35      ti->cpu->set_clock_scale(val ? ti->on_speed : ti->off_speed);
3636   }
3737}
3838
src/mess/machine/c1571.c
r8455r8456
462462   {
463463      UINT32 clock = clock_1_2 ? XTAL_16MHz/8 : XTAL_16MHz/16;
464464
465      cpu_set_clock(c1571->cpu, clock);
465      c1571->cpu->set_unscaled_clock(clock);
466466      c1571->cia->set_unscaled_clock(clock);
467467      c1571->via0->set_unscaled_clock(clock);
468468      c1571->via1->set_unscaled_clock(clock);
src/mess/video/coco6847.c
r8455r8456
18901890   if (cfg->cpu0_timing_factor > 0)
18911891   {
18921892      cpu0_clock_period = period * 1 * GROSS_FACTOR;
1893      cpu_set_clock(machine->firstcpu, ATTOSECONDS_PER_SECOND / cpu0_clock_period);
1893      machine->firstcpu->set_unscaled_clock( ATTOSECONDS_PER_SECOND / cpu0_clock_period);
18941894   }
18951895
18961896   /* calculate timing */
src/mess/video/spectrum.c
r8455r8456
595595{
596596
597597        if (!CyclesPerFrame)
598                CyclesPerFrame = (int)(cpu_get_clock(machine->firstcpu) / machine->primary_screen->frame_period().attoseconds);   //totalcycles();    //_(int)(cpunum_get_clock(0) / machine->config->frames_per_second);
598                CyclesPerFrame = (int)(machine->firstcpu->unscaled_clock() / machine->primary_screen->frame_period().attoseconds);   //totalcycles();    //_(int)(cpunum_get_clock(0) / machine->config->frames_per_second);
599599
600600        if (NumEvents < TotalEvents)
601601        {
src/mess/video/vic4567.c
r8455r8456
13871387   case 0x31:
13881388      vic3->reg[offset] = data;
13891389      if (data & 0x40)
1390         cpu_set_clockscale(vic3->cpu, 1.0);
1390         vic3->cpu->set_clock_scale(1.0);
13911391      else
1392         cpu_set_clockscale(vic3->cpu, 1.0/3.5);
1392         vic3->cpu->set_clock_scale(1.0/3.5);
13931393      break;
13941394   case 0x32:
13951395   case 0x33:
src/mess/drivers/socrates.c
r8455r8456
201201    for (i = 0; i < 0x10000; i++)
202202        gfx[i] = (((i&0x1)?0x00:0xFF)^((i&0x100)?0x00:0xff));
203203// init sound channels to both be on lowest pitch and max volume
204    cpu_set_clockscale(machine->device("maincpu"), 0.45f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
204    machine->device("maincpu")->set_clock_scale(0.45f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
205205}
206206
207207static READ8_HANDLER( socrates_rom_bank_r )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team