Previous 15994 Revisions Next

r4738 Monday 18th May, 2009 at 13:33:08 UTC by Fabio Priuli
[CBM] Refactored code to reduce cross-references between c64, c65 and c128 (part 3 - no more is_cXX)
[src/mess/drivers]c128.c
[src/mess/includes]c128.h c64.h cbm.h
[src/mess/machine]c128.c c64.c c65.c

src/mess/includes/cbm.h
r4737r4738
1515
1616/*----------- defined in machine/cbm.c -----------*/
1717
18/*---------- needed for keyboard reading ---------*/
19
2018/* keyboard lines */
2119extern UINT8 c64_keyline[10];
2220void cbm_common_interrupt( const device_config *device );
src/mess/includes/c128.h
r4737r4738
5151extern DRIVER_INIT( c128pal );
5252extern DRIVER_INIT( c128d );
5353extern DRIVER_INIT( c128dpal );
54extern MACHINE_START( c128 );
5455extern MACHINE_RESET( c128 );
5556extern INTERRUPT_GEN( c128_frame_interrupt );
5657
src/mess/includes/c64.h
r4737r4738
3636DRIVER_INIT( ultimax );
3737DRIVER_INIT( c64gs );
3838DRIVER_INIT( sx64 );
39void c64_common_init_machine (running_machine *machine);
4039
4140MACHINE_START( c64 );
4241INTERRUPT_GEN( c64_frame_interrupt );
src/mess/machine/c65.c
r4737r4738
118118   }
119119}
120120
121/* is this correct for c65 as well as c64? */
121122static void c65_cia0_interrupt (const device_config *device, int level)
122123{
123124   c65_irq (device->machine, level || vicirq);
124125}
125126
127/* is this correct for c65 as well as c64? */
126128void c65_vic_interrupt (running_machine *machine, int level)
127129{
128130   const device_config *cia_0 = devtag_get_device(machine, "cia_0");
src/mess/machine/c128.c
r4737r4738
1717
1818#include "includes/cbm.h"
1919#include "includes/cbmserb.h"
20#include "includes/cbmdrive.h"
2021#include "includes/vc1541.h"
2122#include "video/vic6567.h"
2223#include "video/vdc8563.h"
r4737r4738
7576static UINT8 c128_keyline[3] = {0xff, 0xff, 0xff};
7677
7778static int c128_va1617;
79static int c128_cia1_on = 1;
7880static UINT8 serial_clock, serial_data, serial_atn;
7981static UINT8 vicirq = 0;
8082
r4737r4738
11641166//   drive_config (machine, type_1541, 0, 0, 1, 8);
11651167}
11661168
1167#if 0
1169MACHINE_START( c128 )
1170{
1171   if (c128_cia1_on)
1172   {
1173      cbm_serial_config(machine, &cbm_sim_drive_interface);
1174      cbm_serial_reset_write (machine, 0);
1175      cbm_drive_0_config (SERIAL, 8);
1176      cbm_drive_1_config (SERIAL, 9);
1177      serial_clock = serial_data = serial_atn = 1;
1178   }
1179
11681180// This was in MACHINE_START( c64 ), but never called
11691181// TO DO: find its correct use, when fixing c64 mode
1170MACHINE_START( c128 )
1171{
11721182   if (c64mode)
11731183      c128_bankswitch_64(machine, 1);
11741184}
1175#endif
11761185
11771186MACHINE_RESET( c128 )
11781187{
1179   c64_common_init_machine(machine);
11801188   c128_vicaddr = c64_vicaddr = c64_memory;
11811189   c64mode = 0;
11821190   c128_mmu8722_reset (machine);
src/mess/machine/c64.c
r4737r4738
7171static UINT8 serial_clock, serial_data, serial_atn;
7272static UINT8 vicirq = 0;
7373
74static int is_c65(running_machine *machine)
75{
76   return !strncmp(machine->gamedrv->name, "c65", 3);
77}
78
7974static void c64_nmi(running_machine *machine)
8075{
8176   static int nmilevel = 0;
r4737r4738
620615      }
621616   }
622617
623   if (is_c65(device->machine))
624   {
625      // NPW 8-Feb-2004 - Don't know why I have to do this
626      //c65_bankswitch(machine);
627   }
628
629618   else if (!ultimax)
630619      c64_bankswitch(device->machine, 0);
631620
r4737r4738
645634         data |=  0x10;
646635   }
647636
648   if (is_c65(device->machine))
649   {
650      if (input_port_read(device->machine, "SPECIAL") & 0x20)      /* Check Caps Lock */
651         data &= ~0x40;
652      else
653         data |=  0x40;
654   }
655
656637   return data;
657638}
658639
r4737r4738
873854   drive_config (machine, type_1541, 0, 0, 1, 8);
874855}
875856
876void c64_common_init_machine (running_machine *machine)
857static void c64_common_init_machine (running_machine *machine)
877858{
878859   if (is_sx64)
879860   {
src/mess/drivers/c128.c
r4737r4738
599599   MDRV_CPU_VBLANK_INT("screen", c128_frame_interrupt)
600600   MDRV_CPU_PERIODIC_INT(vic2_raster_irq, VIC6567_HRETRACERATE)
601601
602   MDRV_MACHINE_START( c128 )
602603   MDRV_MACHINE_RESET( c128 )
603604
604605    /* video hardware */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team