Previous 199869 Revisions Next

r24839 Sunday 11th August, 2013 at 18:35:33 UTC by David Haywood
moved sega pico out of megadriv.c and into segapico.c, it really has nothing in common with the MD aside the CPU+VDP and should be properly separated.

added skeleton 'Yamaha Mixt Book Player Copera' to the Sega Pico driver, it appears to be similar to the Pico but with extra sound hardware (a complete Sound Blaster clone) on the MB.  Added a preliminary Softlist.  Added board layouts for both [Team Europe]
[src/mess]mess.lst mess.mak
[src/mess/drivers]megadriv.c segapico.c*
[src/mess/includes]md_cons.h*
[src/mess/machine]md_slot.c md_slot.h

trunk/src/mess/includes/md_cons.h
r0r24839
1
2
3class md_cons_state : public md_base_state
4{
5public:
6   md_cons_state(const machine_config &mconfig, device_type type, const char *tag)
7   : md_base_state(mconfig, type, tag),
8   m_slotcart(*this, "mdslot")
9   { }
10
11   ioport_port *m_io_ctrlr;
12   ioport_port *m_io_pad3b[4];
13   ioport_port *m_io_pad6b[2][4];
14
15   optional_device<md_cart_slot_device> m_slotcart;
16
17   DECLARE_DRIVER_INIT(mess_md_common);
18   DECLARE_DRIVER_INIT(genesis);
19   DECLARE_DRIVER_INIT(md_eur);
20   DECLARE_DRIVER_INIT(md_jpn);
21
22   READ8_MEMBER(mess_md_io_read_data_port);
23   WRITE16_MEMBER(mess_md_io_write_data_port);
24
25   DECLARE_MACHINE_START( md_common );     // setup ioport_port
26   DECLARE_MACHINE_START( ms_megadriv );   // setup ioport_port + install cartslot handlers
27   DECLARE_MACHINE_RESET( ms_megadriv );
28};
29
30
Property changes on: trunk/src/mess/includes/md_cons.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/mess.lst
r24838r24839
102102pico      // 1994 Sega Pico (Europe)
103103picou    // 1994 Sega Pico (USA)
104104picoj    // 1993 Sega Pico (Japan)
105copera   // 1993 Sega / Yamaha
105106segacd  // 1992 Sega Sega CD (USA)
106107megacd  // 1993 Sega Mega-CD (Europe)
107108megacda // 1993 Sega Mega-CD (Asia)
trunk/src/mess/mess.mak
r24838r24839
19371937   $(MESS_MACHINE)/md_stm95.o  \
19381938   $(MESS_MACHINE)/md_svp.o    \
19391939   $(MESS_DRIVERS)/megadriv.o  \
1940   $(MESS_DRIVERS)/segapico.o  \
19401941   $(MESS_DRIVERS)/dccons.o    \
19411942   $(MAME_MACHINE)/gdrom.o     \
19421943   $(MESS_MACHINE)/dccons.o    \
trunk/src/mess/drivers/segapico.c
r0r24839
1
2/****************************************** PICO emulation ****************************************/
3
4/* todo, make this more independent of the Genesis emulation, it's really only the same CPU + VDP
5   and doesn't need to be connected to the Genesis at all. */
6
7/*
8
9Pico mainboard (PAL version)
10
11+---+                              +-------------------------------------------------------------------------+
12|   |                              |                                    +-+                                  |
13|   |                              |                 +--+               |B|        +-+                       |
14|   |                              |                 |A3|               +-+        | |                       |
15|   +------------------------------+                 +--+                          |C|                     +-|                             
16|                                                                                  | |                     | |
17|    GCMK-C2X                                                                      +-+                     | --> PEN
18|                                 +-----+     +--+                                                         +-|
19|                                 |     |     |A3|            +--------+                                     |     
20|                                 | A1  |     +--+            |        |              +---------+            |         
21|          SEGA                   |     |                     |    A2  |              |HM53861J |            |
22|     1994 837-10846              +-----+                     |        |              |         |            |     
23|      IAC MAIN PAL                                           +--------+              +---------+            |               
24|     MADE IN JAPAN                                                        +----+                            |
25|           VA0          +----------+                                      |XTAL|                         +--+           
26|                        |   SEGA   |         +---------+                  |    |                         |  <-- VCC IN         
27|                        | 315-5640 |         |MC68HC000|                  |53.2|                         +--+
28|                        | 9434 W51 |         |FN8-A    |  +----+          |00  |    +----------+            |                 
29|                        |          |         |         |  |    |          +----+    |   SEGA   |            |       
30|                        |          |         |  2B89N  |  |    |                    | 315-5313A|            | 
31|                        |          |         |S0AH9425A|  | A4 |                    |   F1001  |         +--|     
32|                        +----------+         +---------+  |    |                    |          |         |  |                     
33|                                                          |    |                    |9428 LAGG |         |  --> VIDEO OUT
34|                                                          |    |                    |          |         |  |
35|                                                          +----+                    +----------+         +--|           
36|                                                                                                            |
37|                                                                     +----------------------------+         |
38|                                                                     ||||||CARTRIDGE CONNECTOR|||||         |
39|                                                                     +----------------------------+         |
40|                                                                                                            |
41+------------------------------------------------------------------------------------------------------------+
42
43A1 = SEGA / 315-5641 / D77591 / 9442CA010
44A2 = SEGA / 315-5769 U13 / 9451MD020
45A3 = BA10324AF
46A4 = MALAYSIA 9336 / 651632DFP-15 / 0000988S
47B = 4K16 / HC00
48C = MB3514 / 9325 M36
49
50
51315-5640  - touchpad controller?
52315-5313A - VDP
53315-5641  - PCM chip
54
55
56*/
57
58/*
59   Pico Implementation By ElBarto (Emmanuel Vadot, elbarto@megadrive.org)
60   Still missing the PCM custom chip
61   Some game will not boot due to this
62
63 Pico Info from Notaz (http://notaz.gp2x.de/docs/picodoc.txt)
64
65 addr   acc   description
66-------+-----+------------
67800001  byte  Version register.
68              ?vv? ????, where v can be:
69                00 - hardware is for Japan
70                01 - European version
71                10 - USA version
72                11 - ?
73800003  byte  Buttons, 0 for pressed, 1 for released:
74                bit 0: UP (white)
75                bit 1: DOWN (orange)
76                bit 2: LEFT (blue)
77                bit 3: RIGHT (green)
78                bit 4: red button
79                bit 5: unused?
80                bit 6: unused?
81                bit 7: pen button
82800005  byte  Most significant byte of pen x coordinate.
83800007  byte  Least significant byte of pen x coordinate.
84800009  byte  Most significant byte of pen y coordinate.
8580000b  byte  Least significant byte of pen y coordinate.
8680000d  byte  Page register. One bit means one uncovered page sensor.
87                00 - storyware closed
88                01, 03, 07, 0f, 1f, 3f - pages 1-6
89                either page 5 or page 6 is often unused.
90800010  word  PCM data register.
91        r/w   read returns free bytes left in PCM FIFO buffer
92              writes write data to buffer.
93800012  word  PCM control register.
94        r/w   For writes, it has following possible meanings:
95              ?p?? ???? ???? ?rrr
96                p - set to enable playback?
97                r - sample rate / PCM data type?
98                  0: 8kHz 4bit ADPCM?
99                  1-7: 16kHz variants?
100              For reads, if bit 15 is cleared, it means PCM is 'busy' or
101              something like that, as games sometimes wait for it to become 1.
102800019  byte  Games write 'S'
10380001b  byte  Games write 'E'
10480001d  byte  Games write 'G'
10580001f  byte  Games write 'A'
106
107*/
108
109#include "emu.h"
110#include "includes/megadriv.h"
111#include "machine/md_slot.h"
112#include "machine/md_rom.h"
113#include "includes/md_cons.h"
114
115#define PICO_PENX   1
116#define PICO_PENY   2
117
118class pico_base_state : public md_cons_state
119{
120public:
121   pico_base_state(const machine_config &mconfig, device_type type, const char *tag)
122      : md_cons_state(mconfig, type, tag) { }
123
124   ioport_port *m_io_page;
125   ioport_port *m_io_pad;
126   ioport_port *m_io_penx;
127   ioport_port *m_io_peny;
128
129   UINT8 m_page_register;
130
131   UINT16 pico_read_penpos(int pen);
132   DECLARE_READ16_MEMBER(pico_68k_io_read);
133   DECLARE_WRITE16_MEMBER(pico_68k_io_write);
134};
135
136class pico_state : public pico_base_state
137{
138public:
139   pico_state(const machine_config &mconfig, device_type type, const char *tag)
140   : pico_base_state(mconfig, type, tag),
141   m_picocart(*this, "picoslot") { }
142
143   optional_device<pico_cart_slot_device> m_picocart;
144   DECLARE_MACHINE_START(pico);
145
146};
147
148
149
150UINT16 pico_base_state::pico_read_penpos(int pen)
151{
152   UINT16 penpos = 0;
153
154   switch (pen)
155   {
156      case PICO_PENX:
157         penpos = m_io_penx->read_safe(0);
158         penpos |= 0x6;
159         penpos = penpos * 320 / 255;
160         penpos += 0x3d;
161         break;
162      case PICO_PENY:
163         penpos = m_io_peny->read_safe(0);
164         penpos |= 0x6;
165         penpos = penpos * 251 / 255;
166         penpos += 0x1fc;
167         break;
168   }
169
170   return penpos;
171}
172
173READ16_MEMBER(pico_base_state::pico_68k_io_read )
174{
175   UINT8 retdata = 0;
176
177   switch (offset)
178   {
179      case 0: /* Version register ?XX?????? where XX is 00 for japan, 01 for europe and 10 for USA*/
180         retdata = (m_export << 6) | (m_pal << 5);
181         break;
182      case 1:
183         retdata = m_io_pad->read_safe(0);
184         break;
185
186         /*
187         Still notes from notaz for the pen :
188
189         The pen can be used to 'draw' either on the drawing pad or on the storyware
190         itself. Both storyware and drawing pad are mapped on single virtual plane, where
191         coordinates range:
192
193         x: 0x03c - 0x17c
194         y: 0x1fc - 0x2f7 (drawing pad)
195           0x2f8 - 0x3f3 (storyware)
196         */
197      case 2:
198         retdata = pico_read_penpos(PICO_PENX) >> 8;
199         break;
200      case 3:
201         retdata = pico_read_penpos(PICO_PENX) & 0x00ff;
202         break;
203      case 4:
204         retdata = pico_read_penpos(PICO_PENY) >> 8;
205         break;
206      case 5:
207         retdata = pico_read_penpos(PICO_PENY) & 0x00ff;
208         break;
209      case 6:
210      /* Page register :
211         00 - storyware closed
212         01, 03, 07, 0f, 1f, 3f - pages 1-6
213         either page 5 or page 6 is often unused.
214      */
215         {
216            UINT8 tmp = m_io_page->read_safe(0);
217            if (tmp == 2 && m_page_register != 0x3f)
218            {
219               m_page_register <<= 1;
220               m_page_register |= 1;
221            }
222            if (tmp == 1 && m_page_register != 0x00)
223               m_page_register >>= 1;
224            retdata = m_page_register;
225            break;
226         }
227      case 7:
228         /* Returns free bytes left in the PCM FIFO buffer */
229         retdata = 0x00;
230         break;
231      case 8:
232      /*
233         For reads, if bit 15 is cleared, it means PCM is 'busy' or
234         something like that, as games sometimes wait for it to become 1.
235      */
236         retdata = 0x00;
237   }
238
239   return retdata | retdata << 8;
240}
241
242WRITE16_MEMBER(pico_base_state::pico_68k_io_write )
243{
244   switch (offset)
245   {
246   }
247}
248
249static ADDRESS_MAP_START( pico_mem, AS_PROGRAM, 16, pico_base_state )
250   AM_RANGE(0x000000, 0x3fffff) AM_ROM
251
252   AM_RANGE(0x800000, 0x80001f) AM_READWRITE(pico_68k_io_read, pico_68k_io_write)
253
254   AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega_genesis_vdp_device, megadriv_vdp_r,megadriv_vdp_w)
255   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000)
256ADDRESS_MAP_END
257
258
259static INPUT_PORTS_START( pico )
260   PORT_START("PAD")
261   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
262   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
263   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
264   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
265   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Red Button")
266   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Pen Button")
267
268   PORT_START("PAGE")
269   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Increment Page")
270   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Decrement Page")
271
272   PORT_START("PENX")
273   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_NAME("PEN X")
274
275   PORT_START("PENY")
276   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0,255 ) PORT_PLAYER(1) PORT_NAME("PEN Y")
277INPUT_PORTS_END
278
279
280static SLOT_INTERFACE_START(pico_cart)
281   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
282   SLOT_INTERFACE_INTERNAL("rom_sram",  MD_ROM_SRAM)   // not sure these are needed...
283   SLOT_INTERFACE_INTERNAL("rom_sramsafe",  MD_ROM_SRAM)   // not sure these are needed...
284SLOT_INTERFACE_END
285
286MACHINE_START_MEMBER(pico_state,pico)
287{
288   m_io_page = ioport("PAGE");
289   m_io_pad = ioport("PAD");
290   m_io_penx = ioport("PENX");
291   m_io_peny = ioport("PENY");
292
293   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(base_md_cart_slot_device::read),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write),(base_md_cart_slot_device*)m_picocart));
294   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a13),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a13),(base_md_cart_slot_device*)m_picocart));
295   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a15),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a15),(base_md_cart_slot_device*)m_picocart));
296   m_maincpu->space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(base_md_cart_slot_device::write_tmss_bank),(base_md_cart_slot_device*)m_picocart));
297}
298
299static MACHINE_CONFIG_START( pico, pico_state )
300   MCFG_FRAGMENT_ADD( md_ntsc )
301
302   MCFG_CPU_MODIFY("maincpu")
303   MCFG_CPU_PROGRAM_MAP(pico_mem)
304
305   MCFG_DEVICE_REMOVE("genesis_snd_z80")
306
307   MCFG_MACHINE_START_OVERRIDE( pico_state, pico )
308   MCFG_MACHINE_RESET_OVERRIDE( pico_base_state, ms_megadriv )
309
310   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL)
311   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
312MACHINE_CONFIG_END
313
314static MACHINE_CONFIG_START( picopal, pico_state )
315   MCFG_FRAGMENT_ADD( md_pal )
316
317   MCFG_CPU_MODIFY("maincpu")
318   MCFG_CPU_PROGRAM_MAP(pico_mem)
319
320   MCFG_DEVICE_REMOVE("genesis_snd_z80")
321
322   MCFG_MACHINE_START_OVERRIDE( pico_state, pico )
323   MCFG_MACHINE_RESET_OVERRIDE( pico_base_state, ms_megadriv )
324
325   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL)
326   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
327MACHINE_CONFIG_END
328
329
330
331ROM_START( pico )
332   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
333   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
334ROM_END
335
336ROM_START( picou )
337   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
338   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
339ROM_END
340
341ROM_START( picoj )
342   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
343   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
344ROM_END
345
346
347CONS( 1994, pico,       0,         0,      picopal,         pico, md_cons_state,   md_eur,    "Sega",   "Pico (Europe, PAL)", 0)
348CONS( 1994, picou,      pico,      0,      pico,            pico, md_cons_state,   genesis,   "Sega",   "Pico (USA, NTSC)", 0)
349CONS( 1993, picoj,      pico,      0,      pico,            pico, md_cons_state,   md_jpn,    "Sega",   "Pico (Japan, NTSC)", 0)
350
351/*
352
353This looks a lot like a Pico with extra sound hardware...
354 YMZ263B is the basis of a Sound Blaster Clone
355 YMF262-M is the OPL3
356
357YAMAHA - MIXT BOOK PLAYER COPERA
358MMG-1
359
360
361            +-------------+
362            |             |
363            |------+      |
364            |      |      |
365 MIDI OUT <--      |      |
366            |      |      |
367            |------+      |
368            |             |              +------------------------------------------------------------------------------------------------------+
369            |------+      |              |                                    +--+                                                              |
370            |      |      |              |                                    |YM|                                                              |
371  MIDI IN <--      |      |              |                                    |7 |                                                              |
372            |      |      |              |                                    |12|                             +---------+                      |
373            |------+ +--+ |       +------+                                    |8B|                             | YAMAHA  |                      |
374            |        |||| |       |                                           +--+                             | YMZ263B |                      |
375            +---------||--+       |                              +--------+                                    |         |                      |
376                      ||          |                              |YM7 128B|                                    +---------+    +---+             |
377                      ||          |                              +--------+                                                   |YMF|             |
378            +---------||----------+                                                                                           |262|             |
379            |         ||                                                                                                      |-M |             |
380            |         ||                                                                                                      +---+             |
381            |         ||                                                                                                                        |
382            |         ||                                                           SEGA                                                         |
383            |------+  ||                                                 1993 837-9845 COPERA                                                   |
384            |      |  ||                                                      MADE IN JAPAN                                                  +--|
385            |      |  ||                                                           VA0                                                       |  --> PEN
386  CONTROL <--      |  ||                                                                                                                     |  |
387            |      |  ||                                                                                                                     +--|
388            |      |  ||                                                                                                                        |
389            |      |  ||                                                                                                                        |
390            |------+  ||                                                                                         +----+                         |
391            |         ||                                                                                         |XTAL|  +------------+         |
392            |         ||                                                                                         |    |  | OKI JAPAN  |      +----+
393            |         ||                                          +----------+                                   |53.6|  | M54C864-80 |      |    |
394            |        ||||                                         |   SEGA   |                                   |93  |  +------------+      |    |
395            |        +--+                                         | 315-5639 |                                   | Mhz|                      |    |
396            |                                                     |       U11|                                   +----+  +-------------+     |  E |
397            |                                                     |9341PD025 |                                           |             |     |  X |
398            |--+                                                  +----------+                                           |     SEGA    |     |  T |
399      MIC <--  |                                                                     +----+  +----+                      |  315-5313A  |     |  E |
400            |  |                                                                     |TC51|  |TC51|                      |   FC1001    |     |  N |
401            |--+                                                                     |832A|  |832A|                      |  9331 AASG  |     |  D |
402            |                                                                        |FL-1|  |FL-1|                      |             |     |  E |
403            |                                                                        |0   |  |0   |                      |             |     |  D |
404            |                                                                        |    |  |    |                      |             |     |    |
405            |--+                                                                     +----+  +----+                      +-------------+     |    | 
406          +--  |                                                                                                                             |  C |
407          | |--+                                                                                                                             |  O |
408S-AUDIO <-| |                              +-----------+           +-------+                                                                 |  N |
409          | |--+                           |   SEGA    |           | SEGA  |          +-----------+                                          |  N |     
410          +--  |                           | 315-5640  |           |315-564|          |   3D4 UA  |                                          |  E |
411            |--+                           | 9333 W26  |           |1      |          |HD68HC000CP|                                          |  C |
412            |                              |           |           |D77591 |          |8          |                                          |  T |
413            |--+                           |           |           +-------+          |           |                                          |  O |
414  S-VIDEO <--  |                           |           |                              |           |                                          |  R |
415            |--+                           |           |                              |           |                                          |    |
416            |                              +-----------+                              |      JAPAN|                                          |    |
417            |                                                                         +-----------+                                          |    |
418            |--+                                                                                                                             |    |
419       VCC --> |                                                                      +----------------------------------------------+       |    |
420            |--+                                                                      |                  CARTRIDGE                   |       +----+
421            |                                                                         |                  CONNECTOR                   |          |
422            |                                                                         +----------------------------------------------+          |
423            +-----------------------------------------------------------------------------------------------------------------------------------+
424
425*/
426
427
428
429class copera_state : public pico_base_state
430{
431public:
432   copera_state(const machine_config &mconfig, device_type type, const char *tag)
433   : pico_base_state(mconfig, type, tag),
434   m_picocart(*this, "coperaslot") { }
435
436   optional_device<copera_cart_slot_device> m_picocart;
437   DECLARE_MACHINE_START(copera);
438
439};
440
441
442
443static ADDRESS_MAP_START( copera_mem, AS_PROGRAM, 16, copera_state )
444   AM_RANGE(0x000000, 0x3fffff) AM_ROM
445
446   AM_RANGE(0x800000, 0x80001f) AM_READWRITE(pico_68k_io_read, pico_68k_io_write)
447
448   AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega_genesis_vdp_device, megadriv_vdp_r,megadriv_vdp_w)
449   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000)
450ADDRESS_MAP_END
451
452
453
454static SLOT_INTERFACE_START(copera_cart)
455   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
456   SLOT_INTERFACE_INTERNAL("rom_sram",  MD_ROM_SRAM)   // not sure these are needed...
457   SLOT_INTERFACE_INTERNAL("rom_sramsafe",  MD_ROM_SRAM)   // not sure these are needed...
458SLOT_INTERFACE_END
459
460MACHINE_START_MEMBER(copera_state,copera)
461{
462   m_io_page = ioport("PAGE");
463   m_io_pad = ioport("PAD");
464   m_io_penx = ioport("PENX");
465   m_io_peny = ioport("PENY");
466
467   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(base_md_cart_slot_device::read),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write),(base_md_cart_slot_device*)m_picocart));
468   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a13),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a13),(base_md_cart_slot_device*)m_picocart));
469   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a15),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a15),(base_md_cart_slot_device*)m_picocart));
470   m_maincpu->space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(base_md_cart_slot_device::write_tmss_bank),(base_md_cart_slot_device*)m_picocart));
471}
472
473static MACHINE_CONFIG_START( copera, copera_state )
474   MCFG_FRAGMENT_ADD( md_ntsc )
475
476   MCFG_CPU_MODIFY("maincpu")
477   MCFG_CPU_PROGRAM_MAP(copera_mem)
478
479   MCFG_DEVICE_REMOVE("genesis_snd_z80")
480
481   MCFG_MACHINE_START_OVERRIDE( copera_state, copera )
482   MCFG_MACHINE_RESET_OVERRIDE( pico_base_state, ms_megadriv )
483
484   MCFG_COPERA_CARTRIDGE_ADD("coperaslot", copera_cart, NULL)
485   MCFG_SOFTWARE_LIST_ADD("cart_list","copera")
486MACHINE_CONFIG_END
487
488
489
490ROM_START( copera )
491   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
492   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
493ROM_END
494
495CONS( 1993, copera,       0,         0,      copera,         pico, md_cons_state,   md_jpn,    "Yamaha / Sega",   "Yamaha Mixt Book Player Copera", GAME_NOT_WORKING)
Property changes on: trunk/src/mess/drivers/segapico.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/drivers/megadriv.c
r24838r24839
1515#include "imagedev/cartslot.h"
1616
1717#include "formats/imageutl.h"
18#include "includes/md_cons.h"
1819
19class md_cons_state : public md_base_state
20{
21public:
22   md_cons_state(const machine_config &mconfig, device_type type, const char *tag)
23   : md_base_state(mconfig, type, tag),
24   m_slotcart(*this, "mdslot")
25   { }
26
27   ioport_port *m_io_ctrlr;
28   ioport_port *m_io_pad3b[4];
29   ioport_port *m_io_pad6b[2][4];
30
31   optional_device<md_cart_slot_device> m_slotcart;
32
33   DECLARE_DRIVER_INIT(mess_md_common);
34   DECLARE_DRIVER_INIT(genesis);
35   DECLARE_DRIVER_INIT(md_eur);
36   DECLARE_DRIVER_INIT(md_jpn);
37
38   READ8_MEMBER(mess_md_io_read_data_port);
39   WRITE16_MEMBER(mess_md_io_write_data_port);
40
41   DECLARE_MACHINE_START( md_common );     // setup ioport_port
42   DECLARE_MACHINE_START( ms_megadriv );   // setup ioport_port + install cartslot handlers
43   DECLARE_MACHINE_RESET( ms_megadriv );
44};
45
46class pico_state : public md_cons_state
47{
48public:
49   pico_state(const machine_config &mconfig, device_type type, const char *tag)
50   : md_cons_state(mconfig, type, tag),
51   m_picocart(*this, "picoslot") { }
52
53   ioport_port *m_io_page;
54   ioport_port *m_io_pad;
55   ioport_port *m_io_penx;
56   ioport_port *m_io_peny;
57
58   optional_device<pico_cart_slot_device> m_picocart;
59   UINT8 m_page_register;
60
61   UINT16 pico_read_penpos(int pen);
62   DECLARE_READ16_MEMBER(pico_68k_io_read);
63   DECLARE_WRITE16_MEMBER(pico_68k_io_write);
64   DECLARE_MACHINE_START(pico);
65};
66
67
6820/*************************************
6921 *
7022 *  Input handlers
r24838r24839
875827ROM_END
876828
877829
878/****************************************** PICO emulation ****************************************/
879830
880/*
881   Pico Implementation By ElBarto (Emmanuel Vadot, elbarto@megadrive.org)
882   Still missing the PCM custom chip
883   Some game will not boot due to this
884
885 Pico Info from Notaz (http://notaz.gp2x.de/docs/picodoc.txt)
886
887 addr   acc   description
888-------+-----+------------
889800001  byte  Version register.
890              ?vv? ????, where v can be:
891                00 - hardware is for Japan
892                01 - European version
893                10 - USA version
894                11 - ?
895800003  byte  Buttons, 0 for pressed, 1 for released:
896                bit 0: UP (white)
897                bit 1: DOWN (orange)
898                bit 2: LEFT (blue)
899                bit 3: RIGHT (green)
900                bit 4: red button
901                bit 5: unused?
902                bit 6: unused?
903                bit 7: pen button
904800005  byte  Most significant byte of pen x coordinate.
905800007  byte  Least significant byte of pen x coordinate.
906800009  byte  Most significant byte of pen y coordinate.
90780000b  byte  Least significant byte of pen y coordinate.
90880000d  byte  Page register. One bit means one uncovered page sensor.
909                00 - storyware closed
910                01, 03, 07, 0f, 1f, 3f - pages 1-6
911                either page 5 or page 6 is often unused.
912800010  word  PCM data register.
913        r/w   read returns free bytes left in PCM FIFO buffer
914              writes write data to buffer.
915800012  word  PCM control register.
916        r/w   For writes, it has following possible meanings:
917              ?p?? ???? ???? ?rrr
918                p - set to enable playback?
919                r - sample rate / PCM data type?
920                  0: 8kHz 4bit ADPCM?
921                  1-7: 16kHz variants?
922              For reads, if bit 15 is cleared, it means PCM is 'busy' or
923              something like that, as games sometimes wait for it to become 1.
924800019  byte  Games write 'S'
92580001b  byte  Games write 'E'
92680001d  byte  Games write 'G'
92780001f  byte  Games write 'A'
928
929*/
930
931#define PICO_PENX   1
932#define PICO_PENY   2
933
934UINT16 pico_state::pico_read_penpos(int pen)
935{
936   UINT16 penpos = 0;
937
938   switch (pen)
939   {
940      case PICO_PENX:
941         penpos = m_io_penx->read_safe(0);
942         penpos |= 0x6;
943         penpos = penpos * 320 / 255;
944         penpos += 0x3d;
945         break;
946      case PICO_PENY:
947         penpos = m_io_peny->read_safe(0);
948         penpos |= 0x6;
949         penpos = penpos * 251 / 255;
950         penpos += 0x1fc;
951         break;
952   }
953
954   return penpos;
955}
956
957READ16_MEMBER(pico_state::pico_68k_io_read )
958{
959   UINT8 retdata = 0;
960
961   switch (offset)
962   {
963      case 0: /* Version register ?XX?????? where XX is 00 for japan, 01 for europe and 10 for USA*/
964         retdata = (m_export << 6) | (m_pal << 5);
965         break;
966      case 1:
967         retdata = m_io_pad->read_safe(0);
968         break;
969
970         /*
971         Still notes from notaz for the pen :
972
973         The pen can be used to 'draw' either on the drawing pad or on the storyware
974         itself. Both storyware and drawing pad are mapped on single virtual plane, where
975         coordinates range:
976
977         x: 0x03c - 0x17c
978         y: 0x1fc - 0x2f7 (drawing pad)
979           0x2f8 - 0x3f3 (storyware)
980         */
981      case 2:
982         retdata = pico_read_penpos(PICO_PENX) >> 8;
983         break;
984      case 3:
985         retdata = pico_read_penpos(PICO_PENX) & 0x00ff;
986         break;
987      case 4:
988         retdata = pico_read_penpos(PICO_PENY) >> 8;
989         break;
990      case 5:
991         retdata = pico_read_penpos(PICO_PENY) & 0x00ff;
992         break;
993      case 6:
994      /* Page register :
995         00 - storyware closed
996         01, 03, 07, 0f, 1f, 3f - pages 1-6
997         either page 5 or page 6 is often unused.
998      */
999         {
1000            UINT8 tmp = m_io_page->read_safe(0);
1001            if (tmp == 2 && m_page_register != 0x3f)
1002            {
1003               m_page_register <<= 1;
1004               m_page_register |= 1;
1005            }
1006            if (tmp == 1 && m_page_register != 0x00)
1007               m_page_register >>= 1;
1008            retdata = m_page_register;
1009            break;
1010         }
1011      case 7:
1012         /* Returns free bytes left in the PCM FIFO buffer */
1013         retdata = 0x00;
1014         break;
1015      case 8:
1016      /*
1017         For reads, if bit 15 is cleared, it means PCM is 'busy' or
1018         something like that, as games sometimes wait for it to become 1.
1019      */
1020         retdata = 0x00;
1021   }
1022
1023   return retdata | retdata << 8;
1024}
1025
1026WRITE16_MEMBER(pico_state::pico_68k_io_write )
1027{
1028   switch (offset)
1029   {
1030   }
1031}
1032
1033static ADDRESS_MAP_START( pico_mem, AS_PROGRAM, 16, pico_state )
1034   AM_RANGE(0x000000, 0x3fffff) AM_ROM
1035
1036   AM_RANGE(0x800000, 0x80001f) AM_READWRITE(pico_68k_io_read, pico_68k_io_write)
1037
1038   AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega_genesis_vdp_device, megadriv_vdp_r,megadriv_vdp_w)
1039   AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000)
1040ADDRESS_MAP_END
1041
1042
1043static INPUT_PORTS_START( pico )
1044   PORT_START("PAD")
1045   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
1046   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
1047   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
1048   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
1049   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("Red Button")
1050   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("Pen Button")
1051
1052   PORT_START("PAGE")
1053   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("Increment Page")
1054   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("Decrement Page")
1055
1056   PORT_START("PENX")
1057   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0, 255) PORT_PLAYER(1) PORT_NAME("PEN X")
1058
1059   PORT_START("PENY")
1060   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(30) PORT_KEYDELTA(10) PORT_MINMAX(0,255 ) PORT_PLAYER(1) PORT_NAME("PEN Y")
1061INPUT_PORTS_END
1062
1063
1064static SLOT_INTERFACE_START(pico_cart)
1065   SLOT_INTERFACE_INTERNAL("rom",  MD_STD_ROM)
1066   SLOT_INTERFACE_INTERNAL("rom_sram",  MD_ROM_SRAM)   // not sure these are needed...
1067   SLOT_INTERFACE_INTERNAL("rom_sramsafe",  MD_ROM_SRAM)   // not sure these are needed...
1068SLOT_INTERFACE_END
1069
1070MACHINE_START_MEMBER(pico_state,pico)
1071{
1072   m_io_page = ioport("PAGE");
1073   m_io_pad = ioport("PAD");
1074   m_io_penx = ioport("PENX");
1075   m_io_peny = ioport("PENY");
1076
1077   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x000000, 0x7fffff, read16_delegate(FUNC(base_md_cart_slot_device::read),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write),(base_md_cart_slot_device*)m_picocart));
1078   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa13000, 0xa130ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a13),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a13),(base_md_cart_slot_device*)m_picocart));
1079   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xa15000, 0xa150ff, read16_delegate(FUNC(base_md_cart_slot_device::read_a15),(base_md_cart_slot_device*)m_picocart), write16_delegate(FUNC(base_md_cart_slot_device::write_a15),(base_md_cart_slot_device*)m_picocart));
1080   m_maincpu->space(AS_PROGRAM).install_write_handler(0xa14000, 0xa14003, write16_delegate(FUNC(base_md_cart_slot_device::write_tmss_bank),(base_md_cart_slot_device*)m_picocart));
1081}
1082
1083static MACHINE_CONFIG_START( pico, pico_state )
1084   MCFG_FRAGMENT_ADD( md_ntsc )
1085
1086   MCFG_CPU_MODIFY("maincpu")
1087   MCFG_CPU_PROGRAM_MAP(pico_mem)
1088
1089   MCFG_DEVICE_REMOVE("genesis_snd_z80")
1090
1091   MCFG_MACHINE_START_OVERRIDE( pico_state, pico )
1092   MCFG_MACHINE_RESET_OVERRIDE( pico_state, ms_megadriv )
1093
1094   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL)
1095   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
1096MACHINE_CONFIG_END
1097
1098static MACHINE_CONFIG_START( picopal, pico_state )
1099   MCFG_FRAGMENT_ADD( md_pal )
1100
1101   MCFG_CPU_MODIFY("maincpu")
1102   MCFG_CPU_PROGRAM_MAP(pico_mem)
1103
1104   MCFG_DEVICE_REMOVE("genesis_snd_z80")
1105
1106   MCFG_MACHINE_START_OVERRIDE( pico_state, pico )
1107   MCFG_MACHINE_RESET_OVERRIDE( pico_state, ms_megadriv )
1108
1109   MCFG_PICO_CARTRIDGE_ADD("picoslot", pico_cart, NULL)
1110   MCFG_SOFTWARE_LIST_ADD("cart_list","pico")
1111MACHINE_CONFIG_END
1112
1113
1114
1115ROM_START( pico )
1116   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
1117   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
1118ROM_END
1119
1120ROM_START( picou )
1121   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
1122   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
1123ROM_END
1124
1125ROM_START( picoj )
1126   ROM_REGION(MD_CPU_REGION_SIZE, "maincpu", ROMREGION_ERASEFF)
1127   ROM_REGION( 0x10000, "soundcpu", ROMREGION_ERASEFF)
1128ROM_END
1129
1130831/***************************************************************************
1131832
1132833  Game driver(s)
r24838r24839
1160861CONS( 1994, multmega,   cdx,       0,      md_scd,          md, md_cons_state,     md_eur,    "Sega",   "Multi-Mega (Europe, PAL)", GAME_NOT_WORKING )
1161862CONS( 1994, 32x_scd,    0,         0,      genesis_32x_scd, md, md_cons_state,     genesis,   "Sega",   "Sega CD (USA, NTSC, w/32X)", GAME_NOT_WORKING )
1162863
1163// this is a standalone system based on the md-like hardware (same vdp etc.)
1164
1165CONS( 1994, pico,       0,         0,      picopal,         pico, md_cons_state,   md_eur,    "Sega",   "Pico (Europe, PAL)", 0)
1166CONS( 1994, picou,      pico,      0,      pico,            pico, md_cons_state,   genesis,   "Sega",   "Pico (USA, NTSC)", 0)
1167CONS( 1993, picoj,      pico,      0,      pico,            pico, md_cons_state,   md_jpn,    "Sega",   "Pico (Japan, NTSC)", 0)
trunk/src/mess/machine/md_slot.c
r24838r24839
5151
5252const device_type MD_CART_SLOT = &device_creator<md_cart_slot_device>;
5353const device_type PICO_CART_SLOT = &device_creator<pico_cart_slot_device>;
54const device_type COPERA_CART_SLOT = &device_creator<copera_cart_slot_device>;
5455
55
5656//**************************************************************************
5757//    MD cartridges Interface
5858//**************************************************************************
r24838r24839
184184{
185185}
186186
187copera_cart_slot_device::copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
188                  base_md_cart_slot_device(mconfig, COPERA_CART_SLOT, "Copera Cartridge Slot", tag, owner, clock, "copera_cart_slot", __FILE__)
189{
190}
191
187192//-------------------------------------------------
188193//  base_md_cart_slot_device - destructor
189194//-------------------------------------------------
trunk/src/mess/machine/md_slot.h
r24838r24839
220220   virtual const char *file_extensions() const { return "bin,md"; }
221221};
222222
223// ======================> copera_cart_slot_device
223224
225class copera_cart_slot_device :  public base_md_cart_slot_device
226{
227public:
228   // construction/destruction
229   copera_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
230   virtual const char *image_interface() const { return "copera_cart"; }
231   virtual const char *file_extensions() const { return "bin,md"; }
232};
233
234
224235// device type definition
225236extern const device_type MD_CART_SLOT;
226237extern const device_type PICO_CART_SLOT;
238extern const device_type COPERA_CART_SLOT;
227239
228240
229241/***************************************************************************
r24838r24839
238250   MCFG_DEVICE_ADD(_tag, PICO_CART_SLOT, 0) \
239251   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
240252
253#define MCFG_COPERA_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \
254   MCFG_DEVICE_ADD(_tag, COPERA_CART_SLOT, 0) \
255   MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false)
256
257
258
241259#define MCFG_MD_CARTRIDGE_NOT_MANDATORY                                     \
242260   static_cast<md_cart_slot_device *>(device)->set_must_be_loaded(FALSE);
243261

Previous 199869 Revisions Next


© 1997-2024 The MAME Team