Previous 15994 Revisions Next

r8438 Thursday 8th July, 2010 at 08:51:01 UTC by Miodrag Milanović
- Fixed coco timing issue (was hidden in 6847 implementation)
- Set 4 times bigger clock for HD6309 version since that CPU have frequency divider (by 4)
NOTE: Do a full recompile otherwise other drivers using 6847 could crash
[src/mess/drivers]coco.c
[src/mess/video]coco3.c coco6847.c coco6847.h m6847.h

src/mess/video/coco6847.c
r8437r8438
18291829{
18301830   const m6847_variant *v;
18311831   UINT32 frequency;
1832   attoseconds_t period, frame_period, cpu0_clock_period = 0;
1832   attoseconds_t period, frame_period;
18331833   double total_scanlines;
18341834
18351835   /* identify proper M6847 variant */
r8437r8438
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 * cfg->cpu0_timing_factor * GROSS_FACTOR;
1893      cpu_set_clock(machine->firstcpu, ATTOSECONDS_PER_SECOND / cpu0_clock_period);
1894   }
1895
18961889   /* calculate timing */
18971890   total_scanlines = v->vblank_scanlines
18981891      + v->top_border_scanlines
r8437r8438
19211914   {
19221915      logerror("m6847_init():\n");
19231916      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));
19261917      logerror("\tscanline:   %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), ATTOTIME_STRING_PRECISION));
19271918      logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), ATTOTIME_STRING_PRECISION));
19281919      logerror("\thorz sync:  %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), ATTOTIME_STRING_PRECISION));
src/mess/video/coco6847.h
r8437r8438
4848struct _m6847_config
4949{
5050   m6847_type type;
51   int cpu0_timing_factor;
52
51   
5352   /* callbacks */
5453   void (*horizontal_sync_callback)(running_machine *machine, int line);
5554   void (*field_sync_callback)(running_machine *machine,int line);
src/mess/video/m6847.h
r8437r8438
6969struct _mc6847_config
7070{
7171   m6847_type type;
72   int cpu0_timing_factor;
7372
7473   UINT8 (*get_char_rom)(running_machine *machine, UINT8 ch, int line);
7574
r8437r8438
9392#define MDRV_MC6847_TYPE(_type) \
9493   MDRV_DEVICE_CONFIG_DATA32(mc6847_config, type, _type)
9594
96#define MDRV_MC6847_TIMING_FACTOR(_factor) \
97   MDRV_DEVICE_CONFIG_DATA32(mc6847_config, cpu0_timing_factor, _factor)
98
9995#define MDRV_MC6847_CHAR_ROM(_get_char_rom) \
10096   MDRV_DEVICE_CONFIG_DATAPTR(mc6847_config, get_char_rom, _get_char_rom)
10197
src/mess/video/coco3.c
r8437r8438
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] & 0x0F)      * 0x80000);
652      |   ((offs_t) (coco3_gimereg[11] & 0x03)      * 0x80000);
653653}
654654
655655
src/mess/drivers/coco.c
r8437r8438
12501250
12511251static MACHINE_DRIVER_START( coco3h )
12521252   MDRV_IMPORT_FROM( coco3 )
1253   MDRV_CPU_REPLACE( "maincpu", HD6309, COCO_CPU_SPEED_HZ)
1253   MDRV_CPU_REPLACE( "maincpu", HD6309, COCO_CPU_SPEED_HZ * 4)
12541254   MDRV_CPU_PROGRAM_MAP(coco3_map)
12551255MACHINE_DRIVER_END
12561256

Previous 15994 Revisions Next


© 1998-2018 The MESS Team