Previous 15994 Revisions Next

r7708 Monday 5th April, 2010 at 05:13:59 UTC by Firewave
Removed obsolete files
[src/mame/drivers]cowrace.c hexa.c
[src/mame/includes]attckufo.h deco16ic.h hexa.h
[src/mame/layout]funworld.lay
[src/mame/video]attckufo.c hexa.c mayumi.c mjsister.c mole.c

src/mame/includes/hexa.h
r7707r7708
1
2
3typedef struct _hexa_state hexa_state;
4struct _hexa_state
5{
6   /* memory pointers */
7   UINT8 *  videoram;
8   size_t   videoram_size;
9
10   /* video-related */
11   tilemap_t  *bg_tilemap;
12   int      charbank;
13
14};
15
16
17/* ----------- defined in video/hexa.c -----------*/
18
19WRITE8_HANDLER( hexa_videoram_w );
20WRITE8_HANDLER( hexa_d008_w );
21
22VIDEO_START( hexa );
23VIDEO_UPDATE( hexa );
src/mame/includes/attckufo.h
r7707r7708
1/*----------- defined in audio/attckufo.c -----------*/
2
3void attckufo_soundport_w (int offset, int data);
4
5DEVICE_GET_INFO( attckufo_sound );
6#define SOUND_ATTCKUFO DEVICE_GET_INFO_NAME(attckufo_sound)
7
8
9/*----------- defined in video/attckufo.c -----------*/
10
11extern const rgb_t attckufo_palette[16];
12extern UINT8 attckufo_regs[16];
13
14VIDEO_UPDATE( attckufo );
15
16WRITE8_HANDLER ( attckufo_port_w );
17READ8_HANDLER ( attckufo_port_r );
18
19INTERRUPT_GEN( attckufo_raster_interrupt );
20
src/mame/includes/deco16ic.h
r7707r7708
1/*----------- defined in video/deco16ic.c -----------*/
2
3extern UINT16 *deco16_pf1_data,*deco16_pf2_data;
4extern UINT16 *deco16_pf3_data,*deco16_pf4_data;
5extern UINT16 *deco16_pf1_rowscroll,*deco16_pf2_rowscroll;
6extern UINT16 *deco16_pf3_rowscroll,*deco16_pf4_rowscroll;
7
8extern UINT16 *deco16_pf12_control,*deco16_pf34_control;
9extern UINT16 deco16_priority;
10
11extern UINT16 *deco16_raster_display_list;
12extern int deco16_raster_display_position;
13
14extern int deco16_pf1_colour_bank,deco16_pf2_colour_bank,deco16_pf3_colour_bank,deco16_pf4_colour_bank;
15
16void deco16_1_video_init(running_machine *machine);
17void deco16_2_video_init(running_machine *machine, int split);
18void deco16_2_video_init_half_width(running_machine *machine);
19void deco_allocate_sprite_bitmap(running_machine *machine);
20
21void deco16_pf12_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
22void deco16_pf34_update(const UINT16 *rowscroll_1_ptr, const UINT16 *rowscroll_2_ptr);
23
24void deco16_pf12_set_gfxbank(int small, int big);
25void deco16_pf34_set_gfxbank(int small, int big);
26
27void deco16_set_tilemap_bank_callback(int tmap, int (*callback)(const int bank));
28void deco16_set_tilemap_colour_base(int tmap, int base);
29void deco16_set_tilemap_colour_mask(int tmap, int mask);
30void deco16_set_tilemap_transparency_mask(int tmap, int mask);
31
32void deco16_tilemap_1_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
33void deco16_tilemap_2_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
34void deco16_tilemap_3_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
35void deco16_tilemap_4_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
36
37void deco16_tilemap_34_combine_draw(running_device *screen, bitmap_t *bitmap, const rectangle *cliprect, int flags, UINT32 priority);
38
39void deco16_clear_sprite_priority_bitmap(void);
40void deco16_pdrawgfx(
41      bitmap_t *dest,const rectangle *clip,const gfx_element *gfx,
42      UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
43      int transparent_color,UINT32 pri_mask,UINT32 sprite_mask,UINT8 write_pri,UINT8 alpha);
44
45tilemap_t *deco16_get_tilemap(int pf, int size);
46
47WRITE16_HANDLER( deco16_pf1_data_w );
48WRITE16_HANDLER( deco16_pf2_data_w );
49WRITE16_HANDLER( deco16_pf3_data_w );
50WRITE16_HANDLER( deco16_pf4_data_w );
51
52WRITE16_HANDLER( deco16_nonbuffered_palette_w );
53WRITE16_HANDLER( deco16_buffered_palette_w );
54WRITE16_HANDLER( deco16_palette_dma_w );
55
56WRITE16_HANDLER( deco16_priority_w );
57
58READ16_HANDLER( deco16_71_r );
59
60void deco16_print_debug_info(running_machine *machine, bitmap_t *bitmap);
src/mame/video/hexa.c
r7707r7708
1/***************************************************************************
2
3  video.c
4
5  Functions to emulate the video hardware of the machine.
6
7***************************************************************************/
8
9#include "emu.h"
10#include "includes/hexa.h"
11
12WRITE8_HANDLER( hexa_videoram_w )
13{
14   hexa_state *state = (hexa_state *)space->machine->driver_data;
15
16   state->videoram[offset] = data;
17   tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
18}
19
20WRITE8_HANDLER( hexa_d008_w )
21{
22   hexa_state *state = (hexa_state *)space->machine->driver_data;
23
24   /* bit 0 = flipx (or y?) */
25   if (flip_screen_x_get(space->machine) != (data & 0x01))
26   {
27      flip_screen_x_set(space->machine, data & 0x01);
28      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
29   }
30
31   /* bit 1 = flipy (or x?) */
32   if (flip_screen_y_get(space->machine) != (data & 0x02))
33   {
34      flip_screen_y_set(space->machine, data & 0x02);
35      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
36   }
37
38   /* bit 2 - 3 unknown */
39
40   /* bit 4 could be the ROM bank selector for 8000-bfff (not sure) */
41   memory_set_bank(space->machine, "bank1", ((data & 0x10) >> 4));
42
43   /* bit 5 = char bank */
44   if (state->charbank != ((data & 0x20) >> 5))
45   {
46      state->charbank = (data & 0x20) >> 5;
47      tilemap_mark_all_tiles_dirty(state->bg_tilemap);
48   }
49
50   /* bit 6 - 7 unknown */
51}
52
53static TILE_GET_INFO( get_bg_tile_info )
54{
55   hexa_state *state = (hexa_state *)machine->driver_data;
56   int offs = tile_index * 2;
57   int tile = state->videoram[offs + 1] + ((state->videoram[offs] & 0x07) << 8) + (state->charbank << 11);
58   int color = (state->videoram[offs] & 0xf8) >> 3;
59
60   SET_TILE_INFO(0, tile, color, 0);
61}
62
63VIDEO_START( hexa )
64{
65   hexa_state *state = (hexa_state *)machine->driver_data;
66   state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
67}
68
69
70VIDEO_UPDATE( hexa )
71{
72   hexa_state *state = (hexa_state *)screen->machine->driver_data;
73
74   tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
75   return 0;
76}
src/mame/video/mole.c
r7707r7708
1/***************************************************************************
2  video/mole.c
3  Functions to emulate the video hardware of Mole Attack!.
4  Mole Attack's Video hardware is essentially two banks of 512 characters.
5  The program uses a single byte to indicate which character goes in each location,
6  and uses a control location (0x8400) to select the character sets
7***************************************************************************/
8
9#include "emu.h"
10
11static int tile_bank;
12static UINT16 *tileram;
13static tilemap_t *bg_tilemap;
14
15PALETTE_INIT( mole )
16{
17   int i;
18
19   for (i = 0; i < 8; i++) {
20      palette_set_color_rgb(machine, i, pal1bit(i >> 0), pal1bit(i >> 2), pal1bit(i >> 1));
21   }
22}
23
24static TILE_GET_INFO( get_bg_tile_info )
25{
26   UINT16 code = tileram[tile_index];
27   SET_TILE_INFO((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0);
28}
29
30VIDEO_START( mole )
31{
32   tileram = auto_alloc_array(machine, UINT16, 0x400);
33
34   bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 40, 25);
35}
36
37WRITE8_HANDLER( mole_videoram_w )
38{
39   tileram[offset] = data | (tile_bank << 8);
40   tilemap_mark_tile_dirty(bg_tilemap, offset);
41}
42
43WRITE8_HANDLER( mole_tilebank_w )
44{
45   tile_bank = data;
46   tilemap_mark_all_tiles_dirty(bg_tilemap);
47}
48
49WRITE8_HANDLER( mole_flipscreen_w )
50{
51   flip_screen_set(space->machine, data & 0x01);
52}
53
54VIDEO_UPDATE( mole )
55{
56   tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
57   return 0;
58}
src/mame/video/attckufo.c
r7707r7708
1/***************************************************************************
2
3  Attack ufo video emulation
4  based on MOS 6560 emulator by
5  PeT mess@utanet.at
6
7  Differences between 6560 and Attack Ufo chip:
8  - no invert mode
9  - no multicolor
10  - 16 col chars
11
12***************************************************************************/
13
14#include "emu.h"
15#include "includes/attckufo.h"
16
17#define MAX_LINES 261
18
19const rgb_t attckufo_palette[] =
20{
21/* ripped from vice, a very excellent emulator */
22   MAKE_RGB(0x00, 0x00, 0x00),
23   MAKE_RGB(0xff, 0xff, 0xff),
24   MAKE_RGB(0xf0, 0x00, 0x00),
25   MAKE_RGB(0x00, 0xf0, 0xf0),
26
27   MAKE_RGB(0x60, 0x00, 0x60),
28   MAKE_RGB(0x00, 0xa0, 0x00),
29   MAKE_RGB(0x00, 0x00, 0xf0),
30   MAKE_RGB(0xd0, 0xd0, 0x00),
31
32   MAKE_RGB(0xc0, 0xa0, 0x00),
33   MAKE_RGB(0xff, 0xa0, 0x00),
34   MAKE_RGB(0xf0, 0x80, 0x80),
35   MAKE_RGB(0x00, 0xff, 0xff),
36
37   MAKE_RGB(0xff, 0x00, 0xff),
38   MAKE_RGB(0x00, 0xff, 0x00),
39   MAKE_RGB(0x00, 0xa0, 0xff),
40   MAKE_RGB(0xff, 0xff, 0x00)
41};
42
43
44
45UINT8 attckufo_regs[16];
46
47#define CHARS_X ((int)attckufo_regs[2]&0x7f)
48#define CHARS_Y (((int)attckufo_regs[3]&0x7e)>>1)
49
50
51#define XSIZE (CHARS_X*8)
52#define YSIZE (CHARS_Y*8)
53
54#define CHARGENADDR (((int)attckufo_regs[5]&0xf)<<10)
55#define VIDEOADDR ( ( ((int)attckufo_regs[5]&0xf0)<<(10-4))\
56          | ( ((int)attckufo_regs[2]&0x80)<<(9-7)) )
57
58static int rasterline = 0;
59
60static int chars_x, chars_y;
61static int xsize, ysize ;
62static int chargenaddr, videoaddr;
63
64WRITE8_HANDLER ( attckufo_port_w )
65{
66   switch (offset)
67   {
68      case 0xa:
69      case 0xb:
70      case 0xc:
71      case 0xd:
72      case 0xe:
73         attckufo_soundport_w (offset, data);
74         break;
75   }
76   if (attckufo_regs[offset] != data)
77   {
78      switch (offset)
79      {
80         case 0:
81         case 1:
82         case 2:
83         case 3:
84         case 5:
85         case 0xe:
86         case 0xf:
87            video_screen_update_partial(space->machine->primary_screen, rasterline);
88            break;
89      }
90      attckufo_regs[offset] = data;
91      switch (offset)
92      {
93         case 2:
94            /* ntsc values >= 31 behave like 31 */
95            chars_x = CHARS_X;
96            videoaddr = VIDEOADDR;
97            xsize = XSIZE;
98            break;
99         case 3:
100            chars_y = CHARS_Y;
101            ysize = YSIZE;
102            break;
103         case 5:
104            chargenaddr = CHARGENADDR;
105            videoaddr = VIDEOADDR;
106            break;
107      }
108   }
109}
110
111 READ8_HANDLER ( attckufo_port_r )
112{
113   int val;
114
115   switch (offset)
116   {
117      case 3:
118         val = ((rasterline & 1) << 7) | (attckufo_regs[offset] & 0x7f);
119         break;
120      case 4:                     /*rasterline */
121         val = (rasterline / 2) & 0xff;
122         break;
123      default:
124         val = attckufo_regs[offset];
125         break;
126   }
127   return val;
128}
129
130INTERRUPT_GEN( attckufo_raster_interrupt )
131{
132   rasterline++;
133   if (rasterline >= MAX_LINES)
134      rasterline = 0;
135}
136
137VIDEO_UPDATE( attckufo )
138{
139   const address_space *space = cputag_get_address_space(screen->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
140   int x, y, yy;
141
142   for (y = cliprect->min_y & ~7; y <= cliprect->max_y; y += 8)
143   {
144      UINT16 *destrow = BITMAP_ADDR16(bitmap, y, 0);
145      int offs = videoaddr + (y / 8) * chars_x;
146      int ymin = MAX(y, cliprect->min_y) & 7;
147      int ymax = MIN(y + 7, cliprect->max_y) & 7;
148
149      for (x = cliprect->min_x & ~7; x <= cliprect->max_x; x += 8)
150      {
151         UINT8 ch = memory_read_byte(space, offs + x/8);
152         UINT8 attr = memory_read_byte(space, offs + x/8 + 0x400) & 0xf;
153         UINT16 *dest = destrow;
154
155         for (yy = ymin; yy <= ymax; yy++)
156         {
157            UINT8 code = memory_read_byte(space, chargenaddr + ch * 8 + yy);
158            dest[x + 0] = (code & 0x80) ? attr : 0;
159            dest[x + 1] = (code & 0x40) ? attr : 0;
160            dest[x + 2] = (code & 0x20) ? attr : 0;
161            dest[x + 3] = (code & 0x10) ? attr : 0;
162            dest[x + 4] = (code & 0x08) ? attr : 0;
163            dest[x + 5] = (code & 0x04) ? attr : 0;
164            dest[x + 6] = (code & 0x02) ? attr : 0;
165            dest[x + 7] = (code & 0x01) ? attr : 0;
166            dest += bitmap->rowpixels;
167         }
168      }
169   }
170   return 0;
171}
src/mame/video/mjsister.c
r7707r7708
1/*****************************************************************************
2
3Mahjong Sisters (c) 1986 Toa Plan
4
5Video hardware
6    driver by Uki
7
8*****************************************************************************/
9
10#include "emu.h"
11
12int mjsister_screen_redraw;
13int mjsister_flip_screen;
14int mjsister_video_enable;
15
16int mjsister_vrambank;
17int mjsister_colorbank;
18
19static bitmap_t *mjsister_tmpbitmap0, *mjsister_tmpbitmap1;
20static UINT8 *mjsister_videoram0, *mjsister_videoram1;
21
22/****************************************************************************/
23
24VIDEO_START( mjsister )
25{
26   mjsister_tmpbitmap0 = auto_bitmap_alloc(machine,256,256,video_screen_get_format(machine->primary_screen));
27   mjsister_tmpbitmap1 = auto_bitmap_alloc(machine,256,256,video_screen_get_format(machine->primary_screen));
28   mjsister_videoram0 = auto_alloc_array(machine, UINT8, 0x8000);
29   mjsister_videoram1 = auto_alloc_array(machine, UINT8, 0x8000);
30}
31
32static void mjsister_plot0(int offset,UINT8 data)
33{
34   int x,y,c1,c2;
35
36   x = offset & 0x7f;
37   y = offset / 0x80;
38
39   c1 = (data & 0x0f)        + mjsister_colorbank * 0x20;
40   c2 = ((data & 0xf0) >> 4) + mjsister_colorbank * 0x20;
41
42   *BITMAP_ADDR16(mjsister_tmpbitmap0, y, x*2+0) = c1;
43   *BITMAP_ADDR16(mjsister_tmpbitmap0, y, x*2+1) = c2;
44}
45
46static void mjsister_plot1(int offset,UINT8 data)
47{
48   int x,y,c1,c2;
49
50   x = offset & 0x7f;
51   y = offset / 0x80;
52
53   c1 = data & 0x0f;
54   c2 = (data & 0xf0) >> 4;
55
56   if (c1)
57      c1 += mjsister_colorbank * 0x20 + 0x10;
58   if (c2)
59      c2 += mjsister_colorbank * 0x20 + 0x10;
60
61   *BITMAP_ADDR16(mjsister_tmpbitmap1, y, x*2+0) = c1;
62   *BITMAP_ADDR16(mjsister_tmpbitmap1, y, x*2+1) = c2;
63}
64
65WRITE8_HANDLER( mjsister_videoram_w )
66{
67   if (mjsister_vrambank)
68   {
69      mjsister_videoram1[offset] = data;
70      mjsister_plot1(offset,data);
71   }
72   else
73   {
74      mjsister_videoram0[offset] = data;
75      mjsister_plot0(offset,data);
76   }
77}
78
79VIDEO_UPDATE( mjsister )
80{
81   int f = mjsister_flip_screen;
82   int i,j;
83
84   if (mjsister_screen_redraw)
85   {
86      int offs;
87
88      for (offs=0; offs<0x8000; offs++)
89      {
90         mjsister_plot0(offs,mjsister_videoram0[offs]);
91         mjsister_plot1(offs,mjsister_videoram1[offs]);
92      }
93
94      mjsister_screen_redraw = 0;
95   }
96
97   if (mjsister_video_enable)
98   {
99      for (i=0; i<256; i++)
100         for (j=0; j<4; j++)
101            *BITMAP_ADDR16(bitmap, i, 256+j) = mjsister_colorbank * 0x20;
102
103      copybitmap      (bitmap,mjsister_tmpbitmap0,f,f,0,0,cliprect);
104      copybitmap_trans(bitmap,mjsister_tmpbitmap1,f,f,2,0,cliprect,0);
105   }
106   else
107      bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
108   return 0;
109}
src/mame/video/mayumi.c
r7707r7708
1/******************************************************************************
2
3Kikiippatsu Mayumi-chan (c) 1988 Victory L.L.C.
4
5Video hardware
6    driver by Uki
7
8******************************************************************************/
9
10#include "emu.h"
11
12UINT8 *mayumi_videoram;
13static tilemap_t *mayumi_tilemap;
14
15static TILE_GET_INFO( get_tile_info )
16{
17   int code = mayumi_videoram[tile_index] + (mayumi_videoram[tile_index+0x800] & 0x1f)*0x100 ;
18   int col = (mayumi_videoram[tile_index+0x1000] >> 3) & 0x1f;
19
20   SET_TILE_INFO(0, code, col, 0);
21}
22
23VIDEO_START( mayumi )
24{
25   mayumi_videoram = auto_alloc_array(machine, UINT8, 0x1800);
26
27   mayumi_tilemap = tilemap_create( machine, get_tile_info,tilemap_scan_rows,8,8,64,32 );
28}
29
30WRITE8_HANDLER( mayumi_videoram_w )
31{
32   mayumi_videoram[offset] = data;
33   tilemap_mark_tile_dirty(mayumi_tilemap, offset & 0x7ff );
34}
35
36VIDEO_UPDATE( mayumi )
37{
38   tilemap_draw(bitmap, cliprect, mayumi_tilemap, 0, 0);
39   return 0;
40}
41
src/mame/layout/funworld.lay
r7707r7708
1<?xml version="1.0"?>
2<mamelayout version="2">
3   <element name="hold1" defstate="1">
4      <rect state="1">
5         <color red="1.0" green="0.0" blue="0.0" />
6      </rect>
7      <rect state="0">
8         <color red="0.3" green="0.0" blue="0.0" />
9      </rect>
10      <text string="HOLD 1">
11         <color red="0.0" green="0.0" blue="0.0" />
12         <bounds x="0" y="0.1" width="1" height="0.8" />
13      </text>
14   </element>
15
16   <element name="hold2" defstate="1">
17      <rect state="1">
18         <color red="1.0" green="0.0" blue="0.0" />
19      </rect>
20      <rect state="0">
21         <color red="0.3" green="0.0" blue="0.0" />
22      </rect>
23      <text string="HOLD 2">
24         <color red="0.0" green="0.0" blue="0.0" />
25         <bounds x="0" y="0.1" width="1" height="0.8" />
26      </text>
27   </element>
28
29   <element name="hold3" defstate="1">
30      <rect state="1">
31         <color red="1.0" green="0.0" blue="0.0" />
32      </rect>
33      <rect state="0">
34         <color red="0.3" green="0.0" blue="0.0" />
35      </rect>
36      <text string="HOLD 3">
37         <color red="0.0" green="0.0" blue="0.0" />
38         <bounds x="0" y="0.1" width="1" height="0.8" />
39      </text>
40   </element>
41
42   <element name="hold4" defstate="1">
43      <rect state="1">
44         <color red="1.0" green="0.0" blue="0.0" />
45      </rect>
46      <rect state="0">
47         <color red="0.3" green="0.0" blue="0.0" />
48      </rect>
49      <text string="HOLD 4">
50         <color red="0.0" green="0.0" blue="0.0" />
51         <bounds x="0" y="0.1" width="1" height="0.8" />
52      </text>
53   </element>
54
55   <element name="hold5" defstate="1">
56      <rect state="1">
57         <color red="1.0" green="0.0" blue="0.0" />
58      </rect>
59      <rect state="0">
60         <color red="0.3" green="0.0" blue="0.0" />
61      </rect>
62      <text string="HOLD 5">
63         <color red="0.0" green="0.0" blue="0.0" />
64         <bounds x="0" y="0.1" width="1" height="0.8" />
65      </text>
66   </element>
67
68   <element name="cancel" defstate="1">
69      <rect state="1">
70         <color red="0.0" green="1.0" blue="0.0" />
71      </rect>
72      <rect state="0">
73         <color red="0.0" green="0.3" blue="0.0" />
74      </rect>
75      <text string="CANCEL">
76         <color red="0.0" green="0.0" blue="0.0" />
77         <bounds x="0" y="0.1" width="1" height="0.8" />
78      </text>
79   </element>
80
81   <element name="start" defstate="1">
82      <rect state="1">
83         <color red="0.0" green="1.0" blue="0.0" />
84      </rect>
85      <rect state="0">
86         <color red="0.0" green="0.3" blue="0.0" />
87      </rect>
88      <text string="START">
89         <color red="0.0" green="0.0" blue="0.0" />
90         <bounds x="0" y="0.1" width="1" height="0.8" />
91      </text>
92   </element>
93
94   <view name="Button Lamps">
95      <screen index="0">
96         <bounds left="0" top="0" right="4" bottom="3" />
97      </screen>
98      <bezel name="lamp0" element="hold1">
99         <bounds x="0" y="3.13" width="0.55" height="0.24" />
100      </bezel>
101      <bezel name="lamp1" element="hold2">
102         <bounds x="0.65" y="3.13" width="0.55" height="0.24" />
103      </bezel>
104      <bezel name="lamp2" element="hold3">
105         <bounds x="1.3" y="3.13" width="0.55" height="0.24" />
106      </bezel>
107      <bezel name="lamp3" element="hold4">
108         <bounds x="1.95" y="3.13" width="0.55" height="0.24" />
109      </bezel>
110      <bezel name="lamp4" element="hold5">
111         <bounds x="2.6" y="3.13" width="0.55" height="0.24" />
112      </bezel>
113      <bezel name="lamp5" element="cancel">
114         <bounds x="3.45" y="3.02" width="0.55" height="0.24" />
115      </bezel>
116      <bezel name="lamp6" element="start">
117         <bounds x="3.45" y="3.28" width="0.55" height="0.24" />
118      </bezel>
119   </view>
120</mamelayout>
src/mame/drivers/cowrace.c
r7707r7708
1/*************************************************************************************************************
2
3    Cow Race
4
5    preliminary driver by Luca Elia
6
7*************************************************************************************************************/
8
9#include "emu.h"
10#include "cpu/z80/z80.h"
11#include "sound/okim6295.h"
12#include "sound/2203intf.h"
13
14static tilemap_t *tmap;
15static UINT8 *colorram;
16static UINT8 *videoram;
17
18static WRITE8_HANDLER( cowrace_videoram_w )
19{
20   videoram[offset] = data;
21   tilemap_mark_tile_dirty(tmap, offset);
22}
23
24static WRITE8_HANDLER( cowrace_colorram_w )
25{
26   colorram[offset] = data;
27   tilemap_mark_tile_dirty(tmap, offset);
28}
29
30static TILE_GET_INFO( get_tile_info )
31{
32   UINT16 code = videoram[ tile_index ] + (colorram[ tile_index ] << 8) ;
33   UINT8 color = 0;//(colorram[ tile_index ] & 0x3e)>>1;
34
35   SET_TILE_INFO(1, code & 0x1ff, color, TILE_FLIPYX( 0 ));;
36}
37
38static VIDEO_START( cowrace )
39{
40   tmap = tilemap_create(   machine, get_tile_info, tilemap_scan_rows,
41                     8,8, 0x20,0x20   );
42
43//  tilemap_set_transparent_pen(tmap, 0);
44}
45
46static VIDEO_UPDATE( cowrace )
47{
48   tilemap_draw(bitmap, cliprect, tmap, 0, 0);
49   return 0;
50}
51
52#ifdef UNUSED_FUNCTION
53static WRITE8_HANDLER( cowrace_soundlatch_w )
54{
55   soundlatch_w(0, data);
56   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
57}
58#endif
59
60static READ8_HANDLER( ret_ff )
61{
62   return 0xff;
63}
64
65static READ8_HANDLER( ret_00 )
66{
67   return 0x00;
68}
69
70static UINT8 cowrace_38c2;
71
72static WRITE8_HANDLER( cowrace_38c2_w )
73{
74   cowrace_38c2 = data;
75}
76
77static READ8_HANDLER( cowrace_30c3_r )
78{
79   switch( cowrace_38c2 )
80   {
81      case 0x02:   return 0x03;
82      case 0x04:   return 0x00;
83   }
84
85   return 0xff;
86}
87
88static ADDRESS_MAP_START( mem_map_cowrace, ADDRESS_SPACE_PROGRAM, 8 )
89   AM_RANGE(0x302f, 0x302f) AM_READ(ret_00)
90   AM_RANGE(0x30c3, 0x30c3) AM_READ(cowrace_30c3_r)
91   AM_RANGE(0x38c2, 0x38c2) AM_READWRITE(ret_ff, cowrace_38c2_w)
92
93   AM_RANGE(0x0000, 0x2fff) AM_ROM
94   AM_RANGE(0x3000, 0x33ff) AM_RAM
95   AM_RANGE(0x4000, 0x43ff) AM_RAM_WRITE(cowrace_videoram_w) AM_BASE(&videoram)
96   AM_RANGE(0x5000, 0x53ff) AM_RAM_WRITE(cowrace_colorram_w) AM_BASE(&colorram)
97ADDRESS_MAP_END
98
99static ADDRESS_MAP_START( io_map_cowrace, ADDRESS_SPACE_IO, 8 )
100   ADDRESS_MAP_GLOBAL_MASK(0xff)
101   AM_RANGE(0x00, 0x00) AM_NOP
102ADDRESS_MAP_END
103
104
105static ADDRESS_MAP_START( mem_map_sound_cowrace, ADDRESS_SPACE_PROGRAM, 8 )
106   AM_RANGE(0x0000, 0x1fff) AM_ROM
107   AM_RANGE(0x2000, 0x23ff) AM_RAM
108ADDRESS_MAP_END
109
110static ADDRESS_MAP_START( io_map_sound_cowrace, ADDRESS_SPACE_IO, 8 )
111   ADDRESS_MAP_GLOBAL_MASK(0xff)
112   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ymsnd", ym2203_w)
113ADDRESS_MAP_END
114
115
116static const gfx_layout layout8x8x2 =
117{
118   8,8,
119   RGN_FRAC(1,2),
120   2,
121   {
122      RGN_FRAC(0,2),
123      RGN_FRAC(1,2)
124   },
125   { STEP8(0,1) },
126   { STEP8(0,8) },
127   8*8
128};
129
130/* seems more suitable with 2bpp?*/
131static const gfx_layout layout16x16x4 =
132{
133   16,16,
134   RGN_FRAC(1,2),
135   2,
136   {
137      RGN_FRAC(0,2),
138      RGN_FRAC(1,2),
139   },
140   { 16*8+0,16*8+1,16*8+2,16*8+3,16*8+4,16*8+5,16*8+6,16*8+7,0,1,2,3,4,5,6,7 },
141   { 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8  },
142   16*16
143};
144
145static GFXDECODE_START( cowrace )
146   GFXDECODE_ENTRY( "gfx1", 0x000000, layout16x16x4, 0, 0x40 )
147   GFXDECODE_ENTRY( "gfx2", 0x000000, layout8x8x2, 0, 0x40 )
148GFXDECODE_END
149
150static INPUT_PORTS_START( cowrace )
151   PORT_START("IN0")
152INPUT_PORTS_END
153
154static const ym2203_interface ym2203_interface_1 =
155{
156   {
157      AY8910_LEGACY_OUTPUT,
158      AY8910_DEFAULT_LOADS,
159      DEVCB_MEMORY_HANDLER("audiocpu", PROGRAM, soundlatch_r),   // read A
160      DEVCB_DEVICE_HANDLER("oki", okim6295_r),               // read B
161      DEVCB_NULL,                                       // write A
162      DEVCB_DEVICE_HANDLER("oki", okim6295_w)                  // write B
163   },
164   NULL
165};
166
167/* format might be wrong */
168static PALETTE_INIT(cowrace)
169{
170   int   bit0, bit1, bit2 , r, g, b;
171   int   i;
172
173   for (i = 0; i < 0x200; ++i)
174   {
175      bit0 = 0;
176      bit1 = (color_prom[0] >> 0) & 0x01;
177      bit2 = (color_prom[0] >> 1) & 0x01;
178      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
179      bit0 = (color_prom[0] >> 2) & 0x01;
180      bit1 = (color_prom[0] >> 3) & 0x01;
181      bit2 = (color_prom[0] >> 4) & 0x01;
182      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
183      bit0 = (color_prom[0] >> 5) & 0x01;
184      bit1 = (color_prom[0] >> 6) & 0x01;
185      bit2 = (color_prom[0] >> 7) & 0x01;
186      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
187
188      palette_set_color(machine, i, MAKE_RGB(r, g, b));
189      color_prom++;
190   }
191}
192
193static MACHINE_DRIVER_START( cowrace )
194
195   /* basic machine hardware */
196   MDRV_CPU_ADD("maincpu", Z80, 4000000)
197   MDRV_CPU_PROGRAM_MAP(mem_map_cowrace)
198   MDRV_CPU_IO_MAP(io_map_cowrace)
199   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
200
201   /* missing slave z80? (like in King Derby)*/
202
203   MDRV_CPU_ADD("audiocpu", Z80, 4000000)
204   MDRV_CPU_PROGRAM_MAP(mem_map_sound_cowrace)
205   MDRV_CPU_IO_MAP(io_map_sound_cowrace)
206   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)   // NMI by main CPU
207
208   /* video hardware */
209   MDRV_SCREEN_ADD("screen", RASTER)
210   MDRV_SCREEN_REFRESH_RATE(60)
211   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
212   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
213   MDRV_SCREEN_SIZE(256, 256)
214   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 256-1)
215
216   MDRV_GFXDECODE(cowrace)
217   MDRV_PALETTE_LENGTH(0x400)
218   MDRV_PALETTE_INIT(cowrace)
219
220   MDRV_VIDEO_START(cowrace)
221   MDRV_VIDEO_UPDATE(cowrace)
222
223   /* sound hardware */
224   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
225   MDRV_SOUND_ADD("oki", OKIM6295, 1056000)
226   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
227   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
228   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
229
230   MDRV_SOUND_ADD("ymsnd", YM2203, 3000000)
231   MDRV_SOUND_CONFIG(ym2203_interface_1)
232   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
233   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
234MACHINE_DRIVER_END
235
236
237ROM_START( cowrace )
238   ROM_REGION( 0x8000, "maincpu", 0 )
239   ROM_LOAD( "u3.bin", 0x0000, 0x8000, CRC(c05c3bd3) SHA1(b7199a069ab45edd25e021589b79105cdfa5511a) )
240
241   ROM_REGION( 0x2000, "audiocpu", 0 )
242   ROM_LOAD( "u164.bin", 0x0000, 0x2000, CRC(9affa1c8) SHA1(bfc07693e8f749cbf20ab8cda33975b66f567962) )
243
244   ROM_REGION( 0x10000, "gfx1", 0 )
245   ROM_LOAD( "u94.bin", 0x0000, 0x8000, CRC(945dc115) SHA1(bdd145234e6361c42ed20e8ca4cac64f07332748) )
246   ROM_LOAD( "u95.bin", 0x8000, 0x8000, CRC(fc1fc006) SHA1(326a67c1ea0f487ecc8b7aef2d90124a01e6dee3) )
247
248   ROM_REGION( 0x4000, "gfx2", 0 )
249   ROM_LOAD( "u139.bin", 0x0000, 0x2000, CRC(b746bb2f) SHA1(5f5f48752689079ed65fe7bb4a69512ada5db05d) )
250   ROM_LOAD( "u140.bin", 0x2000, 0x2000, CRC(7e24b674) SHA1(c774efeb8e4e833e73c29007d5294c93df1abef4) )
251
252   ROM_REGION( 0x40000, "oki", 0 )
253   ROM_LOAD( "u4.bin", 0x00000, 0x20000, CRC(f92a3ab5) SHA1(fc164492793597eadb8a50154410936edb74fa23) )
254
255   ROM_REGION( 0x20000, "proms", 0 )
256   ROM_LOAD( "u149.bin", 0x00000, 0x200, CRC(f41a5eca) SHA1(797f2d95d4e00f96e5a99604935810e1add59689) )
257ROM_END
258
259GAME( 2000, cowrace, kingdrby, cowrace, cowrace, 0,   ROT0, "bootleg", "Cow Race (hack of King Derby)", GAME_NOT_WORKING | GAME_WRONG_COLORS )
src/mame/drivers/hexa.c
r7707r7708
1/****************************************************************************
2
3    This hardware is derived from Arkanoid's hardware.  The 1986 date found in
4    the roms probably comes from Arkanoid.  This is a Columns style game and
5    the original Columns wasn't released until 1990 and I find it hard to
6    believe that this would pre-date Columns.
7
8    HEXA
9
10    driver by Howie Cohen
11
12    Memory map (prelim)
13    0000 7fff ROM
14    8000 bfff bank switch rom space??
15    c000 c7ff RAM
16    e000 e7ff video ram
17    e800-efff unused RAM
18
19    read:
20    d001      AY8910 read
21    f000      ???????
22
23    write:
24    d000      AY8910 control
25    d001      AY8910 write
26    d008      bit0/1 = flip screen x/y
27              bit 4 = ROM bank??
28              bit 5 = char bank
29              other bits????????
30    d010      watchdog reset, or IRQ acknowledge, or both
31    f000      ????????
32
33*************************************************************************
34
35    main hardware consists of.....
36
37    sub board with Z80 x2, 2 ROMs and a scratched 18 pin chip (probably a PIC)
38
39    main board has....
40    12MHz xtal
41    ay3-8910
42    8 position DSW x1
43    ROMs x4
44    6116 SRAM x3
45    82S123 PROMs x3
46
47*************************************************************************/
48
49#include "emu.h"
50#include "cpu/z80/z80.h"
51#include "sound/ay8910.h"
52#include "includes/hexa.h"
53
54
55static ADDRESS_MAP_START( hexa_map, ADDRESS_SPACE_PROGRAM, 8 )
56   AM_RANGE(0x0000, 0x7fff) AM_ROM
57   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
58   AM_RANGE(0xc000, 0xc7ff) AM_RAM
59   AM_RANGE(0xd001, 0xd001) AM_DEVREAD("aysnd", ay8910_r)
60   AM_RANGE(0xd000, 0xd001) AM_DEVWRITE("aysnd", ay8910_address_data_w)
61   AM_RANGE(0xd008, 0xd008) AM_WRITE(hexa_d008_w)
62   AM_RANGE(0xd010, 0xd010) AM_WRITE(watchdog_reset_w)   /* or IRQ acknowledge, or both */
63   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(hexa_videoram_w) AM_BASE_SIZE_MEMBER(hexa_state, videoram, videoram_size)
64ADDRESS_MAP_END
65
66
67
68static INPUT_PORTS_START( hexa )
69   PORT_START("INPUTS")
70   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
71   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
72   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
73   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
74   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
75   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
76   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
77   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
78
79   PORT_START("DSW")
80   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW1:1,2")
81   PORT_DIPSETTING(    0x00, DEF_STR( 3C_1C ) )
82   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
83   PORT_DIPSETTING(    0x03, DEF_STR( 1C_1C ) )
84   PORT_DIPSETTING(    0x02, DEF_STR( 1C_2C ) )
85   PORT_DIPNAME( 0x04, 0x00, "Naughty Pics" )  PORT_DIPLOCATION("SW1:3")
86   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
87   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
88   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )  PORT_DIPLOCATION("SW1:4")
89   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
90   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
91   PORT_DIPNAME( 0x30, 0x30, "Difficulty?" )  PORT_DIPLOCATION("SW1:5,6")
92   PORT_DIPSETTING(    0x30, "Easy?" )
93   PORT_DIPSETTING(    0x20, "Medium?" )
94   PORT_DIPSETTING(    0x10, "Hard?" )
95   PORT_DIPSETTING(    0x00, "Hardest?" )
96   PORT_DIPNAME( 0x40, 0x40, "Pobys" )  PORT_DIPLOCATION("SW1:7")
97   PORT_DIPSETTING(    0x40, "2" )
98   PORT_DIPSETTING(    0x00, "4" )
99   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )  PORT_DIPLOCATION("SW1:8")
100   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
101   PORT_DIPSETTING(    0x80, DEF_STR( On ) )
102INPUT_PORTS_END
103
104
105
106static const gfx_layout charlayout =
107{
108   8,8,    /* 8 by 8 */
109   4096,   /* 4096 characters */
110   3,      /* 3 bits per pixel */
111   { 2*4096*8*8, 4096*8*8, 0 },   /* plane */
112   { 0, 1, 2, 3, 4, 5, 6, 7 },      /* x bit */
113   { 8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7 },    /* y bit */
114   8*8
115};
116
117
118
119static GFXDECODE_START( hexa )
120   GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout,  0 , 32 )
121GFXDECODE_END
122
123
124
125static const ay8910_interface ay8910_config =
126{
127   AY8910_LEGACY_OUTPUT,
128   AY8910_DEFAULT_LOADS,
129   DEVCB_INPUT_PORT("INPUTS"),
130   DEVCB_INPUT_PORT("DSW"),
131   DEVCB_NULL,
132   DEVCB_NULL
133};
134
135
136
137static MACHINE_START( hexa )
138{
139   hexa_state *state = (hexa_state *)machine->driver_data;
140
141   state_save_register_global(machine, state->charbank);
142}
143
144static MACHINE_RESET( hexa )
145{
146   hexa_state *state = (hexa_state *)machine->driver_data;
147
148   state->charbank = 0;
149}
150
151static MACHINE_DRIVER_START( hexa )
152
153   /* driver data */
154   MDRV_DRIVER_DATA(hexa_state)
155
156   /* basic machine hardware */
157   MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)   /* Imported from arkanoid - correct? */
158   MDRV_CPU_PROGRAM_MAP(hexa_map)
159   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
160
161   MDRV_MACHINE_START(hexa)
162   MDRV_MACHINE_RESET(hexa)
163
164   /* video hardware */
165   MDRV_SCREEN_ADD("screen", RASTER)
166   MDRV_SCREEN_REFRESH_RATE(60)
167   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
168   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
169   MDRV_SCREEN_SIZE(32*8, 32*8)
170   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
171
172   MDRV_GFXDECODE(hexa)
173   MDRV_PALETTE_LENGTH(256)
174
175   MDRV_PALETTE_INIT(RRRR_GGGG_BBBB)
176   MDRV_VIDEO_START(hexa)
177   MDRV_VIDEO_UPDATE(hexa)
178
179   /* sound hardware */
180   MDRV_SPEAKER_STANDARD_MONO("mono")
181   MDRV_SOUND_ADD("aysnd", AY8910, XTAL_12MHz/4/2)   /* Imported from arkanoid - correct? */
182   MDRV_SOUND_CONFIG(ay8910_config)
183   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
184MACHINE_DRIVER_END
185
186
187/***************************************************************************
188
189  Game driver(s)
190
191***************************************************************************/
192
193ROM_START( hexa )
194   ROM_REGION( 0x18000, "maincpu", 0 )      /* 64k for code + 32k for banked ROM */
195   ROM_LOAD( "hexa.20",      0x00000, 0x8000, CRC(98b00586) SHA1(3591a3b0486d720f0aaa9f0bf4be352cd0ffcbc7) )
196   ROM_LOAD( "hexa.21",      0x10000, 0x8000, CRC(3d5d006c) SHA1(ad4eadab82024b122182eacb5a322cfd6e476a70) )
197
198   ROM_REGION( 0x18000, "gfx1", 0 )
199   ROM_LOAD( "hexa.17",      0x00000, 0x8000, CRC(f6911dd6) SHA1(b12ea27ecddd60820a32d4346afab0cc9d06fa57) )
200   ROM_LOAD( "hexa.18",      0x08000, 0x8000, CRC(6e3d95d2) SHA1(6399b7b5d088ceda08fdea9cf650f6b405f038e7) )
201   ROM_LOAD( "hexa.19",      0x10000, 0x8000, CRC(ffe97a31) SHA1(f16b5d2b9ace09bcbbfe3dfb73db7fa377d1af7f) )
202
203   ROM_REGION( 0x0300, "proms", 0 )
204   ROM_LOAD( "hexa.001",     0x0000, 0x0100, CRC(88a055b4) SHA1(eee86a7930d0a251f3e5c2134532cd1dede2026c) )
205   ROM_LOAD( "hexa.003",     0x0100, 0x0100, CRC(3e9d4932) SHA1(9a336dba7134400312985b9902c77b4141105853) )
206   ROM_LOAD( "hexa.002",     0x0200, 0x0100, CRC(ff15366c) SHA1(7feaf1c768bfe76432fb80991585e13d95960b34) )
207ROM_END
208
209
210
211static DRIVER_INIT( hexa )
212{
213   UINT8 *RAM = memory_region(machine, "maincpu");
214#if 0
215
216
217   /* Hexa is not protected or anything, but it keeps writing 0x3f to register */
218   /* 0x07 of the AY8910, to read the input ports. This causes clicks in the */
219   /* music since the output channels are continuously disabled and reenabled. */
220   /* To avoid that, we just NOP out the 0x3f write. */
221
222   RAM[0x0124] = 0x00;
223   RAM[0x0125] = 0x00;
224   RAM[0x0126] = 0x00;
225#endif
226
227   memory_configure_bank(machine, "bank1", 0, 2, &RAM[0x10000], 0x4000);
228}
229
230
231GAME( 199?, hexa, 0, hexa, hexa, hexa, ROT0, "D. R. Korea", "Hexa", GAME_SUPPORTS_SAVE )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team