Previous 15994 Revisions Next

r3932 Saturday 20th December, 2008 at 20:02:11 UTC by Wilbert Pol
Removed deprecat.h from machine/c64.c
[src/emu/sound]sid.c sid.h sid6581.c sid6581.h
[src/mess/includes]c64.h
[src/mess/machine]c64.c

src/emu/sound/sid.c
r3931r3932
323323   }
324324}
325325
326int sid6581_port_r (SID6581 *This, int offset)
326int sid6581_port_r (running_machine *machine, SID6581 *This, int offset)
327327{
328328    int data;
329329/* SIDPLAY reads last written at a sid address value */
r3931r3932
337337   break;
338338    case 0x19:                     /* paddle 1 */
339339   if (This->ad_read != NULL)
340       data=This->ad_read (0);
340       data=This->ad_read (machine, 0);
341341   else
342342       data=0;
343343   break;
344344    case 0x1a:                     /* paddle 2 */
345345   if (This->ad_read != NULL)
346       data=This->ad_read (1);
346       data=This->ad_read (machine, 1);
347347   else
348348       data=0;
349349   break;
src/emu/sound/sid.h
r3931r3932
1818    const device_config *device;
1919    sound_stream *mixer_channel; // mame stream/ mixer channel
2020
21    int (*ad_read) (int which);
21    int (*ad_read) (running_machine *machine, int which);
2222    SIDTYPE type;
2323    UINT32 clock;
2424
r3931r3932
5959
6060int sidEmuReset(SID6581 *This);
6161
62int sid6581_port_r (SID6581 *This, int offset);
62int sid6581_port_r (running_machine *machine, SID6581 *This, int offset);
6363void sid6581_port_w (SID6581 *This, int offset, int data);
6464
6565void sid_set_type(SID6581 *This, SIDTYPE type);
src/emu/sound/sid6581.c
r3931r3932
7575
7676READ8_HANDLER ( sid6581_0_port_r )
7777{
78   return sid6581_port_r(get_sid(0), offset);
78   return sid6581_port_r(space->machine, get_sid(0), offset);
7979}
8080
8181READ8_HANDLER ( sid6581_1_port_r )
8282{
83   return sid6581_port_r(get_sid(1), offset);
83   return sid6581_port_r(space->machine, get_sid(1), offset);
8484}
8585
8686WRITE8_HANDLER ( sid6581_0_port_w )
src/emu/sound/sid6581.h
r3931r3932
2323typedef struct _sid6581_interface sid6581_interface;
2424struct _sid6581_interface
2525{
26   int (*ad_read)(int channel);
26   int (*ad_read)(running_machine *machine, int channel);
2727} ;
2828
2929
src/mess/includes/c64.h
r3931r3932
5353
5454WRITE8_HANDLER ( c64_write_io );
5555READ8_HANDLER ( c64_read_io );
56int c64_paddle_read (int which);
56int c64_paddle_read (running_machine *machine, int which);
5757void c64_vic_interrupt (running_machine *machine, int level);
5858
5959extern int c64_pal;
src/mess/machine/c64.c
r3931r3932
2727#include "machine/6526cia.h"
2828#include "video/vic6567.h"
2929#include "video/vdc8563.h"
30#include "deprecat.h"
3130
3231#include "includes/cbm.h"
3332#include "includes/cbmserb.h"
r3931r3932
861860}
862861
863862
864int c64_paddle_read (int which)
863int c64_paddle_read (running_machine *machine, int which)
865864{
866865   int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
867   UINT8 cia0porta = cia_get_output_a(device_list_find_by_tag(Machine->config->devicelist, CIA6526R1, "cia_0"));
868   int controller1 = input_port_read(Machine, "CTRLSEL") & 0x07;
869   int controller2 = input_port_read(Machine, "CTRLSEL") & 0x70;
866   UINT8 cia0porta = cia_get_output_a(device_list_find_by_tag(machine->config->devicelist, CIA6526R1, "cia_0"));
867   int controller1 = input_port_read(machine, "CTRLSEL") & 0x07;
868   int controller2 = input_port_read(machine, "CTRLSEL") & 0x70;
870869
871870   /* Notice that only a single input is defined for Mouse & Lightpen in both ports */
872871   switch (controller1)
873872   {
874873      case 0x01:
875874         if (which)
876            pot2 = input_port_read(Machine, "PADDLE2");
875            pot2 = input_port_read(machine, "PADDLE2");
877876         else
878            pot1 = input_port_read(Machine, "PADDLE1");
877            pot1 = input_port_read(machine, "PADDLE1");
879878         break;
880879
881880      case 0x02:
882881         if (which)
883            pot2 = input_port_read(Machine, "TRACKY");
882            pot2 = input_port_read(machine, "TRACKY");
884883         else
885            pot1 = input_port_read(Machine, "TRACKX");
884            pot1 = input_port_read(machine, "TRACKX");
886885         break;
887886
888887      case 0x03:
889         if (which && (input_port_read(Machine, "JOY1_2B") & 0x20))   /* Joy1 Button 2 */
888         if (which && (input_port_read(machine, "JOY1_2B") & 0x20))   /* Joy1 Button 2 */
890889            pot1 = 0x00;
891890         break;
892891
893892      case 0x04:
894893         if (which)
895            pot2 = input_port_read(Machine, "LIGHTY");
894            pot2 = input_port_read(machine, "LIGHTY");
896895         else
897            pot1 = input_port_read(Machine, "LIGHTX");
896            pot1 = input_port_read(machine, "LIGHTX");
898897         break;
899898
900899      case 0x00:
r3931r3932
910909   {
911910      case 0x10:
912911         if (which)
913            pot4 = input_port_read(Machine, "PADDLE4");
912            pot4 = input_port_read(machine, "PADDLE4");
914913         else
915            pot3 = input_port_read(Machine, "PADDLE3");
914            pot3 = input_port_read(machine, "PADDLE3");
916915         break;
917916
918917      case 0x20:
919918         if (which)
920            pot4 = input_port_read(Machine, "TRACKY");
919            pot4 = input_port_read(machine, "TRACKY");
921920         else
922            pot3 = input_port_read(Machine, "TRACKX");
921            pot3 = input_port_read(machine, "TRACKX");
923922         break;
924923
925924      case 0x30:
926         if (which && (input_port_read(Machine, "JOY2_2B") & 0x20))   /* Joy2 Button 2 */
925         if (which && (input_port_read(machine, "JOY2_2B") & 0x20))   /* Joy2 Button 2 */
927926            pot4 = 0x00;
928927         break;
929928
930929      case 0x40:
931930         if (which)
932            pot4 = input_port_read(Machine, "LIGHTY");
931            pot4 = input_port_read(machine, "LIGHTY");
933932         else
934            pot3 = input_port_read(Machine, "LIGHTX");
933            pot3 = input_port_read(machine, "LIGHTX");
935934         break;
936935
937936      case 0x00:
r3931r3932
943942         break;
944943   }
945944
946   if (input_port_read(Machine, "CTRLSEL") & 0x80)      /* Swap */
945   if (input_port_read(machine, "CTRLSEL") & 0x80)      /* Swap */
947946   {
948947      temp = pot1; pot1 = pot2; pot2 = pot1;
949948      temp = pot3; pot3 = pot4; pot4 = pot3;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team