mirror of
https://github.com/holub/mame
synced 2025-04-23 08:49:55 +03:00
Replace ATTOSECONDS_TO_HZ with as_hz where appropriate (nw)
This commit is contained in:
parent
20e9bfd19f
commit
f07fab41d6
@ -2635,7 +2635,7 @@ void ppc_device::ppc4xx_spu_timer_reset()
|
||||
attotime charperiod = clockperiod * (divisor * 16 * bpc);
|
||||
m_spu.timer->adjust(charperiod, 0, charperiod);
|
||||
if (PRINTF_SPU)
|
||||
printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", ATTOSECONDS_TO_HZ(charperiod.attoseconds()) * bpc);
|
||||
printf("ppc4xx_spu_timer_reset: baud rate = %.0f\n", charperiod.as_hz() * bpc);
|
||||
}
|
||||
|
||||
/* otherwise, disable the timer */
|
||||
|
@ -966,7 +966,7 @@ WRITE32_MEMBER(vrc5074_device::cpu_reg_w)
|
||||
if (!(olddata & 1) && (m_cpu_regs[offset] & 1))
|
||||
{
|
||||
m_timer[which]->adjust(attotime::from_hz(clock()) * m_cpu_regs[NREG_T0CNTR + which * 4], which);
|
||||
if (LOG_TIMERS) logerror("Starting timer %d at a rate of %f Hz\n", which, ATTOSECONDS_TO_HZ(attotime::from_double(m_timer_period[which]).as_attoseconds()));
|
||||
if (LOG_TIMERS) logerror("Starting timer %d at a rate of %f Hz\n", which, attotime::from_double(m_timer_period[which]).as_hz());
|
||||
}
|
||||
|
||||
/* timer disabled? */
|
||||
|
@ -372,7 +372,7 @@ u8 z80ctc_channel_device::read()
|
||||
{
|
||||
attotime period = m_device->clocks_to_attotime((m_mode & PRESCALER) == PRESCALER_16 ? 16 : 256);
|
||||
|
||||
LOG("CTC clock %f\n",ATTOSECONDS_TO_HZ(period.attoseconds()));
|
||||
LOG("CTC clock %f\n", period.as_hz());
|
||||
|
||||
if (m_timer != nullptr)
|
||||
return ((int)(m_timer->remaining().as_double() / period.as_double()) + 1) & 0xff;
|
||||
|
@ -428,7 +428,7 @@ inline void crt9007_device::recompute_parameters()
|
||||
// visible area
|
||||
rectangle visarea(m_hsync_end, horiz_pix_total - 1, m_vsync_end, vert_pix_total - 1);
|
||||
|
||||
LOG("CRT9007 Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, ATTOSECONDS_TO_HZ(refresh.as_attoseconds()));
|
||||
LOG("CRT9007 Screen: %u x %u @ %f Hz\n", horiz_pix_total, vert_pix_total, refresh.as_hz());
|
||||
LOG("CRT9007 Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
|
||||
|
||||
//screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh.as_attoseconds());
|
||||
|
@ -249,7 +249,7 @@ void dp835x_device::reconfigure_screen()
|
||||
screen().configure(m_dots_per_line, lines_per_frame, screen().visible_area(), refresh.as_attoseconds());
|
||||
|
||||
logerror("Frame rate refresh: %.2f Hz (f%d); horizontal rate scan: %.4f kHz; character rate: %.4f MHz; dot rate: %.5f MHz\n",
|
||||
ATTOSECONDS_TO_HZ(refresh.as_attoseconds()),
|
||||
refresh.as_hz(),
|
||||
m_60hz_refresh ? 1 : 0,
|
||||
clock() / (m_dots_per_line * 1000.0),
|
||||
clock() / (m_char_width * 1000000.0),
|
||||
|
@ -957,15 +957,15 @@ void scn2674_device::recompute_parameters()
|
||||
int horiz_chars_total = (m_equalizing_constant + (m_horz_sync_width << 1)) << 1;
|
||||
int horiz_pix_total = horiz_chars_total * m_hpixels_per_column;
|
||||
int vert_pix_total = m_rows_per_screen * m_scanline_per_char_row + m_vert_front_porch + m_vert_back_porch + m_vsync_width;
|
||||
attoseconds_t refresh = screen().frame_period().as_attoseconds();
|
||||
attotime refresh = screen().frame_period();
|
||||
int max_visible_x = (m_character_per_row * m_hpixels_per_column) - 1;
|
||||
int max_visible_y = (m_rows_per_screen * m_scanline_per_char_row) - 1;
|
||||
|
||||
//attoseconds_t refresh = clocks_to_attotime(horiz_chars_total * vert_pix_total).as_attoseconds();
|
||||
LOGMASKED(LOG_IR, "width %u height %u max_x %u max_y %u refresh %f\n", horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, ATTOSECONDS_TO_HZ(refresh));
|
||||
//attotime refresh = clocks_to_attotime(horiz_chars_total * vert_pix_total);
|
||||
LOGMASKED(LOG_IR, "width %u height %u max_x %u max_y %u refresh %f\n", horiz_pix_total, vert_pix_total, max_visible_x, max_visible_y, refresh.as_hz());
|
||||
|
||||
rectangle visarea(0, max_visible_x, 0, max_visible_y);
|
||||
screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh);
|
||||
screen().configure(horiz_pix_total, vert_pix_total, visarea, refresh.as_attoseconds());
|
||||
|
||||
m_scanline_timer->adjust(screen().time_until_pos(0, 0), 0, screen().scan_period());
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ void snes_ppu_device::device_reset()
|
||||
m_beam.current_vert = 0;
|
||||
|
||||
/* Set STAT78 to NTSC or PAL */
|
||||
m_stat78 = (ATTOSECONDS_TO_HZ(screen().frame_period().attoseconds()) >= 59.0) ? SNES_NTSC : SNES_PAL;
|
||||
m_stat78 = (screen().frame_period().as_hz() >= 59.0) ? SNES_NTSC : SNES_PAL;
|
||||
m_beam.last_visible_line = m_stat78 & SNES_PAL ? 240 : 225;
|
||||
m_mode = 0;
|
||||
m_ppu1_version = 1; // 5C77 chip version number, read by STAT77, only '1' is known
|
||||
|
@ -349,11 +349,11 @@ void tms9927_device::recompute_parameters(bool postload)
|
||||
rectangle visarea(0, m_overscan_left + m_visible_hpix + m_overscan_right - 1,
|
||||
0, m_overscan_top + m_visible_vpix + m_overscan_bottom - 1);
|
||||
|
||||
attoseconds_t refresh = clocks_to_attotime(HCOUNT * m_total_vpix).as_attoseconds();
|
||||
attotime refresh = clocks_to_attotime(HCOUNT * m_total_vpix);
|
||||
|
||||
osd_printf_debug("TMS9927: Total = %dx%d, Visible = %dx%d, HSync = %d-%d, VSync = %d-%d, Skew=%d, Upscroll=%d, Period=%f Hz\n", m_total_hpix, m_total_vpix, m_visible_hpix, m_visible_vpix, m_hsyn_start, m_hsyn_end, m_vsyn_start, m_vsyn_end, SKEW_BITS, m_start_datarow, ATTOSECONDS_TO_HZ(refresh));
|
||||
osd_printf_debug("TMS9927: Total = %dx%d, Visible = %dx%d, HSync = %d-%d, VSync = %d-%d, Skew=%d, Upscroll=%d, Period=%f Hz\n", m_total_hpix, m_total_vpix, m_visible_hpix, m_visible_vpix, m_hsyn_start, m_hsyn_end, m_vsyn_start, m_vsyn_end, SKEW_BITS, m_start_datarow, refresh.as_hz());
|
||||
|
||||
screen().configure(m_total_hpix, m_total_vpix, visarea, refresh);
|
||||
screen().configure(m_total_hpix, m_total_vpix, visarea, refresh.as_attoseconds());
|
||||
|
||||
m_hsyn = false;
|
||||
if (!m_write_hsyn.isnull())
|
||||
|
@ -457,7 +457,7 @@ void video_manager::begin_recording_mng(const char *name, uint32_t index, screen
|
||||
if (filerr == osd_file::error::NONE)
|
||||
{
|
||||
// start the capture
|
||||
int rate = ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds());
|
||||
int rate = int(screen->frame_period().as_hz());
|
||||
png_error pngerr = mng_capture_start(*info.m_mng_file, m_snap_bitmap, rate);
|
||||
if (pngerr != PNGERR_NONE)
|
||||
{
|
||||
@ -493,7 +493,7 @@ void video_manager::begin_recording_avi(const char *name, uint32_t index, screen
|
||||
// build up information about this new movie
|
||||
avi_file::movie_info info;
|
||||
info.video_format = 0;
|
||||
info.video_timescale = 1000 * ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds());
|
||||
info.video_timescale = 1000 * screen->frame_period().as_hz();
|
||||
info.video_sampletime = 1000;
|
||||
info.video_numsamples = 0;
|
||||
info.video_width = m_snap_bitmap.width();
|
||||
|
@ -105,7 +105,7 @@ void menu_device_config::populate(float &customtop, float &custombottom)
|
||||
screen.tag(),
|
||||
visarea.width(),
|
||||
visarea.height(),
|
||||
ATTOSECONDS_TO_HZ(screen.frame_period().attoseconds()));
|
||||
screen.frame_period().as_hz());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ std::string machine_info::game_info_string() const
|
||||
detail = string_format("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz",
|
||||
visarea.width(), visarea.height(),
|
||||
(screen.orientation() & ORIENTATION_SWAP_XY) ? "V" : "H",
|
||||
ATTOSECONDS_TO_HZ(screen.frame_period().attoseconds()));
|
||||
screen.frame_period().as_hz());
|
||||
}
|
||||
|
||||
util::stream_format(buf,
|
||||
|
@ -1682,8 +1682,8 @@ int32_t mame_ui_manager::slider_refresh(running_machine &machine, void *arg, int
|
||||
}
|
||||
|
||||
if (str)
|
||||
*str = string_format(_("%1$.3ffps"), ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds()));
|
||||
refresh = ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds());
|
||||
*str = string_format(_("%1$.3ffps"), screen->frame_period().as_hz());
|
||||
refresh = screen->frame_period().as_hz();
|
||||
return floor((refresh - defrefresh) * 1000.0 + 0.5);
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ void atari_cage_device::update_serial()
|
||||
m_serial_period_per_word = bit_clock_period * (8 * (((m_tms32031_io_regs[SPORT_GLOBAL_CTL] >> 18) & 3) + 1));
|
||||
|
||||
/* compute the step value to stretch this to the sample_rate */
|
||||
freq = ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds()) / DAC_BUFFER_CHANNELS;
|
||||
freq = m_serial_period_per_word.as_hz() / DAC_BUFFER_CHANNELS;
|
||||
if (freq > 0 && freq < 100000)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
@ -402,7 +402,7 @@ WRITE32_MEMBER( atari_cage_device::tms32031_io_w )
|
||||
|
||||
case SPORT_DATA_TX:
|
||||
#if (DAC_BUFFER_CHANNELS == 4)
|
||||
if ((int)ATTOSECONDS_TO_HZ(m_serial_period_per_word.attoseconds()) == 22050*4 && (m_tms32031_io_regs[SPORT_RX_CTL] & 0xff) == 0x62)
|
||||
if (int(m_serial_period_per_word.as_hz()) == 22050*4 && (m_tms32031_io_regs[SPORT_RX_CTL] & 0xff) == 0x62)
|
||||
m_tms32031_io_regs[SPORT_RX_CTL] ^= 0x800;
|
||||
#endif
|
||||
break;
|
||||
|
@ -2056,10 +2056,10 @@ void dcs_audio_device::recompute_sample_rate()
|
||||
sample_period = attotime::from_hz(31250);
|
||||
}
|
||||
|
||||
dmadac_set_frequency(&m_dmadac[0], m_channels, ATTOSECONDS_TO_HZ(sample_period.attoseconds()));
|
||||
dmadac_set_frequency(&m_dmadac[0], m_channels, sample_period.as_hz());
|
||||
dmadac_enable(&m_dmadac[0], m_channels, 1);
|
||||
if (LOG_DCS_IO)
|
||||
logerror("recompute_sample_rate: Channels: %d Freq: %e Size: 0x%x m_incs: 0x%x\n", m_channels, ATTOSECONDS_TO_HZ(sample_period.attoseconds()), m_size, m_incs);
|
||||
logerror("recompute_sample_rate: Channels: %d Freq: %e Size: 0x%x m_incs: 0x%x\n", m_channels, sample_period.as_hz(), m_size, m_incs);
|
||||
|
||||
/* fire off a timer which will hit every half-buffer */
|
||||
if (m_incs)
|
||||
|
@ -390,7 +390,7 @@ void acclaim_rax_device::recompute_sample_rate(int which)
|
||||
|
||||
/* now put it down to samples, so we know what the channel frequency has to be */
|
||||
sample_period = sample_period * (16 * 1);
|
||||
dmadac_set_frequency(&m_dmadac[0], 2, ATTOSECONDS_TO_HZ(sample_period.attoseconds()));
|
||||
dmadac_set_frequency(&m_dmadac[0], 2, sample_period.as_hz());
|
||||
dmadac_enable(&m_dmadac[0], 2, 1);
|
||||
|
||||
/* fire off a timer which will hit every half-buffer */
|
||||
|
@ -609,7 +609,7 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback)
|
||||
|
||||
for (uint8_t i = 0; i < SOUND_CHANNELS; i++)
|
||||
{
|
||||
m_dmadac[i]->set_frequency(ATTOSECONDS_TO_HZ(sample_period.attoseconds()));
|
||||
m_dmadac[i]->set_frequency(sample_period.as_hz());
|
||||
m_dmadac[i]->enable(1);
|
||||
}
|
||||
|
||||
|
@ -1069,7 +1069,7 @@ void snes_state::snes_init_ram()
|
||||
SNES_CPU_REG(WRIO) = 0xff;
|
||||
|
||||
// init frame counter so first line is 0
|
||||
if (ATTOSECONDS_TO_HZ(m_screen->frame_period().attoseconds()) >= 59)
|
||||
if (m_screen->frame_period().as_hz() >= 59.0)
|
||||
m_ppu->set_current_vert(SNES_VTOTAL_NTSC);
|
||||
else
|
||||
m_ppu->set_current_vert(SNES_VTOTAL_PAL);
|
||||
|
@ -208,7 +208,7 @@ void vt100_video_device::recompute_parameters()
|
||||
|
||||
int vert_pix_visible = m_height * (m_linedoubler ? 20 : 10);
|
||||
int vert_pix_total = m_is_50hz ? (m_interlaced ? 629 : 630/2) : (m_interlaced ? 525 : 524/2);
|
||||
attoseconds_t frame_period = clocks_to_attotime(vert_pix_total * 1530).as_attoseconds();
|
||||
attotime frame_period = clocks_to_attotime(vert_pix_total * 1530);
|
||||
|
||||
// display 1 less filler pixel in 132 char. mode
|
||||
int horiz_pix_visible = m_columns * (m_columns == 132 ? 9 : 10);
|
||||
@ -217,10 +217,10 @@ void vt100_video_device::recompute_parameters()
|
||||
// dot clock is divided by 1.5 in 80 column mode
|
||||
screen().set_unscaled_clock(m_columns == 132 ? clock() : clock() * 2 / 3);
|
||||
rectangle visarea(0, horiz_pix_visible - 1, 0, vert_pix_visible - 1);
|
||||
screen().configure(horiz_pix_total, vert_pix_total, visarea, frame_period);
|
||||
screen().configure(horiz_pix_total, vert_pix_total, visarea, frame_period.as_attoseconds());
|
||||
|
||||
LOG("(RECOMPUTE) HPIX: %d (%d) - VPIX: %d (%d)\n", horiz_pix_visible, horiz_pix_total, vert_pix_visible, vert_pix_total);
|
||||
LOG("(RECOMPUTE) FREQUENCY: %f\n", ATTOSECONDS_TO_HZ(frame_period));
|
||||
LOG("(RECOMPUTE) FREQUENCY: %f\n", frame_period.as_hz());
|
||||
if (m_interlaced)
|
||||
LOG("(RECOMPUTE) * INTERLACED *\n");
|
||||
if (m_linedoubler)
|
||||
|
@ -204,7 +204,7 @@ void x68k_crtc_device::refresh_mode()
|
||||
if ((m_reg[20] & 0x0c) == 0)
|
||||
div *= 2;
|
||||
attotime refresh = attotime::from_ticks(scr.max_x * scr.max_y, (BIT(m_reg[20], 4) ? 69.55199_MHz_XTAL : 38.86363_MHz_XTAL) / div);
|
||||
LOG("screen().configure(%i,%i,[%i,%i,%i,%i],%f)\n", scr.max_x, scr.max_y, visiblescr.min_x, visiblescr.min_y, visiblescr.max_x, visiblescr.max_y, ATTOSECONDS_TO_HZ(refresh.as_attoseconds()));
|
||||
LOG("screen().configure(%i,%i,[%i,%i,%i,%i],%f)\n", scr.max_x, scr.max_y, visiblescr.min_x, visiblescr.min_y, visiblescr.max_x, visiblescr.max_y, refresh.as_hz());
|
||||
screen().configure(scr.max_x, scr.max_y, visiblescr, refresh.as_attoseconds());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user