summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-11-05 16:02:25 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-11-05 16:05:51 -0500
commitf07fab41d6a42e311fed5017cc47f077e98cd913 (patch)
tree6292314e91e3b128daf87afd96fdf485eebc983a
parent20e9bfd19f28c7349606441dfcff1db49e31b8ca (diff)
Replace ATTOSECONDS_TO_HZ with as_hz where appropriate (nw)
-rw-r--r--src/devices/cpu/powerpc/ppccom.cpp2
-rw-r--r--src/devices/machine/vrc5074.cpp2
-rw-r--r--src/devices/machine/z80ctc.cpp2
-rw-r--r--src/devices/video/crt9007.cpp2
-rw-r--r--src/devices/video/dp8350.cpp2
-rw-r--r--src/devices/video/scn2674.cpp8
-rw-r--r--src/devices/video/snes_ppu.cpp2
-rw-r--r--src/devices/video/tms9927.cpp6
-rw-r--r--src/emu/video.cpp4
-rw-r--r--src/frontend/mame/ui/devopt.cpp2
-rw-r--r--src/frontend/mame/ui/info.cpp2
-rw-r--r--src/frontend/mame/ui/ui.cpp4
-rw-r--r--src/mame/audio/cage.cpp4
-rw-r--r--src/mame/audio/dcs.cpp4
-rw-r--r--src/mame/audio/rax.cpp2
-rw-r--r--src/mame/drivers/gaelco3d.cpp2
-rw-r--r--src/mame/machine/snes.cpp2
-rw-r--r--src/mame/video/vtvideo.cpp6
-rw-r--r--src/mame/video/x68k_crtc.cpp2
19 files changed, 30 insertions, 30 deletions
diff --git a/src/devices/cpu/powerpc/ppccom.cpp b/src/devices/cpu/powerpc/ppccom.cpp
index 14e3d4e5f8b..50881d922a4 100644
--- a/src/devices/cpu/powerpc/ppccom.cpp
+++ b/src/devices/cpu/powerpc/ppccom.cpp
@@ -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 */
diff --git a/src/devices/machine/vrc5074.cpp b/src/devices/machine/vrc5074.cpp
index 34305f9e096..b04b689bd9b 100644
--- a/src/devices/machine/vrc5074.cpp
+++ b/src/devices/machine/vrc5074.cpp
@@ -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? */
diff --git a/src/devices/machine/z80ctc.cpp b/src/devices/machine/z80ctc.cpp
index 0ad5719a047..968a43265a1 100644
--- a/src/devices/machine/z80ctc.cpp
+++ b/src/devices/machine/z80ctc.cpp
@@ -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;
diff --git a/src/devices/video/crt9007.cpp b/src/devices/video/crt9007.cpp
index 636ee4971e1..40279d1316a 100644
--- a/src/devices/video/crt9007.cpp
+++ b/src/devices/video/crt9007.cpp
@@ -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());
diff --git a/src/devices/video/dp8350.cpp b/src/devices/video/dp8350.cpp
index a522220849e..b15ad895a67 100644
--- a/src/devices/video/dp8350.cpp
+++ b/src/devices/video/dp8350.cpp
@@ -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),
diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp
index 7cf956e87a0..7fedf0c4d25 100644
--- a/src/devices/video/scn2674.cpp
+++ b/src/devices/video/scn2674.cpp
@@ -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());
}
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index f4c8c1000e6..9ab3e8c9bc6 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -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
diff --git a/src/devices/video/tms9927.cpp b/src/devices/video/tms9927.cpp
index 70b4ecd6983..9a43cb1f635 100644
--- a/src/devices/video/tms9927.cpp
+++ b/src/devices/video/tms9927.cpp
@@ -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())
diff --git a/src/emu/video.cpp b/src/emu/video.cpp
index 434e51be969..12fa4d05991 100644
--- a/src/emu/video.cpp
+++ b/src/emu/video.cpp
@@ -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();
diff --git a/src/frontend/mame/ui/devopt.cpp b/src/frontend/mame/ui/devopt.cpp
index 2c1ddd9aebd..8dd9b9c9a9e 100644
--- a/src/frontend/mame/ui/devopt.cpp
+++ b/src/frontend/mame/ui/devopt.cpp
@@ -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());
}
}
}
diff --git a/src/frontend/mame/ui/info.cpp b/src/frontend/mame/ui/info.cpp
index 4a39bc050f5..963dfb5597c 100644
--- a/src/frontend/mame/ui/info.cpp
+++ b/src/frontend/mame/ui/info.cpp
@@ -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,
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 94eea829b4c..812d5c23502 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -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);
}
diff --git a/src/mame/audio/cage.cpp b/src/mame/audio/cage.cpp
index 6c474150333..35b1fd1ecec 100644
--- a/src/mame/audio/cage.cpp
+++ b/src/mame/audio/cage.cpp
@@ -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;
diff --git a/src/mame/audio/dcs.cpp b/src/mame/audio/dcs.cpp
index c02a54277fc..1f0cd1640ff 100644
--- a/src/mame/audio/dcs.cpp
+++ b/src/mame/audio/dcs.cpp
@@ -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)
diff --git a/src/mame/audio/rax.cpp b/src/mame/audio/rax.cpp
index 90ffd568606..eb86b4b3c68 100644
--- a/src/mame/audio/rax.cpp
+++ b/src/mame/audio/rax.cpp
@@ -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 */
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp
index 67b676f657a..6d89cef3bf9 100644
--- a/src/mame/drivers/gaelco3d.cpp
+++ b/src/mame/drivers/gaelco3d.cpp
@@ -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);
}
diff --git a/src/mame/machine/snes.cpp b/src/mame/machine/snes.cpp
index e67d97f4d5b..de0e730da04 100644
--- a/src/mame/machine/snes.cpp
+++ b/src/mame/machine/snes.cpp
@@ -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);
diff --git a/src/mame/video/vtvideo.cpp b/src/mame/video/vtvideo.cpp
index 771c9d53957..ab232583384 100644
--- a/src/mame/video/vtvideo.cpp
+++ b/src/mame/video/vtvideo.cpp
@@ -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)
diff --git a/src/mame/video/x68k_crtc.cpp b/src/mame/video/x68k_crtc.cpp
index d997b7aefe0..232ebb19358 100644
--- a/src/mame/video/x68k_crtc.cpp
+++ b/src/mame/video/x68k_crtc.cpp
@@ -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());
}