src/mess/video/coco6847.c
| r8437 | r8438 | |
| 1829 | 1829 | { |
| 1830 | 1830 | const m6847_variant *v; |
| 1831 | 1831 | UINT32 frequency; |
| 1832 | | attoseconds_t period, frame_period, cpu0_clock_period = 0; |
| 1832 | attoseconds_t period, frame_period; |
| 1833 | 1833 | double total_scanlines; |
| 1834 | 1834 | |
| 1835 | 1835 | /* identify proper M6847 variant */ |
| r8437 | r8438 | |
| 1886 | 1886 | * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1887 | 1887 | period = ATTOSECONDS_PER_SECOND / frequency; |
| 1888 | 1888 | |
| 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 | | |
| 1896 | 1889 | /* calculate timing */ |
| 1897 | 1890 | total_scanlines = v->vblank_scanlines |
| 1898 | 1891 | + v->top_border_scanlines |
| r8437 | r8438 | |
| 1921 | 1914 | { |
| 1922 | 1915 | logerror("m6847_init():\n"); |
| 1923 | 1916 | 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)); |
| 1926 | 1917 | logerror("\tscanline: %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), ATTOTIME_STRING_PRECISION)); |
| 1927 | 1918 | logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), ATTOTIME_STRING_PRECISION)); |
| 1928 | 1919 | logerror("\thorz sync: %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), ATTOTIME_STRING_PRECISION)); |
src/mess/video/m6847.h
| r8437 | r8438 | |
| 69 | 69 | struct _mc6847_config |
| 70 | 70 | { |
| 71 | 71 | m6847_type type; |
| 72 | | int cpu0_timing_factor; |
| 73 | 72 | |
| 74 | 73 | UINT8 (*get_char_rom)(running_machine *machine, UINT8 ch, int line); |
| 75 | 74 | |
| r8437 | r8438 | |
| 93 | 92 | #define MDRV_MC6847_TYPE(_type) \ |
| 94 | 93 | MDRV_DEVICE_CONFIG_DATA32(mc6847_config, type, _type) |
| 95 | 94 | |
| 96 | | #define MDRV_MC6847_TIMING_FACTOR(_factor) \ |
| 97 | | MDRV_DEVICE_CONFIG_DATA32(mc6847_config, cpu0_timing_factor, _factor) |
| 98 | | |
| 99 | 95 | #define MDRV_MC6847_CHAR_ROM(_get_char_rom) \ |
| 100 | 96 | MDRV_DEVICE_CONFIG_DATAPTR(mc6847_config, get_char_rom, _get_char_rom) |
| 101 | 97 | |