Previous 15994 Revisions Next

r3606 Wednesday 26th November, 2008 at 21:52:02 UTC by R. Belmont
Fixed some (not all) cbmshare files.
[src/mess/machine]cbm.c cbmieeeb.c tpi6525.c vc1541.c

src/mess/machine/vc1541.c
r3605r3606
606606   
607607      if (drive->type == type_1541)
608608      {
609         cpunum_set_input_line(machine, drive->cpunumber, M6502_SET_OVERFLOW, 1);
610         via_3_ca1_w(machine, 0,1);
609         cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 1);
610         via_3_ca1_w(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0,1);
611611      }
612612
613613      drive->clock = 1;
r3605r3606
642642
643643   if (drive->type == type_1541)
644644   {
645      cpunum_set_input_line(machine, drive->cpunumber, M6502_SET_OVERFLOW, 0);
646      via_3_ca1_w(machine, 0, 0);
645      cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_SET_OVERFLOW, 0);
646      via_3_ca1_w(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0, 0);
647647   }
648648
649649   drive->clock = 0;
r3605r3606
671671   drive->via0irq = level;
672672   DBG_LOG(2, "vc1541 via0 irq",("level %d %d\n",drive->via0irq,drive->via1irq));
673673
674   cpunum_set_input_line (machine, drive->cpunumber, M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
674   cpu_set_input_line (machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
675675}
676676
677677static READ8_HANDLER( vc1541_via0_read_portb )
r3605r3606
724724      vc1541_serial_clock_write (1, drive->drive.serial.serial_clock = !(data & 0x08));
725725   }
726726
727   vc1541_serial_atn_write (machine, 1, drive->drive.serial.serial_atn = 1);
727   vc1541_serial_atn_write (space->machine, 1, drive->drive.serial.serial_atn = 1);
728728}
729729
730730
r3605r3606
761761   drive->via1irq = level;
762762   DBG_LOG(2, "vc1541 via1 irq", ("level %d %d\n", drive->via0irq, drive->via1irq));
763763
764   cpunum_set_input_line (machine, drive->cpunumber, M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
764   cpu_set_input_line (machine->cpu[drive->cpunumber], M6502_IRQ_LINE, drive->via1irq || drive->via0irq);
765765}
766766
767767static READ8_HANDLER( vc1541_via1_read_porta )
r3605r3606
940940         serial.atn[0] = serial.atn[1] && serial.atn[2];
941941         if (serial.atn[0] == level)
942942         {
943         #if 0
943944            DBG_LOG(1, "vc1541",("%d:%.4x atn %s\n",
944945                            cpu_getactivecpu (),
945946                            activecpu_get_pc(),
946947                            serial.atn[0]?"ATN":"atn"));
948         #endif
947949            via_set_input_ca1 (machine, 2, !level);
948950#if 0
949951            value=drive->drive.serial.data;
r3605r3606
979981      if (serial.data[0] != level)
980982      {
981983         serial.data[0] = serial.data[1] && serial.data[2];
984         #if 0
982985         if (serial.data[0] == level)
983986         {
984987            DBG_LOG(1, "vc1541",("%d:%.4x data %s\n",
r3605r3606
986989                            activecpu_get_pc(),
987990                            serial.data[0]?"DATA":"data"));
988991         }
992         #endif
989993      }
990994   }
991995}
r3605r3606
10111015         serial.clock[0] = serial.clock[1] && serial.clock[2];
10121016         if (serial.clock[0] == level)
10131017         {
1014            DBG_LOG(1, "vc1541",("%d:%.4x clock %s\n",
1018/*            DBG_LOG(1, "vc1541",("%d:%.4x clock %s\n",
10151019                            cpu_getactivecpu (),
10161020                            activecpu_get_pc(),
1017                            serial.clock[0]?"CLOCK":"clock"));
1021                            serial.clock[0]?"CLOCK":"clock"));*/
10181022         }
10191023      }
10201024   }
r3605r3606
10851089 */
10861090static TIMER_CALLBACK(c1551_irq_timer)
10871091{
1088   cpunum_set_input_line(machine, drive->cpunumber, M6502_IRQ_LINE, PULSE_LINE);
1092   cpu_set_input_line(machine->cpu[drive->cpunumber], M6502_IRQ_LINE, PULSE_LINE);
10891093}
10901094
10911095/*
r3605r3606
12541258
12551259static void c1551x_write_data (running_machine *machine, TPI6525 *This, int data)
12561260{
1257   DBG_LOG(1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data));
1261//   DBG_LOG(1, "c1551 cpu", ("%d write data %.2x\n", cpu_getactivecpu (), data));
12581262#ifdef CPU_SYNC
12591263   cpu_sync();
12601264#endif
1261
1262   tpi6525_0_port_a_w(machine, 0,data);
1265   tpi6525_0_port_a_w(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0,data);
12631266}
12641267
12651268static int c1551x_read_data (running_machine *machine, TPI6525 *This)
r3605r3606
12691272   cpu_sync ();
12701273#endif
12711274
1272   data = tpi6525_0_port_a_r(machine, 0);
1273   DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data));
1275   data = tpi6525_0_port_a_r(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0);
1276//   DBG_LOG(2, "c1551 cpu",("%d read data %.2x\n", cpu_getactivecpu (), data));
12741277   return data;
12751278}
12761279
12771280static void c1551x_write_handshake (running_machine *machine, TPI6525 *This, int data)
12781281{
1279   DBG_LOG(1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data));
1282//   DBG_LOG(1, "c1551 cpu",("%d write handshake %.2x\n", cpu_getactivecpu (), data));
12801283#ifdef CPU_SYNC
12811284   cpu_sync();
12821285#endif
12831286
1284   tpi6525_0_port_c_w(machine, 0,data&0x40?0xff:0x7f);
1287   tpi6525_0_port_c_w(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0,data&0x40?0xff:0x7f);
12851288}
12861289
12871290static int c1551x_read_handshake (running_machine *machine, TPI6525 *This)
r3605r3606
12911294   cpu_sync();
12921295#endif
12931296
1294   data = tpi6525_0_port_c_r(machine, 0) & 0x08 ? 0x80 : 0x00;
1295   DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data));
1297   data = tpi6525_0_port_c_r(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0) & 0x08 ? 0x80 : 0x00;
1298//   DBG_LOG(2, "c1551 cpu",("%d read handshake %.2x\n", cpu_getactivecpu (), data));
12961299   return data;
12971300}
12981301
r3605r3606
13031306   cpu_sync();
13041307#endif
13051308
1306   data = tpi6525_0_port_c_r(machine, 0) & 0x03;
1307   DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data));
1309   data = tpi6525_0_port_c_r(cpu_get_address_space(machine->cpu[drive->cpunumber], ADDRESS_SPACE_PROGRAM), 0) & 0x03;
1310//   DBG_LOG(1, "c1551 cpu",("%d read status %.2x\n", cpu_getactivecpu (), data));
13081311
13091312   return data;
13101313}
src/mess/machine/cbmieeeb.c
r3605r3606
361361
362362void cbm_ieee_dav_w(int device, int data)
363363{
364   DBG_LOG(1,"cbm ieee dav",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
364//   DBG_LOG(1,"cbm ieee dav",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
365365   cbmieee.bus[device].dav=data;
366366   if (device==0) c2031_state(cbm_drive);
367367}
368368
369369void cbm_ieee_nrfd_w(int device, int data)
370370{
371   DBG_LOG(1,"cbm ieee nrfd",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
371//   DBG_LOG(1,"cbm ieee nrfd",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
372372   cbmieee.bus[device].nrfd=data;
373373   if (device==0) c2031_state(cbm_drive);
374374}
375375
376376void cbm_ieee_ndac_w(int device, int data)
377377{
378   DBG_LOG(1,"cbm ieee ndac",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
378//   DBG_LOG(1,"cbm ieee ndac",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
379379   cbmieee.bus[device].ndac=data;
380380   if (device==0) c2031_state(cbm_drive);
381381}
382382
383383void cbm_ieee_atn_w(int device, int data)
384384{
385   DBG_LOG(1,"cbm ieee atn",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
385//   DBG_LOG(1,"cbm ieee atn",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
386386   cbmieee.bus[device].atn=data;
387387   if (device==0) c2031_state(cbm_drive);
388388}
389389
390390void cbm_ieee_eoi_w(int device, int data)
391391{
392   DBG_LOG(1,"cbm ieee eoi",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
392//   DBG_LOG(1,"cbm ieee eoi",("%.4x dev:%d %d\n", activecpu_get_pc(), device, data));
393393   cbmieee.bus[device].eoi=data;
394394   if (device==0) c2031_state(cbm_drive);
395395}
396396
397397void cbm_ieee_data_w(int device, int data)
398398{
399   DBG_LOG(1,"cbm ieee data",("%.4x dev:%d %.2x\n", activecpu_get_pc(), device, data));
399//   DBG_LOG(1,"cbm ieee data",("%.4x dev:%d %.2x\n", activecpu_get_pc(), device, data));
400400   cbmieee.bus[device].data=data;
401401   if (device==0) c2031_state(cbm_drive);
402402}
src/mess/machine/cbm.c
r3605r3606
88#include "includes/cbm.h"
99#include "formats/cbm_tap.h"
1010
11#include "deprecat.h"
1112
12
1313/***********************************************
1414
1515   CBM Quickloads
r3605r3606
2525   UINT32 bytesread;
2626   UINT16 address = 0;
2727   int i;
28   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2829
2930   if (!file_type)
3031      goto error;
r3605r3606
7374      goto error;
7475
7576   for (i = 0; i < snapshot_size; i++)
76      program_write_byte(address + i + offset, data[i]);
77      memory_write_byte(space, address + i + offset, data[i]);
7778
7879   cbm_sethiaddress(address + snapshot_size);
7980   free(data);
r3605r3606
8788
8889static void cbm_quick_sethiaddress(UINT16 hiaddress)
8990{
90   program_write_byte(0x31, hiaddress & 0xff);
91   program_write_byte(0x2f, hiaddress & 0xff);
92   program_write_byte(0x2d, hiaddress & 0xff);
93   program_write_byte(0x32, hiaddress >> 8);
94   program_write_byte(0x30, hiaddress >> 8);
95   program_write_byte(0x2e, hiaddress >> 8);
91   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
92
93   memory_write_byte(space, 0x31, hiaddress & 0xff);
94   memory_write_byte(space, 0x2f, hiaddress & 0xff);
95   memory_write_byte(space, 0x2d, hiaddress & 0xff);
96   memory_write_byte(space, 0x32, hiaddress >> 8);
97   memory_write_byte(space, 0x30, hiaddress >> 8);
98   memory_write_byte(space, 0x2e, hiaddress >> 8);
9699}
97100
98101QUICKLOAD_LOAD( cbm_c16 )
r3605r3606
112115
113116static void cbm_pet_quick_sethiaddress(UINT16 hiaddress)
114117{
115   program_write_byte(0x2e, hiaddress & 0xff);
116   program_write_byte(0x2c, hiaddress & 0xff);
117   program_write_byte(0x2a, hiaddress & 0xff);
118   program_write_byte(0x2f, hiaddress >> 8);
119   program_write_byte(0x2d, hiaddress >> 8);
120   program_write_byte(0x2b, hiaddress >> 8);
118   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
119
120   memory_write_byte(space, 0x2e, hiaddress & 0xff);
121   memory_write_byte(space, 0x2c, hiaddress & 0xff);
122   memory_write_byte(space, 0x2a, hiaddress & 0xff);
123   memory_write_byte(space, 0x2f, hiaddress >> 8);
124   memory_write_byte(space, 0x2d, hiaddress >> 8);
125   memory_write_byte(space, 0x2b, hiaddress >> 8);
121126}
122127
123128QUICKLOAD_LOAD( cbm_pet )
r3605r3606
127132
128133static void cbm_pet1_quick_sethiaddress(UINT16 hiaddress)
129134{
130   program_write_byte(0x80, hiaddress & 0xff);
131   program_write_byte(0x7e, hiaddress & 0xff);
132   program_write_byte(0x7c, hiaddress & 0xff);
133   program_write_byte(0x81, hiaddress >> 8);
134   program_write_byte(0x7f, hiaddress >> 8);
135   program_write_byte(0x7d, hiaddress >> 8);
135   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
136
137   memory_write_byte(space, 0x80, hiaddress & 0xff);
138   memory_write_byte(space, 0x7e, hiaddress & 0xff);
139   memory_write_byte(space, 0x7c, hiaddress & 0xff);
140   memory_write_byte(space, 0x81, hiaddress >> 8);
141   memory_write_byte(space, 0x7f, hiaddress >> 8);
142   memory_write_byte(space, 0x7d, hiaddress >> 8);
136143}
137144
138145QUICKLOAD_LOAD( cbm_pet1 )
r3605r3606
142149
143150static void cbmb_quick_sethiaddress(UINT16 hiaddress)
144151{
145   program_write_byte(0xf0046, hiaddress & 0xff);
146   program_write_byte(0xf0047, hiaddress >> 8);
152   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
153
154   memory_write_byte(space, 0xf0046, hiaddress & 0xff);
155   memory_write_byte(space, 0xf0047, hiaddress >> 8);
147156}
148157
149158QUICKLOAD_LOAD( cbmb )
r3605r3606
158167
159168static void cbm_c65_quick_sethiaddress(UINT16 hiaddress)
160169{
161   program_write_byte(0x82, hiaddress & 0xff);
162   program_write_byte(0x83, hiaddress >> 8);
170   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
171
172   memory_write_byte(space, 0x82, hiaddress & 0xff);
173   memory_write_byte(space, 0x83, hiaddress >> 8);
163174}
164175
165176QUICKLOAD_LOAD( cbm_c65 )
src/mess/machine/tpi6525.c
r3605r3606
459459
460460 READ8_HANDLER ( tpi6525_0_port_r )
461461{
462   return tpi6525_port_r(machine, tpi6525, offset);
462   return tpi6525_port_r(space->machine, tpi6525, offset);
463463}
464464
465465 READ8_HANDLER ( tpi6525_1_port_r )
466466{
467   return tpi6525_port_r(machine, tpi6525+1, offset);
467   return tpi6525_port_r(space->machine, tpi6525+1, offset);
468468}
469469
470470 READ8_HANDLER ( tpi6525_2_port_r )
471471{
472   return tpi6525_port_r(machine, tpi6525+2, offset);
472   return tpi6525_port_r(space->machine, tpi6525+2, offset);
473473}
474474
475475 READ8_HANDLER ( tpi6525_3_port_r )
476476{
477   return tpi6525_port_r(machine, tpi6525+3, offset);
477   return tpi6525_port_r(space->machine, tpi6525+3, offset);
478478}
479479
480480WRITE8_HANDLER ( tpi6525_0_port_w )
481481{
482   tpi6525_port_w(machine, tpi6525, offset, data);
482   tpi6525_port_w(space->machine, tpi6525, offset, data);
483483}
484484
485485WRITE8_HANDLER ( tpi6525_1_port_w )
486486{
487   tpi6525_port_w(machine, tpi6525+1, offset, data);
487   tpi6525_port_w(space->machine, tpi6525+1, offset, data);
488488}
489489
490490WRITE8_HANDLER ( tpi6525_2_port_w )
491491{
492   tpi6525_port_w(machine, tpi6525+2, offset, data);
492   tpi6525_port_w(space->machine, tpi6525+2, offset, data);
493493}
494494
495495WRITE8_HANDLER ( tpi6525_3_port_w )
496496{
497   tpi6525_port_w(machine, tpi6525+3, offset, data);
497   tpi6525_port_w(space->machine, tpi6525+3, offset, data);
498498}
499499
500500 READ8_HANDLER ( tpi6525_0_port_a_r )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team