Previous 15994 Revisions Next

r5722 Sunday 13th September, 2009 at 23:15:15 UTC by R. Belmont
Added 3 skeletons in various stages of operation: Ensoniq ESQ-1 synthesizer,
Game Park GP32 handheld, and Game Park Holdings GP2X handheld.
[docs]messnew.txt
[src/mess]mess.mak messdriv.c
[src/mess/drivers]esq1.c* gp2x.c* gp32.c*

src/mess/messdriv.c
r5721r5722
149149//  DRIVER( mtc9016 )   /* 1978 Mustang 9016 Telespiel Computer             */
150150//  DRIVER( shmc1200 )
151151
152    /* ENSONIQ */
153    DRIVER( esq1 )   /* 1986 ESQ-1 Digital Wave Synthesizer */
154
152155    /* FAIRCHILD */
153156    DRIVER( channelf )  /* Fairchild Channel F VES - 1976                   */
154157    DRIVER( sabavdpl )  /* SABA Videoplay - 1977 (PAL)                      */
r5721r5722
177180    DRIVER( arcadia )   /* Emerson Arcadia 2001                             */
178181    DRIVER( vcg )       /* Palladium Video-Computer-Game                    */
179182
183    /* GAME PARK */
184    DRIVER( gp32 )   /* GP32 2001 */
185    DRIVER( gp2x )   /* GP2X 2005 */
186
180187    /* GCE */
181188    DRIVER( vectrex )   /* General Consumer Electric Vectrex - 1982-1984    */
182189                        /* (aka Milton-Bradley Vectrex)                     */
src/mess/mess.mak
r5721r5722
281281   $(MESSOBJ)/einis.a \
282282   $(MESSOBJ)/elektor.a \
283283   $(MESSOBJ)/elektrka.a \
284   $(MESSOBJ)/ensoniq.a \
284285   $(MESSOBJ)/entex.a \
285286   $(MESSOBJ)/epoch.a \
286287   $(MESSOBJ)/epson.a \
r5721r5722
289290   $(MESSOBJ)/fairch.a \
290291   $(MESSOBJ)/fujitsu.a \
291292   $(MESSOBJ)/galaxy.a \
293   $(MESSOBJ)/gamepark.a \
292294   $(MESSOBJ)/gce.a \
293295   $(MESSOBJ)/grundy.a \
294296   $(MESSOBJ)/hartung.a \
r5721r5722
807809$(MESSOBJ)/elektor.a:         \
808810   $(MESS_DRIVERS)/ec65.o      \
809811   $(MESS_DRIVERS)/junior.o   \
812
813$(MESSOBJ)/ensoniq.a:            \
814   $(MESS_DRIVERS)/esq1.o   \
810815   
811816$(MESSOBJ)/entex.a:            \
812817   $(MESS_VIDEO)/advision.o   \
r5721r5722
852857   $(MESS_MACHINE)/galaxy.o   \
853858   $(MESS_FORMATS)/gtp_cas.o   \
854859
860$(MESSOBJ)/gamepark.a:         \
861   $(MESS_DRIVERS)/gp32.o      \
862   $(MESS_DRIVERS)/gp2x.o      \
863
855864$(MESSOBJ)/gce.a:                 \
856865   $(MESS_DRIVERS)/vectrex.o   \
857866   $(MESS_VIDEO)/vectrex.o      \
src/mess/drivers/gp2x.c
r0r5722
1/**************************************************************************
2 *
3 * gp2x.c - Game Park Holdings GP2X
4 * Skeleton by R. Belmont
5 *
6 * CPU: MagicEyes MP2520F SoC
7 * MP2520F consists of:
8 *    ARM920T CPU core + MMU
9 *    ARM940T slave CPU w/o MMU
10 *    LCD controller
11 *    DMA controller
12 *    Interrupt controller
13 *    NAND flash interface
14 *    MMC/SD Card interface
15 *    USB controller
16 *    and more.
17 *
18 **************************************************************************/
19
20#include "driver.h"
21#include "video/generic.h"
22#include "cpu/arm7/arm7.h"
23
24static UINT32 *gp2x_ram;
25
26static UINT16 gp2x_vidregs[0x200/2];
27#if 0
28static const char* gp2x_regnames[0x200] =
29{
30   "DPC Control",
31   "PAD Control",
32   "PAD Polarity Control 1",
33   "PAD Polarity Control 2",
34   "PAD Polarity Control 3",
35   "PAD Enable Control 1",
36   "PAD Enable Control 2",
37   "PAD Enable Control 3",
38   "",
39   "",
40   "",
41   "Active width",   
42   "Active height",
43   "HSYNC width",
44   "HSYNC start",
45   "HSYNC end",
46   "VSYNC control",    // 20
47   "VSYNC end",
48   "",
49   "DE Control",
50   "S Control",
51   "FG Control",
52   "LP Control",
53   "CLKV Control",
54   "CLKV Control 2",   // 30
55   "POL Control",
56   "CIS Sync Control",
57   "",
58   "",
59   "Luma blank level",
60   "Chroma blank level",
61   "Luma pos sync",
62   "Luma neg sync",   // 40
63   "Chroma pos sync",
64   "Chroma neg sync",
65   "Interrupt control",
66   "Clock control",
67   "",
68   "",
69   "",
70   "",         // 50
71   "",
72   "",
73   "",
74   "",
75   "",
76   "",
77   "",
78   "",         // 60
79   "",
80   "",
81   "",
82   "",
83   "",
84   "",
85   "",
86   "",         // 70
87   "",
88   "",
89   "",
90   "",
91   "",
92   "",
93   "",
94   "Overlay control",   // 80
95   "Image effect",
96   "Image control",
97   "Scale factor A top",
98   "Scale factor A bottom",
99   "Scale factor A top 2 H",
100   "Scale factor A top 2 L",
101   "Scale factor A bottom 2 H",
102   "Scale factor A bottom 2 L",   // 90
103   "Width region A top",
104   "Width region A bottom",
105   "H Offset region A",
106   "H Offset region A 2",
107   "V Start region A",
108   "V End region A top",
109   "V End region A bottom",
110   "YUV Source region A L",   // a0
111   "YUV Source region A H",   
112};
113#endif
114static VIDEO_UPDATE( gp2x )
115{
116   // display enabled?
117   if (gp2x_vidregs[0] & 1)
118   {
119      // only support RGB still image layer for now
120      if (gp2x_vidregs[0x80/2] & 4)
121      {
122         int x, y;
123         UINT16 *vram = (UINT16 *)&gp2x_ram[0x2100000/4];
124
125/*         printf("RGB still image 1 enabled, bpp %d, size is %d %d %d %d\n",
126            (gp2x_vidregs[(0xda/2)]>>9)&3,
127            gp2x_vidregs[(0xe2/2)],
128            gp2x_vidregs[(0xe4/2)],
129            gp2x_vidregs[(0xe6/2)],
130            gp2x_vidregs[(0xe8/2)]);*/
131
132
133         for (y = 0; y < 240; y++)
134         {
135            UINT32 *scanline = BITMAP_ADDR32(bitmap, y, 0);
136
137            for (x = 0; x < 320; x++)
138            {
139               UINT16 pixel = vram[(320*y)+x];
140
141               *scanline++ = MAKE_ARGB(0xff, (pixel>>11)<<3, ((pixel>>5)&0x3f)<<2, (pixel&0x1f)<<3);
142            }
143         }
144      }
145   }
146
147   return 0;
148}
149
150static READ32_HANDLER( gp2x_lcdc_r )
151{
152   return gp2x_vidregs[offset*2] | gp2x_vidregs[(offset*2)+1]<<16;
153}
154
155static WRITE32_HANDLER( gp2x_lcdc_w )
156{
157   if (mem_mask == 0xffff)
158   {
159      gp2x_vidregs[offset*2] = data;
160//      printf("%x to video reg %x (%s)\n", data, offset*2, gp2x_regnames[offset*2]);
161   }
162   else if (mem_mask == 0xffff0000)
163   {
164      gp2x_vidregs[(offset*2)+1] = data>>16;
165//      printf("%x to video reg %x (%s)\n", data>>16, (offset*2)+1, gp2x_regnames[(offset*2)+1]);
166   }
167   else
168   {
169      logerror("GP2X LCDC: ERROR: write %x to vid reg @ %x mask %08x\n", data, offset, mem_mask);
170   }
171}
172
173static UINT32 nand_ptr = 0, nand_cmd, nand_subword_stage;
174static UINT32 nand_stage = 0, nand_ptr_temp = 0;
175static READ32_HANDLER(nand_r)
176{
177   UINT32 *ROM = (UINT32 *)memory_region(space->machine, "maincpu");
178   UINT32 ret;
179
180   if (offset == 0)
181   {
182      switch (nand_cmd)
183      {
184         case 0:
185            if (mem_mask == 0xffffffff)
186            {
187               return ROM[nand_ptr++];
188            }
189            else if (mem_mask == 0x000000ff)     // byte-wide reads?
190            {
191               switch (nand_subword_stage++)
192               {
193                  case 0:
194                     return ROM[nand_ptr];
195                  case 1:
196                     return ROM[nand_ptr]>>8;
197                  case 2:
198                     return ROM[nand_ptr]>>16;
199                  case 3:
200                     ret = ROM[nand_ptr]>>24;
201                     nand_subword_stage = 0;
202                     nand_ptr++;
203                     return ret;
204                  default:
205                     logerror("Bad nand_subword_stage = %d\n", nand_subword_stage);
206                     break;
207               }
208            }
209            break;
210
211         case 0x50:   // read out-of-band data
212            return 0xff;
213
214         case 0x90:   // read ID
215            switch (nand_stage++)
216            {   
217               case 0:
218                  return 0xec;   // Samsung
219               case 1:
220                  return 0x76;   // 64MB
221            }
222            break;
223
224         default:
225            logerror("NAND: read unk command %x (PC %x)\n", nand_cmd, cpu_get_pc(space->cpu));
226            break;
227      }
228   }
229
230//   printf("Read unknown nand offset %x\n", offset);
231
232   return 0;
233}
234
235static WRITE32_HANDLER(nand_w)
236{
237   switch (offset)
238   {
239      case 4:   // command
240         nand_cmd = data;
241//         printf("NAND: command %x (PC %x0)\n", data, cpu_get_pc(space->cpu));
242         nand_stage = 0;
243         nand_subword_stage = 0;
244         break;
245
246      case 6:   // address
247         if (nand_cmd == 0)
248         {
249            switch (nand_stage)
250            {
251               case 0:
252                  nand_ptr_temp &= ~0xff;
253                  nand_ptr_temp |= data;
254                  break;
255               case 1:
256                  nand_ptr_temp &= ~0xff00;
257                  nand_ptr_temp |= data<<8;
258                  break;
259               case 2:
260                  nand_ptr_temp &= ~0xff0000;
261                  nand_ptr_temp |= data<<16;
262                  break;
263               case 3:
264                  nand_ptr_temp &= ~0xff000000;
265                  nand_ptr_temp |= data<<24;
266
267//                  printf("NAND: ptr now %x, /2 %x, replacing %x\n", nand_ptr_temp, nand_ptr_temp/2, nand_ptr);
268                  nand_ptr = nand_ptr_temp/2;
269                  break;
270            }
271            nand_stage++;
272         }
273         break;
274
275      default:
276         logerror("nand_w: %x to unknown offset %x\n", data, offset);
277         break;
278   }
279}
280
281static READ32_HANDLER(tx_status_r)
282{
283   return 0x6;   // tx ready, tx empty
284}
285
286static WRITE32_HANDLER(tx_xmit_w)
287{
288   printf("%c", data&0xff);
289}
290
291static UINT32 timer = 0;
292static READ32_HANDLER(timer_r)
293{
294   return timer++;
295}
296
297static READ32_HANDLER(nand_ctrl_r)
298{
299   return 0x8000<<16;      // timed out
300}
301
302static WRITE32_HANDLER(nand_ctrl_w)
303{
304//   printf("%08x to nand_ctrl_w\n", data);
305}
306
307static READ32_HANDLER(sdcard_r)
308{
309   return 0xffff<<16;   // at 3e146b0 - indicate timeout & CRC error
310}
311
312static ADDRESS_MAP_START( gp2x_map, ADDRESS_SPACE_PROGRAM, 32 )
313   AM_RANGE(0x00000000, 0x00007fff) AM_ROM
314   AM_RANGE(0x01000000, 0x04ffffff) AM_RAM   AM_BASE(&gp2x_ram) // 64 MB of RAM
315   AM_RANGE(0x9c000000, 0x9c00001f) AM_READWRITE(nand_r, nand_w)
316   AM_RANGE(0xc0000a00, 0xc0000a03) AM_READ(timer_r)
317   AM_RANGE(0xc0001208, 0xc000120b) AM_READ(tx_status_r)
318   AM_RANGE(0xc0001210, 0xc0001213) AM_WRITE(tx_xmit_w)
319   AM_RANGE(0xc0001508, 0xc000150b) AM_READ(sdcard_r)
320   AM_RANGE(0xc0002800, 0xc00029ff) AM_READWRITE(gp2x_lcdc_r, gp2x_lcdc_w)
321   AM_RANGE(0xc0003a38, 0xc0003a3b) AM_READWRITE(nand_ctrl_r, nand_ctrl_w)
322ADDRESS_MAP_END
323
324static INPUT_PORTS_START( gp2x )
325INPUT_PORTS_END
326
327static MACHINE_DRIVER_START( gp2x )
328   MDRV_CPU_ADD("maincpu", ARM9, 80000000)
329   MDRV_CPU_PROGRAM_MAP(gp2x_map)
330
331   MDRV_PALETTE_LENGTH(32768)
332
333   MDRV_SCREEN_ADD("screen", RASTER)
334   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
335   MDRV_SCREEN_REFRESH_RATE(60)
336   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
337   MDRV_SCREEN_SIZE(320, 240)
338   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
339
340   MDRV_VIDEO_UPDATE(gp2x)
341
342   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
343MACHINE_DRIVER_END
344
345ROM_START(gp2x)
346   ROM_REGION( 0x600000, "maincpu", 0 )   // contents of NAND flash
347        ROM_LOAD( "gp2xboot.img", 0x000000, 0x05b264, CRC(9d82937e) SHA1(9655f04c11f78526b3b8a4613897070df3119ead) )
348        ROM_LOAD( "gp2xkernel.img", 0x080000, 0x09a899, CRC(e272eac9) SHA1(9d814ad6c27d22812ba3f101a7358698d1b035eb) )
349   ROM_LOAD( "gp2xsound.wav", 0x1a0000, 0x03a42c, CRC(b6ac0ade) SHA1(32362ebbcd09a3b15e164ec3fbd2a8f11159bcd7) )
350ROM_END
351
352ROM_START(gp2x3)
353   ROM_REGION( 0x600000, "maincpu", ROMREGION_ERASEFF )   // contents of NAND flash
354   ROM_LOAD( "gp2xboot.img", 0x000000, 0x05b264, CRC(ab1fc556) SHA1(2ce66fec325b6e8e29f540322aefb435d8e3baf0) )
355   ROM_LOAD( "gp2xkernel.img", 0x080000, 0x09f047, CRC(6f8922ae) SHA1(0f44204757f9251c7d68560ff31a1ce72f16698e) )
356   ROM_LOAD( "gp2xsound.wav", 0x1a0000, 0x03a42c, CRC(b6ac0ade) SHA1(32362ebbcd09a3b15e164ec3fbd2a8f11159bcd7) )
357   ROM_LOAD( "gp2xyaffs.img", 0x300000, 0x2ec4d0, CRC(f81a4a57) SHA1(73bb84798ad3a4e281612a47abb2da4772cbe6cd) )
358ROM_END
359
360ROM_START(gp2x4)
361   ROM_REGION( 0x600000, "maincpu", 0 )   // contents of NAND flash
362        ROM_LOAD( "gp2xboot.img", 0x000000, 0x05b264, CRC(160af379) SHA1(0940fc975960fa52f32a9258a9480cc5cb1140e2) )
363        ROM_LOAD( "gp2xkernel.img", 0x080000, 0x0a43a8, CRC(77b1cf9c) SHA1(7e759e4581399bfbee982e1b6c3b54a10b0e9c3d) )
364        ROM_LOAD( "gp2xsound.wav", 0x1a0000, 0x03a42c, CRC(b6ac0ade) SHA1(32362ebbcd09a3b15e164ec3fbd2a8f11159bcd7) )
365        ROM_LOAD( "gp2xyaffs.img", 0x300000, 0x2dfed0, CRC(e77efc53) SHA1(21477ff77aacb84005bc465a03066d71031a6098) )
366ROM_END
367
368CONS(2005, gp2x,  0,    0, gp2x, gp2x, 0, 0, "Game Park Holdings", "GP2X 2.0", GAME_NOT_WORKING|GAME_NO_SOUND)
369CONS(2005, gp2x3, gp2x, 0, gp2x, gp2x, 0, 0, "Game Park Holdings", "GP2X 3.0", GAME_NOT_WORKING|GAME_NO_SOUND)
370CONS(2005, gp2x4, gp2x, 0, gp2x, gp2x, 0, 0, "Game Park Holdings", "GP2X 4.0", GAME_NOT_WORKING|GAME_NO_SOUND)
371
372
src/mess/drivers/esq1.c
r0r5722
1/***************************************************************************
2
3    drivers/esq1.c
4
5    Ensoniq ESQ-1 and SQ-80 Digital Wave Synthesizers
6    Preliminary driver by R. Belmont
7
8   Map for ESQ-1:
9   0000-1fff: OS RAM
10   2000-3fff: Cartridge
11   4000-5fff: SEQRAM
12   6000-63ff: ES5503 DOC
13   6400-67ff: MC2681 DUART
14   6800-6fff: AD7524 (CV_MUX)
15   7000-7fff: OS ROM low (banked)
16   8000-ffff: OS ROM high (fixed)
17
18   Map for SQ-80:
19   0000-1fff: OS RAM
20   2000-3fff: Cartridge
21   4000-5fff: DOSRAM or SEQRAM (banked)
22   6000-63ff: ES5503 DOC
23   6400-67ff: MC2681 DUART
24   6800-6bff: AD7524 (CV_MUX)
25   6c00-6dff: Mapper (bit 0 only - determines DOSRAM or SEQRAM at 4000)
26   6e00-6fff: WD1772 FDC (not present on ESQ1)
27   7000-7fff: OS ROM low (banked)
28   8000-ffff: OS ROM high (fixed)
29
30   CV_MUX area:
31   write to        output goes to
32   $68f8    $00    D/A converter
33   $68f0    -$08    Filter Frequency (FF)
34   $68e8    -$10    Filter Resonance (Q)
35   $68d8    -$20    Final DCA (ENV4)
36   $68b8    -$40    Panning (PAN)
37   $6878    -$80    Floppy (Motor/LED on)
38
39If SEQRAM is mapped at 4000, DUART port 2 determines the 32KB "master bank" and ports 0 and 1
40determine which of the 4 8KB "sub banks" is visible.
41
42Output ports 3 to 1 determine the 4kB page which should be shown at $7000 to $7fff.
43
44IRQ sources are the DUART and the DRQ line from the FDC (SQ-80 only).
45NMI is from the IRQ line on the FDC (again, SQ-80 only).
46
47TODO:
48   - Actual 2681 DUART emulation
49   - VFD display
50   - Keyboard
51   - Analog filters and VCA on the back end of the 5503
52   - SQ-80 support (additional banking, FDC)
53
54***************************************************************************/
55
56#include "driver.h"
57#include "cpu/m6809/m6809.h"
58#include "sound/es5503.h"
59
60static UINT8 uart_regs[0x10];
61static UINT8 uart_outputport;
62
63void esq1_doc_irq(const device_config *device, int state)
64{
65}
66
67static READ8_DEVICE_HANDLER( esq1_adc_read )
68{
69   return 0x80;
70}
71
72static const es5503_interface esq1_es5503_interface =
73{
74   esq1_doc_irq,
75   esq1_adc_read,
76   NULL
77};
78
79static VIDEO_START( esq1 )
80{
81}
82
83static VIDEO_UPDATE( esq1 )
84{
85   return 0;
86}
87
88static MACHINE_RESET( esq1 )
89{
90   es5503_set_base(devtag_get_device(machine, "es5503"), memory_region(machine, "ensoniq"));
91
92   // set default OSROM banking
93   memory_set_bankptr(machine, 1, memory_region(machine, "osrom") );
94}
95
96static void recalc_osrom_bank(running_machine *machine)
97{
98   int bank = ((uart_outputport >> 1) & 0x7) ^ 7;
99
100//   printf("bank %d => offset %x (PC=%x)\n", bank, bank * 0x1000, cpu_get_pc(machine->cpu[0]));
101   memory_set_bankptr(machine, 1, memory_region(machine, "osrom") + (bank * 0x1000) );
102}
103
104static READ8_HANDLER( uart_r )
105{
106//   printf("Read UART @ %x\n", offset);
107
108   switch (offset)
109   {
110      case 5:   // interrupt status
111         return 0x08;   // timer/counter expire
112         break;
113   }
114
115   return 0;
116}
117
118static WRITE8_HANDLER( uart_w )
119{
120   uart_regs[offset] = data;
121
122//   printf("%x to UART %x\n", data, offset);
123
124   switch (offset)
125   {
126      case 0xb:
127//         printf("%02x to 6500\n", data);
128         break;
129
130      case 0xe:   // set output port bits
131         uart_outputport |= data;
132         recalc_osrom_bank(space->machine);
133         break;
134
135      case 0xf:   // reset output port bits
136         uart_outputport &= ~data;
137         recalc_osrom_bank(space->machine);
138         break;
139   }
140}
141
142static ADDRESS_MAP_START( esq1_map, ADDRESS_SPACE_PROGRAM, 8 )
143   AM_RANGE(0x0000, 0x1fff) AM_RAM               // OSRAM
144   AM_RANGE(0x4000, 0x5fff) AM_RAM               // SEQRAM
145   AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("es5503", es5503_r, es5503_w)
146   AM_RANGE(0x6400, 0x640f) AM_READWRITE( uart_r, uart_w )
147   AM_RANGE(0x7000, 0x7fff) AM_ROMBANK(1)
148   AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("osrom", 0x8000)   // OS "high" ROM is always mapped here
149ADDRESS_MAP_END
150
151static INTERRUPT_GEN( esq1_interrupt )
152{
153   cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
154}
155
156static MACHINE_DRIVER_START( esq1 )
157   MDRV_CPU_ADD("maincpu", M6809E, 4000000)   // how fast is it?
158   MDRV_CPU_PROGRAM_MAP(esq1_map)
159   MDRV_CPU_VBLANK_INT("screen", esq1_interrupt)
160
161   MDRV_MACHINE_RESET( esq1 )
162
163   MDRV_SCREEN_ADD("screen", RASTER)
164   MDRV_SCREEN_REFRESH_RATE(60)
165   MDRV_VIDEO_START(esq1)
166   MDRV_VIDEO_UPDATE(esq1)
167   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
168   MDRV_SCREEN_SIZE(320, 240)
169   MDRV_SCREEN_VISIBLE_AREA(0, 319, 1, 239)
170
171   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
172   MDRV_SOUND_ADD("es5503", ES5503, 7000000)
173   MDRV_SOUND_CONFIG(esq1_es5503_interface)
174   MDRV_SOUND_ROUTE(0, "lspeaker", 1.0)
175   MDRV_SOUND_ROUTE(1, "rspeaker", 1.0)
176MACHINE_DRIVER_END
177
178static INPUT_PORTS_START( esq1 )
179INPUT_PORTS_END
180
181ROM_START( esq1 )
182   ROM_REGION(0x10000, "osrom", 0)
183        ROM_LOAD( "3p5lo.bin",    0x0000, 0x8000, CRC(ed001ad8) SHA1(14d1150bccdbc15d90567cf1812aacdb3b6ee882) )
184        ROM_LOAD( "3p5hi.bin",    0x8000, 0x8000, CRC(332c572f) SHA1(ddb4f62807eb2ab29e5ac6b5d209d2ecc74cf806) )
185
186   ROM_REGION(0x20000, "ensoniq", 0)
187        ROM_LOAD( "esq1wavlo.bin", 0x0000, 0x8000, CRC(4d04ac87) SHA1(867b51229b0a82c886bf3b216aa8893748236d8b) )
188        ROM_LOAD( "esq1wavhi.bin", 0x8000, 0x8000, CRC(94c554a3) SHA1(ed0318e5253637585559e8cf24c06d6115bd18f6) )
189ROM_END
190
191CONS( 1987, esq1, 0, 0, esq1, esq1, 0, 0, "Ensoniq", "ESQ-1", GAME_NOT_WORKING )
192
193/*
194
1957 to UART 6                counter/timer upper
196d0 to UART 7               counter/timer lower                                                 
19760 to UART 4               aux control (C/T timer mode using external clock)
19820 to UART a               command register B                                                 
19930 to UART a               command register B                                                 
20010 to UART a               command register B                                                 
20113 to UART 8               mode register B => 8 bits no parity
202f to UART 8                mode register B => force odd parity, 8 bits (?)                                               
203ee to UART 9               clock select register B
2045 to UART a                command register B (Enable Tx/Enable Rx)
205e7 to UART b               Tx holding register B (send E7 to display)
2060 to UART d                output port config (all bits are output ports)
207ab to UART 5               interrupt mask register (input port change, RxRdyB, counter ready, RxReadyA, TxReadyA)
208
209*/
210
src/mess/drivers/gp32.c
r0r5722
1/**************************************************************************
2 *
3 * gp32.c - Game Park GP32
4 * Skeleton by R. Belmont
5 *
6 * CPU: Samsung S3C2400X01 SoC
7 * S3C2400X01 consists of:
8 *    ARM920T CPU core + MMU
9 *    LCD controller
10 *    DMA controller
11 *    Interrupt controller
12 *    USB controller
13 *    and more.
14 *
15 **************************************************************************/
16
17#include "driver.h"
18#include "video/generic.h"
19#include "cpu/arm7/arm7.h"
20
21static UINT32 s3c240x_vidregs[0x400/4];
22
23static UINT32 *s3c240x_ram;
24
25static VIDEO_UPDATE( gp32 )
26{
27   if (s3c240x_vidregs[0] & 1)   // display enabled?
28   {
29      int x, y;
30      UINT8 *vram;
31      UINT32 vramaddr = s3c240x_vidregs[5];
32
33      // get offset
34      vramaddr = (vramaddr & 0x1fffff);
35      vramaddr |= (s3c240x_vidregs[5]&0xffe00000)<<1;
36
37      vram = (UINT8 *)&s3c240x_ram[(vramaddr-0x0c000000)/4];
38
39      for (y = 0; y < 240; y++)
40      {
41         UINT16 *scanline = BITMAP_ADDR16(bitmap, y, 0);
42         
43         for (x = 0; x < 320; x++)
44         {
45            *scanline++ = vram[(160*y)+x];
46         }
47      }
48   }
49
50   return 0;
51}
52
53static READ32_HANDLER(s3c240x_vidregs_r)
54{
55   // make sure line counter is going
56   s3c240x_vidregs[0] &= 0x3ffff;
57   s3c240x_vidregs[0] |= (240-video_screen_get_vpos(space->machine->primary_screen))<<18;
58
59   return s3c240x_vidregs[offset];
60}
61
62static WRITE32_HANDLER(s3c240x_vidregs_w)
63{
64   COMBINE_DATA(&s3c240x_vidregs[offset]);
65}
66
67static WRITE32_HANDLER(s3c240x_palette_w)
68{
69   if (mem_mask != 0xffffffff)
70   {
71      printf("s3c240x_palette_w: unknown mask %08x\n", mem_mask);
72   }
73
74   palette_set_color_rgb(space->machine, offset, ((data>>11)&0x1f)<<3, ((data>>5)&0x3f)<<2, (data&0x1f)<<3);
75}
76
77static UINT32 s3c240x_irq_regs[0x18/4];
78static READ32_HANDLER(s3c240x_irq_r)
79{
80   return s3c240x_irq_regs[offset];
81}
82
83static WRITE32_HANDLER(s3c240x_irq_w)
84{
85//   printf("%08x to interrupt controller @ 0x144000%02x\n", data, offset<<2);
86
87   COMBINE_DATA(&s3c240x_irq_regs[offset]);
88}
89
90#if 0
91static const char *timer_reg_names[] =
92{
93   "Timer config 0",
94   "Timer config 1",
95   "Timer control",
96   "Timer count buffer 0",
97   "Timer compare buffer 0",
98   "Timer count observation 0",
99   "Timer count buffer 1",
100   "Timer compare buffer 1",
101   "Timer count observation 1",
102   "Timer count buffer 2",
103   "Timer compare buffer 2",
104   "Timer count observation 2",
105   "Timer count buffer 3",
106   "Timer compare buffer 3",
107   "Timer count observation 3",
108   "Timer count buffer 4",
109   "Timer compare buffer 4",
110   "Timer count observation 4",
111};
112#endif
113
114static emu_timer *s3c240x_timers[5];
115static UINT32 s3c240x_timer_regs[0x44/4];
116static READ32_HANDLER(s3c240x_timer_r)
117{
118   return s3c240x_timer_regs[offset];
119}
120
121static void s3c240x_timer_recalc(running_machine *machine, int timer, UINT32 ctrl_bits, UINT32 count_reg)
122{
123   if (ctrl_bits & 1)   // timer start?
124   {
125//      printf("starting timer %d\n", timer);
126   }
127   else   // stopping is easy
128   {
129//      printf("stopping timer %d\n", timer);
130      timer_adjust_oneshot(s3c240x_timers[timer], attotime_never, 0);
131   }   
132}
133
134static WRITE32_HANDLER(s3c240x_timer_w)
135{
136   UINT32 old_value = s3c240x_timer_regs[offset];
137
138//   printf("%08x to timer @ 0x151000%02x (%s)\n", data, offset<<2, timer_reg_names[offset]);
139
140   COMBINE_DATA(&s3c240x_timer_regs[offset]);
141
142   if (offset == 2)   // TCON
143   {
144      if ((data & 1) != (old_value & 1))   // timer 0 status change
145      {
146         s3c240x_timer_recalc(space->machine, 0, data&0xf, 0xc);
147      }
148
149      if ((data & 0x100) != (old_value & 0x100))   // timer 1 status change
150      {
151         s3c240x_timer_recalc(space->machine, 1, (data>>8)&0xf, 0x18);
152      }
153
154      if ((data & 0x1000) != (old_value & 0x1000))   // timer 2 status change
155      {
156         s3c240x_timer_recalc(space->machine, 2, (data>>12)&0xf, 0x24);
157      }
158     
159      if ((data & 0x10000) != (old_value & 0x10000))   // timer 3 status change
160      {
161         s3c240x_timer_recalc(space->machine, 3, (data>>16)&0xf, 0x30);
162      }
163
164      if ((data & 0x100000) != (old_value & 0x100000))   // timer 4 status change
165      {
166         s3c240x_timer_recalc(space->machine, 4, (data>>20)&0xf, 0x3c);
167      }
168   }
169}
170
171static TIMER_CALLBACK( s3c240x_timer_exp )
172{
173   int ch = param;
174
175   timer_adjust_oneshot(s3c240x_timers[ch], attotime_never, 0);
176}
177
178static void s3c240x_machine_start(running_machine *machine)
179{
180   s3c240x_timers[0] = timer_alloc(machine, s3c240x_timer_exp, (void *)(FPTR)0);
181   s3c240x_timers[1] = timer_alloc(machine, s3c240x_timer_exp, (void *)(FPTR)1);
182   s3c240x_timers[2] = timer_alloc(machine, s3c240x_timer_exp, (void *)(FPTR)2);
183   s3c240x_timers[3] = timer_alloc(machine, s3c240x_timer_exp, (void *)(FPTR)3);
184   s3c240x_timers[4] = timer_alloc(machine, s3c240x_timer_exp, (void *)(FPTR)4);
185}
186
187static UINT32 s3c240x_gpio[0x60/4];
188
189static READ32_HANDLER( s3c240x_gpio_r )
190{
191//   printf("read GPIO @ 0x156000%02x (PC %x)\n", offset*4, cpu_get_pc(space->cpu));
192
193   return s3c240x_gpio[offset];
194}
195
196static WRITE32_HANDLER( s3c240x_gpio_w )
197{
198   COMBINE_DATA(&s3c240x_gpio[offset]);
199
200//   printf("%08x to GPIO @ 0x156000%02x (PC %x)\n", data, offset*4, cpu_get_pc(space->cpu));
201
202//   if (offset == 0x30/4) printf("[%08x] %s %s\n", data, (data & 0x200) ? "SCL" : "scl", (data & 0x400) ? "SDL" : "sdl");
203}
204
205static ADDRESS_MAP_START( gp32_map, ADDRESS_SPACE_PROGRAM, 32 )
206   AM_RANGE(0x00000000, 0x0007ffff) AM_ROM
207   AM_RANGE(0x0c000000, 0x0c7fffff) AM_RAM AM_BASE(&s3c240x_ram)
208   AM_RANGE(0x14400000, 0x14400017) AM_READWRITE(s3c240x_irq_r, s3c240x_irq_w)
209   AM_RANGE(0x14a00000, 0x14a003ff) AM_READWRITE(s3c240x_vidregs_r, s3c240x_vidregs_w)
210   AM_RANGE(0x14a00400, 0x14a007ff) AM_RAM AM_BASE(&paletteram32) AM_WRITE(s3c240x_palette_w)
211   AM_RANGE(0x15100000, 0x15100043) AM_READWRITE(s3c240x_timer_r, s3c240x_timer_w)
212   AM_RANGE(0x15600000, 0x1560005b) AM_READWRITE(s3c240x_gpio_r, s3c240x_gpio_w)
213ADDRESS_MAP_END
214
215static INPUT_PORTS_START( gp32 )
216INPUT_PORTS_END
217
218static MACHINE_START( gp32 )
219{
220   s3c240x_machine_start(machine);
221}
222
223static MACHINE_DRIVER_START( gp32 )
224   MDRV_CPU_ADD("maincpu", ARM9, 40000000)
225   MDRV_CPU_PROGRAM_MAP(gp32_map)
226
227   MDRV_PALETTE_LENGTH(32768)
228
229   MDRV_SCREEN_ADD("screen", RASTER)
230   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
231   MDRV_SCREEN_REFRESH_RATE(60)
232   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
233   MDRV_SCREEN_SIZE(320, 240)
234   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 239)
235
236   MDRV_VIDEO_UPDATE(gp32)
237
238   MDRV_MACHINE_START(gp32)
239
240   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
241MACHINE_DRIVER_END
242
243ROM_START(gp32)
244   ROM_REGION( 0x80000, "maincpu", 0 )
245   ROM_LOAD( "gp32157e.bin", 0x000000, 0x080000, CRC(b1e35643) SHA1(1566bc2a27980602e9eb501cf8b2d62939bfd1e5) )
246ROM_END
247
248CONS(2001, gp32, 0, 0, gp32, gp32, 0, 0, "Game Park", "GP32", GAME_NOT_WORKING|GAME_NO_SOUND)
249
docs/messnew.txt
r5721r5722
88- Nintendo Game Boy Advance [R. Belmont, Harmony]
99- Tandy 1000RL  [Wilbert Pol]
1010- DECTalk DTC-01 [Lord Nightmare]
11- Ensoniq ESQ-1 (not working) [R. Belmont]
12- Game Park GP32 (not working) [R. Belmont]
13- Game Park Holdings GP2X (not working) [R. Belmont]
1114
1215
13
1416Systems Promoted from GAME_NOT_WORKING:
1517---------------------------------------
1618- Elektor Junior [Manfred Schneider]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team