Previous 15994 Revisions Next

r6490 Tuesday 1st December, 2009 at 09:57:35 UTC by Curt Coder
Changed CDP1869 PAL/NTSC signal to use devcb.
[src/emu/sound]cdp1869.c cdp1869.h
[src/mess/machine]comx35.c

src/emu/sound/cdp1869.c
r6489r6490
88
99    TODO:
1010
11    - remove CDP1802 dependency
11   - remove CDP1802 dependency
12   - sound base frequencies are TPA/TPB
1213    - white noise
1314    - scanline based update
1415    - CMSEL output
r6489r6490
5152   devcb_resolved_read8      in_page_ram_func;
5253   devcb_resolved_write8      out_page_ram_func;
5354   devcb_resolved_write_line   out_prd_func;
55   devcb_resolved_read_line   in_pal_ntsc_func;
5456
5557   const device_config *device;
5658   const cdp1869_interface *intf;   /* interface */
r6489r6490
104106    IMPLEMENTATION
105107***************************************************************************/
106108
109#define CDP1869_IS_NTSC \
110   (!devcb_call_read_line(&cdp1869->in_pal_ntsc_func))
111
107112/*-------------------------------------------------
108113    update_prd_changed_timer - update predisplay
109114    changed timer
r6489r6490
118123      int scanline = video_screen_get_vpos(cdp1869->screen);
119124      int next_scanline;
120125
121      if (cdp1869->intf->pal_ntsc == CDP1869_NTSC)
126      if (CDP1869_IS_NTSC)
122127      {
123128         start = CDP1869_SCANLINE_PREDISPLAY_START_NTSC;
124129         end = CDP1869_SCANLINE_PREDISPLAY_END_NTSC;
r6489r6490
507512   cdp1869->cmem = BIT(word, 0);
508513   cdp1869->line9 = BIT(word, 3);
509514
510   if (cdp1869->intf->pal_ntsc == CDP1869_NTSC)
515   if (CDP1869_IS_NTSC)
511516   {
512517      cdp1869->line16 = BIT(word, 5);
513518   }
r6489r6490
719724
720725   rectangle screen_rect, outer;
721726
722   switch (cdp1869->intf->pal_ntsc)
727   if (CDP1869_IS_NTSC)
723728   {
724   case CDP1869_NTSC:
725729      outer.min_x = CDP1869_HBLANK_END;
726730      outer.max_x = CDP1869_HBLANK_START - 1;
727731      outer.min_y = CDP1869_SCANLINE_VBLANK_END_NTSC;
r6489r6490
730734      screen_rect.max_x = CDP1869_SCREEN_END - 1;
731735      screen_rect.min_y = CDP1869_SCANLINE_DISPLAY_START_NTSC;
732736      screen_rect.max_y = CDP1869_SCANLINE_DISPLAY_END_NTSC - 1;
733      break;
734
735   default:
736   case CDP1869_PAL:
737   }
738   else
739   {
737740      outer.min_x = CDP1869_HBLANK_END;
738741      outer.max_x = CDP1869_HBLANK_START - 1;
739742      outer.min_y = CDP1869_SCANLINE_VBLANK_END_PAL;
r6489r6490
742745      screen_rect.max_x = CDP1869_SCREEN_END - 1;
743746      screen_rect.min_y = CDP1869_SCANLINE_DISPLAY_START_PAL;
744747      screen_rect.max_y = CDP1869_SCANLINE_DISPLAY_END_PAL - 1;
745      break;
746748   }
747749
748750   sect_rect(&outer, cliprect);
r6489r6490
869871   devcb_resolve_read8(&cdp1869->in_page_ram_func, &cdp1869->intf->in_page_ram_func, device);
870872   devcb_resolve_write8(&cdp1869->out_page_ram_func, &cdp1869->intf->out_page_ram_func, device);
871873   devcb_resolve_write_line(&cdp1869->out_prd_func, &cdp1869->intf->out_prd_func, device);
874   devcb_resolve_read_line(&cdp1869->in_pal_ntsc_func, &cdp1869->intf->in_pal_ntsc_func, device);
872875
873876   /* set initial values */
874877   cdp1869->device = device;
src/emu/sound/cdp1869.h
r6489r6490
113113#define CDP1869_CHAR_RAM_WRITE(name) void name(const device_config *device, UINT16 pma, UINT8 cma, UINT8 data)
114114#define CDP1869_PCB_READ(name) int name(const device_config *device, UINT16 pma, UINT8 cma)
115115
116#define CDP1869_PAL \
117   DEVCB_LINE_VCC
118
119#define CDP1869_NTSC \
120   DEVCB_LINE_GND
121
116122/***************************************************************************
117123    TYPE DEFINITIONS
118124***************************************************************************/
r6489r6490
121127typedef void (*cdp1869_char_ram_write_func)(const device_config *device, UINT16 pma, UINT8 cma, UINT8 data);
122128typedef int (*cdp1869_pcb_read_func)(const device_config *device, UINT16 pma, UINT8 cma);
123129
124enum _cdp1869_format {
125   CDP1869_NTSC = 0,
126   CDP1869_PAL
127};
128typedef enum _cdp1869_format cdp1869_format;
129
130130/* interface */
131131typedef struct _cdp1869_interface cdp1869_interface;
132132struct _cdp1869_interface
r6489r6490
137137   /* pixel clock of the chip is the device clock */
138138   int color_clock;         /* the chroma clock of the chip */
139139
140   cdp1869_format pal_ntsc;   /* screen format */
140   /* screen format */
141   devcb_read_line               in_pal_ntsc_func;
141142
142143   /* page memory read function */
143144   devcb_read8                  in_page_ram_func;
src/mess/machine/comx35.c
r6489r6490
643643
644644   /* screen format */
645645
646   state->pal_ntsc = CDP1869_PAL;
646   state->pal_ntsc = 1;
647647
648648   /* register for state saving */
649649
r6489r6490
674674
675675   // screen format
676676
677   state->pal_ntsc = CDP1869_NTSC;
677   state->pal_ntsc = 0;
678678}
679679
680680MACHINE_RESET( comx35 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team