Previous 15994 Revisions Next

r1867 Sunday 9th March, 2008 at 06:08:01 UTC by PeT
hartung gamemaster added
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/audio]gmaster.c*
[src/mess/drivers]gmaster.c*
[src/mess/includes]gmaster.h*

src/mess/audio/gmaster.c
r0r1867
1/***************************************************************************
2 PeT mess@utanet.at march 2002
3***************************************************************************/
4#include <assert.h>
5#include <math.h>
6#include "osd_cpu.h"
7#include "driver.h"
8#include "streams.h"
9#include "deprecat.h"
10#include "mame.h"
11#include "timer.h"
12//#include "sound/mixer.h"
13#include "cpu/upd7810/upd7810.h"
14
15#include "includes/gmaster.h"
16
17static /*bool*/int level;
18static sound_stream *mixer_channel;
19
20int gmaster_io_callback(int ioline, int state)
21{
22    switch (ioline) {
23    case UPD7810_TO:
24   stream_update(mixer_channel);
25   level=state;
26   break;
27    default:
28   logerror("io changed %d %.2x\n",ioline, state);
29    }
30    return 0;
31}
32
33
34/************************************/
35/* Sound handler update             */
36/************************************/
37static void gmaster_update (void* param, stream_sample_t **inputs, stream_sample_t **_buffer, int length)
38{
39    int i;
40    stream_sample_t *buffer=_buffer[0];
41   
42    for (i = 0; i < length; i++, buffer++)
43    {
44   *buffer = level?0x4000:0;
45    }
46}
47
48/************************************/
49/* Sound handler start              */
50/************************************/
51void* gmaster_custom_start (int clock, const struct CustomSound_interface *config)
52{
53  mixer_channel = stream_create(0, 1, Machine->sample_rate, 0, gmaster_update);
54
55  return (void*)~0;
56}
57
58/************************************/
59/* Sound handler stop               */
60/************************************/
61void gmaster_custom_stop (void)
62{
63}
64
65void gmaster_custom_update (void)
66{
67}
src/mess/includes/gmaster.h
r0r1867
1#ifndef __GMASTER_H_
2#define __GMASTER_H_
3
4#include "sound/custom.h"
5
6int gmaster_io_callback(int ioline, int state);
7void* gmaster_custom_start (int clock, const struct CustomSound_interface *config);
8//extern void gmaster_custom_stop (void);
9//extern void gmaster_custom_update (void);
10
11#endif
src/mess/messdriv.c
r1866r1867
169169   /* MAGNAVOX */
170170   DRIVER( odyssey2 )   /* Magnavox Odyssey 2 - 1978-1983               */
171171
172   /* Hartung, Watara, ...*/
173   DRIVER( gmaster )   /* Hartung Gamemaster */
174
172175   /* WATARA */
173176   DRIVER( svision )   /* Supervision Handheld                        */
174177TESTDRIVER( svisions )
175178
176179TESTDRIVER( svisionp )
177180TESTDRIVER( svisionn )
178TESTDRIVER( tvlinkp )
181   DRIVER( tvlinkp )
179182
180183   /* INTERTON */
181184   DRIVER( vc4000 )   /* Interton vc4000                           */
src/mess/mess.mak
r1866r1867
128128#CPUS += ADSP2181
129129CPUS += PSXCPU
130130#CPUS += ASAP
131#CPUS += UPD7810
131CPUS += UPD7810
132132#CPUS += UPD7807
133133CPUS += UPD7801
134134CPUS += ARM
r1866r1867
425425   $(MESSOBJ)/osborne.a \
426426   $(MESSOBJ)/shared.a \
427427   $(MESSOBJ)/exeltel.a \
428   $(MESSOBJ)/gmaster.a \
428429
429430
430431
r1866r1867
496497   $(MESS_MACHINE)/adam.o      \
497498   $(MESS_DRIVERS)/adam.o      \
498499   $(MESS_FORMATS)/adam_dsk.o   \
499   
500
500501$(MESSOBJ)/arcadia.a:  \
501502   $(MESS_DRIVERS)/arcadia.o   \
502503   $(MESS_AUDIO)/arcadia.o   \
r1866r1867
11731174   $(MESS_DRIVERS)/orao.o \
11741175   $(MESS_MACHINE)/orao.o \
11751176   $(MESS_VIDEO)/orao.o \
1177
1178$(MESSOBJ)/gmaster.a:         \
1179   $(MESS_DRIVERS)/gmaster.o   \
1180   $(MESS_AUDIO)/gmaster.o
11761181 
11771182#-------------------------------------------------
11781183# layout dependencies
r1866r1867
12311236#-------------------------------------------------
12321237# MESS special OSD rules
12331238#-------------------------------------------------
1234   
1239
12351240include $(SRC)/mess/osd/$(OSD)/$(OSD).mak
src/mess/drivers/gmaster.c
r0r1867
1/******************************************************************************
2 PeT mess@utanet.at march 2002
3******************************************************************************/
4
5#include "driver.h"
6#include "deprecat.h"
7#include "mslegacy.h"
8//#include "vidhrdw/generic.h"
9#include "cpu/upd7810/upd7810.h"
10#include "devices/cartslot.h"
11
12#include "includes/gmaster.h"
13
14
15static struct {
16    UINT8 data[8];
17    int index;
18    int x, y;
19  /*bool*/int mode; // true read does not increase address
20  /*bool*/int delayed;
21    UINT8 pixels[8][64/*>=62 sure*/];   
22} gmaster_video;
23
24typedef struct {
25    UINT8 ports[5];
26} GMASTER;
27static GMASTER gmaster;
28
29static READ8_HANDLER( gmaster_io_r )
30{
31    UINT8 data=0;
32    if (gmaster.ports[2]&1) {
33   data=memory_region(REGION_CPU1)[0x4000+offset];
34   logerror("%.4x external memory %.4x read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset,data);
35    } else {
36   switch (offset) {
37   case 1:
38       data=gmaster_video.pixels[gmaster_video.y][gmaster_video.x];
39       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       if (!(gmaster_video.mode)&&gmaster_video.delayed) gmaster_video.x++;
41       gmaster_video.delayed=TRUE;
42       break;
43   default:
44     logerror("%.4x memory %.4x read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset,data);
45   }
46    }
47    return data;
48}
49
50#define BLITTER_Y ((gmaster.ports[2]&4)|(gmaster_video.data[0]&3))
51
52static WRITE8_HANDLER( gmaster_io_w )
53{
54    if (gmaster.ports[2]&1) {
55   memory_region(REGION_CPU1)[0x4000+offset]=data;
56   logerror("%.4x external memory %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
57    } else {
58   switch (offset) {
59   case 0:
60       gmaster_video.delayed=FALSE;
61       logerror("%.4x lcd %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
62       // e2 af a4 a0 a9 falling block init for both halves
63       if ((data&0xfc)==0xb8) {
64      gmaster_video.index=0;
65      gmaster_video.data[gmaster_video.index]=data;
66      gmaster_video.y=BLITTER_Y;
67       } else if ((data&0xc0)==0) {
68      gmaster_video.x=data;
69       } else if ((data&0xf0)==0xe0) {
70      gmaster_video.mode=(data&0xe)?FALSE:TRUE;
71       }
72       gmaster_video.data[gmaster_video.index]=data;
73       gmaster_video.index=(gmaster_video.index+1)&7;
74       break;
75   case 1:
76       gmaster_video.delayed=FALSE;
77       if (gmaster_video.x<ARRAY_LENGTH(gmaster_video.pixels[0])) // continental galaxy flutlicht
78      gmaster_video.pixels[gmaster_video.y][gmaster_video.x]=data;
79       logerror("%.4x lcd x:%.2x y:%.2x %.4x written %.2x\n",
80           (int)activecpu_get_reg(CPUINFO_INT_PC), gmaster_video.x, gmaster_video.y, 0x4000+offset, data);
81       gmaster_video.x++;
82/* 02 b8 1a
83   02 bb 1a
84   02 bb 22
85   04 b8 12
86   04 b8 1a
87   04 b8 22
88   04 b9 12
89   04 b9 1a
90   04 b9 22
91   02 bb 12
92   4000 e0
93   rr w rr w rr w rr w rr w rr w rr w rr w
94   4000 ee
95*/
96       break;
97   default:
98     logerror("%.4x memory %.4x written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), 0x4000+offset, data);
99   }
100    }
101}
102
103static READ8_HANDLER( gmaster_port_r )
104{
105//    UINT8 data=gmaster.ports[offset];
106    UINT8 data=0xff;
107    switch (offset) {
108    case UPD7810_PORTA:
109   data=readinputport(0);
110   break;
111    default:
112      logerror("%.4x port %d read %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC),offset,data);
113    }
114    return data;
115}
116
117static WRITE8_HANDLER( gmaster_port_w )
118{
119    gmaster.ports[offset]=data;
120    logerror("%.4x port %d written %.2x\n",(int)activecpu_get_reg(CPUINFO_INT_PC), offset, data);
121    switch (offset) {
122    case UPD7810_PORTC:
123   gmaster_video.y=BLITTER_Y;
124   break;
125    }
126}
127
128static ADDRESS_MAP_START( gmaster_mem, ADDRESS_SPACE_PROGRAM, 8 )
129     AM_RANGE(0x0000, 0x3fff) AM_ROM
130      AM_RANGE( 0x4000, 0x7fff) AM_READWRITE(gmaster_io_r, gmaster_io_w)
131     AM_RANGE(0x8000, 0xfeff) AM_ROM
132      AM_RANGE(0xff00, 0xffff) AM_RAM
133ADDRESS_MAP_END
134
135static ADDRESS_MAP_START(gmaster_io, ADDRESS_SPACE_IO, 8)
136     AM_RANGE(UPD7810_PORTA, UPD7810_PORTF) AM_READWRITE(gmaster_port_r, gmaster_port_w )
137ADDRESS_MAP_END
138
139static INPUT_PORTS_START( gmaster )
140    PORT_START
141    PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT)
142    PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
143    PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
144    PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   )
145     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("B")
146     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("A")
147     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SELECT)  PORT_NAME("select")
148     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START) PORT_NAME("start")
149INPUT_PORTS_END
150
151/* palette in red, green, blue tribles */
152static unsigned char gmaster_palette[2][3] =
153{
154#if 1
155    // ziemlich schwierig den lcd touch rüberzubringen
156    // es ist hauptsächlich die das fleckige grünlich, bläuliche
157    { 130, 159, 166 },
158    { 45,45,43 }
159#else
160    { 255,255,255 },
161    { 0, 0, 0 }
162#endif
163};
164
165static PALETTE_INIT( gmaster )
166{
167  palette_set_colors_rgb(machine, 0, (unsigned char*)gmaster_palette, sizeof(gmaster_palette));
168}
169
170static VIDEO_UPDATE( gmaster )
171{
172    int x,y;
173//    plot_box(bitmap, 0, 0, 64/*bitmap->width*/, bitmap->height, Machine->pens[0]); //xmess rounds up to 64 pixel
174    for (y=0;y<ARRAY_LENGTH(gmaster_video.pixels); y++) {
175   for (x=0;x<ARRAY_LENGTH(gmaster_video.pixels[0]);x++) {
176     UINT8 d=gmaster_video.pixels[y][x];
177     UINT16 *line;
178     line=BITMAP_ADDR16(bitmap, (y*8), x);
179     line[0]=(d>>0)&1;
180     line=BITMAP_ADDR16(bitmap, (y*8+1), x);
181     line[0]=(d>>1)&1;
182     line=BITMAP_ADDR16(bitmap, (y*8+2), x);
183     line[0]=(d>>2)&1;
184     line=BITMAP_ADDR16(bitmap, (y*8+3), x);
185     line[0]=(d>>3)&1;
186     line=BITMAP_ADDR16(bitmap, (y*8+4), x);
187     line[0]=(d>>4)&1;
188     line=BITMAP_ADDR16(bitmap, (y*8+5), x);
189     line[0]=(d>>5)&1;
190     line=BITMAP_ADDR16(bitmap, (y*8+6), x);
191     line[0]=(d>>6)&1;
192     line=BITMAP_ADDR16(bitmap, (y*8+7), x);
193     line[0]=(d>>7)&1;
194   }
195    }
196    return 0;
197}
198
199static INTERRUPT_GEN( gmaster_interrupt )
200{
201  cpunum_set_input_line(machine, 0, UPD7810_INTFE1, PULSE_LINE);
202}
203
204static UPD7810_CONFIG config={
205  //    TYPE_7810,
206    TYPE_7801, // temporarily until 7810 core fixes synchronized
207    gmaster_io_callback
208};
209
210static const struct CustomSound_interface gmaster_sound_interface =
211{
212   gmaster_custom_start
213};
214
215static MACHINE_DRIVER_START( gmaster )
216     MDRV_CPU_ADD_TAG("main", UPD7810, 5000000)
217MDRV_CPU_PROGRAM_MAP(gmaster_mem, 0)
218MDRV_CPU_IO_MAP( gmaster_io, 0 )
219MDRV_CPU_CONFIG( config )
220MDRV_CPU_VBLANK_INT(gmaster_interrupt,1)
221
222     MDRV_SCREEN_ADD("main", LCD)
223     MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
224     MDRV_SCREEN_REFRESH_RATE(60)
225     MDRV_SCREEN_SIZE(64, 64)
226     MDRV_SCREEN_VISIBLE_AREA(0, 64-1-3, 0, 64-1)
227  MDRV_PALETTE_LENGTH(sizeof(gmaster_palette)/sizeof(gmaster_palette[0]))
228  MDRV_VIDEO_UPDATE(gmaster)
229     MDRV_PALETTE_INIT(gmaster)
230
231     MDRV_SPEAKER_STANDARD_MONO("gmaster")
232     MDRV_SOUND_ADD(CUSTOM, 0)
233     MDRV_SOUND_CONFIG(gmaster_sound_interface)
234     MDRV_SOUND_ROUTE(0, "gmaster", 0.50)
235MACHINE_DRIVER_END
236
237
238ROM_START(gmaster)
239   ROM_REGION(0x10000,REGION_CPU1, 0)
240     ROM_LOAD("gmaster.bin", 0x0000, 0x1000, CRC(05cc45e5) SHA1(05d73638dea9657ccc2791c0202d9074a4782c1e) )
241     ROM_CART_LOAD(0, "bin", 0x8000, 0x7eff, 0)
242ROM_END
243
244static DRIVER_INIT( gmaster )
245{
246    memset(&gmaster_video, 0, sizeof(gmaster_video));
247
248}
249
250#if 0
251static int gmaster_load_rom(int id)
252{
253   FILE *cartfile;
254   UINT8 *rom = memory_region(REGION_CPU1);
255   int size;
256
257   if (device_filename(IO_CARTSLOT, id) == NULL)
258   {
259      printf("%s requires Cartridge!\n", Machine->gamedrv->name);
260      return 0;
261   }
262   
263   if (!(cartfile = (FILE*)image_fopen(IO_CARTSLOT, id, OSD_FILETYPE_IMAGE_R, 0)))
264   {
265      logerror("%s not found\n",device_filename(IO_CARTSLOT,id));
266      return 1;
267   }
268   size=osd_fsize(cartfile);
269   if (size>0x8000) {
270       logerror("%s: size %d not yet supported\n",device_filename(IO_CARTSLOT,id), size);
271       return 1;
272   }
273
274   if (osd_fread(cartfile, rom+0x8000, size)!=size) {
275      logerror("%s load error\n",device_filename(IO_CARTSLOT,id));
276      osd_fclose(cartfile);
277      return 1;
278   }
279//   memcpy(rom+0x0000, rom+0x8000, 0x4000);
280   osd_fclose(cartfile);
281   return 0;
282}
283#endif
284
285SYSTEM_CONFIG_START(gmaster)
286     CONFIG_DEVICE(cartslot_device_getinfo)
287SYSTEM_CONFIG_END
288
289/*    YEAR      NAME            PARENT  MACHINE   INPUT     INIT               
290     COMPANY                 FULLNAME */
291CONS( 1990, gmaster,       0,          0, gmaster,  gmaster,    gmaster,   gmaster, "Hartung", "Gamemaster", GAME_IMPERFECT_SOUND)
292
docs/messnew.txt
r1866r1867
77- Galeb [Miodrag Milanovic]
88- Orao [Miodrag Milanovic]
99- Philips Videopac G7000/C52 [Wilbert Pol]
10- Hartung/Watara/Virella/Videojet/... Game Master [PeT]
1011
11
12
1312System Driver Changes:
1413----------------------
1514- [ABC80x] Updated to use the new MAME MC6845 code. [Curt Coder]
r1866r1867
3332- [VC4000] Cleaned up, added quickload and fixed colors.  (bug #1404) [Manfred
3433  Schneider]
3534
35- [SVISION] Watara TV-Link PAL activated [PeT]
3636
3737
3838User Interface Changes:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team