trunk/src/emu/video/fixfreq.c
| r26785 | r26786 | |
| 245 | 245 | return 0; |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | | void fixedfreq_device::update_vid(double newval, attotime cur_time) |
| 248 | NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_vid) |
| 249 | 249 | { |
| 250 | 250 | bitmap_rgb32 *bm = m_bitmap[m_cur_bm]; |
| 251 | 251 | const int has_fields = (m_fieldcount > 1) ? 1: 0; |
| 252 | 252 | |
| 253 | | int pixels = round((cur_time - m_line_time).as_double() / m_clock_period.as_double()); |
| 254 | | attotime time = (cur_time - m_last_time); |
| 253 | int pixels = round((time - m_line_time).as_double() / m_clock_period.as_double()); |
| 254 | attotime delta_time = (time - m_last_time); |
| 255 | 255 | |
| 256 | | if (newval == m_vid) |
| 256 | if (data == m_vid) |
| 257 | 257 | return; |
| 258 | 258 | |
| 259 | | ATTR_UNUSED int sync = sync_separator(time, newval); |
| 259 | ATTR_UNUSED int sync = sync_separator(delta_time, data); |
| 260 | 260 | |
| 261 | 261 | if (m_last_y < bm->height()) |
| 262 | 262 | { |
| r26785 | r26786 | |
| 297 | 297 | m_last_y = m_vbackporch - m_vsync; // 6; // FIXME: needed for pong - need to be able to adjust screen parameters |
| 298 | 298 | // toggle bitmap |
| 299 | 299 | m_cur_bm ^= 1; |
| 300 | | update_screen_parameters(cur_time - m_last_vsync_time); |
| 301 | | m_last_vsync_time = cur_time; |
| 300 | update_screen_parameters(time - m_last_vsync_time); |
| 301 | m_last_vsync_time = time; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | if ((sync & 2) && !m_sig_vsync) |
| 305 | 305 | { |
| 306 | 306 | m_last_y += m_fieldcount; |
| 307 | 307 | m_last_x = 0; |
| 308 | | m_line_time = cur_time; |
| 308 | m_line_time = time; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | | m_last_time = cur_time; |
| 312 | | m_vid = newval; |
| 311 | m_last_time = time; |
| 312 | m_vid = data; |
| 313 | 313 | |
| 314 | 314 | } |
| 315 | 315 | |
trunk/src/emu/video/fixfreq.h
| r26785 | r26786 | |
| 13 | 13 | #define FIXFREQ_H |
| 14 | 14 | |
| 15 | 15 | #include "emu.h" |
| 16 | #include "machine/netlist.h" |
| 16 | 17 | |
| 17 | 18 | #define FIXFREQ_INTERFACE(name) \ |
| 18 | 19 | const fixedfreq_interface (name) = |
| r26785 | r26786 | |
| 56 | 57 | |
| 57 | 58 | virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 58 | 59 | |
| 59 | | void update_vid(const double newval, const attotime cur_time); |
| 60 | NETDEV_ANALOG_CALLBACK_MEMBER(update_vid); |
| 60 | 61 | |
| 61 | 62 | protected: |
| 62 | 63 | // device-level overrides |