Previous 15994 Revisions Next

r5688 Friday 11th September, 2009 at 13:10:50 UTC by Curt Coder
[VIP] Fixed VP595 frequency and VP590 color modes.
[src/mess/audio]vp550.c vp550.h vp595.c vp595.h
[src/mess/drivers]vip.c
[src/mess/includes]vip.h

src/mess/audio/vp550.c
r5687r5688
2727    PARAMETERS
2828***************************************************************************/
2929
30#define LOG 0
31
3230#define CDP1863_A_TAG   "u1"
3331#define CDP1863_B_TAG   "u2"
3432
src/mess/audio/vp550.h
r5687r5688
3131DEVICE_GET_INFO( vp550 );
3232
3333/* Q line */
34WRITE_LINE_DEVICE_HANDLER( vp550_q_w );
34WRITE_LINE_DEVICE_HANDLER( vp550_q_w ) ATTR_NONNULL(1);
3535
3636/* install write handlers */
37void vp550_install_write_handlers(const device_config *device, const address_space *program, int enabled);
37void vp550_install_write_handlers(const device_config *device, const address_space *program, int enabled) ATTR_NONNULL(1) ATTR_NONNULL(2);
3838
3939#endif /* __VP550__ */
src/mess/audio/vp595.c
r5687r5688
11/**********************************************************************
22
3   RCA VP595 - VIP Super Sound System emulation
3   RCA VP595 - VIP Simple Sound System emulation
44
55   Copyright MESS Team.
66    Visit http://mamedev.org for licensing and usage restrictions.
77
88*********************************************************************/
99
10/*
11
12   TODO:
13
14   - CDP1863 frequency?
15
16*/
17
1810#include "driver.h"
1911#include "vp595.h"
20#include "cpu/cdp1802/cdp1802.h"
2112#include "sound/cdp1863.h"
2213
2314/***************************************************************************
2415    PARAMETERS
2516***************************************************************************/
2617
27#define LOG 0
18#define CDP1863_TAG      "u1"
19#define CDP1863_XTAL   440560
2820
29#define CDP1863_TAG      "cdp1863"
30
3121/***************************************************************************
3222    TYPE DEFINITIONS
3323***************************************************************************/
r5687r5688
6757}
6858
6959/*-------------------------------------------------
60    vp595_cdp1863_w - CDP1863 latch write
61-------------------------------------------------*/
62
63static WRITE8_DEVICE_HANDLER( vp595_cdp1863_w )
64{
65   /* inject 0x80 instead of 0x00 */
66   if (data == 0) data = 0x80;
67
68   cdp1863_str_w(device, 0, data);
69}
70
71/*-------------------------------------------------
7072    vp595_install_readwrite_handler - install
7173   or uninstall write handlers
7274-------------------------------------------------*/
r5687r5688
7779
7880   if (enabled)
7981   {
80      memory_install_write8_device_handler(io, vp595->cdp1863, 0x03, 0x03, 0, 0, cdp1863_str_w);
82      memory_install_write8_device_handler(io, vp595->cdp1863, 0x03, 0x03, 0, 0, vp595_cdp1863_w);
8183   }
8284   else
8385   {
r5687r5688
9092-------------------------------------------------*/
9193
9294static MACHINE_DRIVER_START( vp595 )
93   MDRV_CDP1863_ADD(CDP1863_TAG, XTAL_3_52128MHz/2, 0)
95   MDRV_CDP1863_ADD(CDP1863_TAG, 0, 0) // TODO: clock2 should be CDP1863_XTAL
9496   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
9597MACHINE_DRIVER_END
9698
r5687r5688
103105   vp595_t *vp595 = get_safe_token(device);
104106
105107   /* look up devices */
106   vp595->cdp1863 = devtag_get_device(device->machine, "vp595:cdp1863");
108   vp595->cdp1863 = devtag_get_device(device->machine, "vp595:u1");
107109   assert(vp595->cdp1863 != NULL);
108110
109   /* register for state saving */
110//   state_save_register_global(device->machine, vp595->);
111   /* HACK workaround */
112   cdp1863_set_clk2(vp595->cdp1863, CDP1863_XTAL);
111113}
112114
113115/*-------------------------------------------------
114    DEVICE_RESET( vp595 )
115-------------------------------------------------*/
116
117static DEVICE_RESET( vp595 )
118{
119   vp595_t *vp595 = get_safe_token(device);
120
121   device_reset(vp595->cdp1863);
122}
123
124/*-------------------------------------------------
125116    DEVICE_GET_INFO( vp595 )
126117-------------------------------------------------*/
127118
r5687r5688
140131      /* --- the following bits of info are returned as pointers to data or functions --- */
141132      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(vp595);      break;
142133      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
143      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(vp595);      break;
134      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
144135
145136      /* --- the following bits of info are returned as NULL-terminated strings --- */
146137      case DEVINFO_STR_NAME:                     strcpy(info->s, "RCA VP595");            break;
src/mess/audio/vp595.h
r5687r5688
2020
2121#define VP595 DEVICE_GET_INFO_NAME(vp595)
2222
23#define MDRV_VP595_ADD(_clock) \
24   MDRV_DEVICE_ADD(VP595_TAG, VP595, _clock)
23#define MDRV_VP595_ADD \
24   MDRV_DEVICE_ADD(VP595_TAG, VP595, 0)
2525
2626/***************************************************************************
2727    PROTOTYPES
r5687r5688
3131DEVICE_GET_INFO( vp595 );
3232
3333/* Q line */
34WRITE_LINE_DEVICE_HANDLER( vp595_q_w );
34WRITE_LINE_DEVICE_HANDLER( vp595_q_w ) ATTR_NONNULL(1);
3535
3636/* install write handlers */
37void vp595_install_write_handlers(const device_config *device, const address_space *io, int enabled);
37void vp595_install_write_handlers(const device_config *device, const address_space *io, int enabled) ATTR_NONNULL(1) ATTR_NONNULL(2);
3838
3939#endif /* __VP595__ */
src/mess/includes/vip.h
r5687r5688
3939
4040   /* video state */
4141   int cdp1861_efx;            /* EFx */
42   int a12;                  /* latched address line 12 */
4243   int colorram_mwr;            /* color RAM write */
4344   UINT8 *colorram;            /* CDP1862 color RAM */
4445
src/mess/drivers/vip.c
r5687r5688
408408static WRITE8_HANDLER( vip_colorram_w )
409409{
410410   vip_state *state = space->machine->driver_data;
411   UINT8 mask = 0xff;
411412
412   state->colorram[offset] = data;
413   state->a12 = (offset & 0x1000) ? 1 : 0;
414
415   if (!state->a12)
416   {
417      /* mask out A4 and A3 */
418      mask = 0xe7;
419   }
420
421//   logerror("COLOR RAM (%04x) %02x = %02x\n", offset, offset & mask, data);
422
423   /* write to CDP1822 */
424   state->colorram[offset & mask] = data << 1;
413425   state->colorram_mwr = ASSERT_LINE;
414426}
415427
r5687r5688
541553
542554   case VIP_VIDEO_CDP1862:
543555      {
544         UINT8 color = state->colorram[offset & 0xff];
556         UINT8 mask = 0xff;
557         UINT8 color;
558         int rd, bd, gd;
559
560         if (!state->a12)
561         {
562            /* mask out A4 and A3 */
563            mask = 0xe7;
564         }
565
566         color = state->colorram[offset & mask];
545567         
546         int rdata = BIT(color, 1);
547         int gdata = BIT(color, 3);
548         int bdata = BIT(color, 2);
568         rd = BIT(color, 1);
569         bd = BIT(color, 2);
570         gd = BIT(color, 3);
549571
550         cdp1862_dma_w(state->cdp1862, data, state->colorram_mwr, rdata, gdata, bdata);
572         cdp1862_dma_w(state->cdp1862, data, state->colorram_mwr, rd, gd, bd);
551573      }
552574      break;
553575   }
r5687r5688
636658   {
637659   case VIP_VIDEO_CDP1861:
638660      memory_install_write8_handler(io, 0x05, 0x05, 0, 0, SMH_UNMAP);
639      memory_install_write8_handler(program, 0xc000, 0xc0ff, 0, 0, SMH_UNMAP);
661      memory_install_write8_handler(program, 0xc000, 0xdfff, 0, 0, SMH_UNMAP);
640662      break;
641663
642664   case VIP_VIDEO_CDP1862:
643665      memory_install_write8_device_handler(io, state->cdp1862, 0x05, 0x05, 0, 0, cdp1862_bkg_w);
644      memory_install_write8_handler(program, 0xc000, 0xc0ff, 0, 0, vip_colorram_w);
666      memory_install_write8_handler(program, 0xc000, 0xdfff, 0, 0, vip_colorram_w);
645667      break;
646668   }
647669
r5687r5688
718740   MDRV_SOUND_CONFIG_DISCRETE(vip)
719741   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80)
720742
743   MDRV_VP595_ADD
721744   MDRV_VP550_ADD(XTAL_3_52128MHz/2)
722   MDRV_VP595_ADD(XTAL_3_52128MHz/2)
723745
724746   /* devices */
725747   MDRV_QUICKLOAD_ADD("quickload", vip, "bin,c8,c8x", 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team