src/mess/video/m6847.c
| r1314 | r1315 | |
| 928 | 928 | |
| 929 | 929 | |
| 930 | 930 | |
| 931 | #define ATTOTIME_STRING_PRECISION 9 |
| 932 | |
| 931 | 933 | #define M6847_RGB(r,g,b) ((r << 16) | (g << 8) | (b << 0)) |
| 932 | 934 | |
| 933 | 935 | |
| r1314 | r1315 | |
| 1620 | 1622 | static TIMER_CALLBACK(hs_fall) |
| 1621 | 1623 | { |
| 1622 | 1624 | if (LOG_HS) |
| 1623 | | logerror("hs_fall(): time=%g\n", attotime_to_double(timer_get_time())); |
| 1625 | logerror("hs_fall(): time=%s\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION)); |
| 1624 | 1626 | |
| 1625 | 1627 | set_horizontal_sync(); |
| 1626 | 1628 | } |
| r1314 | r1315 | |
| 1628 | 1630 | static TIMER_CALLBACK(hs_rise) |
| 1629 | 1631 | { |
| 1630 | 1632 | if (LOG_HS) |
| 1631 | | logerror("hs_rise(): time=%g\n", attotime_to_double(timer_get_time())); |
| 1633 | logerror("hs_rise(): time=%s\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION)); |
| 1632 | 1634 | |
| 1633 | 1635 | timer_adjust(m6847->hs_rise_timer, |
| 1634 | 1636 | attotime_make(0, m6847->scanline_period), |
| r1314 | r1315 | |
| 1644 | 1646 | static TIMER_CALLBACK(fs_fall) |
| 1645 | 1647 | { |
| 1646 | 1648 | if (LOG_FS) |
| 1647 | | logerror("fs_fall(): time=%g scanline=%d\n", attotime_to_double(timer_get_time()), get_scanline()); |
| 1649 | logerror("fs_fall(): time=%s scanline=%d\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1648 | 1650 | |
| 1649 | 1651 | set_field_sync(); |
| 1650 | 1652 | } |
| r1314 | r1315 | |
| 1652 | 1654 | static TIMER_CALLBACK(fs_rise) |
| 1653 | 1655 | { |
| 1654 | 1656 | if (LOG_FS) |
| 1655 | | logerror("fs_rise(): time=%g scanline=%d\n", attotime_to_double(timer_get_time()), get_scanline()); |
| 1657 | logerror("fs_rise(): time=%s scanline=%d\n", attotime_string(timer_get_time(), ATTOTIME_STRING_PRECISION), get_scanline()); |
| 1656 | 1658 | |
| 1657 | 1659 | /* adjust field sync falling edge timer */ |
| 1658 | 1660 | timer_adjust(m6847->fs_fall_timer, |
| r1314 | r1315 | |
| 1865 | 1867 | frequency = v->frames_per_second |
| 1866 | 1868 | * ((UINT32) (v->scanlines_per_frame * FACTOR_SCANLINES_PER_FRAME)) |
| 1867 | 1869 | * ((UINT32) (v->clocks_per_scanline * FACTOR_CLOCKS_PER_SCANLINE)); |
| 1868 | | period = ATTOTIME_MAX_SECONDS / frequency; |
| 1870 | period = ATTOSECONDS_PER_SECOND / frequency; |
| 1869 | 1871 | |
| 1870 | 1872 | /* choose CPU clock, if specified */ |
| 1871 | 1873 | if (cfg->cpu0_timing_factor > 0) |
| r1314 | r1315 | |
| 1908 | 1910 | if (LOG_STATS) |
| 1909 | 1911 | { |
| 1910 | 1912 | logerror("m6847_init():\n"); |
| 1911 | | logerror("\tclock: %30s sec\n", attotime_string(attotime_make(0, period * GROSS_FACTOR), 6)); |
| 1913 | logerror("\tclock: %30s sec\n", attotime_string(attotime_make(0, period * GROSS_FACTOR), ATTOTIME_STRING_PRECISION)); |
| 1912 | 1914 | if (cpu0_clock_period > 0) |
| 1913 | | logerror("\tCPU0 clock: %30s sec\n", attotime_string(attotime_make(0, cpu0_clock_period), 6)); |
| 1914 | | logerror("\tscanline: %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), 6)); |
| 1915 | | logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), 6)); |
| 1916 | | logerror("\thorz sync: %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), 6)); |
| 1917 | | logerror("\tvblank: %30s sec\n", attotime_string(attotime_make(0, m6847->vblank_period), 6)); |
| 1918 | | logerror("\tframe: %30s sec\n", attotime_string(attotime_make(0, frame_period), 6)); |
| 1915 | logerror("\tCPU0 clock: %30s sec\n", attotime_string(attotime_make(0, cpu0_clock_period), ATTOTIME_STRING_PRECISION)); |
| 1916 | logerror("\tscanline: %30s sec\n", attotime_string(attotime_make(0, m6847->scanline_period), ATTOTIME_STRING_PRECISION)); |
| 1917 | logerror("\tfield sync: %30s sec\n", attotime_string(attotime_make(0, m6847->field_sync_period), ATTOTIME_STRING_PRECISION)); |
| 1918 | logerror("\thorz sync: %30s sec\n", attotime_string(attotime_make(0, m6847->horizontal_sync_period), ATTOTIME_STRING_PRECISION)); |
| 1919 | logerror("\tvblank: %30s sec\n", attotime_string(attotime_make(0, m6847->vblank_period), ATTOTIME_STRING_PRECISION)); |
| 1920 | logerror("\tframe: %30s sec\n", attotime_string(attotime_make(0, frame_period), ATTOTIME_STRING_PRECISION)); |
| 1919 | 1921 | logerror("\n"); |
| 1920 | 1922 | } |
| 1921 | 1923 | |