Previous 15994 Revisions Next

r3618 Thursday 27th November, 2008 at 02:42:59 UTC by Nathan Woods
Updated Enterprise; more search/replace
[src/mess]mess.mak messdriv.c
[src/mess/audio]dave.c dave.h
[src/mess/drivers]coleco.c enterp.c ip22.c mk1.c nc.c pcw.c pcw16.c
[src/mess/machine]at.c dai.c gamecom.c geneve.c lisa.c ti99_4x.c
[src/mess/video]odyssey2.c vtech1.c

src/mess/audio/dave.c
r3617r3618
4040}
4141
4242
43static void dave_refresh_ints(void)
43static void dave_refresh_ints(running_machine *machine)
4444{
4545   int int_wanted;
4646
r3617r3618
5050
5151   if (dave_iface->int_callback)
5252   {
53      dave_iface->int_callback(int_wanted);
53      dave_iface->int_callback(machine, int_wanted);
5454   }
5555}
5656
5757
58static void dave_refresh_selectable_int(void)
58static void dave_refresh_selectable_int(running_machine *machine)
5959{
6060   /* update 1kHz/50Hz/tg latch and int input */
6161   switch ((dave.Regs[7]>>5) & 0x03)
r3617r3618
8989         break;
9090   }
9191
92   dave_refresh_ints();
92   dave_refresh_ints(machine);
9393}
9494
9595static TIMER_CALLBACK(dave_1khz_callback)
r3617r3618
113113   {
114114      /* these two lines are temp here */
115115      nick_virq^=0x0ffffffff;
116      Dave_SetExternalIntState(DAVE_INT1_ID, nick_virq);
116      Dave_SetExternalIntState(machine, DAVE_INT1_ID, nick_virq);
117117
118118
119119      dave.fifty_hz_count = DAVE_FIFTY_HZ_COUNTER_RELOAD;
r3617r3618
143143      }
144144   }
145145
146   dave_refresh_selectable_int();
146   dave_refresh_selectable_int(machine);
147147}
148148
149149
150150
151void   Dave_Init(running_machine *machine)
151void Dave_Init(running_machine *machine)
152152{
153153   int i;
154154
r3617r3618
323323         count++;
324324
325325
326         dave.Period[channel_index] = ((STEP  * machine->sample_rate)/125000) * count;
326         dave.Period[channel_index] = ((STEP  * space->machine->sample_rate)/125000) * count;
327327
328328      }
329329      break;
r3617r3618
484484{
485485   logerror("dave w: %04x %02x\n",offset,data);
486486
487   Dave_sound_w(machine, offset, data);
487   Dave_sound_w(space, offset, data);
488488
489489   dave.Regs[offset & 0x01f] = data;
490490
r3617r3618
492492   {
493493      case 0x07:
494494      {
495         dave_refresh_selectable_int();
495         dave_refresh_selectable_int(space->machine);
496496      }
497497      break;
498498
r3617r3618
510510         }
511511
512512         /* refresh ints */
513         dave_refresh_ints();
513         dave_refresh_ints(space->machine);
514514      }
515515      break;
516516
r3617r3618
520520
521521   if (dave_iface!=NULL)
522522   {
523      dave_iface->reg_w(offset, data);
523      dave_iface->reg_w(space->machine, offset, data);
524524   }
525525}
526526
527527
528WRITE8_HANDLER ( Dave_setreg )
528void Dave_setreg(running_machine *machine, offs_t offset, UINT8 data)
529529{
530530   dave.Regs[offset & 0x01f] = data;
531531}
r3617r3618
536536
537537   if (dave_iface!=NULL)
538538   {
539      dave_iface->reg_r(offset);
539      dave_iface->reg_r(space->machine, offset);
540540   }
541541
542542   switch (offset)
r3617r3618
579579}
580580
581581/* negative edge triggered */
582void   Dave_SetExternalIntState(int IntID, int State)
582void   Dave_SetExternalIntState(running_machine *machine, int IntID, int State)
583583{
584584   switch (IntID)
585585   {
r3617r3618
606606               /* int request */
607607               dave.int_latch |= (1<<5);
608608
609               dave_refresh_ints();
609               dave_refresh_ints(machine);
610610            }
611611         }
612612
r3617r3618
635635               /* int request */
636636               dave.int_latch|=(1<<7);
637637
638               dave_refresh_ints();
638               dave_refresh_ints(machine);
639639            }
640640         }
641641      }
src/mess/audio/dave.h
r3617r3618
1717
1818typedef struct DAVE_INTERFACE
1919{
20   void (*reg_r)(int);
21   void (*reg_w)(int,int);
22   void (*int_callback)(int);
20   void (*reg_r)(running_machine *, int);
21   void (*reg_w)(running_machine *, int,int);
22   void (*int_callback)(running_machine *, int);
2323} DAVE_INTERFACE;
2424
2525#define DAVE_FIFTY_HZ_COUNTER_RELOAD 20
r3617r3618
9090   DAVE_INT2_ID
9191};
9292
93void   Dave_Init(running_machine *machine);
93void Dave_Init(running_machine *machine);
9494/* set external int state */
95void   Dave_SetExternalIntState(int IntID, int State);
95void Dave_SetExternalIntState(running_machine *machine, int IntID, int State);
9696
97extern int   Dave_getreg(int);
98extern WRITE8_HANDLER ( Dave_setreg );
97extern int Dave_getreg(int);
98extern void Dave_setreg(running_machine *machine, offs_t offset, UINT8 data);
9999
100extern READ8_HANDLER (    Dave_reg_r );
100extern READ8_HANDLER ( Dave_reg_r );
101101extern WRITE8_HANDLER (   Dave_reg_w );
102102
103void   Dave_SetIFace(const struct DAVE_INTERFACE *newInterface);
103void Dave_SetIFace(const struct DAVE_INTERFACE *newInterface);
104104
105105#endif
src/mess/video/vtech1.c
r3617r3618
9090static void vtech1_field_sync_callback(int data)
9191{
9292   if (data)
93      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
93      cpu_set_input_line(Machine->cpu[0], 0, CLEAR_LINE);
9494   else
95      cpunum_set_input_line(Machine, 0, 0, HOLD_LINE);
95      cpu_set_input_line(Machine->cpu[0], 0, HOLD_LINE);
9696}
9797
9898
src/mess/video/odyssey2.c
r3617r3618
622622         /* Throw an interrupt if enabled */
623623         if( o2_vdc.s.control & 0x4 )
624624         {
625            cpunum_set_input_line(Machine, 0, 1, HOLD_LINE); /* Is this right? */
625            cpu_set_input_line(Machine->cpu[0], 1, HOLD_LINE); /* Is this right? */
626626         }
627627
628628         /* Adjust volume */
src/mess/messdriv.c
r3617r3618
575575//128u4   DRIVER( einstei2 )
576576
577577   /* INTELLIGENT SOFTWARE */
578//128u4   DRIVER( ep128 )      /* Enterprise 128 k                           */
578   DRIVER( ep128 )      /* Enterprise 128 k                           */
579579
580580   /* NON LINEAR SYSTEMS */
581581//128u4   DRIVER( kaypro )   /* Kaypro 2X                              */
src/mess/machine/dai.c
r3617r3618
8282   if (intreq)
8383      cpunum_set_input_line_and_vector(Machine, 0, 0, HOLD_LINE, vector);
8484   else
85      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
85      cpu_set_input_line(Machine->cpu[0], 0, CLEAR_LINE);
8686}
8787
8888static const tms5501_init_param dai_tms5501_init_param =
src/mess/machine/gamecom.c
r3617r3618
554554      gamecom_dma.dest_current = gamecom_dma.dest_line;
555555   }
556556   gamecom_dma.enabled = 0;
557   cpunum_set_input_line(Machine, 0, DMA_INT, HOLD_LINE );
557   cpu_set_input_line(Machine->cpu[0], DMA_INT, HOLD_LINE );
558558}
559559
560560void gamecom_update_timers( int cycles ) {
r3617r3618
565565         gamecom_timer[0].counter++;
566566         if ( gamecom_timer[0].counter == gamecom_timer[0].check_value ) {
567567            gamecom_timer[0].counter = 0;
568            cpunum_set_input_line(Machine, 0, TIM0_INT, HOLD_LINE );
568            cpu_set_input_line(Machine->cpu[0], TIM0_INT, HOLD_LINE );
569569         }
570570      }
571571   }
r3617r3618
576576         gamecom_timer[1].counter++;
577577         if ( gamecom_timer[1].counter == gamecom_timer[1].check_value ) {
578578            gamecom_timer[1].counter = 0;
579            cpunum_set_input_line(Machine, 0, TIM1_INT, HOLD_LINE );
579            cpu_set_input_line(Machine->cpu[0], TIM1_INT, HOLD_LINE );
580580         }
581581      }
582582   }
src/mess/machine/at.c
r3617r3618
145145static void at_set_gate_a20(int a20)
146146{
147147   /* set the CPU's A20 line */
148   cpunum_set_input_line(Machine, 0, INPUT_LINE_A20, a20);
148   cpu_set_input_line(Machine->cpu[0], INPUT_LINE_A20, a20);
149149}
150150
151151
src/mess/machine/lisa.c
r3617r3618
423423                  if (keycode == NMIcode)
424424                  {   /* generate NMI interrupt */
425425                     cpu_set_input_line(machine->cpu[0], M68K_IRQ_7, PULSE_LINE);
426                     cpunum_set_input_line_vector(0, M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR);
426                     cpu_set_input_line_vector(machine->cpu[0], M68K_IRQ_7, M68K_INT_ACK_AUTOVECTOR);
427427                  }
428428#endif
429429                  COPS_queue_data(machine, & keycode, 1);
src/mess/machine/geneve.c
r3617r3618
13401340static void tms9901_interrupt_callback(int intreq, int ic)
13411341{
13421342   /* INTREQ is connected to INT1 (IC0-3 are not connected) */
1343   cpunum_set_input_line(Machine, 0, 0, intreq ? ASSERT_LINE : CLEAR_LINE);
1343   cpu_set_input_line(Machine->cpu[0], 0, intreq ? ASSERT_LINE : CLEAR_LINE);
13441344}
13451345
13461346/*
src/mess/machine/ti99_4x.c
r3617r3618
22442244   }
22452245   else
22462246   {
2247      cpunum_set_input_line(Machine, 0, 0, CLEAR_LINE);
2247      cpu_set_input_line(Machine->cpu[0], 0, CLEAR_LINE);
22482248   }
22492249}
22502250
src/mess/mess.mak
r3617r3618
376376   $(MESSOBJ)/bk.a \
377377   $(MESSOBJ)/cbmshare.a \
378378   $(MESSOBJ)/einis.a \
379   $(MESSOBJ)/ep128.a \
379380   $(MESSOBJ)/galaxy.a \
380381   $(MESSOBJ)/homelab.a \
381382   $(MESSOBJ)/intv.a \
r3617r3618
427428#   $(MESSOBJ)/cybiko.a \
428429#   $(MESSOBJ)/dai.a \
429430#   $(MESSOBJ)/dgn_beta.a \
430#   $(MESSOBJ)/ep128.a \
431431#   $(MESSOBJ)/epoch.a \
432432#   $(MESSOBJ)/epson.a \
433433#   $(MESSOBJ)/exeltel.a \
src/mess/drivers/nc.c
r3617r3618
879879      {
880880         /* I'll pulse it because if I used hold-line I'm not sure
881881            it would clear - to be checked */
882         cpunum_set_input_line(Machine, 0, INPUT_LINE_NMI, PULSE_LINE);
882         cpu_set_input_line(Machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE);
883883      }
884884   }
885885
src/mess/drivers/mk1.c
r3617r3618
181181   ROM_LOAD("82c210-1", 0x0000, 0x800, CRC(278f7bf3) SHA1(b384c95ba691d52dfdddd35987a71e9746a46170))
182182ROM_END
183183
184static void mk1_interrupt( UINT16 addr, int level ) {
185    cpunum_set_input_line_vector( 0, 0, addr );
186    cpunum_set_input_line( Machine, 0, 0, level ? F8_INT_INTR : F8_INT_NONE );
184static void mk1_interrupt( UINT16 addr, int level )
185{
186    cpu_set_input_line_vector(Machine->cpu[0], 0, addr );
187    cpu_set_input_line(Machine->cpu[0], 0, level ? F8_INT_INTR : F8_INT_NONE );
187188}
188189
189190static const f3853_config mk1_config = {
src/mess/drivers/pcw16.c
r3617r3618
456456
457457   mem_ptr = mem_ptr + ((bank_id - bank_offs)<<14);
458458   pcw16_mem_ptr[bank] = (char*)mem_ptr;
459   memory_set_bankptr((bank+1), mem_ptr);
460   memory_set_bankptr((bank+5), mem_ptr);
459   memory_set_bankptr(machine, (bank+1), mem_ptr);
460   memory_set_bankptr(machine, (bank+5), mem_ptr);
461461
462462   if ((bank_id & 0x080)==0)
463463   {
src/mess/drivers/ip22.c
r3617r3618
169169   // if it's not masked, also assert it now at the CPU
170170   if (int3_regs[2] & source_mask)
171171   {
172      cpunum_set_input_line(Machine, 0, MIPS3_IRQ1, ASSERT_LINE);
172      cpu_set_input_line(Machine->cpu[0], MIPS3_IRQ1, ASSERT_LINE);
173173   }
174174}
175175
src/mess/drivers/pcw.c
r3617r3618
754754{
755755   pcw_boot = 1;
756756
757   cpunum_set_input_line_vector(0, 0,0x0ff);
757   cpu_set_input_line_vector(machine->cpu[0], 0,0x0ff);
758758
759759
760760   /* ram paging is actually undefined at power-on */
src/mess/drivers/enterp.c
r3617r3618
6666static int Enterprise_KeyboardLine = 0;
6767
6868/* set read/write pointers for CPU page */
69static void   Enterprise_SetMemoryPage(int CPU_Page, int EP_Page)
69static void   Enterprise_SetMemoryPage(running_machine *machine, int CPU_Page, int EP_Page)
7070{
71   memory_set_bankptr((CPU_Page+1), Enterprise_Pages_Read[EP_Page & 0x0ff]);
72   memory_set_bankptr((CPU_Page+5), Enterprise_Pages_Write[EP_Page & 0x0ff]);
71   memory_set_bankptr(machine, (CPU_Page+1), Enterprise_Pages_Read[EP_Page & 0x0ff]);
72   memory_set_bankptr(machine, (CPU_Page+5), Enterprise_Pages_Write[EP_Page & 0x0ff]);
7373}
7474
7575/* EP specific handling of dave register write */
76static void enterprise_dave_reg_write(int RegIndex, int Data)
76static void enterprise_dave_reg_write(running_machine *machine, int RegIndex, int Data)
7777{
7878   switch (RegIndex)
7979   {
r3617r3618
8181   case 0x010:
8282      {
8383        /* set CPU memory page 0 */
84         Enterprise_SetMemoryPage(0, Data);
84         Enterprise_SetMemoryPage(machine, 0, Data);
8585      }
8686      break;
8787
8888   case 0x011:
8989      {
9090        /* set CPU memory page 1 */
91         Enterprise_SetMemoryPage(1, Data);
91         Enterprise_SetMemoryPage(machine, 1, Data);
9292      }
9393      break;
9494
9595   case 0x012:
9696      {
9797        /* set CPU memory page 2 */
98         Enterprise_SetMemoryPage(2, Data);
98         Enterprise_SetMemoryPage(machine, 2, Data);
9999      }
100100      break;
101101
102102   case 0x013:
103103      {
104104        /* set CPU memory page 3 */
105         Enterprise_SetMemoryPage(3, Data);
105         Enterprise_SetMemoryPage(machine, 3, Data);
106106      }
107107      break;
108108
r3617r3618
118118   }
119119}
120120
121static void enterprise_dave_reg_read(int RegIndex)
121static void enterprise_dave_reg_read(running_machine *machine, int RegIndex)
122122{
123123   static const char *keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4",
124124                              "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
125   running_machine *machine = Machine;
126
127125   switch (RegIndex)
128126   {
129127   case 0x015:
130128      {
131129      /* read keyboard line */
132      Dave_setreg(machine, 0x015, input_port_read(machine, keynames[Enterprise_KeyboardLine]));
130         Dave_setreg(machine, 0x015, input_port_read(machine, keynames[Enterprise_KeyboardLine]));
133131      }
134132      break;
135133
r3617r3618
156154   }
157155}
158156
159static void enterprise_dave_interrupt(int state)
157static void enterprise_dave_interrupt(running_machine *machine, int state)
160158{
161159   if (state)
162      cpunum_set_input_line(Machine, 0,0,HOLD_LINE);
160      cpu_set_input_line(Machine->cpu[0],0,HOLD_LINE);
163161   else
164      cpunum_set_input_line(Machine, 0,0,CLEAR_LINE);
162      cpu_set_input_line(Machine->cpu[0],0,CLEAR_LINE);
165163}
166164
167165/* enterprise interface to dave - ok, so Dave chip is unique
r3617r3618
180178static void enterprise_reset(running_machine *machine)
181179{
182180   int i;
181   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
183182
184183   for (i=0; i<256; i++)
185184   {
r3617r3618
225224
226225   Dave_SetIFace(&enterprise_dave_interface);
227226
228   Dave_reg_w(machine, 0x010,0);
229   Dave_reg_w(machine, 0x011,0);
230   Dave_reg_w(machine, 0x012,0);
231   Dave_reg_w(machine, 0x013,0);
227   Dave_reg_w(space, 0x010,0);
228   Dave_reg_w(space, 0x011,0);
229   Dave_reg_w(space, 0x012,0);
230   Dave_reg_w(space, 0x013,0);
232231
233   cpunum_set_input_line_vector(0,0,0x0ff);
232   cpu_set_input_line_vector(machine->cpu[0],0,0x0ff);
234233
235234   floppy_drive_set_geometry(image_from_devtype_and_index(IO_FLOPPY, 0), FLOPPY_DRIVE_DS_80);
236235}
r3617r3618
241240   add_reset_callback(machine, enterprise_reset);
242241}
243242
244static READ8_HANDLER ( enterprise_wd177x_read )
243static READ8_HANDLER ( enterprise_wd177x_read )
245244{
246245   switch (offset & 0x03)
247246   {
248247   case 0:
249      return wd17xx_status_r(machine, offset);
248      return wd17xx_status_r(space, offset);
250249   case 1:
251      return wd17xx_track_r(machine, offset);
250      return wd17xx_track_r(space, offset);
252251   case 2:
253      return wd17xx_sector_r(machine, offset);
252      return wd17xx_sector_r(space, offset);
254253   case 3:
255      return wd17xx_data_r(machine, offset);
254      return wd17xx_data_r(space, offset);
256255   default:
257256      break;
258257   }
r3617r3618
265264   switch (offset & 0x03)
266265   {
267266   case 0:
268      wd17xx_command_w(machine, offset, data);
267      wd17xx_command_w(space, offset, data);
269268      return;
270269   case 1:
271      wd17xx_track_w(machine, offset, data);
270      wd17xx_track_w(space, offset, data);
272271      return;
273272   case 2:
274      wd17xx_sector_w(machine, offset, data);
273      wd17xx_sector_w(space, offset, data);
275274      return;
276275   case 3:
277      wd17xx_data_w(machine, offset, data);
276      wd17xx_data_w(space, offset, data);
278277      return;
279278   default:
280279      break;
src/mess/drivers/coleco.c
r3617r3618
396396
397397static MACHINE_RESET( coleco )
398398{
399    cpunum_set_input_line_vector(0, INPUT_LINE_IRQ0, 0xff);
399    cpu_set_input_line_vector(machine->cpu[0], INPUT_LINE_IRQ0, 0xff);
400400   memset(&memory_region(machine, "main")[0x6000], 0xff, 0x400);   // initialize RAM
401401    timer_pulse(ATTOTIME_IN_MSEC(20), NULL, 0, paddle_callback);
402402}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team