Previous 15994 Revisions Next

r3924 Saturday 20th December, 2008 at 17:18:06 UTC by Nathan Woods
More Machine cleanup [Atari Ace]
[src/mess/drivers]amiga.c
[src/mess/includes]bebox.h
[src/mess/machine]99_ide.c 99_ide.h amigacd.c amigacrt.c bebox.c i82439tx.c matsucd.c matsucd.h

src/mess/includes/bebox.h
r3923r3924
4646WRITE64_HANDLER( bebox_80000480_w );
4747WRITE64_HANDLER( bebox_flash_w );
4848
49void bebox_ide_interrupt(int state);
49void bebox_ide_interrupt(const device_config *device, int state);
5050
5151UINT32 scsi53c810_pci_read(const device_config *busdevice, const device_config *device, int function, int offset, UINT32 mem_mask);
5252void scsi53c810_pci_write(const device_config *busdevice, const device_config *device, int function, int offset, UINT32 data, UINT32 mem_mask);
src/mess/machine/matsucd.c
r3923r3924
4747   UINT16   xfer_offset;
4848   UINT8   sector_buffer[CD_MAX_SECTOR_DATA];
4949   UINT8   cdda_set;
50   void (*sten_cb)( int level );   /* Status enabled callback */
51   void (*stch_cb)( int level );   /* Status changed callback */
52   void (*scor_cb)( int level );   /* Subcode ready callback */
50   void (*sten_cb)( running_machine *machine, int level );   /* Status enabled callback */
51   void (*stch_cb)( running_machine *machine, int level );   /* Status changed callback */
52   void (*scor_cb)( running_machine *machine, int level );   /* Subcode ready callback */
5353   cdrom_file *cdrom;
5454   emu_timer *frame_timer;
5555} matsucd;
r3923r3924
7272   cd.stch_signal = 1;
7373}
7474
75void matsucd_set_status_enabled_callback( void (*sten_cb)( int level ) )
75void matsucd_set_status_enabled_callback( void (*sten_cb)( running_machine *machine, int level ) )
7676{
7777   /* add the callback for status enabled signal */
7878   cd.sten_cb = sten_cb;
7979}
8080
81void matsucd_set_status_changed_callback( void (*stch_cb)( int level ) )
81void matsucd_set_status_changed_callback( void (*stch_cb)( running_machine *machine, int level ) )
8282{
8383   /* add the callback for status changed signal */
8484   cd.stch_cb = stch_cb;
8585}
8686
87void matsucd_set_subcode_ready_callback( void (*scor_cb)( int level ) )
87void matsucd_set_subcode_ready_callback( void (*scor_cb)( running_machine *machine, int level ) )
8888{
8989   /* add the callback for subcode ready signal */
9090   cd.scor_cb = scor_cb;
r3923r3924
227227   return cd.scor_signal ? 0 : 1;
228228}
229229
230static void update_status_enable( int level )
230static void update_status_enable( running_machine *machine, int level )
231231{
232232   cd.sten_signal = level;
233233
234234   if ( cd.sten_cb )
235235   {
236      (*cd.sten_cb)(cd.sten_signal);
236      (*cd.sten_cb)(machine, cd.sten_signal);
237237   }
238238}
239239
240static void update_status_changed( int level )
240static void update_status_changed( running_machine *machine, int level )
241241{
242242   cd.stch_signal = level;
243243
244244   if ( cd.stch_cb )
245245   {
246      (*cd.stch_cb)(cd.stch_signal);
246      (*cd.stch_cb)(machine, cd.stch_signal);
247247   }
248248}
249249
250static void update_subcode_ready( int level )
250static void update_subcode_ready( running_machine *machine, int level )
251251{
252252   cd.scor_signal = level;
253253
254254   if ( cd.scor_cb )
255255   {
256      (*cd.scor_cb)(cd.scor_signal);
256      (*cd.scor_cb)(machine, cd.scor_signal);
257257   }
258258}
259259
260260static TIMER_CALLBACK(matsucd_set_status_end)
261261{
262   update_status_changed( 1 );
262   update_status_changed( machine, 1 );
263263}
264264
265265static void matsucd_set_status( running_machine *machine, UINT8 status )
r3923r3924
270270
271271      if ( cd.stch_signal != 0 )
272272      {
273         update_status_changed( 0 );
273         update_status_changed( machine, 0 );
274274         timer_set(machine,  ATTOTIME_IN_MSEC(1), NULL, 0, matsucd_set_status_end );
275275      }
276276   }
r3923r3924
291291      {
292292         if ( s == 0x11 )
293293         {
294            update_subcode_ready( 1 );
295            update_subcode_ready( 0 );
294            update_subcode_ready( machine, 1 );
295            update_subcode_ready( machine, 0 );
296296         }
297297
298298         newstatus |= MATSU_STATUS_PLAYING;
r3923r3924
331331
332332   matsucd_set_status( machine, newstatus );
333333
334   update_status_enable( 1 );
335   update_status_enable( 0 );
334   update_status_enable( machine, 1 );
335   update_status_enable( machine, 0 );
336336}
337337
338UINT8 matsucd_response_r( void )
338UINT8 matsucd_response_r( running_machine *machine )
339339{
340340   UINT8   v = cd.output[cd.output_pos++];
341341
342342   if ( cd.output_pos < cd.output_len )
343343   {
344      update_status_enable( 1 );
345      update_status_enable( 0 );
344      update_status_enable( machine, 1 );
345      update_status_enable( machine, 0 );
346346   }
347347
348348   return v;
src/mess/machine/matsucd.h
r3923r3924
1616extern int matsucd_scor_r( void );         /* /SCOR pin */
1717
1818/* callback for signal changes */
19extern void matsucd_set_status_enabled_callback( void (*sten_cb)( int level ) );
20extern void matsucd_set_status_changed_callback( void (*stch_cb)( int level ) );
21extern void matsucd_set_subcode_ready_callback( void (*scor_cb)( int level ) );
19extern void matsucd_set_status_enabled_callback( void (*sten_cb)( running_machine *machine, int level ) );
20extern void matsucd_set_status_changed_callback( void (*stch_cb)( running_machine *machine, int level ) );
21extern void matsucd_set_subcode_ready_callback( void (*scor_cb)( running_machine *machine, int level ) );
2222
2323/* data transfer routines */
2424extern void matsucd_read_next_block( void );
r3923r3924
2626
2727/* main command interface */
2828extern void matsucd_command_w( running_machine *machine, UINT8 data );
29extern UINT8 matsucd_response_r( void );
29extern UINT8 matsucd_response_r( running_machine *machine );
src/mess/machine/amigacrt.c
r3923r3924
3333
3434***************************************************************************/
3535
36static int check_kickstart_12_13( const char *cart_name )
36static int check_kickstart_12_13( running_machine *machine, const char *cart_name )
3737{
38   UINT16 * ksmem = (UINT16 *)memory_region( Machine, "user1" );
38   UINT16 * ksmem = (UINT16 *)memory_region( machine, "user1" );
3939
4040   if ( ksmem[2] == 0x00FC )
4141      return 1;
r3923r3924
136136   void *ar_ram;
137137
138138   /* check kickstart version */
139   if ( !check_kickstart_12_13( "Amiga Action Replay" ) )
139   if ( !check_kickstart_12_13( machine, "Amiga Action Replay" ) )
140140   {
141141      amiga_cart_type = -1;
142142      return;
r3923r3924
344344   void *ar_ram;
345345
346346   /* check kickstart version */
347   if ( !check_kickstart_12_13( "Action Replay MKII or MKIII" ) )
347   if ( !check_kickstart_12_13( machine, "Action Replay MKII or MKIII" ) )
348348   {
349349      amiga_cart_type = -1;
350350      return;
r3923r3924
441441
442442void amiga_cart_nmi( void )
443443{
444   running_machine *machine = Machine;
444445   if ( amiga_cart_type < 0 )
445446      return;
446447
447448   switch( amiga_cart_type )
448449   {
449450      case ACTION_REPLAY:
450         amiga_ar1_nmi(Machine);
451         amiga_ar1_nmi(machine);
451452      break;
452453
453454      case ACTION_REPLAY_MKII:
454455      case ACTION_REPLAY_MKIII:
455         amiga_ar23_nmi(Machine);
456         amiga_ar23_nmi(machine);
456457      break;
457458   }
458459}
src/mess/machine/amigacd.c
r3923r3924
184184      case 0x50:
185185      {
186186         LOG(( "DMAC: PC=%08x - CDROM RESP Read\n", cpu_get_pc(space->cpu) ));
187         return matsucd_response_r();
187         return matsucd_response_r(space->machine);
188188      }
189189      break;
190190
r3923r3924
387387
388388static void   dmac_install(offs_t base)
389389{
390   memory_install_read16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, base + 0xFFFF, 0, 0, amiga_dmac_r);
391   memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, base + 0xFFFF, 0, 0, amiga_dmac_w);
390   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
391   memory_install_read16_handler(space, base, base + 0xFFFF, 0, 0, amiga_dmac_r);
392   memory_install_write16_handler(space, base, base + 0xFFFF, 0, 0, amiga_dmac_w);
392393}
393394
394395static void   dmac_uninstall(offs_t base)
395396{
396   memory_install_read16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, base + 0xFFFF, 0, 0, SMH_UNMAP);
397   memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), base, base + 0xFFFF, 0, 0, SMH_UNMAP);
397   const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
398   memory_install_read16_handler(space, base, base + 0xFFFF, 0, 0, SMH_UNMAP);
399   memory_install_write16_handler(space, base, base + 0xFFFF, 0, 0, SMH_UNMAP);
398400}
399401
400402static const amiga_autoconfig_device dmac_device =
r3923r3924
479481   }
480482}
481483
482static void cdrom_status_enabled( int level )
484static void cdrom_status_enabled( running_machine *machine, int level )
483485{
484486   /* PC3 on the 6525 */
485   tpi6525_0_irq3_level( Machine, level );
487   tpi6525_0_irq3_level( machine, level );
486488}
487489
488static void cdrom_status_change( int level )
490static void cdrom_status_change( running_machine *machine, int level )
489491{
490492   /* invert */
491493   level = level ? 0 : 1;
492494
493495   /* PC2 on the 6525 */
494   tpi6525_0_irq2_level( Machine, level );
496   tpi6525_0_irq2_level( machine, level );
495497}
496498
497static void cdrom_subcode_ready( int level )
499static void cdrom_subcode_ready( running_machine *machine, int level )
498500{
499501   /* PC1 on the 6525 */
500   tpi6525_0_irq1_level( Machine, level );
502   tpi6525_0_irq1_level( machine, level );
501503}
502504
503505MACHINE_START( amigacd )
src/mess/machine/i82439tx.c
r3923r3924
77***************************************************************************/
88
99#include "driver.h"
10#include "deprecat.h"
1110#include "machine/i82439tx.h"
1211#include "machine/pci.h"
1312
r3923r3924
121120
122121void intel82439tx_pci_write(const device_config *busdevice, const device_config *device, int function, int offset, UINT32 data, UINT32 mem_mask)
123122{
124   running_machine *machine = Machine;
123   running_machine *machine = busdevice->machine;
125124
126125   if (function != 0)
127126      return;
src/mess/machine/99_ide.c
r3923r3924
7676
7777   IDE interrupt callback
7878*/
79void ti99_ide_interrupt(running_machine *machine, int state)
79void ti99_ide_interrupt(const device_config *device, int state)
8080{
8181   ide_irq = state;
8282   if (cru_register & cru_reg_int_en)
83      ti99_peb_set_ila_bit(machine, inta_ide_bit, state);
83      ti99_peb_set_ila_bit(device->machine, inta_ide_bit, state);
8484}
8585
8686/*
src/mess/machine/99_ide.h
r3923r3924
44void ti99_ide_init(running_machine *machine);
55void ti99_ide_reset(running_machine *machine, int in_tms9995_mode);
66
7void ti99_ide_interrupt(running_machine *machine, int state);
7void ti99_ide_interrupt(const device_config *device, int state);
src/mess/machine/bebox.c
r3923r3924
538538}
539539
540540
541void bebox_ide_interrupt(int state)
541void bebox_ide_interrupt(const device_config *device, int state)
542542{
543   bebox_set_irq_bit(Machine, 7, state);
543   bebox_set_irq_bit(device->machine, 7, state);
544544   if ( bebox_devices.pic8259_master ) {
545545      pic8259_set_irq_line( bebox_devices.pic8259_master, 6, state);
546546   }
src/mess/drivers/amiga.c
r3923r3924
412412
413413static UINT16 amiga_read_joy0dat(void)
414414{
415   if ( input_port_read(Machine, "input") & 0x20 ) {
415   running_machine *machine = Machine;
416   if ( input_port_read(machine, "input") & 0x20 ) {
416417      /* Joystick */
417      return input_port_read_safe(Machine, "JOY0DAT", 0xffff);
418      return input_port_read_safe(machine, "JOY0DAT", 0xffff);
418419   } else {
419420      /* Mouse */
420421      int input;
421      input  = ( input_port_read(Machine, "P0MOUSEX") & 0xff );
422      input |= ( input_port_read(Machine, "P0MOUSEY") & 0xff ) << 8;
422      input  = ( input_port_read(machine, "P0MOUSEX") & 0xff );
423      input |= ( input_port_read(machine, "P0MOUSEY") & 0xff ) << 8;
423424      return input;
424425   }
425426}
426427
427428static UINT16 amiga_read_joy1dat(void)
428429{
429   if ( input_port_read(Machine, "input") & 0x10 ) {
430   running_machine *machine = Machine;
431   if ( input_port_read(machine, "input") & 0x10 ) {
430432      /* Joystick */
431      return input_port_read_safe(Machine, "JOY1DAT", 0xffff);
433      return input_port_read_safe(machine, "JOY1DAT", 0xffff);
432434   } else {
433435      /* Mouse */
434436      int input;
435      input  = ( input_port_read(Machine, "P1MOUSEX") & 0xff );
436      input |= ( input_port_read(Machine, "P1MOUSEY") & 0xff ) << 8;
437      input  = ( input_port_read(machine, "P1MOUSEX") & 0xff );
438      input |= ( input_port_read(machine, "P1MOUSEY") & 0xff ) << 8;
437439      return input;
438440   }
439441}
r3923r3924
454456
455457static void amiga_reset(void)
456458{
457   if (input_port_read(Machine, "hardware") & 0x08)
459   running_machine *machine = Machine;
460   if (input_port_read(machine, "hardware") & 0x08)
458461   {
459462      /* Install RTC */
460      memory_install_readwrite16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xdc0000, 0xdc003f, 0, 0, amiga_clock_r, amiga_clock_w);
463      memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xdc0000, 0xdc003f, 0, 0, amiga_clock_r, amiga_clock_w);
461464   }
462465   else
463466   {
464467      /* No RTC support */
465      memory_install_readwrite16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xdc0000, 0xdc003f, 0, 0, SMH_UNMAP, SMH_UNMAP);
468      memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xdc0000, 0xdc003f, 0, 0, SMH_UNMAP, SMH_UNMAP);
466469   }
467470}
468471

Previous 15994 Revisions Next


© 1998-2018 The MESS Team