Previous 15994 Revisions Next

r8693 Monday 2nd August, 2010 at 15:31:35 UTC by Roberto Zandonà
[C64] modified RDY hack and implemented joystick's ports mirror (now Arcana works)
[src/mess/drivers]c64.c
[src/mess/machine]c64.c cbmipt.c
[src/mess/video]vic6567.c

src/mess/machine/cbmipt.c
r8692r8693
163163//  PORT_CATEGORY_ITEM( 0x20, "Mouse 1351", 22 )
164164//  PORT_CATEGORY_ITEM( 0x30, "Mouse (Non Proportional) 1350", 23 )
165165   PORT_CATEGORY_ITEM( 0x70, "No Device Connected", 27 )
166   PORT_CONFNAME( 0x08, 0x00, "Workaround for RDY")
167   PORT_CONFSETTING(   0x00, DEF_STR( No ) )
168   PORT_CONFSETTING(   0x08, DEF_STR( Yes ) )
169166   PORT_CONFNAME( 0x80, 0x00, "Swap Gameport A and B") PORT_CODE(KEYCODE_F1) PORT_TOGGLE
170167   PORT_CONFSETTING(   0x00, DEF_STR( No ) )
171168   PORT_CONFSETTING(   0x80, DEF_STR( Yes ) )
172169
170   PORT_START("CYCLES")
171   PORT_CATEGORY_CLASS( 0x07, 0x00, "Cycles in a line" )
172   PORT_CATEGORY_ITEM( 0x00, "0", 0 )
173   PORT_CATEGORY_ITEM( 0x01, "1", 1 )
174   PORT_CATEGORY_ITEM( 0x02, "2", 2 )
175   PORT_CATEGORY_ITEM( 0x03, "3", 3 )
176   PORT_CATEGORY_ITEM( 0x04, "4", 4 )
177   PORT_CATEGORY_ITEM( 0x07, "Off", 7 )
178
173179   PORT_START("JOY1_1B")
174180   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(10)
175181   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_CATEGORY(10)
src/mess/machine/c64.c
r8692r8693
316316   else if (offset < 0xc00)
317317      return c64_colorram[offset & 0x3ff];
318318
319   else if (offset == 0xc00)
319   else if (offset < 0xd00)
320320      {
321         cia_set_port_mask_value(cia_0, 0, input_port_read(space->machine, "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] );
322         return mos6526_r(cia_0, offset);
323      }
321         if (offset & 1)
322            cia_set_port_mask_value(cia_0, 1, input_port_read(space->machine, "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] );
323         else
324            cia_set_port_mask_value(cia_0, 0, input_port_read(space->machine, "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] );
324325
325   else if (offset == 0xc01)
326      {
327         cia_set_port_mask_value(cia_0, 1, input_port_read(space->machine, "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] );
328326         return mos6526_r(cia_0, offset);
329327      }
330328
331   else if (offset < 0xd00)
332      return mos6526_r(cia_0, offset);
333
334329   else if (c64_cia1_on && (offset < 0xe00))
335330      return mos6526_r(cia_1, offset);
336331
src/mess/video/vic6567.c
r8692r8693
374374   if (vic2->cpu_suspended == 0)
375375   {
376376      vic2->first_ba_cycle = vic2->cycles_counter;
377      if (vic2->rdy_workaround_cb != NULL && vic2->rdy_workaround_cb(machine))
377      if ((vic2->rdy_workaround_cb != NULL) && (vic2->rdy_workaround_cb(machine) != 7 ))
378378         cpu_suspend(machine->firstcpu, SUSPEND_REASON_SPIN, 0);
379379      vic2->cpu_suspended = 1;
380380   }
r8692r8693
385385{
386386   if (vic2->cpu_suspended == 1)
387387   {
388      if (vic2->rdy_workaround_cb != NULL && vic2->rdy_workaround_cb(machine))
388      if ((vic2->rdy_workaround_cb != NULL))
389389         cpu_resume(machine->firstcpu, SUSPEND_REASON_SPIN);
390390      vic2->cpu_suspended = 0;
391391   }
r8692r8693
446446// Video matrix access
447447INLINE void vic2_matrix_access( running_machine *machine, vic2_state *vic2 )
448448{
449   if (vic2->cpu_suspended == 1)
449//   if (vic2->cpu_suspended == 1)
450450   {
451451      if ((vic2->cycles_counter - vic2->first_ba_cycle) < 0)
452452         vic2->matrix_line[vic2->ml_index] = vic2->color_line[vic2->ml_index] = 0xff;
r8692r8693
11861186
11871187      vic2->raster_x = 0xfffc;
11881188
1189      if ((vic2->rdy_workaround_cb(machine) == 0 ) && (vic2->is_bad_line))
1190         vic2_suspend_cpu(machine, vic2);
1191
11891192      vic2->cycle++;
11901193      break;
11911194
r8692r8693
11981201
11991202      vic2->vc = vic2->vc_base;
12001203
1204      if ((vic2->rdy_workaround_cb(machine) == 1 ) && (vic2->is_bad_line))
1205         vic2_suspend_cpu(machine, vic2);
1206
12011207      vic2->cycle++;
12021208      break;
12031209
r8692r8693
12121218         if (vic2->spr_exp_y & (1 << i))
12131219            vic2->mc_base[i] += 2;
12141220
1215      if (vic2->is_bad_line)
1216         vic2_suspend_cpu(machine, vic2);
1217
12181221      vic2->ml_index = 0;
12191222      vic2_matrix_access(machine, vic2);
12201223
1224      if ((vic2->rdy_workaround_cb(machine) == 2 ) && (vic2->is_bad_line))
1225         vic2_suspend_cpu(machine, vic2);
1226
12211227      vic2->cycle++;
12221228      break;
12231229
r8692r8693
12391245
12401246      vic2_matrix_access(machine, vic2);
12411247
1248      if ((vic2->rdy_workaround_cb(machine) == 3 ) && (vic2->is_bad_line))
1249         vic2_suspend_cpu(machine, vic2);
1250
12421251      vic2->cycle++;
12431252      break;
12441253
r8692r8693
12731282      vic2_fetch_if_bad_line(vic2);
12741283      vic2_matrix_access(machine, vic2);
12751284
1285      if ((vic2->rdy_workaround_cb(machine) == 4 ) && (vic2->is_bad_line))
1286         vic2_suspend_cpu(machine, vic2);
1287
12761288      vic2->cycle++;
12771289      break;
12781290
src/mess/drivers/c64.c
r8692r8693
620620
621621static UINT8 c64_rdy_cb( running_machine *machine )
622622{
623   return input_port_read(machine, "CTRLSEL") & 0x08;
623   return input_port_read(machine, "CYCLES") & 0x07;
624624}
625625
626626static const vic2_interface c64_vic2_ntsc_intf = {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team