Previous 15994 Revisions Next

r8442 Thursday 8th July, 2010 at 09:24:52 UTC by Miodrag Milanović
Put coco hacks back, but not in main 6847 since there they are not needed.
Hack is updated since CPU clock is set with this call without multiplier
[src/mess/video]coco.c coco3.c coco6847.c coco6847.h

src/mess/video/coco6847.c
r8441r8442
18291829{
18301830   const m6847_variant *v;
18311831   UINT32 frequency;
1832   attoseconds_t period, frame_period;
1832   attoseconds_t period, frame_period, cpu0_clock_period = 0;
18331833   double total_scanlines;
18341834
18351835   /* identify proper M6847 variant */
r8441r8442
18861886      * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE));
18871887   period = ATTOSECONDS_PER_SECOND / frequency;
18881888
1889   /* choose CPU clock, if specified */
1890   if (cfg->cpu0_timing_factor > 0)
1891   {
1892      cpu0_clock_period = period * 1 * GROSS_FACTOR;
1893      cpu_set_clock(machine->firstcpu, ATTOSECONDS_PER_SECOND / cpu0_clock_period);
1894   }
1895
18891896   /* calculate timing */
18901897   total_scanlines = v->vblank_scanlines
18911898      + v->top_border_scanlines
r8441r8442
19141921   {
19151922      logerror("m6847_init():\n");
19161923      logerror("\tclock:      %30s sec\n", attotime_string(attotime_make(0, period * GROSS_FACTOR), ATTOTIME_STRING_PRECISION));
1924      if (cpu0_clock_period > 0)
1925         logerror("\tCPU0 clock: %30s sec\n", attotime_string(attotime_make(0, cpu0_clock_period), ATTOTIME_STRING_PRECISION));
19171926      logerror("\tscanline:   %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), ATTOTIME_STRING_PRECISION));
19181927      logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), ATTOTIME_STRING_PRECISION));
19191928      logerror("\thorz sync:  %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), ATTOTIME_STRING_PRECISION));
src/mess/video/coco6847.h
r8441r8442
4848struct _m6847_config
4949{
5050   m6847_type type;
51   
51   int cpu0_timing_factor;
52
5253   /* callbacks */
5354   void (*horizontal_sync_callback)(running_machine *machine, int line);
5455   void (*field_sync_callback)(running_machine *machine,int line);
src/mess/video/coco.c
r8441r8442
8989   memset(&cfg, 0, sizeof(cfg));
9090   cfg.type = type;
9191
92   /* NPW 14-May-2006 - Ugly hack; using CPU timing factor seems to break some
93     * Dragon games */
94   if (machine->gamedrv->name[0] == 'c')
95      cfg.cpu0_timing_factor = 4;
96
9297   if (type==M6847_VERSION_M6847T1_NTSC) {
9398      cfg.get_attributes = coco_get_attributes;
9499   } else {
src/mess/video/coco3.c
r8441r8442
649649     */
650650   return   ((offs_t) (coco3_gimereg[14] & ff9e_mask)   * 0x00008)
651651      |   ((offs_t) (coco3_gimereg[13] & ff9d_mask)   * 0x00800)
652      |   ((offs_t) (coco3_gimereg[11] & 0x03)      * 0x80000);
652      |   ((offs_t) (coco3_gimereg[11] & 0x0F)      * 0x80000);
653653}
654654
655655
r8441r8442
835835   /* initialize the CoCo video code */
836836   memset(&cfg, 0, sizeof(cfg));
837837   cfg.type = type;
838   cfg.cpu0_timing_factor = 4;
838839   cfg.get_attributes = coco_get_attributes;
839840   cfg.get_video_ram = get_video_ram_coco3;
840841   cfg.horizontal_sync_callback = coco3_horizontal_sync_callback;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team