Previous 15994 Revisions Next

r3678 Thursday 27th November, 2008 at 20:00:14 UTC by Fabio Priuli
[GAMEPOCK][GMASTER] Re-enabled
[src/mess]mess.mak messdriv.c
[src/mess/drivers]gamepock.c gmaster.c
[src/mess/machine]gamepock.c

src/mess/messdriv.c
r3677r3678
175175   DRIVER( odyssey2 )   /* Magnavox Odyssey 2 - 1978-1983               */
176176
177177   /* Hartung, Watara, ...*/
178//128u4   DRIVER( gmaster )   /* Hartung Gamemaster                         */
178   DRIVER( gmaster )   /* Hartung Gamemaster                         */
179179
180180   /* WATARA */
181181//128u4   DRIVER( svision )   /* Supervision Handheld                        */
r3677r3678
192192//128u4   DRIVER( wscolor )   /* Bandai WonderSwan Color Handheld               */
193193
194194   /* EPOCH */
195//128u4   DRIVER( gamepock )   /* Epoch Game Pocket Computer                  */
195   DRIVER( gamepock )   /* Epoch Game Pocket Computer                  */
196196
197197   /* KOEI */
198198   DRIVER( pasogo )   /* KOEI PasoGo                              */
src/mess/machine/gamepock.c
r3677r3678
1515static UINT8 gamepock_port_b;
1616static HD44102CH hd44102ch[3];
1717
18static void hd44102ch_w( int which, int c_d, UINT8 data ) {
19   if ( c_d ) {
18static void hd44102ch_w( int which, int c_d, UINT8 data )
19{
20   if ( c_d )
21   {
2022      UINT8   y;
2123      /* Data */
2224      hd44102ch[which].ram[ hd44102ch[which].address ] = data;
2325
2426      /* Increment/decrement Y counter */
2527      y = ( hd44102ch[which].address & 0x3F ) + hd44102ch[which].y_inc;
26      if ( y == 0xFF ) {
28      if ( y == 0xFF )
29      {
2730         y = 49;
2831      }
29      if ( y == 50 ) {
32      if ( y == 50 )
33      {
3034         y = 0;
3135      }
3236      hd44102ch[which].address = ( hd44102ch[which].address & 0xC0 ) | y;
33   } else {
37   }
38   else
39   {
3440      /* Command */
35      switch ( data ) {
41      switch ( data )
42      {
3643      case 0x38:      /* Display off */
3744         hd44102ch[which].enabled = 0;
3845         break;
r3677r3678
5259         hd44102ch[which].start_page = data & 0xC0;
5360         break;
5461      default:
55         if ( ( data & 0x3F ) < 50 ) {
62         if ( ( data & 0x3F ) < 50 )
63         {
5664            hd44102ch[which].address = data;
5765         }
5866         break;
r3677r3678
6068   }
6169}
6270
63static void hd44102ch_init( int which ) {
71static void hd44102ch_init( int which )
72{
6473   memset( &hd44102ch[which], 0, sizeof( HD44102CH ) );
6574   hd44102ch[which].y_inc = 0x01;
6675}
6776
68static void gamepock_lcd_update(void) {
77static void gamepock_lcd_update(void)
78{
6979   /* Check whether HD44102CH #1 is enabled */
70   if ( gamepock_port_a & 0x08 ) {
80   if ( gamepock_port_a & 0x08 )
81   {
7182      hd44102ch_w( 0, gamepock_port_a & 0x04, gamepock_port_b );
7283   }
7384
7485   /* Check whether HD44102CH #2 is enabled */
75   if ( gamepock_port_a & 0x10 ) {
86   if ( gamepock_port_a & 0x10 )
87   {
7688      hd44102ch_w( 1, gamepock_port_a & 0x04, gamepock_port_b );
7789   }
7890
7991   /* Check whether HD44102CH #3 is enabled */
80   if ( gamepock_port_a & 0x20 ) {
92   if ( gamepock_port_a & 0x20 )
93   {
8194      hd44102ch_w( 2, gamepock_port_a & 0x04, gamepock_port_b );
8295   }
8396}
8497
85WRITE8_HANDLER( gamepock_port_a_w ) {
98WRITE8_HANDLER( gamepock_port_a_w )
99{
86100   UINT8   old_port_a = gamepock_port_a;
87101
88102   gamepock_port_a = data;
89103
90   if ( ! ( old_port_a & 0x02 ) && ( gamepock_port_a & 0x02 ) ) {
104   if ( ! ( old_port_a & 0x02 ) && ( gamepock_port_a & 0x02 ) )
105   {
91106      gamepock_lcd_update();
92107   }
93108}
94109
95WRITE8_HANDLER( gamepock_port_b_w ) {
110WRITE8_HANDLER( gamepock_port_b_w )
111{
96112   gamepock_port_b = data;
97113}
98114
99READ8_HANDLER( gamepock_port_b_r ) {
115READ8_HANDLER( gamepock_port_b_r )
116{
100117   logerror("gamepock_port_b_r: not implemented\n");
101118   return 0xFF;
102119}
103120
104READ8_HANDLER( gamepock_port_c_r ) {
121READ8_HANDLER( gamepock_port_c_r )
122{
105123   UINT8   data = 0xFF;
106124
107125   if ( gamepock_port_a & 0x80 )
108126   {
109      data &= input_port_read(machine, "IN0");
127      data &= input_port_read(space->machine, "IN0");
110128   }
111129
112130   if ( gamepock_port_a & 0x40 )
113131   {
114      data &= input_port_read(machine, "IN1");
132      data &= input_port_read(space->machine, "IN1");
115133   }
116134
117135   return data;
118136}
119137
120MACHINE_RESET( gamepock ) {
138MACHINE_RESET( gamepock )
139{
121140   hd44102ch_init( 0 );
122141   hd44102ch_init( 1 );
123142   hd44102ch_init( 2 );
124143}
125144
126VIDEO_UPDATE( gamepock ) {
145VIDEO_UPDATE( gamepock )
146{
127147   UINT8   ad;
128148   int      i,j;
129149
130150   /* Handle HD44102CH #0 */
131151   ad = hd44102ch[0].start_page;
132   for ( i = 0; i < 4; i++ ) {
133      for ( j = 0; j < 50; j++ ) {
152   for ( i = 0; i < 4; i++ )
153   {
154      for ( j = 0; j < 50; j++ )
155      {
134156         *BITMAP_ADDR16(bitmap, i * 8 + 0, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x01 ) ? 0 : 1;
135157         *BITMAP_ADDR16(bitmap, i * 8 + 1, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x02 ) ? 0 : 1;
136158         *BITMAP_ADDR16(bitmap, i * 8 + 2, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x04 ) ? 0 : 1;
r3677r3678
145167
146168   /* Handle HD44102CH #1 */
147169   ad = hd44102ch[1].start_page;
148   for ( i = 4; i < 8; i++ ) {
149      for ( j = 0; j < 50; j++ ) {
170   for ( i = 4; i < 8; i++ )
171   {
172      for ( j = 0; j < 50; j++ )
173      {
150174         *BITMAP_ADDR16(bitmap, i * 8 + 0, j ) = ( hd44102ch[1].ram[ad+j] & 0x01 ) ? 0 : 1;
151175         *BITMAP_ADDR16(bitmap, i * 8 + 1, j ) = ( hd44102ch[1].ram[ad+j] & 0x02 ) ? 0 : 1;
152176         *BITMAP_ADDR16(bitmap, i * 8 + 2, j ) = ( hd44102ch[1].ram[ad+j] & 0x04 ) ? 0 : 1;
r3677r3678
161185
162186   /* Handle HD44102CH #2 */
163187   ad = hd44102ch[2].start_page;
164   for ( i = 0; i < 4; i++ ) {
165      for ( j = 0; j < 25; j++ ) {
188   for ( i = 0; i < 4; i++ )
189   {
190      for ( j = 0; j < 25; j++ )
191      {
166192         *BITMAP_ADDR16(bitmap, i * 8 + 0, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1;
167193         *BITMAP_ADDR16(bitmap, i * 8 + 1, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1;
168194         *BITMAP_ADDR16(bitmap, i * 8 + 2, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1;
r3677r3678
172198         *BITMAP_ADDR16(bitmap, i * 8 + 6, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1;
173199         *BITMAP_ADDR16(bitmap, i * 8 + 7, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1;
174200      }
175      for ( j = 25; j < 50; j++ ) {
201      for ( j = 25; j < 50; j++ )
202      {
176203         *BITMAP_ADDR16(bitmap, 32 + i * 8 + 0, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1;
177204         *BITMAP_ADDR16(bitmap, 32 + i * 8 + 1, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1;
178205         *BITMAP_ADDR16(bitmap, 32 + i * 8 + 2, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1;
r3677r3678
189216}
190217
191218/* This is called whenever the T0 pin switches state */
192int gamepock_io_callback( int ioline, int state ) {
193   if ( ioline == UPD7810_TO ) {
219int gamepock_io_callback( int ioline, int state )
220{
221   if ( ioline == UPD7810_TO )
222   {
194223      speaker_level_w(0, state & 1 );
195224   }
196225   return 0;
src/mess/mess.mak
r3677r3678
397397   $(MESSOBJ)/dai.a \
398398   $(MESSOBJ)/einis.a \
399399   $(MESSOBJ)/ep128.a \
400   $(MESSOBJ)/epoch.a \
400401   $(MESSOBJ)/exidy.a \
401402   $(MESSOBJ)/fairch.a \
402403   $(MESSOBJ)/gce.a \
403404   $(MESSOBJ)/galaxy.a \
405   $(MESSOBJ)/gmaster.a \
404406   $(MESSOBJ)/grundy.a \
405407   $(MESSOBJ)/homelab.a \
406408   $(MESSOBJ)/intv.a \
r3677r3678
465467#   $(MESSOBJ)/coco.a \
466468#   $(MESSOBJ)/compis.a \
467469#   $(MESSOBJ)/dgn_beta.a \
468#   $(MESSOBJ)/epoch.a \
469470#   $(MESSOBJ)/epson.a \
470471#   $(MESSOBJ)/exeltel.a \
471472#   $(MESSOBJ)/glasgow.a \
472#   $(MESSOBJ)/gmaster.a \
473473#   $(MESSOBJ)/hp48.a \
474474#   $(MESSOBJ)/lynx.a \
475475#   $(MESSOBJ)/mephisto.a \
src/mess/drivers/gmaster.c
r3677r3678
3131{
3232    UINT8 data=0;
3333    if (gmaster.ports[2]&1) {
34   data=memory_region(machine, "main")[0x4000+offset];
35   logerror("%.4x external memory %.4x read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset,data);
34   data=memory_region(space->machine, "main")[0x4000+offset];
35   logerror("%.4x external memory %.4x read %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), 0x4000+offset,data);
3636    } else {
3737   switch (offset) {
3838   case 1:
3939       data=gmaster_video.pixels[gmaster_video.y][gmaster_video.x];
40       logerror("%.4x lcd x:%.2x y:%.2x %.4x read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), gmaster_video.x, gmaster_video.y, 0x4000+offset,data);
40       logerror("%.4x lcd x:%.2x y:%.2x %.4x read %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), gmaster_video.x, gmaster_video.y, 0x4000+offset,data);
4141       if (!(gmaster_video.mode)&&gmaster_video.delayed) gmaster_video.x++;
4242       gmaster_video.delayed=TRUE;
4343       break;
4444   default:
45     logerror("%.4x memory %.4x read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset,data);
45     logerror("%.4x memory %.4x read %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), 0x4000+offset,data);
4646   }
4747    }
4848    return data;
r3677r3678
5353static WRITE8_HANDLER( gmaster_io_w )
5454{
5555    if (gmaster.ports[2]&1) {
56   memory_region(machine, "main")[0x4000+offset]=data;
57   logerror("%.4x external memory %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
56   memory_region(space->machine, "main")[0x4000+offset]=data;
57   logerror("%.4x external memory %.4x written %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), 0x4000+offset, data);
5858    } else {
5959   switch (offset) {
6060   case 0:
6161       gmaster_video.delayed=FALSE;
62       logerror("%.4x lcd %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
62       logerror("%.4x lcd %.4x written %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), 0x4000+offset, data);
6363       // e2 af a4 a0 a9 falling block init for both halves
6464       if ((data&0xfc)==0xb8) {
6565      gmaster_video.index=0;
r3677r3678
7878       if (gmaster_video.x<ARRAY_LENGTH(gmaster_video.pixels[0])) // continental galaxy flutlicht
7979      gmaster_video.pixels[gmaster_video.y][gmaster_video.x]=data;
8080       logerror("%.4x lcd x:%.2x y:%.2x %.4x written %.2x\n",
81           (int)activecpu_get_reg(CPUINFO_INT_PC), gmaster_video.x, gmaster_video.y, 0x4000+offset, data);
81           (int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), gmaster_video.x, gmaster_video.y, 0x4000+offset, data);
8282       gmaster_video.x++;
8383/* 02 b8 1a
8484   02 bb 1a
r3677r3678
9696*/
9797       break;
9898   default:
99     logerror("%.4x memory %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
99     logerror("%.4x memory %.4x written %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), 0x4000+offset, data);
100100   }
101101    }
102102}
r3677r3678
107107    UINT8 data=0xff;
108108    switch (offset) {
109109    case UPD7810_PORTA:
110   data=input_port_read(machine, "JOY");
110   data=input_port_read(space->machine, "JOY");
111111   break;
112112    default:
113      logerror("%.4x port %d read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC),offset,data);
113      logerror("%.4x port %d read %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC),offset,data);
114114    }
115115    return data;
116116}
r3677r3678
118118static WRITE8_HANDLER( gmaster_port_w )
119119{
120120    gmaster.ports[offset]=data;
121    logerror("%.4x port %d written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), offset, data);
121    logerror("%.4x port %d written %.2x\n",(int)cpu_get_reg(space->cpu, CPUINFO_INT_PC), offset, data);
122122    switch (offset) {
123123    case UPD7810_PORTC:
124124   gmaster_video.y=BLITTER_Y;
r3677r3678
203203
204204static INTERRUPT_GEN( gmaster_interrupt )
205205{
206  cpu_set_input_line(machine->cpu[0], UPD7810_INTFE1, PULSE_LINE);
206  cpu_set_input_line(device->machine->cpu[0], UPD7810_INTFE1, PULSE_LINE);
207207}
208208
209209static UPD7810_CONFIG config={
src/mess/drivers/gamepock.c
r3677r3678
6363MACHINE_DRIVER_END
6464
6565static DEVICE_START(gamepock_cart) {
66   memory_set_bankptr( 1, memory_region(device->machine,  "user1" ) );
66   memory_set_bankptr( device->machine, 1, memory_region(device->machine,  "user1" ) );
6767   return DEVICE_START_OK;
6868}
6969
r3677r3678
7676      return INIT_FAIL;
7777   }
7878
79   memory_set_bankptr( 1, memory_region(image->machine,  "user1" ) );
79   memory_set_bankptr( image->machine, 1, memory_region(image->machine,  "user1" ) );
8080
8181   return INIT_PASS;
8282}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team