trunk/src/emu/ioport.c
| r31184 | r31185 | |
| 922 | 922 | // post - post a unicode encoded string |
| 923 | 923 | //------------------------------------------------- |
| 924 | 924 | |
| 925 | | void natural_keyboard::post(const unicode_char *text, size_t length, attotime rate) |
| 925 | void natural_keyboard::post(const unicode_char *text, size_t length, const attotime &rate) |
| 926 | 926 | { |
| 927 | 927 | // set the fixed rate |
| 928 | 928 | m_current_rate = rate; |
| r31184 | r31185 | |
| 946 | 946 | // post_utf8 - post a UTF-8 encoded string |
| 947 | 947 | //------------------------------------------------- |
| 948 | 948 | |
| 949 | | void natural_keyboard::post_utf8(const char *text, size_t length, attotime rate) |
| 949 | void natural_keyboard::post_utf8(const char *text, size_t length, const attotime &rate) |
| 950 | 950 | { |
| 951 | 951 | // set the fixed rate |
| 952 | 952 | m_current_rate = rate; |
| r31184 | r31185 | |
| 979 | 979 | // post_coded - post a coded string |
| 980 | 980 | //------------------------------------------------- |
| 981 | 981 | |
| 982 | | void natural_keyboard::post_coded(const char *text, size_t length, attotime rate) |
| 982 | void natural_keyboard::post_coded(const char *text, size_t length, const attotime &rate) |
| 983 | 983 | { |
| 984 | 984 | static const struct |
| 985 | 985 | { |
| r31184 | r31185 | |
| 3436 | 3436 | // playback |
| 3437 | 3437 | //------------------------------------------------- |
| 3438 | 3438 | |
| 3439 | | void ioport_manager::playback_frame(attotime curtime) |
| 3439 | void ioport_manager::playback_frame(const attotime &curtime) |
| 3440 | 3440 | { |
| 3441 | 3441 | // if playing back, fetch the information and verify |
| 3442 | 3442 | if (m_playback_file.is_open()) |
| r31184 | r31185 | |
| 3575 | 3575 | // recording |
| 3576 | 3576 | //------------------------------------------------- |
| 3577 | 3577 | |
| 3578 | | void ioport_manager::record_frame(attotime curtime) |
| 3578 | void ioport_manager::record_frame(const attotime &curtime) |
| 3579 | 3579 | { |
| 3580 | 3580 | // if recording, record information about the current frame |
| 3581 | 3581 | if (m_record_file.is_open()) |
trunk/src/emu/ioport.h
| r31184 | r31185 | |
| 818 | 818 | |
| 819 | 819 | // posting |
| 820 | 820 | void post(unicode_char ch); |
| 821 | | void post(const unicode_char *text, size_t length = 0, attotime rate = attotime::zero); |
| 822 | | void post_utf8(const char *text, size_t length = 0, attotime rate = attotime::zero); |
| 823 | | void post_coded(const char *text, size_t length = 0, attotime rate = attotime::zero); |
| 821 | void post(const unicode_char *text, size_t length = 0, const attotime &rate = attotime::zero); |
| 822 | void post_utf8(const char *text, size_t length = 0, const attotime &rate = attotime::zero); |
| 823 | void post_coded(const char *text, size_t length = 0, const attotime &rate = attotime::zero); |
| 824 | 824 | |
| 825 | 825 | void frame_update(ioport_port &port, ioport_value &digital); |
| 826 | 826 | const char *key_name(astring &string, unicode_char ch); |
| r31184 | r31185 | |
| 1419 | 1419 | template<typename _Type> _Type playback_read(_Type &result); |
| 1420 | 1420 | time_t playback_init(); |
| 1421 | 1421 | void playback_end(const char *message = NULL); |
| 1422 | | void playback_frame(attotime curtime); |
| 1422 | void playback_frame(const attotime &curtime); |
| 1423 | 1423 | void playback_port(ioport_port &port); |
| 1424 | 1424 | |
| 1425 | 1425 | template<typename _Type> void record_write(_Type value); |
| 1426 | 1426 | void record_init(); |
| 1427 | 1427 | void record_end(const char *message = NULL); |
| 1428 | | void record_frame(attotime curtime); |
| 1428 | void record_frame(const attotime &curtime); |
| 1429 | 1429 | void record_port(ioport_port &port); |
| 1430 | 1430 | |
| 1431 | 1431 | // internal state |
trunk/src/emu/video/fixfreq.c
| r31184 | r31185 | |
| 189 | 189 | screen().configure(m_htotal, m_vtotal, visarea, m_refresh.as_attoseconds()); |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | | void fixedfreq_device::update_screen_parameters(attotime refresh) |
| 192 | void fixedfreq_device::update_screen_parameters(const attotime &refresh) |
| 193 | 193 | { |
| 194 | 194 | rectangle visarea( |
| 195 | 195 | // m_hsync - m_hvisible, |
| r31184 | r31185 | |
| 203 | 203 | screen().configure(m_htotal, m_vtotal, visarea, m_refresh.as_attoseconds()); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | | int fixedfreq_device::sync_separator(attotime time, double newval) |
| 206 | int fixedfreq_device::sync_separator(const attotime &time, double newval) |
| 207 | 207 | { |
| 208 | 208 | int last_vsync = m_sig_vsync; |
| 209 | 209 | int last_comp = m_sig_composite; |
trunk/src/emu/video/fixfreq.h
| r31184 | r31185 | |
| 68 | 68 | //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 69 | 69 | |
| 70 | 70 | void recompute_parameters(bool postload); |
| 71 | | void update_screen_parameters(attotime refresh); |
| 71 | void update_screen_parameters(const attotime &refresh); |
| 72 | 72 | |
| 73 | 73 | private: |
| 74 | 74 | |
| 75 | | int sync_separator(attotime time, double newval); |
| 75 | int sync_separator(const attotime &time, double newval); |
| 76 | 76 | |
| 77 | 77 | int m_htotal; |
| 78 | 78 | int m_vtotal; |
trunk/src/emu/video/voodoo.c
| r31184 | r31185 | |
| 205 | 205 | static void init_tmu(voodoo_state *v, tmu_state *t, voodoo_reg *reg, void *memory, int tmem); |
| 206 | 206 | static void soft_reset(voodoo_state *v); |
| 207 | 207 | static void recompute_video_memory(voodoo_state *v); |
| 208 | | static void check_stalled_cpu(voodoo_state *v, attotime current_time); |
| 209 | | static void flush_fifos(voodoo_state *v, attotime current_time); |
| 208 | static void check_stalled_cpu(voodoo_state *v, const attotime ¤t_time); |
| 209 | static void flush_fifos(voodoo_state *v, const attotime ¤t_time); |
| 210 | 210 | static TIMER_CALLBACK( stall_cpu_callback ); |
| 211 | | static void stall_cpu(voodoo_state *v, int state, attotime current_time); |
| 211 | static void stall_cpu(voodoo_state *v, int state, const attotime ¤t_time); |
| 212 | 212 | static TIMER_CALLBACK( vblank_callback ); |
| 213 | 213 | static INT32 register_w(voodoo_state *v, offs_t offset, UINT32 data); |
| 214 | 214 | static INT32 lfb_w(voodoo_state *v, offs_t offset, UINT32 data, UINT32 mem_mask, int forcefront); |
| r31184 | r31185 | |
| 2108 | 2108 | } |
| 2109 | 2109 | |
| 2110 | 2110 | |
| 2111 | | static void check_stalled_cpu(voodoo_state *v, attotime current_time) |
| 2111 | static void check_stalled_cpu(voodoo_state *v, const attotime ¤t_time) |
| 2112 | 2112 | { |
| 2113 | 2113 | int resume = FALSE; |
| 2114 | 2114 | |
| r31184 | r31185 | |
| 2162 | 2162 | } |
| 2163 | 2163 | |
| 2164 | 2164 | |
| 2165 | | static void stall_cpu(voodoo_state *v, int state, attotime current_time) |
| 2165 | static void stall_cpu(voodoo_state *v, int state, const attotime ¤t_time) |
| 2166 | 2166 | { |
| 2167 | 2167 | /* sanity check */ |
| 2168 | 2168 | if (!v->pci.op_pending) fatalerror("FIFOs not empty, no op pending!\n"); |
| r31184 | r31185 | |
| 3421 | 3421 | * |
| 3422 | 3422 | *************************************/ |
| 3423 | 3423 | |
| 3424 | | static void flush_fifos(voodoo_state *v, attotime current_time) |
| 3424 | static void flush_fifos(voodoo_state *v, const attotime ¤t_time) |
| 3425 | 3425 | { |
| 3426 | 3426 | static UINT8 in_flush; |
| 3427 | 3427 | |
trunk/src/emu/machine/hd63450.h
| r31184 | r31185 | |
| 84 | 84 | template<class _Object> static devcb_base &set_dma_write_3_callback(device_t &device, _Object object) { return downcast<hd63450_device &>(device).m_dma_write_3.set_callback(object); } |
| 85 | 85 | |
| 86 | 86 | static void set_cpu_tag(device_t &device, const char *tag) { downcast<hd63450_device &>(device).m_cpu_tag = tag; } |
| 87 | | static void set_our_clocks(device_t &device, attotime clk1, attotime clk2, attotime clk3, attotime clk4) |
| 87 | static void set_our_clocks(device_t &device, const attotime &clk1, const attotime &clk2, const attotime &clk3, const attotime &clk4) |
| 88 | 88 | { |
| 89 | 89 | hd63450_device &dev = downcast<hd63450_device &>(device); |
| 90 | 90 | dev.m_our_clock[0] = clk1; |
| r31184 | r31185 | |
| 92 | 92 | dev.m_our_clock[2] = clk3; |
| 93 | 93 | dev.m_our_clock[3] = clk4; |
| 94 | 94 | } |
| 95 | | static void set_burst_clocks(device_t &device, attotime clk1, attotime clk2, attotime clk3, attotime clk4) |
| 95 | static void set_burst_clocks(device_t &device, const attotime &clk1, const attotime &clk2, const attotime &clk3, const attotime &clk4) |
| 96 | 96 | { |
| 97 | 97 | hd63450_device &dev = downcast<hd63450_device &>(device); |
| 98 | 98 | dev.m_burst_clock[0] = clk1; |
| r31184 | r31185 | |
| 109 | 109 | DECLARE_WRITE_LINE_MEMBER(drq3_w); |
| 110 | 110 | |
| 111 | 111 | void single_transfer(int x); |
| 112 | | void set_timer(int channel, attotime tm); |
| 112 | void set_timer(int channel, const attotime &tm); |
| 113 | 113 | int get_vector(int channel); |
| 114 | 114 | int get_error_vector(int channel); |
| 115 | 115 | |
trunk/src/emu/machine/ldvp931.c
| r31184 | r31185 | |
| 307 | 307 | // start of the blanking period |
| 308 | 308 | //------------------------------------------------- |
| 309 | 309 | |
| 310 | | void phillips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 310 | void phillips_22vp931_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 311 | 311 | { |
| 312 | 312 | // reset our command counter (debugging only) |
| 313 | 313 | m_cmdcount = 0; |
| r31184 | r31185 | |
| 323 | 323 | // the first visible line of the frame |
| 324 | 324 | //------------------------------------------------- |
| 325 | 325 | |
| 326 | | INT32 phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 326 | INT32 phillips_22vp931_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 327 | 327 | { |
| 328 | 328 | // set the first VBI timer to go at the start of line 16 |
| 329 | 329 | timer_set(screen().time_until_pos(16*2), TID_VBI_DATA_FETCH, LASERDISC_CODE_LINE16 << 2); |
trunk/src/emu/machine/ldvp931.h
| r31184 | r31185 | |
| 80 | 80 | virtual machine_config_constructor device_mconfig_additions() const; |
| 81 | 81 | |
| 82 | 82 | // subclass overrides |
| 83 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 84 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 83 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 84 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 85 | 85 | virtual void player_overlay(bitmap_yuy16 &bitmap) { } |
| 86 | 86 | |
| 87 | 87 | public: |
trunk/src/emu/machine/laserdsc.h
| r31184 | r31185 | |
| 232 | 232 | }; |
| 233 | 233 | |
| 234 | 234 | // subclass overrides |
| 235 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) = 0; |
| 236 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) = 0; |
| 235 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) = 0; |
| 236 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) = 0; |
| 237 | 237 | virtual void player_overlay(bitmap_yuy16 &bitmap) = 0; |
| 238 | 238 | |
| 239 | 239 | // device-level overrides |
| r31184 | r31185 | |
| 252 | 252 | void set_slider_speed(INT32 tracks_per_vsync); |
| 253 | 253 | void advance_slider(INT32 numtracks); |
| 254 | 254 | slider_position get_slider_position(); |
| 255 | | INT32 generic_update(const vbi_metadata &vbi, int fieldnum, attotime curtime, player_state_info &curstate); |
| 255 | INT32 generic_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime, player_state_info &curstate); |
| 256 | 256 | |
| 257 | 257 | // general helpers |
| 258 | 258 | bool is_start_of_frame(const vbi_metadata &vbi); |
trunk/src/emu/machine/ldv1000.c
| r31184 | r31185 | |
| 301 | 301 | // start of the blanking period |
| 302 | 302 | //------------------------------------------------- |
| 303 | 303 | |
| 304 | | void pioneer_ldv1000_device::player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 304 | void pioneer_ldv1000_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 305 | 305 | { |
| 306 | 306 | // generate interrupts if we hit the edges |
| 307 | 307 | slider_position sliderpos = get_slider_position(); |
| r31184 | r31185 | |
| 325 | 325 | // the first visible line of the frame |
| 326 | 326 | //------------------------------------------------- |
| 327 | 327 | |
| 328 | | INT32 pioneer_ldv1000_device::player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 328 | INT32 pioneer_ldv1000_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 329 | 329 | { |
| 330 | 330 | if (LOG_FRAMES_SEEN) |
| 331 | 331 | { |
trunk/src/emu/machine/upd765.c
| r31184 | r31185 | |
| 2333 | 2333 | } |
| 2334 | 2334 | } |
| 2335 | 2335 | |
| 2336 | | bool upd765_family_device::read_one_bit(attotime limit) |
| 2336 | bool upd765_family_device::read_one_bit(const attotime &limit) |
| 2337 | 2337 | { |
| 2338 | 2338 | int bit = cur_live.pll.get_next_bit(cur_live.tm, cur_live.fi->dev, limit); |
| 2339 | 2339 | if(bit < 0) |
| r31184 | r31185 | |
| 2351 | 2351 | return false; |
| 2352 | 2352 | } |
| 2353 | 2353 | |
| 2354 | | bool upd765_family_device::write_one_bit(attotime limit) |
| 2354 | bool upd765_family_device::write_one_bit(const attotime &limit) |
| 2355 | 2355 | { |
| 2356 | 2356 | bool bit = cur_live.shift_reg & 0x8000; |
| 2357 | 2357 | if(cur_live.pll.write_next_bit(bit, cur_live.tm, cur_live.fi->dev, limit)) |
trunk/src/emu/machine/ldv1000.h
| r31184 | r31185 | |
| 73 | 73 | virtual machine_config_constructor device_mconfig_additions() const; |
| 74 | 74 | |
| 75 | 75 | // subclass overrides |
| 76 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 77 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 76 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 77 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 78 | 78 | virtual void player_overlay(bitmap_yuy16 &bitmap) { } |
| 79 | 79 | |
| 80 | 80 | // internal helpers |
trunk/src/emu/machine/upd765.h
| r31184 | r31185 | |
| 267 | 267 | int write_position; |
| 268 | 268 | int freq_hist; |
| 269 | 269 | |
| 270 | | void set_clock(attotime period); |
| 271 | | void reset(attotime when); |
| 272 | | int get_next_bit(attotime &tm, floppy_image_device *floppy, attotime limit); |
| 273 | | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, attotime limit); |
| 274 | | void start_writing(attotime tm); |
| 275 | | void commit(floppy_image_device *floppy, attotime tm); |
| 276 | | void stop_writing(floppy_image_device *floppy, attotime tm); |
| 270 | void set_clock(const attotime &period); |
| 271 | void reset(const attotime &when); |
| 272 | int get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 273 | bool write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit); |
| 274 | void start_writing(const attotime &tm); |
| 275 | void commit(floppy_image_device *floppy, const attotime &tm); |
| 276 | void stop_writing(floppy_image_device *floppy, const attotime &tm); |
| 277 | 277 | }; |
| 278 | 278 | |
| 279 | 279 | struct floppy_info { |
| r31184 | r31185 | |
| 409 | 409 | void live_write_fm(UINT8 fm); |
| 410 | 410 | void live_write_mfm(UINT8 mfm); |
| 411 | 411 | |
| 412 | | bool read_one_bit(attotime limit); |
| 413 | | bool write_one_bit(attotime limit); |
| 412 | bool read_one_bit(const attotime &limit); |
| 413 | bool write_one_bit(const attotime &limit); |
| 414 | 414 | }; |
| 415 | 415 | |
| 416 | 416 | class upd765a_device : public upd765_family_device { |
trunk/src/emu/machine/ldpr8210.c
| r31184 | r31185 | |
| 407 | 407 | // start of the blanking period |
| 408 | 408 | //------------------------------------------------- |
| 409 | 409 | |
| 410 | | void pioneer_pr8210_device::player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 410 | void pioneer_pr8210_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 411 | 411 | { |
| 412 | 412 | // logging |
| 413 | 413 | if (LOG_VBLANK_VBI) |
| r31184 | r31185 | |
| 432 | 432 | // first visible line of the frame |
| 433 | 433 | //------------------------------------------------- |
| 434 | 434 | |
| 435 | | INT32 pioneer_pr8210_device::player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 435 | INT32 pioneer_pr8210_device::player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 436 | 436 | { |
| 437 | 437 | // logging |
| 438 | 438 | if (LOG_VBLANK_VBI) |
| r31184 | r31185 | |
| 934 | 934 | // start of the blanking period |
| 935 | 935 | //------------------------------------------------- |
| 936 | 936 | |
| 937 | | void simutrek_special_device::player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) |
| 937 | void simutrek_special_device::player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) |
| 938 | 938 | { |
| 939 | 939 | // latch the control state after the second field |
| 940 | 940 | if (fieldnum == 1) |
trunk/src/emu/machine/ldpr8210.h
| r31184 | r31185 | |
| 87 | 87 | virtual machine_config_constructor device_mconfig_additions() const; |
| 88 | 88 | |
| 89 | 89 | // subclass overrides |
| 90 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 91 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 90 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 91 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 92 | 92 | virtual void player_overlay(bitmap_yuy16 &bitmap); |
| 93 | 93 | |
| 94 | 94 | // internal helpers |
| r31184 | r31185 | |
| 158 | 158 | }; |
| 159 | 159 | |
| 160 | 160 | // subclass overrides |
| 161 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime); |
| 161 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime); |
| 162 | 162 | |
| 163 | 163 | // device-level overrides |
| 164 | 164 | virtual void device_start(); |
trunk/src/emu/machine/ldstub.h
| r31184 | r31185 | |
| 59 | 59 | |
| 60 | 60 | protected: |
| 61 | 61 | // subclass overrides |
| 62 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) { } |
| 63 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) { return fieldnum; } |
| 62 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { } |
| 63 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { return fieldnum; } |
| 64 | 64 | virtual void player_overlay(bitmap_yuy16 &bitmap) { } |
| 65 | 65 | }; |
| 66 | 66 | |
| r31184 | r31185 | |
| 83 | 83 | |
| 84 | 84 | protected: |
| 85 | 85 | // subclass overrides |
| 86 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) { } |
| 87 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) { return fieldnum; } |
| 86 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { } |
| 87 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { return fieldnum; } |
| 88 | 88 | virtual void player_overlay(bitmap_yuy16 &bitmap) { } |
| 89 | 89 | }; |
| 90 | 90 | |
| r31184 | r31185 | |
| 105 | 105 | |
| 106 | 106 | protected: |
| 107 | 107 | // subclass overrides |
| 108 | | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, attotime curtime) { } |
| 109 | | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, attotime curtime) { return fieldnum; } |
| 108 | virtual void player_vsync(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { } |
| 109 | virtual INT32 player_update(const vbi_metadata &vbi, int fieldnum, const attotime &curtime) { return fieldnum; } |
| 110 | 110 | virtual void player_overlay(bitmap_yuy16 &bitmap) { } |
| 111 | 111 | }; |
| 112 | 112 | |
trunk/src/emu/machine/eeprom.h
| r31184 | r31185 | |
| 67 | 67 | static void static_set_default_data(device_t &device, const UINT8 *data, UINT32 size); |
| 68 | 68 | static void static_set_default_data(device_t &device, const UINT16 *data, UINT32 size); |
| 69 | 69 | static void static_set_default_value(device_t &device, UINT32 value); |
| 70 | | static void static_set_timing(device_t &device, timing_type type, attotime duration); |
| 70 | static void static_set_timing(device_t &device, timing_type type, const attotime &duration); |
| 71 | 71 | |
| 72 | 72 | // read/write/erase data |
| 73 | 73 | UINT32 read(offs_t address); |
trunk/src/emu/sound/3812intf.c
| r31184 | r31185 | |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | | static void timer_handler(void *param,int c,attotime period) |
| 52 | static void timer_handler(void *param,int c,const attotime &period) |
| 53 | 53 | { |
| 54 | 54 | ym3812_device *ym3812 = (ym3812_device *) param; |
| 55 | 55 | ym3812->_timer_handler(c, period); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | | void ym3812_device::_timer_handler(int c, attotime period) |
| 58 | void ym3812_device::_timer_handler(int c, const attotime &period) |
| 59 | 59 | { |
| 60 | 60 | if( period == attotime::zero ) |
| 61 | 61 | { /* Reset FM Timer */ |
trunk/src/emu/sound/speaker.c
| r31184 | r31185 | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
| 320 | | void speaker_sound_device::update_interm_samples(attotime time, int volume) |
| 320 | void speaker_sound_device::update_interm_samples(const attotime &time, int volume) |
| 321 | 321 | { |
| 322 | 322 | double fraction; |
| 323 | 323 | |
| r31184 | r31185 | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | |
| 403 | | inline double speaker_sound_device::make_fraction(attotime a, attotime b, double timediv) |
| 403 | inline double speaker_sound_device::make_fraction(const attotime &a, const attotime &b, double timediv) |
| 404 | 404 | { |
| 405 | 405 | /* fraction = (a - b) / timediv */ |
| 406 | 406 | return (a - b).as_double() / timediv; |
trunk/src/emu/sound/speaker.h
| r31184 | r31185 | |
| 48 | 48 | // internal state |
| 49 | 49 | |
| 50 | 50 | // Updates the composed volume array according to time |
| 51 | | void update_interm_samples(attotime time, int volume); |
| 51 | void update_interm_samples(const attotime &time, int volume); |
| 52 | 52 | |
| 53 | 53 | // Updates the composed volume array and returns final filtered volume of next stream sample |
| 54 | 54 | double update_interm_samples_get_filtered_volume(int volume); |
| 55 | 55 | |
| 56 | 56 | void finalize_interm_sample(int volume); |
| 57 | 57 | void init_next_interm_sample(); |
| 58 | | inline double make_fraction(attotime a, attotime b, double timediv); |
| 58 | inline double make_fraction(const attotime &a, const attotime &b, double timediv); |
| 59 | 59 | double get_filtered_volume(); |
| 60 | 60 | |
| 61 | 61 | // Kernel (pulse response) for filtering across samples (while we avoid fancy filtering within samples) |
trunk/src/emu/sound/8950intf.c
| r31184 | r31185 | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | | static void timer_handler(void *param, int c, attotime period) |
| 49 | static void timer_handler(void *param, int c, const attotime &period) |
| 50 | 50 | { |
| 51 | 51 | y8950_device *y8950 = (y8950_device *) param; |
| 52 | 52 | y8950->_timer_handler(c, period); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | void y8950_device::_timer_handler(int c, attotime period) |
| 55 | void y8950_device::_timer_handler(int c, const attotime &period) |
| 56 | 56 | { |
| 57 | 57 | if( period == attotime::zero ) |
| 58 | 58 | { /* Reset FM Timer */ |
trunk/src/emu/sound/262intf.c
| r31184 | r31185 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| 42 | | static void timer_handler(void *param, int c, attotime period) |
| 42 | static void timer_handler(void *param, int c, const attotime &period) |
| 43 | 43 | { |
| 44 | 44 | ymf262_device *ymf262 = (ymf262_device *) param; |
| 45 | 45 | ymf262->_timer_handler(c, period); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | | void ymf262_device::_timer_handler(int c, attotime period) |
| 48 | void ymf262_device::_timer_handler(int c, const attotime &period) |
| 49 | 49 | { |
| 50 | 50 | if( period == attotime::zero ) |
| 51 | 51 | { /* Reset FM Timer */ |
trunk/src/emu/sound/3526intf.c
| r31184 | r31185 | |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | | static void timer_handler(void *param,int c,attotime period) |
| 52 | static void timer_handler(void *param,int c,const attotime &period) |
| 53 | 53 | { |
| 54 | 54 | ym3526_device *ym3526 = (ym3526_device *) param; |
| 55 | 55 | ym3526->_timer_handler(c, period); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | | void ym3526_device::_timer_handler(int c,attotime period) |
| 58 | void ym3526_device::_timer_handler(int c,const attotime &period) |
| 59 | 59 | { |
| 60 | 60 | if( period == attotime::zero ) |
| 61 | 61 | { /* Reset FM Timer */ |
trunk/src/emu/sound/fmopl.h
| r31184 | r31185 | |
| 32 | 32 | #endif |
| 33 | 33 | */ |
| 34 | 34 | |
| 35 | | typedef void (*OPL_TIMERHANDLER)(void *param,int timer,attotime period); |
| 35 | typedef void (*OPL_TIMERHANDLER)(void *param,int timer,const attotime &period); |
| 36 | 36 | typedef void (*OPL_IRQHANDLER)(void *param,int irq); |
| 37 | 37 | typedef void (*OPL_UPDATEHANDLER)(void *param,int min_interval_us); |
| 38 | 38 | typedef void (*OPL_PORTHANDLER_W)(void *param,unsigned char data); |
trunk/src/emu/device.c
| r31184 | r31185 | |
| 316 | 316 | // attotime to CPU clock ticks |
| 317 | 317 | //------------------------------------------------- |
| 318 | 318 | |
| 319 | | UINT64 device_t::attotime_to_clocks(attotime duration) const |
| 319 | UINT64 device_t::attotime_to_clocks(const attotime &duration) const |
| 320 | 320 | { |
| 321 | 321 | return mulu_32x32(duration.seconds, m_clock) + (UINT64)duration.attoseconds / (UINT64)m_attoseconds_per_clock; |
| 322 | 322 | } |
| r31184 | r31185 | |
| 338 | 338 | // call our device callback |
| 339 | 339 | //------------------------------------------------- |
| 340 | 340 | |
| 341 | | void device_t::timer_set(attotime duration, device_timer_id id, int param, void *ptr) |
| 341 | void device_t::timer_set(const attotime &duration, device_timer_id id, int param, void *ptr) |
| 342 | 342 | { |
| 343 | 343 | machine().scheduler().timer_set(duration, *this, id, param, ptr); |
| 344 | 344 | } |
trunk/src/emu/device.h
| r31184 | r31185 | |
| 110 | 110 | virtual ~device_t(); |
| 111 | 111 | |
| 112 | 112 | // getters |
| 113 | | running_machine &machine() const { assert(m_machine != NULL); return *m_machine; } |
| 113 | running_machine &machine() const { /*assert(m_machine != NULL);*/ return *m_machine; } |
| 114 | 114 | const char *tag() const { return m_tag; } |
| 115 | 115 | const char *basetag() const { return m_basetag; } |
| 116 | 116 | device_type type() const { return m_type; } |
| r31184 | r31185 | |
| 180 | 180 | double clock_scale() const { return m_clock_scale; } |
| 181 | 181 | void set_clock_scale(double clockscale); |
| 182 | 182 | attotime clocks_to_attotime(UINT64 clocks) const; |
| 183 | | UINT64 attotime_to_clocks(attotime duration) const; |
| 183 | UINT64 attotime_to_clocks(const attotime &duration) const; |
| 184 | 184 | |
| 185 | 185 | // timer interfaces |
| 186 | 186 | emu_timer *timer_alloc(device_timer_id id = 0, void *ptr = NULL); |
| 187 | | void timer_set(attotime duration, device_timer_id id = 0, int param = 0, void *ptr = NULL); |
| 187 | void timer_set(const attotime &duration, device_timer_id id = 0, int param = 0, void *ptr = NULL); |
| 188 | 188 | void synchronize(device_timer_id id = 0, int param = 0, void *ptr = NULL) { timer_set(attotime::zero, id, param, ptr); } |
| 189 | 189 | void timer_expired(emu_timer &timer, device_timer_id id, int param, void *ptr) { device_timer(timer, id, param, ptr); } |
| 190 | 190 | |
trunk/src/emu/timer.c
| r31184 | r31185 | |
| 68 | 68 | // helper to set up a periodic timer |
| 69 | 69 | //------------------------------------------------- |
| 70 | 70 | |
| 71 | | void timer_device::static_configure_periodic(device_t &device, timer_device_expired_delegate callback, attotime period) |
| 71 | void timer_device::static_configure_periodic(device_t &device, timer_device_expired_delegate callback, const attotime &period) |
| 72 | 72 | { |
| 73 | 73 | timer_device &timer = downcast<timer_device &>(device); |
| 74 | 74 | timer.m_type = TIMER_TYPE_PERIODIC; |
| r31184 | r31185 | |
| 110 | 110 | // to set the starting delay |
| 111 | 111 | //------------------------------------------------- |
| 112 | 112 | |
| 113 | | void timer_device::static_set_start_delay(device_t &device, attotime delay) |
| 113 | void timer_device::static_set_start_delay(device_t &device, const attotime &delay) |
| 114 | 114 | { |
| 115 | 115 | timer_device &timer = downcast<timer_device &>(device); |
| 116 | 116 | timer.m_start_delay = delay; |
trunk/src/emu/timer.h
| r31184 | r31185 | |
| 85 | 85 | |
| 86 | 86 | // inline configuration helpers |
| 87 | 87 | static void static_configure_generic(device_t &device, timer_device_expired_delegate callback); |
| 88 | | static void static_configure_periodic(device_t &device, timer_device_expired_delegate callback, attotime period); |
| 88 | static void static_configure_periodic(device_t &device, timer_device_expired_delegate callback, const attotime &period); |
| 89 | 89 | static void static_configure_scanline(device_t &device, timer_device_expired_delegate callback, const char *screen, int first_vpos, int increment); |
| 90 | 90 | static void static_set_callback(device_t &device, timer_device_expired_delegate callback); |
| 91 | | static void static_set_start_delay(device_t &device, attotime delay); |
| 91 | static void static_set_start_delay(device_t &device, const attotime &delay); |
| 92 | 92 | static void static_set_param(device_t &device, int param); |
| 93 | 93 | static void static_set_ptr(device_t &device, void *ptr); |
| 94 | 94 | |
| r31184 | r31185 | |
| 104 | 104 | |
| 105 | 105 | // adjustments |
| 106 | 106 | void reset() { adjust(attotime::never, 0, attotime::never); } |
| 107 | | void adjust(attotime duration, INT32 param = 0, attotime period = attotime::never) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } |
| 107 | void adjust(const attotime &duration, INT32 param = 0, const attotime &period = attotime::never) { assert(m_type == TIMER_TYPE_GENERIC); m_timer->adjust(duration, param, period); } |
| 108 | 108 | |
| 109 | 109 | // timing information |
| 110 | 110 | attotime time_elapsed() const { return m_timer->elapsed(); } |
trunk/src/emu/diexec.c
| r31184 | r31185 | |
| 115 | 115 | // to set up periodic interrupts on the device |
| 116 | 116 | //------------------------------------------------- |
| 117 | 117 | |
| 118 | | void device_execute_interface::static_set_periodic_int(device_t &device, device_interrupt_delegate function, attotime rate) |
| 118 | void device_execute_interface::static_set_periodic_int(device_t &device, device_interrupt_delegate function, const attotime &rate) |
| 119 | 119 | { |
| 120 | 120 | device_execute_interface *exec; |
| 121 | 121 | if (!device.interface(exec)) |
| r31184 | r31185 | |
| 265 | 265 | // period of time |
| 266 | 266 | //------------------------------------------------- |
| 267 | 267 | |
| 268 | | void device_execute_interface::spin_until_time(attotime duration) |
| 268 | void device_execute_interface::spin_until_time(const attotime &duration) |
| 269 | 269 | { |
| 270 | 270 | static int timetrig = 0; |
| 271 | 271 | |
trunk/src/emu/cpu/h8/h8_sci.h
| r31184 | r31185 | |
| 61 | 61 | h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 62 | 62 | |
| 63 | 63 | void set_info(const char *intc, int eri, int rxi, int txi, int tei); |
| 64 | | void set_external_clock_period(attotime _period); |
| 64 | void set_external_clock_period(const attotime &_period); |
| 65 | 65 | |
| 66 | 66 | DECLARE_WRITE8_MEMBER(smr_w); |
| 67 | 67 | DECLARE_READ8_MEMBER(smr_r); |
trunk/src/emu/diexec.h
| r31184 | r31185 | |
| 142 | 142 | UINT32 min_cycles() const { return execute_min_cycles(); } |
| 143 | 143 | UINT32 max_cycles() const { return execute_max_cycles(); } |
| 144 | 144 | attotime cycles_to_attotime(UINT64 cycles) const { return device().clocks_to_attotime(cycles_to_clocks(cycles)); } |
| 145 | | UINT64 attotime_to_cycles(attotime duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); } |
| 145 | UINT64 attotime_to_cycles(const attotime &duration) const { return clocks_to_cycles(device().attotime_to_clocks(duration)); } |
| 146 | 146 | UINT32 input_lines() const { return execute_input_lines(); } |
| 147 | 147 | UINT32 default_irq_vector() const { return execute_default_irq_vector(); } |
| 148 | 148 | bool is_octal() const { return m_is_octal; } |
| r31184 | r31185 | |
| 150 | 150 | // static inline configuration helpers |
| 151 | 151 | static void static_set_disable(device_t &device); |
| 152 | 152 | static void static_set_vblank_int(device_t &device, device_interrupt_delegate function, const char *tag, int rate = 0); |
| 153 | | static void static_set_periodic_int(device_t &device, device_interrupt_delegate function, attotime rate); |
| 153 | static void static_set_periodic_int(device_t &device, device_interrupt_delegate function, const attotime &rate); |
| 154 | 154 | static void static_set_irq_acknowledge_callback(device_t &device, device_irq_acknowledge_delegate callback); |
| 155 | 155 | |
| 156 | 156 | // execution management |
| r31184 | r31185 | |
| 173 | 173 | void yield() { suspend(SUSPEND_REASON_TIMESLICE, false); } |
| 174 | 174 | void spin() { suspend(SUSPEND_REASON_TIMESLICE, true); } |
| 175 | 175 | void spin_until_trigger(int trigid) { suspend_until_trigger(trigid, true); } |
| 176 | | void spin_until_time(attotime duration); |
| 176 | void spin_until_time(const attotime &duration); |
| 177 | 177 | void spin_until_interrupt() { spin_until_trigger(m_inttrigger); } |
| 178 | 178 | |
| 179 | 179 | // triggers |
trunk/src/emu/diserial.h
| r31184 | r31185 | |
| 88 | 88 | void receive_register_update_bit(int bit); |
| 89 | 89 | void receive_register_extract(); |
| 90 | 90 | |
| 91 | | void set_rcv_rate(attotime rate); |
| 92 | | void set_tra_rate(attotime rate); |
| 91 | void set_rcv_rate(const attotime &rate); |
| 92 | void set_tra_rate(const attotime &rate); |
| 93 | 93 | void set_rcv_rate(UINT32 clock, int div) { set_rcv_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } |
| 94 | 94 | void set_tra_rate(UINT32 clock, int div) { set_tra_rate((clock && div) ? (attotime::from_hz(clock) * div) : attotime::never); } |
| 95 | 95 | void set_rcv_rate(int baud) { set_rcv_rate(baud ? attotime::from_hz(baud) : attotime::never); } |
| 96 | 96 | void set_tra_rate(int baud) { set_tra_rate(baud ? attotime::from_hz(baud) : attotime::never); } |
| 97 | | void set_rate(attotime rate) { set_rcv_rate(rate); set_tra_rate(rate); } |
| 97 | void set_rate(const attotime &rate) { set_rcv_rate(rate); set_tra_rate(rate); } |
| 98 | 98 | void set_rate(UINT32 clock, int div) { set_rcv_rate(clock, div); set_tra_rate(clock, div); } |
| 99 | 99 | void set_rate(int baud) { set_rcv_rate(baud); set_tra_rate(baud); } |
| 100 | 100 | |
trunk/src/mame/machine/cdislave.c
| r31184 | r31185 | |
| 60 | 60 | m_interrupt_timer->adjust(attotime::never); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | | void cdislave_device::prepare_readback(attotime delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd) |
| 63 | void cdislave_device::prepare_readback(const attotime &delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd) |
| 64 | 64 | { |
| 65 | 65 | m_channel[channel].m_out_index = 0; |
| 66 | 66 | m_channel[channel].m_out_count = count; |
trunk/src/mame/machine/cdislave.h
| r31184 | r31185 | |
| 100 | 100 | // static internal members |
| 101 | 101 | |
| 102 | 102 | // non-static internal members |
| 103 | | void prepare_readback(attotime delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd); |
| 103 | void prepare_readback(const attotime &delay, UINT8 channel, UINT8 count, UINT8 data0, UINT8 data1, UINT8 data2, UINT8 data3, UINT8 cmd); |
| 104 | 104 | void perform_mouse_update(); |
| 105 | 105 | void set_mouse_position(); |
| 106 | 106 | }; |
trunk/src/mame/includes/gottlieb.h
| r31184 | r31185 | |
| 305 | 305 | void draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 306 | 306 | inline void audio_end_state(); |
| 307 | 307 | void audio_process_clock(int logit); |
| 308 | | void audio_handle_zero_crossing(attotime zerotime, int logit); |
| 308 | void audio_handle_zero_crossing(const attotime &zerotime, int logit); |
| 309 | 309 | void laserdisc_audio_process(laserdisc_device &device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1); |
| 310 | 310 | |
| 311 | 311 | protected: |
trunk/src/mame/includes/n8080.h
| r31184 | r31185 | |
| 104 | 104 | void spacefev_update_SN76477_status(); |
| 105 | 105 | void sheriff_update_SN76477_status(); |
| 106 | 106 | void update_SN76477_status(); |
| 107 | | void start_mono_flop( int n, attotime expire ); |
| 107 | void start_mono_flop( int n, const attotime &expire ); |
| 108 | 108 | void stop_mono_flop( int n ); |
| 109 | 109 | TIMER_CALLBACK_MEMBER( stop_mono_flop_callback ); |
| 110 | 110 | void spacefev_sound_pins_changed(); |