Previous 15994 Revisions Next

r2009 Monday 17th March, 2008 at 12:36:13 UTC by Dirk Best
[ASTROCDE] Updated to use the MAME implementation of the video hardware
[src/mame/includes]astrocde.h
[src/mame/video]astrocde.c
[src/mess]mess.mak
[src/mess/drivers]astrocde.c
[src/mess/includes]astrocde.h
[src/mess/video]astrocde.c

src/mame/includes/astrocde.h
r2008r2009
66
77#include "sound/custom.h"
88
9#define ASTROCADE_CLOCK      (14318180/2)
9#define ASTROCADE_CLOCK      (XTAL_14_31818MHz/2)
1010
1111#define AC_SOUND_PRESENT   (0x01)
1212#define AC_LIGHTPEN_INTS   (0x02)
src/mame/video/astrocde.c
r2008r2009
452452      vertical_feedback = vfeedback;
453453      horizontal_feedback = hfeedback;
454454   }
455   
456   /* nothing to do, clear the interrupt */
457   else
458      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
455459}
456460
457461
r2008r2009
468472   int astrocade_scanline = mame_vpos_to_astrocade_vpos(scanline);
469473
470474   /* force an update against the current scanline */
471   video_screen_update_partial(machine->primary_screen, scanline - 1);
475   video_screen_update_partial(machine->primary_screen, scanline ? scanline - 1 : video_screen_get_height(machine->primary_screen));
472476
473477   /* generate a scanline interrupt if it's time */
474478   if (astrocade_scanline == interrupt_scanline && (interrupt_enable & 0x08) != 0)
r2008r2009
489493   else if (astrocade_video_config & AC_LIGHTPEN_INTS)
490494      astrocade_trigger_lightpen(machine, astrocade_scanline, 8);
491495
496   /* nothing to do, clear the interrupt */
497   else
498      cpunum_set_input_line(machine, 0, 0, CLEAR_LINE);
499
492500   /* advance to the next scanline */
493501   scanline++;
494502   if (scanline >= video_screen_get_height(machine->primary_screen))
r2008r2009
555563      case 0x17:   /* keypad column 3 */
556564         result = readinputportbytag_safe("KEYPAD3", 0xff);
557565         break;
566
567      case 0x1c:   /* player 1 knob */
568         result = readinputportbytag_safe("P1_KNOB", 0xff);
569         break;
570
571      case 0x1d:   /* player 2 knob */
572         result = readinputportbytag_safe("P2_KNOB", 0xff);
573         break;
574
575      case 0x1e:   /* player 3 knob */
576         result = readinputportbytag_safe("P3_KNOB", 0xff);
577         break;
578
579      case 0x1f:   /* player 4 knob */
580         result = readinputportbytag_safe("P4_KNOB", 0xff);
581         break;
558582   }
559583
560584   return result;
r2008r2009
563587
564588WRITE8_HANDLER( astrocade_data_chip_register_w )
565589{
590   static int color_index = 7;
591   
566592   /* these are the core registers */
567593   switch (offset & 0xff)
568594   {
r2008r2009
591617         break;
592618
593619      case 0x0b:   /* color block transfer */
594         colors[(offset >> 8) & 7] = data;
620         colors[color_index] = data;
621         if (color_index-- == 0) color_index = 7;
595622         break;
596623
597624      case 0x0c:   /* function generator */
src/mess/includes/astrocde.h
r2008r2009
1/*****************************************************************************
2 *
3 * includes/astrocde.h
4 *
5 ****************************************************************************/
6
7#ifndef ASTROCDE_H_
8#define ASTROCDE_H_
9
10
11#define XTAL_Y1  XTAL_14_31818MHz
12
13
14/*----------- defined in video/astrocde.c -----------*/
15
16PALETTE_INIT( astrocade );
17
18WRITE8_HANDLER( astrocade_interrupt_enable_w );
19WRITE8_HANDLER( astrocade_interrupt_w );
20WRITE8_HANDLER ( astrocade_interrupt_vector_w );
21
22READ8_HANDLER( astrocade_intercept_r );
23WRITE8_HANDLER( astrocade_magic_expand_color_w );
24WRITE8_HANDLER( astrocade_magic_control_w );
25WRITE8_HANDLER( astrocade_magicram_w );
26
27READ8_HANDLER( astrocade_video_retrace_r );
28WRITE8_HANDLER( astrocade_vertical_blank_w );
29
30WRITE8_HANDLER( astrocade_mode_w );
31
32WRITE8_HANDLER( astrocade_colour_register_w );
33WRITE8_HANDLER( astrocade_colour_block_w );
34WRITE8_HANDLER( astrocade_colour_split_w );
35
36VIDEO_UPDATE( astrocde );
37
38
39#endif /* ASTROCDE_H_ */
src/mess/video/astrocde.c
r2008r2009
1/***************************************************************************
2
3  video/astrocde.c
4
5  Functions to emulate the video hardware of the machine.
6
7  * History *
8
9  MJC - 01.02.98 - Line based dirty colour / dirty rectangle handling
10
11***************************************************************************/
12
13#include "driver.h"
14#include "cpu/z80/z80.h"
15#include "includes/astrocde.h"
16
17#include <math.h> /* for sin() and cos() */
18
19#define VERBOSE 0
20#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
21
22static int magic_expand_color, magic_control, magic_expand_flipflop, collision;
23
24static int ColourSplit=0;                        /* Colour System vars */
25static int Colour[8] = {0,0,0,0,0,0,0,0};
26
27static unsigned int LeftColourCheck=0x00000000;
28static unsigned int RightColourCheck=0x00000000;
29static unsigned int LeftLineColour[256];
30static unsigned int RightLineColour[256];
31
32static int VerticalBlank = 204;
33static int BackgroundData = 0;
34static int LastShifter = 0;
35static int astrocade_mode = 0;
36
37static UINT8 interrupt_vector = 0;
38
39static int screen_interrupt_enabled;
40static int screen_interrupt_mode;
41static int screen_interrupt_line = 0;
42
43static int lightpen_interrupt_enabled;
44static int lightpen_interrupt_mode;
45
46
47/* These are the bits of the Magic Register */
48static const unsigned char SHIFT_MASK  = 0x03;
49static const unsigned char ROTATE_MASK = 0x04;
50static const unsigned char EXPAND_MASK = 0x08;
51static const unsigned char OR_MASK     = 0x10;
52static const unsigned char XOR_MASK    = 0x20;
53static const unsigned char FLOP_MASK   = 0x40;
54
55
56
57/*************************************
58 *
59 *  Palette
60 *
61 *************************************/
62
63PALETTE_INIT( astrocade )
64{
65   /* This routine builds a palette using a transformation from */
66   /* the YUV (Y, B-Y, R-Y) to the RGB color space */
67
68   /* It also returns a fake colortable, for the menus */
69
70   int i,j;
71
72   float Y, RY, BY;   /* Y, R-Y, and B-Y signals as generated by the game */
73                  /* Y = Luminance -> (0 to 1) */
74                  /* R-Y = Color along R-Y axis -> C*(-1 to +1) */
75                  /* B-Y = Color along B-Y axis -> C*(-1 to +1) */
76   float R, G, B;
77
78   float brightest = 1.0;   /* Approx. Luminance values for the extremes -> (0 to 1) */
79   float dimmest   = 0.0;
80   float C = 0.75;          /* Approx. Chroma intensity */
81
82   /* The astrocade has a 256 color palette                 */
83   /* 32 colors, with 8 luminance levels for each color     */
84   /* The 32 colors circle around the YUV color space,      */
85   /* with the exception of the first 8 which are grayscale */
86
87   /* Note: to simulate a B&W monitor, set C=0 and all      */
88   /*       colors will appear as the first 8 grayscales    */
89
90   for(i=0;i<32;i++)
91   {
92      RY = C*sin(i*2.0*M_PI/32.0);
93      if (i == 0)
94         BY = 0;
95      else
96         BY = C*cos(i*2.0*M_PI/32.0);
97
98      for(j=0;j<8;j++)
99      {
100         Y = (j/7.0)*(brightest-dimmest)+dimmest;
101
102         /* Transform to RGB */
103
104         R = (RY+Y)*255;
105         G = (Y - 0.299*(RY+Y) - 0.114*(BY+Y))/0.587*255;
106         B = (BY+Y)*255;
107
108         /* Clipping, in case of saturation */
109
110         if (R < 0)
111            R = 0;
112         if (R > 255)
113            R = 255;
114         if (G < 0)
115            G = 0;
116         if (G > 255)
117            G = 255;
118         if (B < 0)
119            B = 0;
120         if (B > 255)
121            B = 255;
122
123         /* Round, and set the value */
124         palette_set_color_rgb(machine, i*8+j, floor(R+.5), floor(G+.5),  floor(B+.5));
125      }
126   }
127}
128
129
130
131/*************************************
132 *
133 *  Interrupts
134 *
135 *************************************/
136
137WRITE8_HANDLER( astrocade_interrupt_enable_w )
138{
139   screen_interrupt_enabled = data & 0x08;
140   screen_interrupt_mode = data & 0x04;
141
142   lightpen_interrupt_enabled = data & 0x02;
143   lightpen_interrupt_mode = data & 0x01;
144
145   LOG(("Interrupt Flag set to %02x\n",data & 0x0f));
146}
147
148
149WRITE8_HANDLER( astrocade_interrupt_w )
150{
151   /* in low res mode, only bits 1-7 are used */
152   screen_interrupt_line = astrocade_mode ? data : data >> 1;
153   
154   LOG(("Scanline interrupt set to %02x\n", screen_interrupt_line));
155}
156
157
158WRITE8_HANDLER( astrocade_interrupt_vector_w )
159{
160   interrupt_vector = data;
161}
162
163
164
165/*************************************
166 *
167 *  VBlank
168 *
169 *************************************/
170
171WRITE8_HANDLER( astrocade_vertical_blank_w )
172{
173   VerticalBlank = data;
174}
175
176
177READ8_HANDLER( astrocade_video_retrace_r )
178{
179    return video_screen_get_vpos(machine->primary_screen);
180}
181
182
183
184/*************************************
185 *
186 *  Screen mode
187 *
188 *************************************/
189
190/*-------------------------------------------------
191    astrocade_mode_w - this selects commercial
192    (high res, arcade) or consumer
193    (low res, astrocade) mode
194-------------------------------------------------*/
195
196WRITE8_HANDLER( astrocade_mode_w )
197{
198   rectangle visarea;
199   astrocade_mode = data & 0x01;
200
201   if (astrocade_mode)
202   {
203      /* high res mode */
204      visarea.min_x = 0;
205      visarea.max_x = 319;
206      visarea.min_y = 0;
207      visarea.max_y = 255;
208
209      video_screen_configure(machine->primary_screen, 455, 268, &visarea, HZ_TO_ATTOSECONDS(XTAL_Y1/2) * 268 * 455);
210   }
211   else
212   {
213      /* low res mode */
214      visarea.min_x = 0;
215      visarea.max_x = 159;
216      visarea.min_y = 0;
217      visarea.max_y = 127;
218
219      video_screen_configure(machine->primary_screen, 455, 134, &visarea, HZ_TO_ATTOSECONDS(XTAL_Y1/4) * 134 * 455);
220   }
221}
222
223
224
225/*************************************
226 *
227 *  Collisions
228 *
229 *************************************/
230
231READ8_HANDLER( astrocade_intercept_r )
232{
233   int res;
234
235   res = collision;
236   collision = 0;
237
238   return res;
239}
240
241
242
243/*************************************
244 *
245 *  Colors
246 *
247 *************************************/
248
249/*-------------------------------------------------
250    astrocade_colour_split_w - switches colour
251    registers at this zone - 40 zones
252    also sets the background colors
253-------------------------------------------------*/
254
255WRITE8_HANDLER ( astrocade_colour_split_w )
256{
257   ColourSplit = data&0x3f;
258
259   if (astrocade_mode == 1)
260      ColourSplit <<= 1;
261
262   BackgroundData = ((data&0xc0) >> 6) * 0x55;
263
264   LOG(("Colour split set to %02d\n", ColourSplit));
265}
266
267WRITE8_HANDLER( astrocade_colour_register_w )
268{
269   if(Colour[offset] != data)
270    {
271      Colour[offset] = data;
272
273        if(offset>3)
274         LeftColourCheck = (Colour[4] << 24) | (Colour[5] << 16) | (Colour[6] < 8) | Colour[7];
275        else
276           RightColourCheck = (Colour[0] << 24) | (Colour[1] << 16) | (Colour[2] < 8) | Colour[3];
277   }
278
279   LOG(("Colour %01x set to %02x\n",offset,data));
280}
281
282WRITE8_HANDLER ( astrocade_colour_block_w )
283{
284   static int color_reg_num = 7;
285
286   Colour[color_reg_num] = data;
287
288   LOG(("Colour block write: color %x set to %x\n", color_reg_num,data));
289
290   if (color_reg_num == 0)
291      color_reg_num = 7;
292   else
293      color_reg_num--;
294
295   LeftColourCheck = (Colour[4] << 24) | (Colour[5] << 16) | (Colour[6] < 8) | Colour[7];
296    RightColourCheck = (Colour[0] << 24) | (Colour[1] << 16) | (Colour[2] < 8) | Colour[3];
297
298}
299
300
301
302/*************************************
303 *
304 *  Magic RAM
305 *
306 *************************************/
307
308WRITE8_HANDLER( astrocade_magic_expand_color_w )
309{
310   //LOG(("%04x: magic_expand_color = %02x\n",cpu_getpc(),data));
311
312   magic_expand_color = data;
313}
314
315
316WRITE8_HANDLER( astrocade_magic_control_w )
317{
318   //LOG(("%04x: magic_control = %02x\n",cpu_getpc(),data));
319
320   magic_expand_flipflop = 0;   /* initialize the expand nibble */
321   LastShifter = 0;         /* clear the shifter */
322
323   magic_control = data;
324}
325
326
327WRITE8_HANDLER( astrocade_magicram_w )
328{
329   unsigned int data1,shift,bits,bibits,stib,k,old_data;
330
331   //LOG(("%04x: magicram_w(%04x) = %02x, magic_register = %02x\n",cpu_getpc(),offset,data,magic_control));
332
333   if (magic_control & EXPAND_MASK)   /* expand mode */
334   {
335      bits = data;
336
337      /* if flip-flop set, expand lower half */
338      /* otherwise do upper half */
339
340      if (magic_expand_flipflop)
341         bits <<= 4;
342
343      /* now what we want to expand is in bits 4-7 */
344
345      bibits = 0;
346      for (k = 0;k < 4;k++)
347      {
348         bibits <<= 2;
349         if (bits & 0x80)
350            bibits |= (magic_expand_color >> 2) & 0x03;
351         else
352            bibits |= magic_expand_color & 0x03;
353         bits <<= 1;
354      }
355
356      data = bibits;
357   }
358
359   /* rotating or shifting */
360
361   data1 = 0;
362
363   if (magic_control & ROTATE_MASK)
364   {
365      /* Rotate not implemented */
366      /* (Only functional in commercial mode) */
367   }
368   else
369   {
370      shift = (magic_control & SHIFT_MASK);
371
372      if (shift)
373      {
374         while (shift > 0)
375         {
376            data1 >>= 2;
377            data1 |= (data & 0x03) << 6;
378
379            data >>= 2;
380
381            shift--;
382         }
383
384         data |= LastShifter;
385         LastShifter = data1;
386
387      }
388   }
389
390   /* flopping */
391
392   if (magic_control & FLOP_MASK)   /* copy backwards */
393   {
394      bits = data;
395      stib = 0;
396      for (k = 0;k < 4;k++)
397      {
398         stib >>= 2;
399         stib |= (bits & 0xc0);
400         bits <<= 2;
401      }
402
403      data = stib;
404
405      bits = data1;
406      stib = 0;
407      for (k = 0;k < 4;k++)
408      {
409         stib >>= 2;
410         stib |= (bits & 0xc0);
411         bits <<= 2;
412      }
413
414      data1 = stib;
415   }
416
417   /* OR or XOR */
418
419   if (magic_control & 0x30)
420   {
421      old_data = videoram[offset];
422      collision &= 0x0f;
423
424      if (data | old_data)
425      {
426         if ((data & 0x03) && (old_data & 0x03))
427            collision |= 0x88;
428         if ((data & 0x0c) && (old_data & 0x0c))
429            collision |= 0x44;
430         if ((data & 0x30) && (old_data & 0x30))
431            collision |= 0x22;
432         if ((data & 0xc0) && (old_data & 0xc0))
433            collision |= 0x11;
434      }
435   }
436
437   if (magic_control & XOR_MASK)
438      data ^= videoram[offset];       /* draw in XOR mode */
439   else if (magic_control & OR_MASK)
440      data |= videoram[offset];      /* draw in OR mode */
441
442   /* else draw in copy mode */
443   videoram[offset] = data;
444
445   magic_expand_flipflop ^= 1;
446}
447
448
449
450/*************************************
451 *
452 *  Video update and interrupts
453 *
454 *************************************/
455
456VIDEO_UPDATE( astrocde )
457{
458   int line = video_screen_get_vpos(screen);
459    int num_bytes = astrocade_mode ? 80 : 40;
460    int memloc = line * num_bytes;
461    int vblank_start = astrocade_mode ? VerticalBlank : VerticalBlank >> 1;
462
463    int i;
464
465    /* scanline interrupt? */
466   if (screen_interrupt_enabled && (line == screen_interrupt_line))
467      cpunum_set_input_line_and_vector(screen->machine, 0, 0,
468         screen_interrupt_mode ? ASSERT_LINE : HOLD_LINE, interrupt_vector);
469   else
470      cpunum_set_input_line(screen->machine, 0, 0, CLEAR_LINE);
471
472   LeftLineColour[line] = LeftColourCheck;
473   RightLineColour[line] = RightColourCheck;
474   
475   for (i = 0; i < num_bytes; i++, memloc++)
476   {
477      int data, x;
478     
479      if (line < vblank_start)
480         data = videoram[memloc];
481      else
482         data = BackgroundData;
483
484      for (x = i*4+3; x >= i*4; x--)
485      {
486         int color = data & 03;
487
488         if (i < ColourSplit)
489            color += 4;
490
491         *BITMAP_ADDR16(bitmap, line, x) = screen->machine->pens[Colour[color]];
492
493         data >>= 2;
494      }
495
496   }
497   
498   return 0;
499}
src/mess/mess.mak
r2008r2009
757757   $(MESS_DRIVERS)/tutor.o
758758
759759$(MESSOBJ)/bally.a:    \
760   $(MESS_VIDEO)/astrocde.o \
760   $(MAME_VIDEO)/astrocde.o \
761761   $(MESS_DRIVERS)/astrocde.o
762762
763763$(MESSOBJ)/pcshare.a:               \
src/mess/drivers/astrocde.c
r2008r2009
1
21/****************************************************************************
32
4    Bally Astrocade Driver
3    Bally Astrocade consumer hardware
4    driver by Nicola Salmoria, Mike Coates, Frank Palazzolo, Aaron Giles,
5    Dirk Best
56
6    09/23/98 - Added sound, added player 2 pot                  FMP
7               Added SMH_ROM to fix Star Fortress problem
8               Added cartridge support
7****************************************************************************/
98
10    08/02/98 - First release based on original wow.c in MAME    FMP
11               Added palette generation based on a function
12               Fixed collision detection
13                           Fixed shifter operation
14                           Fixed clock speed
15                           Fixed Interrupt Rate and handling
16                           (No Light pen support yet)
17                           (No sound yet)
18
19        Original header follows, some comments don't apply      FMP
20
21 ****************************************************************************/
22
23 /****************************************************************************
24
25   Bally Astrocade style games
26
27   02.02.98 - New IO port definitions               MJC
28              Dirty Rectangle handling
29              Sparkle Circuit for Gorf
30              errorlog output conditional on MAME_DEBUG
31
32   03/04 98 - Extra Bases driver                ATJ
33              Wow word driver
34
35 ****************************************************************************/
36
379#include "driver.h"
3810#include "includes/astrocde.h"
3911#include "sound/astrocde.h"
r2008r2009
4113
4214
4315
44/****************************************************************************
45 * Bally Astrocade
46 ****************************************************************************/
47
48static WRITE8_HANDLER( astrocade_soundblock1_w )
49{
50   astrocade_sound1_w(machine, offset + 0x18, data);
51}
52
53
54
5516/*************************************
5617 *
5718 *  Memory maps
r2008r2009
5920 *************************************/
6021
6122static ADDRESS_MAP_START( astrocade_mem, ADDRESS_SPACE_PROGRAM, 8 )
62   AM_RANGE(0x0000, 0x0fff) AM_READWRITE(SMH_ROM, astrocade_magicram_w)
23   AM_RANGE(0x0000, 0x0fff) AM_READWRITE(SMH_ROM, astrocade_funcgen_w)
6324   AM_RANGE(0x1000, 0x3fff) AM_ROM /* Star Fortress writes in here?? */
6425   AM_RANGE(0x4000, 0x4fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* ASG */
6526ADDRESS_MAP_END
r2008r2009
6728
6829static ADDRESS_MAP_START( astrocade_io, ADDRESS_SPACE_IO, 8 )
6930   ADDRESS_MAP_GLOBAL_MASK(0xff)
70   AM_RANGE(0x00, 0x07) AM_WRITE(astrocade_colour_register_w)
71   AM_RANGE(0x08, 0x08) AM_READWRITE(astrocade_intercept_r, astrocade_mode_w)
72   AM_RANGE(0x09, 0x09) AM_WRITE(astrocade_colour_split_w)
73   AM_RANGE(0x0a, 0x0a) AM_WRITE(astrocade_vertical_blank_w)
74   AM_RANGE(0x0b, 0x0b) AM_WRITE(astrocade_colour_block_w)
75   AM_RANGE(0x0c, 0x0c) AM_WRITE(astrocade_magic_control_w)
76   AM_RANGE(0x0d, 0x0d) AM_WRITE(astrocade_interrupt_vector_w)
77   AM_RANGE(0x0e, 0x0e) AM_READWRITE(astrocade_video_retrace_r, astrocade_interrupt_enable_w)
78   AM_RANGE(0x0f, 0x0f) AM_WRITE(astrocade_interrupt_w)
79/*   AM_RANGE(0x0f, 0x0f) AM_READ(astrocade_horiz_r) */
80   AM_RANGE(0x10, 0x10) AM_READ_PORT("P1_HANDLE")
81   AM_RANGE(0x11, 0x11) AM_READ_PORT("P2_HANDLE")
82   AM_RANGE(0x12, 0x12) AM_READ_PORT("P3_HANDLE")
83   AM_RANGE(0x13, 0x13) AM_READ_PORT("P4_HANDLE")
84   AM_RANGE(0x14, 0x14) AM_READ_PORT("KEYPAD_COL0")
85   AM_RANGE(0x15, 0x15) AM_READ_PORT("KEYPAD_COL1")
86   AM_RANGE(0x16, 0x16) AM_READ_PORT("KEYPAD_COL2")
87   AM_RANGE(0x17, 0x17) AM_READ_PORT("KEYPAD_COL3")
88   AM_RANGE(0x10, 0x17) AM_WRITE(astrocade_sound1_w) /* Sound Stuff */
89   AM_RANGE(0x19, 0x19) AM_WRITE(astrocade_magic_expand_color_w)
90   AM_RANGE(0x1c, 0x1c) AM_READ_PORT("P1_KNOB")
91   AM_RANGE(0x1d, 0x1d) AM_READ_PORT("P2_KNOB")
92   AM_RANGE(0x1e, 0x1e) AM_READ_PORT("P3_KNOB")
93   AM_RANGE(0x1f, 0x1f) AM_READ_PORT("P4_KNOB")
94   AM_RANGE(0x18, 0xff) AM_WRITE(astrocade_soundblock1_w)
31   AM_RANGE(0x00, 0x1f) AM_READWRITE(astrocade_data_chip_register_r, astrocade_data_chip_register_w)
9532ADDRESS_MAP_END
9633
9734
r2008r2009
12057 *************************************/
12158
12259static INPUT_PORTS_START( astrocde )
123   PORT_START_TAG("P1_HANDLE")
124    PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(1) PORT_8WAY
125    PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(1) PORT_8WAY
126    PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(1) PORT_8WAY
60   PORT_START_TAG("P1HANDLE")
61    PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP)    PORT_PLAYER(1) PORT_8WAY
62    PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN)  PORT_PLAYER(1) PORT_8WAY
63    PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT)  PORT_PLAYER(1) PORT_8WAY
12764    PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_8WAY
128   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(1)
129    PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
130    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
131    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
65   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)        PORT_PLAYER(1)
66    PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED)
13267
133   PORT_START_TAG("P2_HANDLE")
134    PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(2) PORT_8WAY
135    PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(2) PORT_8WAY
136    PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(2) PORT_8WAY
68   PORT_START_TAG("P2HANDLE")
69    PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP)    PORT_PLAYER(2) PORT_8WAY
70    PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN)  PORT_PLAYER(2) PORT_8WAY
71    PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT)  PORT_PLAYER(2) PORT_8WAY
13772    PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_8WAY
138   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(2)
139    PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
140    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
141    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
73   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)        PORT_PLAYER(2)
74    PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED)
14275
143   PORT_START_TAG("P3_HANDLE")
144   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(3) PORT_8WAY
145   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(3) PORT_8WAY
146   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(3) PORT_8WAY
76   PORT_START_TAG("P3HANDLE")
77   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP)    PORT_PLAYER(3) PORT_8WAY
78   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN)  PORT_PLAYER(3) PORT_8WAY
79   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT)  PORT_PLAYER(3) PORT_8WAY
14780   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(3) PORT_8WAY
148   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(3)
149   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
150   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
151   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
81   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)        PORT_PLAYER(3)
82   PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED)
15283
153   PORT_START_TAG("P4_HANDLE")
154   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP) PORT_PLAYER(4) PORT_8WAY
155   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN) PORT_PLAYER(4) PORT_8WAY
156   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT) PORT_PLAYER(4) PORT_8WAY
84   PORT_START_TAG("P4HANDLE")
85   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP)    PORT_PLAYER(4) PORT_8WAY
86   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN)  PORT_PLAYER(4) PORT_8WAY
87   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT)  PORT_PLAYER(4) PORT_8WAY
15788   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT) PORT_PLAYER(4) PORT_8WAY
158   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_PLAYER(4)
159   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
160   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
161   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
89   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1)        PORT_PLAYER(4)
90   PORT_BIT(0xe0, IP_ACTIVE_HIGH, IPT_UNUSED)
16291
163   PORT_START_TAG("KEYPAD_COL0")
92   PORT_START_TAG("KEYPAD0")
16493   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("%   \xC3\xB7         [   ]   LIST") PORT_CODE(KEYCODE_O)
16594   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("/   x     J   K   L   NEXT") PORT_CODE(KEYCODE_SLASH_PAD)
16695   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("x   -     V   W   X   IF") PORT_CODE(KEYCODE_ASTERISK)
16796   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("-   +     &   @   *   GOTO") PORT_CODE(KEYCODE_MINUS_PAD)
16897   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("+   =     #   %   :   PRINT") PORT_CODE(KEYCODE_PLUS_PAD)
16998   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("=   WORDS Shift") PORT_CODE(KEYCODE_ENTER_PAD)
170    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
171    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
99    PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
172100
173   PORT_START_TAG("KEYPAD_COL1")
101   PORT_START_TAG("KEYPAD1")
174102   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x93   HALT              RUN") PORT_CODE(KEYCODE_PGDN)
175103   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CH  9     G   H   I   STEP") PORT_CODE(KEYCODE_H)
176104   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("9   6     S   T   U   RND") PORT_CODE(KEYCODE_9)
177105   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("6   3     \xE2\x86\x91   .   \xE2\x86\x93   BOX") PORT_CODE(KEYCODE_6)
178106   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("3   ERASE (   ;   )") PORT_CODE(KEYCODE_3)
179107   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(".   BLUE Shift") PORT_CODE(KEYCODE_STOP)
180    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
181    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
108    PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
182109
183   PORT_START_TAG("KEYPAD_COL2")
110   PORT_START_TAG("KEYPAD2")
184111   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("\xE2\x86\x91   PAUSE     /   \\") PORT_CODE(KEYCODE_PGUP)
185112   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MS  8     D   E   F   TO") PORT_CODE(KEYCODE_S)
186113   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("8   5     P   Q   R   RETN") PORT_CODE(KEYCODE_8)
187114   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("5   2     \xE2\x86\x90   '   \xE2\x86\x92   LINE") PORT_CODE(KEYCODE_5)
188115   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("2   0     <   \"   >   INPUT") PORT_CODE(KEYCODE_2)
189116   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("0   RED Shift") PORT_CODE(KEYCODE_0)
190    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
191    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
117    PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
192118
193   PORT_START_TAG("KEYPAD_COL3")
119   PORT_START_TAG("KEYPAD3")
194120   PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("C   GO                +10") PORT_CODE(KEYCODE_C)
195121   PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("MR  7     A   B   C   FOR") PORT_CODE(KEYCODE_R)
196122   PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("7   4     M   N   O   GOSB") PORT_CODE(KEYCODE_7)
197123   PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("4   1     Y   Z   !   CLEAR") PORT_CODE(KEYCODE_4)
198124   PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("1   SPACE $   ,   ?") PORT_CODE(KEYCODE_1)
199125   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CE  GREEN Shift") PORT_CODE(KEYCODE_E)
200    PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
201    PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
126    PORT_BIT(0xc0, IP_ACTIVE_HIGH, IPT_UNUSED)
202127
203128   PORT_START_TAG("P1_KNOB")
204129   PORT_BIT(0xff, 0x00, IPT_PADDLE) PORT_INVERT PORT_SENSITIVITY(85) PORT_KEYDELTA(10) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_PLAYER(1)
r2008r2009
223148
224149static MACHINE_DRIVER_START( astrocde )
225150   /* basic machine hardware */
226   MDRV_CPU_ADD(Z80, XTAL_Y1/8)        /* 1.789 Mhz */
151   MDRV_CPU_ADD(Z80, ASTROCADE_CLOCK/4)        /* 1.789 Mhz */
227152   MDRV_CPU_PROGRAM_MAP(astrocade_mem, 0)
228153   MDRV_CPU_IO_MAP(astrocade_io, 0)
229154
230155    /* video hardware */
231156   MDRV_SCREEN_ADD("main", RASTER)
232   MDRV_SCREEN_RAW_PARAMS(XTAL_Y1/2, 455, 0, 320, 268, 0, 204)
157   MDRV_SCREEN_RAW_PARAMS(ASTROCADE_CLOCK, 455, 0, 352, 262, 0, 240)
233158   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
234159
235   MDRV_PALETTE_LENGTH(8*32)
236   MDRV_PALETTE_INIT(astrocade)
160   MDRV_PALETTE_LENGTH(512)
161   MDRV_PALETTE_INIT(astrocde)
237162
163   MDRV_VIDEO_START(astrocde)
238164   MDRV_VIDEO_UPDATE(astrocde)
239   MDRV_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE)
240165
241166   /* sound hardware */
242167   MDRV_SPEAKER_STANDARD_MONO("mono")
243   MDRV_SOUND_ADD(ASTROCADE, XTAL_Y1/8)
168   MDRV_SOUND_ADD(ASTROCADE, ASTROCADE_CLOCK/4)
244169   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
245170MACHINE_DRIVER_END
246171
r2008r2009
255180ROM_START( astrocde )
256181    ROM_REGION( 0x10000, REGION_CPU1, 0 )
257182    ROM_LOAD( "astro.bin",  0x0000, 0x2000, CRC(ebc77f3a) SHA1(b902c941997c9d150a560435bf517c6a28137ecc))
258    ROM_CART_LOAD(0, "bin", 0x2000, 0x8000, ROM_OPTIONAL)
183    ROM_CART_LOAD(0, "bin", 0x2000, 0x2000, ROM_OPTIONAL)
259184ROM_END
260185
261186ROM_START( astrocdw )
262187    ROM_REGION( 0x10000, REGION_CPU1, 0 )
263188    ROM_LOAD( "bioswhit.bin",  0x0000, 0x2000, CRC(6eb53e79) SHA1(d84341feec1a0a0e8aa6151b649bc3cf6ef69fbf))
264    ROM_CART_LOAD(0, "bin", 0x2000, 0x8000, ROM_OPTIONAL)
189    ROM_CART_LOAD(0, "bin", 0x2000, 0x2000, ROM_OPTIONAL)
265190ROM_END
266191
267192
r2008r2009
280205
281206/*************************************
282207 *
208 *  Driver initialization
209 *
210 *************************************/
211
212DRIVER_INIT( astrocde )
213{
214   astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS;
215}
216
217
218
219/*************************************
220 *
283221 *  Driver definitions
284222 *
285223 *************************************/
286224
287/*    YEAR  NAME      PARENT    COMPAT    MACHINE   INPUT     INIT  CONFIG    COMPANY                FULLNAME                     FLAGS */
288CONS( 1978, astrocde, 0,        0,        astrocde, astrocde, 0,    astrocde, "Bally Manufacturing", "Bally Professional Arcade", 0)
289CONS( 1977, astrocdw, astrocde, 0,        astrocde, astrocde, 0,    astrocde, "Bally Manufacturing", "Bally Computer System",     0)
225/*    YEAR  NAME      PARENT    COMPAT    MACHINE   INPUT     INIT      CONFIG    COMPANY                FULLNAME                     FLAGS */
226CONS( 1978, astrocde, 0,        0,        astrocde, astrocde, astrocde, astrocde, "Bally Manufacturing", "Bally Professional Arcade", GAME_SUPPORTS_SAVE )
227CONS( 1977, astrocdw, astrocde, 0,        astrocde, astrocde, astrocde, astrocde, "Bally Manufacturing", "Bally Computer System",     GAME_SUPPORTS_SAVE )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team