| Previous | 199869 Revisions | Next |
| r41678 Wednesday 11th November, 2015 at 15:31:18 UTC by Miodrag Milanović |
|---|
| Some cleanups and init fixes with help of ReSharper C++ (nw) |
| [src/devices/imagedev] | cassette.cpp chd_cd.cpp flopdrv.cpp flopdrv.h floppy.cpp mfmhd.cpp mfmhd.h midiin.cpp midiout.cpp |
| [src/devices/machine] | keyboard.cpp legscsi.cpp ram.cpp terminal.cpp |
| [src/devices/sound] | samples.cpp |
| [src/devices/video] | poly.h |
| [src/emu] | addrmap.cpp audit.cpp debugger.cpp devcb.cpp devcpu.cpp devfind.cpp devfind.h device.h diexec.h digfx.cpp diimage.cpp diimage.h dinetwork.cpp dinetwork.h dioutput.cpp dioutput.h dipty.cpp dipty.h dirtc.h diserial.cpp dislot.cpp disound.cpp distate.cpp distate.h drawgfxm.h drivenum.cpp drivenum.h emualloc.cpp emupal.cpp hashfile.cpp input.cpp ioport.cpp ioport.h luaengine.cpp machine.cpp machine.h mame.cpp memory.cpp network.cpp render.cpp render.h rendfont.cpp rendlay.cpp romload.cpp save.cpp schedule.cpp screen.cpp softlist.cpp sound.cpp speaker.cpp sprite.h tilemap.cpp timer.cpp uiinput.cpp video.cpp |
| [src/emu/debug] | debugcmd.cpp debugcon.cpp debugcpu.cpp debugvw.cpp debugvw.h dvmemory.h express.cpp |
| [src/emu/drivers] | testcpu.cpp |
| [src/emu/machine] | generic.cpp |
| [src/emu/ui] | cheatopt.cpp filemngr.cpp filesel.cpp imgcntrl.cpp inputmap.cpp mainmenu.cpp menu.cpp menu.h miscmenu.cpp selgame.cpp swlist.cpp ui.cpp videoopt.cpp viewgfx.cpp |
| [src/emu/video] | resnet.cpp rgbgen.h rgbvmx.h vector.cpp |
| r250189 | r250190 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | cassette_image_device::cassette_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 32 | 32 | : device_t(mconfig, CASSETTE, "Cassette", tag, owner, clock, "cassette_image", __FILE__), |
| 33 | device_image_interface(mconfig, *this), | |
| 34 | m_state(CASSETTE_STOPPED), | |
| 33 | device_image_interface(mconfig, *this), | |
| 34 | m_cassette(NULL), | |
| 35 | m_state(CASSETTE_STOPPED), | |
| 36 | m_position(0), | |
| 37 | m_position_time(0), | |
| 38 | m_value(0), | |
| 39 | m_channel(0), | |
| 40 | m_speed(0), | |
| 41 | m_direction(0), | |
| 35 | 42 | m_formats(cassette_default_formats), |
| 36 | 43 | m_create_opts(NULL), |
| 37 | 44 | m_default_state(CASSETTE_PLAY), |
| r250189 | r250190 | |
| 423 | 430 | if (position > length) |
| 424 | 431 | { |
| 425 | 432 | m_state = (cassette_state)(( m_state & ~CASSETTE_MASK_UISTATE ) | CASSETTE_STOPPED); |
| 426 | position = length; | |
| 427 | 433 | } |
| 428 | 434 | } |
| 429 | 435 | } |
| r250189 | r250190 | |
|---|---|---|
| 28 | 28 | |
| 29 | 29 | cdrom_image_device::cdrom_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 30 | 30 | : device_t(mconfig, CDROM, "CD-ROM Image", tag, owner, clock, "cdrom_image", __FILE__), |
| 31 | device_image_interface(mconfig, *this), | |
| 31 | device_image_interface(mconfig, *this), | |
| 32 | m_cdrom_handle(NULL), | |
| 33 | m_extension_list(NULL), | |
| 32 | 34 | m_interface(NULL) |
| 33 | 35 | { |
| 34 | 36 | } |
| 35 | 37 | |
| 36 | 38 | cdrom_image_device::cdrom_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 37 | 39 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 38 | device_image_interface(mconfig, *this), | |
| 40 | device_image_interface(mconfig, *this), | |
| 41 | m_cdrom_handle(NULL), | |
| 42 | m_extension_list(NULL), | |
| 39 | 43 | m_interface(NULL) |
| 40 | 44 | { |
| 41 | 45 | } |
| r250189 | r250190 | |
|---|---|---|
| 709 | 709 | m_rdy(0), |
| 710 | 710 | m_dskchg(0), |
| 711 | 711 | m_drive_id(0), |
| 712 | m_active(0), | |
| 712 | m_active(0), | |
| 713 | m_config(NULL), | |
| 713 | 714 | m_flags(0), |
| 714 | 715 | m_max_track(0), |
| 715 | 716 | m_num_sides(0), |
| 716 | m_current_track(0), | |
| 717 | m_current_track(0), | |
| 718 | m_index_timer(NULL), | |
| 717 | 719 | m_index_pulse_callback(NULL), |
| 718 | 720 | m_rpm(0.0f), |
| 719 | 721 | m_id_index(0), |
| r250189 | r250190 | |
| 741 | 743 | m_rdy(0), |
| 742 | 744 | m_dskchg(0), |
| 743 | 745 | m_drive_id(0), |
| 744 | m_active(0), | |
| 746 | m_active(0), | |
| 747 | m_config(NULL), | |
| 745 | 748 | m_flags(0), |
| 746 | 749 | m_max_track(0), |
| 747 | 750 | m_num_sides(0), |
| 748 | m_current_track(0), | |
| 751 | m_current_track(0), | |
| 752 | m_index_timer(NULL), | |
| 749 | 753 | m_index_pulse_callback(NULL), |
| 750 | 754 | m_rpm(0.0f), |
| 751 | 755 | m_id_index(0), |
| r250189 | r250190 | |
|---|---|---|
| 161 | 161 | TIMER_CALLBACK_MEMBER(floppy_drive_index_callback); |
| 162 | 162 | void floppy_drive_init(); |
| 163 | 163 | void floppy_drive_index_func(); |
| 164 | TIMER_CALLBACK(floppy_drive_index_callback); | |
| 165 | 164 | int internal_floppy_device_load(int create_format, option_resolution *create_args); |
| 166 | 165 | TIMER_CALLBACK_MEMBER( set_wpt ); |
| 167 | 166 |
| r250189 | r250190 | |
|---|---|---|
| 7 | 7 | *********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "emu.h" |
| 10 | #include "emuopts.h" | |
| 11 | 10 | #include "ui/menu.h" |
| 12 | 11 | #include "ui/filesel.h" |
| 13 | 12 | #include "zippath.h" |
| r250189 | r250190 | |
| 127 | 126 | |
| 128 | 127 | floppy_connector::floppy_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 129 | 128 | device_t(mconfig, FLOPPY_CONNECTOR, "Floppy drive connector abstraction", tag, owner, clock, "floppy_connector", __FILE__), |
| 130 | device_slot_interface(mconfig, *this), | |
| 129 | device_slot_interface(mconfig, *this), | |
| 130 | formats(NULL), | |
| 131 | 131 | m_enable_sound(false) |
| 132 | 132 | { |
| 133 | 133 | } |
| r250189 | r250190 | |
| 167 | 167 | floppy_image_device::floppy_image_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 168 | 168 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 169 | 169 | device_image_interface(mconfig, *this), |
| 170 | device_slot_card_interface(mconfig, *this), | |
| 170 | device_slot_card_interface(mconfig, *this), | |
| 171 | input_format(NULL), | |
| 172 | output_format(NULL), | |
| 171 | 173 | image(NULL), |
| 172 | fif_list(NULL), | |
| 173 | m_make_sound(false) | |
| 174 | fif_list(NULL), | |
| 175 | index_timer(NULL), | |
| 176 | tracks(0), | |
| 177 | sides(0), | |
| 178 | form_factor(0), | |
| 179 | motor_always_on(false), | |
| 180 | dir(0), stp(0), wtg(0), mon(0), ss(0), idx(0), wpt(0), rdy(0), dskchg(0), | |
| 181 | ready(false), | |
| 182 | rpm(0), | |
| 183 | floppy_ratio_1(0), | |
| 184 | revolution_count(0), | |
| 185 | cyl(0), | |
| 186 | subcyl(0), | |
| 187 | image_dirty(false), | |
| 188 | ready_counter(0), | |
| 189 | m_make_sound(false), | |
| 190 | m_sound_out(NULL) | |
| 174 | 191 | { |
| 175 | 192 | extension_list[0] = '\0'; |
| 176 | 193 | m_err = IMAGE_ERROR_INVALIDIMAGE; |
| r250189 | r250190 | |
| 983 | 1000 | |
| 984 | 1001 | bool can_in_place = input_format->supports_save(); |
| 985 | 1002 | if(can_in_place) { |
| 986 | file_error filerr | |
| 1003 | file_error filerr; | |
| 987 | 1004 | std::string tmp_path; |
| 988 | 1005 | core_file *tmp_file; |
| 989 | 1006 | /* attempt to open the file for writing but *without* create */ |
| r250189 | r250190 | |
| 1004 | 1021 | switch (state) { |
| 1005 | 1022 | case DO_CREATE: { |
| 1006 | 1023 | floppy_image_format_t *fif_list = fd->get_formats(); |
| 1007 | int ext_match = 0, total_usable = 0; | |
| 1008 | for(floppy_image_format_t *i = fif_list; i; i = i->next) { | |
| 1024 | int ext_match; | |
| 1025 | int total_usable = 0; | |
| 1026 | for(floppy_image_format_t *i = fif_list; i; i = i->next) { | |
| 1009 | 1027 | if(!i->supports_save()) |
| 1010 | 1028 | continue; |
| 1011 | 1029 | if (i->extension_matches(current_file.c_str())) |
| r250189 | r250190 | |
| 1085 | 1103 | //=================================================================== |
| 1086 | 1104 | |
| 1087 | 1105 | floppy_sound_device::floppy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1088 | : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__) | |
| 1106 | : samples_device(mconfig, FLOPPYSOUND, "Floppy sound", tag, owner, clock, "flopsnd", __FILE__), | |
| 1107 | m_sound(NULL), | |
| 1108 | m_is525(false), | |
| 1109 | m_sampleindex_motor_start(0), | |
| 1110 | m_sampleindex_motor_loop(0), | |
| 1111 | m_sampleindex_motor_end(0), | |
| 1112 | m_samplesize_motor_start(0), | |
| 1113 | m_samplesize_motor_loop(0), | |
| 1114 | m_samplesize_motor_end(0), | |
| 1115 | m_samplepos_motor(0), | |
| 1116 | m_motor_playback_state(0), | |
| 1117 | m_motor_on(false), | |
| 1118 | m_step_samples(0), | |
| 1119 | m_sampleindex_step1(0), | |
| 1120 | m_samplepos_step(0), | |
| 1121 | m_step_playback_state(0) | |
| 1089 | 1122 | { |
| 1090 | 1123 | m_loaded = false; |
| 1091 | 1124 | } |
| r250189 | r250190 | |
| 1193 | 1226 | // Also, there is no need for interpolation, as we only expect |
| 1194 | 1227 | // one sample rate of 44100 for all samples |
| 1195 | 1228 | |
| 1196 | INT16 out | |
| 1229 | INT16 out; | |
| 1197 | 1230 | stream_sample_t *samplebuffer = outputs[0]; |
| 1198 | 1231 | |
| 1199 | 1232 | while (samples-- > 0) |
| r250189 | r250190 | |
|---|---|---|
| 270 | 270 | **************************************************************************/ |
| 271 | 271 | |
| 272 | 272 | #include "emu.h" |
| 273 | #include "formats/imageutl.h" | |
| 274 | 273 | #include "harddisk.h" |
| 275 | 274 | #include "mfmhd.h" |
| 276 | 275 | |
| r250189 | r250190 | |
| 310 | 309 | |
| 311 | 310 | mfm_harddisk_device::mfm_harddisk_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 312 | 311 | : harddisk_image_device(mconfig, type, name, tag, owner, clock, shortname, source), |
| 313 | device_slot_card_interface(mconfig, *this) | |
| 312 | device_slot_card_interface(mconfig, *this), | |
| 313 | m_index_timer(NULL), | |
| 314 | m_spinup_timer(NULL), | |
| 315 | m_seek_timer(NULL), | |
| 316 | m_cache_timer(NULL), | |
| 317 | m_precomp_cyl(0), | |
| 318 | m_redwc_cyl(0), | |
| 319 | m_encoding(), | |
| 320 | m_ready(false), | |
| 321 | m_current_cylinder(0), | |
| 322 | m_current_head(0), | |
| 323 | m_track_delta(0), | |
| 324 | m_step_phase(0), | |
| 325 | m_seek_complete(false), | |
| 326 | m_seek_inward(false), | |
| 327 | m_autotruncation(false), | |
| 328 | m_recalibrated(false), | |
| 329 | m_step_line(), | |
| 330 | m_format(NULL) | |
| 314 | 331 | { |
| 315 | 332 | m_spinupms = 10000; |
| 316 | 333 | m_cachelines = 5; |
| r250189 | r250190 | |
| 952 | 969 | // This is a write-back LRU cache. |
| 953 | 970 | // =========================================================== |
| 954 | 971 | |
| 955 | mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine): | |
| 972 | mfmhd_trackimage_cache::mfmhd_trackimage_cache(running_machine &machine): | |
| 973 | m_mfmhd(NULL), | |
| 956 | 974 | m_tracks(NULL), |
| 957 | 975 | m_machine(machine) |
| 958 | 976 | { |
| r250189 | r250190 | |
| 1026 | 1044 | { |
| 1027 | 1045 | if (TRACE_CACHE) m_machine.logerror("%s: MFM HD cache init; cache size is %d tracks\n", mfmhd->tag(), trackslots); |
| 1028 | 1046 | |
| 1029 | chd_error state | |
| 1047 | chd_error state; | |
| 1030 | 1048 | |
| 1031 | mfmhd_trackimage* previous | |
| 1049 | mfmhd_trackimage* previous; | |
| 1032 | 1050 | mfmhd_trackimage* current = NULL; |
| 1033 | 1051 | |
| 1034 | 1052 | m_mfmhd = mfmhd; |
| r250189 | r250190 | |
| 1141 | 1159 | |
| 1142 | 1160 | mfm_harddisk_connector::mfm_harddisk_connector(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock): |
| 1143 | 1161 | device_t(mconfig, MFM_HD_CONNECTOR, "MFM hard disk connector", tag, owner, clock, "mfm_hd_connector", __FILE__), |
| 1144 | device_slot_interface(mconfig, *this) | |
| 1162 | device_slot_interface(mconfig, *this), | |
| 1163 | m_encoding(), | |
| 1164 | m_spinupms(0), | |
| 1165 | m_cachesize(0), | |
| 1166 | m_format(NULL) | |
| 1145 | 1167 | { |
| 1146 | 1168 | } |
| 1147 | 1169 |
| r250189 | r250190 | |
|---|---|---|
| 154 | 154 | mfmhd_trackimage_cache* m_cache; |
| 155 | 155 | mfmhd_image_format_t* m_format; |
| 156 | 156 | |
| 157 | void prepare_track(int cylinder, int head); | |
| 158 | 157 | void head_move(); |
| 159 | 158 | void recalibrate(); |
| 160 | 159 |
| r250189 | r250190 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | midiin_device::midiin_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 26 | 26 | : device_t(mconfig, MIDIIN, "MIDI In image device", tag, owner, clock, "midiin", __FILE__), |
| 27 | device_image_interface(mconfig, *this), | |
| 28 | device_serial_interface(mconfig, *this), | |
| 29 | m_input_cb(*this) | |
| 27 | device_image_interface(mconfig, *this), | |
| 28 | device_serial_interface(mconfig, *this), | |
| 29 | m_midi(NULL), | |
| 30 | m_timer(NULL), | |
| 31 | m_input_cb(*this), | |
| 32 | m_xmit_read(0), | |
| 33 | m_xmit_write(0), | |
| 34 | m_tx_busy(false) | |
| 30 | 35 | { |
| 31 | 36 | } |
| 32 | 37 |
| r250189 | r250190 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | midiout_device::midiout_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 26 | 26 | : device_t(mconfig, MIDIOUT, "MIDI Out image device", tag, owner, clock, "midiout", __FILE__), |
| 27 | device_image_interface(mconfig, *this), | |
| 28 | device_serial_interface(mconfig, *this) | |
| 27 | device_image_interface(mconfig, *this), | |
| 28 | device_serial_interface(mconfig, *this), | |
| 29 | m_midi(NULL) | |
| 29 | 30 | { |
| 30 | 31 | } |
| 31 | 32 |
| r250189 | r250190 | |
|---|---|---|
| 43 | 43 | m_io_kbd7(*this, "TERM_LINE7"), |
| 44 | 44 | m_io_kbd8(*this, "TERM_LINE8"), |
| 45 | 45 | m_io_kbd9(*this, "TERM_LINE9"), |
| 46 | m_io_kbdc(*this, "TERM_LINEC"), | |
| 46 | m_io_kbdc(*this, "TERM_LINEC"), | |
| 47 | m_timer(NULL), | |
| 48 | m_last_code(0), | |
| 49 | m_scan_line(0), | |
| 47 | 50 | m_keyboard_cb(*this) |
| 48 | 51 | { |
| 49 | 52 | } |
| r250189 | r250190 | |
| 61 | 64 | m_io_kbd8(*this, "TERM_LINE8"), |
| 62 | 65 | m_io_kbd9(*this, "TERM_LINE9"), |
| 63 | 66 | m_io_kbdc(*this, "TERM_LINEC"), |
| 67 | m_timer(NULL), | |
| 68 | m_last_code(0), | |
| 69 | m_scan_line(0), | |
| 64 | 70 | m_keyboard_cb(*this) |
| 65 | 71 | { |
| 66 | 72 | } |
| r250189 | r250190 | |
|---|---|---|
| 3 | 3 | #include "legscsi.h" |
| 4 | 4 | |
| 5 | 5 | legacy_scsi_host_adapter::legacy_scsi_host_adapter(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : |
| 6 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 6 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 7 | m_selected(0), | |
| 7 | 8 | m_scsi_port(*this) |
| 8 | 9 | { |
| 9 | 10 | } |
| r250189 | r250190 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | const char *ramsize_string = NULL; |
| 80 | 80 | int is_valid = FALSE; |
| 81 | UINT32 specified_ram = 0; | |
| 82 | const char *gamename_option = NULL; | |
| 81 | UINT32 specified_ram; | |
| 82 | const char *gamename_option; | |
| 83 | 83 | |
| 84 | 84 | /* verify default ram value */ |
| 85 | 85 | if (default_size() == 0) |
| r250189 | r250190 | |
| 183 | 183 | UINT32 ram; |
| 184 | 184 | char suffix = '\0'; |
| 185 | 185 | |
| 186 | s | |
| 186 | sscanf(s, "%u%c", &ram, &suffix); | |
| 187 | 187 | |
| 188 | 188 | switch(tolower(suffix)) |
| 189 | 189 | { |
| r250189 | r250190 | |
|---|---|---|
| 143 | 143 | generic_terminal_device::generic_terminal_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 144 | 144 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 145 | 145 | m_palette(*this, "palette"), |
| 146 | m_io_term_conf(*this, "TERM_CONF"), | |
| 146 | m_io_term_conf(*this, "TERM_CONF"), | |
| 147 | m_x_pos(0), | |
| 148 | m_framecnt(0), | |
| 149 | m_y_pos(0), | |
| 147 | 150 | m_keyboard_cb(*this) |
| 148 | 151 | { |
| 149 | 152 | } |
| 150 | 153 | |
| 151 | 154 | generic_terminal_device::generic_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 152 | 155 | : device_t(mconfig, GENERIC_TERMINAL, "Generic Terminal", tag, owner, clock, "generic_terminal", __FILE__), |
| 153 | m_palette(*this, "palette"), | |
| 154 | m_io_term_conf(*this, "TERM_CONF"), | |
| 155 | m_keyboard_cb(*this) | |
| 156 | m_palette(*this, "palette"), | |
| 157 | m_io_term_conf(*this, "TERM_CONF"), | |
| 158 | m_x_pos(0), | |
| 159 | m_framecnt(0), | |
| 160 | m_y_pos(0), | |
| 161 | m_keyboard_cb(*this) | |
| 156 | 162 | { |
| 157 | 163 | } |
| 158 | 164 |
| r250189 | r250190 | |
|---|---|---|
| 363 | 363 | chan.source_num = -1; |
| 364 | 364 | if (samples > 0) |
| 365 | 365 | memset(buffer, 0, samples * sizeof(*buffer)); |
| 366 | samples = 0; | |
| 367 | 366 | break; |
| 368 | 367 | } |
| 369 | 368 | } |
| r250189 | r250190 | |
|---|---|---|
| 656 | 656 | v3 = tv; |
| 657 | 657 | if (v2->y < v1->y) |
| 658 | 658 | { |
| 659 | const vertex_t *tv = v1; | |
| 659 | const vertex_t *tv2 = v1; | |
| 660 | 660 | v1 = v2; |
| 661 | v2 = tv; | |
| 661 | v2 = tv2; | |
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | 664 |
| r250189 | r250190 | |
|---|---|---|
| 29 | 29 | m_addrmask(0), |
| 30 | 30 | m_share(NULL), |
| 31 | 31 | m_region(NULL), |
| 32 | m_rgnoffs(0), | |
| 32 | m_rgnoffs(0), | |
| 33 | m_submap_bits(0), | |
| 33 | 34 | m_memory(NULL), |
| 34 | 35 | m_bytestart(0), |
| 35 | 36 | m_byteend(0), |
| r250189 | r250190 | |
|---|---|---|
| 270 | 270 | int found = 0; |
| 271 | 271 | |
| 272 | 272 | // iterate over sample entries |
| 273 | samples_device_iterator iter(m_enumerator.config().root_device()); | |
| 274 | for (samples_device *device = iter.first(); device != NULL; device = iter.next()) | |
| 273 | samples_device_iterator iterator(m_enumerator.config().root_device()); | |
| 274 | for (samples_device *device = iterator.first(); device != NULL; device = iterator.next()) | |
| 275 | 275 | { |
| 276 | 276 | // by default we just search using the driver name |
| 277 | 277 | std::string searchpath(m_enumerator.driver().name); |
| r250189 | r250190 | |
|---|---|---|
| 1353 | 1353 | address_space *space; |
| 1354 | 1354 | const char *action = NULL; |
| 1355 | 1355 | UINT64 address, length; |
| 1356 | int type | |
| 1356 | int type; | |
| 1357 | 1357 | int wpnum; |
| 1358 | 1358 | |
| 1359 | 1359 | /* CPU is implicit */ |
| r250189 | r250190 | |
| 1830 | 1830 | { |
| 1831 | 1831 | UINT64 offset, endoffset, length, width = 0, ascii = 1; |
| 1832 | 1832 | address_space *space; |
| 1833 | FILE *f | |
| 1833 | FILE *f; | |
| 1834 | 1834 | UINT64 i, j; |
| 1835 | 1835 | |
| 1836 | 1836 | /* validate parameters */ |
| r250189 | r250190 | |
| 1984 | 1984 | /* initialize entire memory by default */ |
| 1985 | 1985 | if (params <= 1) |
| 1986 | 1986 | { |
| 1987 | offset = 0; | |
| 1988 | length = space->bytemask() + 1; | |
| 1989 | 1987 | for (entry = space->map()->m_entrylist.first(); entry != NULL; entry = entry->next()) |
| 1990 | 1988 | { |
| 1991 | 1989 | cheat_region[region_count].offset = space->address_to_byte(entry->m_addrstart) & space->bytemask(); |
| r250189 | r250190 | |
| 2456 | 2454 | UINT64 offset, length, bytes = 1; |
| 2457 | 2455 | int minbytes, maxbytes, byteswidth; |
| 2458 | 2456 | address_space *space, *decrypted_space; |
| 2459 | FILE *f | |
| 2457 | FILE *f; | |
| 2460 | 2458 | int j; |
| 2461 | 2459 | |
| 2462 | 2460 | /* validate parameters */ |
| r250189 | r250190 | |
|---|---|---|
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "debugcon.h" |
| 13 | 13 | #include "debugcpu.h" |
| 14 | #include "debughlp.h" | |
| 15 | 14 | #include "debugvw.h" |
| 16 | 15 | #include "textbuf.h" |
| 17 | 16 | #include "debugger.h" |
| r250189 | r250190 | |
| 270 | 269 | { |
| 271 | 270 | char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH]; |
| 272 | 271 | char *params[MAX_COMMAND_PARAMS] = { 0 }; |
| 273 | CMDERR result | |
| 272 | CMDERR result; | |
| 274 | 273 | char *command_start; |
| 275 | 274 | char *p, c = 0; |
| 276 | 275 |
| r250189 | r250190 | |
|---|---|---|
| 12 | 12 | #include "emuopts.h" |
| 13 | 13 | #include "osdepend.h" |
| 14 | 14 | #include "debugcpu.h" |
| 15 | #include "debugcmd.h" | |
| 16 | 15 | #include "debugcon.h" |
| 17 | 16 | #include "express.h" |
| 18 | 17 | #include "debugvw.h" |
| r250189 | r250190 | |
|---|---|---|
| 17 | 17 | #include "dvmemory.h" |
| 18 | 18 | #include "dvbpoints.h" |
| 19 | 19 | #include "dvwpoints.h" |
| 20 | #include "debugcmd.h" | |
| 21 | 20 | #include "debugcpu.h" |
| 22 | #include "debugcon.h" | |
| 23 | 21 | #include <ctype.h> |
| 24 | 22 | |
| 25 | 23 |
| r250189 | r250190 | |
|---|---|---|
| 162 | 162 | const simple_list<debug_view_source> &source_list() const { return m_source_list; } |
| 163 | 163 | |
| 164 | 164 | // setters |
| 165 | void set_size(int width, int height); | |
| 166 | 165 | void set_visible_size(debug_view_xy size); |
| 167 | 166 | void set_visible_position(debug_view_xy pos); |
| 168 | 167 | void set_cursor_position(debug_view_xy pos); |
| r250189 | r250190 | |
|---|---|---|
| 11 | 11 | #ifndef __DVMEMORY_H__ |
| 12 | 12 | #define __DVMEMORY_H__ |
| 13 | 13 | |
| 14 | #include "dvstate.h" | |
| 15 | ||
| 16 | ||
| 17 | 14 | //************************************************************************** |
| 18 | 15 | // TYPE DEFINITIONS |
| 19 | 16 | //************************************************************************** |
| r250189 | r250190 | |
|---|---|---|
| 1105 | 1105 | throw expression_error(expression_error::INVALID_TOKEN, token.offset()); |
| 1106 | 1106 | |
| 1107 | 1107 | // convert the space to flags |
| 1108 | expression_space memspace | |
| 1108 | expression_space memspace; | |
| 1109 | 1109 | switch (space) |
| 1110 | 1110 | { |
| 1111 | 1111 | case 'p': memspace = physical ? EXPSPACE_PROGRAM_PHYSICAL : EXPSPACE_PROGRAM_LOGICAL; break; |
| r250189 | r250190 | |
| 1219 | 1219 | |
| 1220 | 1220 | // loop over all the original tokens |
| 1221 | 1221 | parse_token *prev = NULL; |
| 1222 | parse_token *next | |
| 1222 | parse_token *next; | |
| 1223 | 1223 | for (parse_token *token = m_tokenlist.detach_all(); token != NULL; prev = token, token = next) |
| 1224 | 1224 | { |
| 1225 | 1225 | // pre-determine our next token |
| r250189 | r250190 | |
|---|---|---|
| 13 | 13 | #include "debug/debugcpu.h" |
| 14 | 14 | #include "debug/debugcmd.h" |
| 15 | 15 | #include "debug/debugcon.h" |
| 16 | #include "debug/express.h" | |
| 17 | 16 | #include "debug/debugvw.h" |
| 18 | 17 | #include <ctype.h> |
| 19 | 18 |
| r250189 | r250190 | |
|---|---|---|
| 108 | 108 | //------------------------------------------------- |
| 109 | 109 | |
| 110 | 110 | devcb_read_base::devcb_read_base(device_t &device, UINT64 defmask) |
| 111 | : devcb_base(device, defmask) | |
| 111 | : devcb_base(device, defmask), | |
| 112 | m_adapter(NULL) | |
| 112 | 113 | { |
| 113 | 114 | } |
| 114 | 115 | |
| r250189 | r250190 | |
| 335 | 336 | //------------------------------------------------- |
| 336 | 337 | |
| 337 | 338 | devcb_write_base::devcb_write_base(device_t &device, UINT64 defmask) |
| 338 | : devcb_base(device, defmask) | |
| 339 | : devcb_base(device, defmask), | |
| 340 | m_adapter(NULL) | |
| 339 | 341 | { |
| 340 | 342 | } |
| 341 | 343 |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "debugger.h" | |
| 13 | 12 | #include <ctype.h> |
| 14 | 13 | |
| 15 | 14 |
| r250189 | r250190 | |
|---|---|---|
| 40 | 40 | // find_memregion - find memory region |
| 41 | 41 | //------------------------------------------------- |
| 42 | 42 | |
| 43 | void *finder_base::find_memregion(UINT8 width, size_t &length, bool required) | |
| 43 | void *finder_base::find_memregion(UINT8 width, size_t &length, bool required) const | |
| 44 | 44 | { |
| 45 | 45 | // look up the region and return NULL if not found |
| 46 | 46 | memory_region *region = m_base.memregion(m_tag); |
| r250189 | r250190 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | protected: |
| 55 | 55 | // helpers |
| 56 | void *find_memregion(UINT8 width, size_t &length, bool required); | |
| 56 | void *find_memregion(UINT8 width, size_t &length, bool required) const; | |
| 57 | 57 | void *find_memshare(UINT8 width, size_t &bytes, bool required); |
| 58 | 58 | bool report_missing(bool found, const char *objname, bool required); |
| 59 | 59 | |
| r250189 | r250190 | |
| 80 | 80 | |
| 81 | 81 | // operators to make use transparent |
| 82 | 82 | operator _ObjectClass *() const { return m_target; } |
| 83 | _ObjectClass *operator->() const { assert(m_target != NULL); return m_target; } | |
| 84 | 83 | |
| 84 | virtual _ObjectClass *operator->() const { assert(m_target != NULL); return m_target; } | |
| 85 | ||
| 85 | 86 | // getter for explicit fetching |
| 86 | 87 | _ObjectClass *target() const { return m_target; } |
| 87 | 88 |
| r250189 | r250190 | |
|---|---|---|
| 198 | 198 | |
| 199 | 199 | // debugging |
| 200 | 200 | device_debug *debug() const { return m_debug; } |
| 201 | offs_t safe_pc(); | |
| 202 | offs_t safe_pcbase(); | |
| 201 | offs_t safe_pc() const; | |
| 202 | offs_t safe_pcbase() const; | |
| 203 | 203 | |
| 204 | 204 | void set_default_bios(UINT8 bios) { m_default_bios = bios; } |
| 205 | 205 | void set_system_bios(UINT8 bios) { m_system_bios = bios; } |
| r250189 | r250190 | |
|---|---|---|
| 166 | 166 | void set_input_line(int linenum, int state) { m_input[linenum].set_state_synced(state); } |
| 167 | 167 | void set_input_line_vector(int linenum, int vector) { m_input[linenum].set_vector(vector); } |
| 168 | 168 | void set_input_line_and_vector(int linenum, int state, int vector) { m_input[linenum].set_state_synced(state, vector); } |
| 169 | int input_state(int linenum) { return m_input[linenum].m_curstate; } | |
| 169 | int input_state(int linenum) const { return m_input[linenum].m_curstate; } | |
| 170 | 170 | |
| 171 | 171 | // suspend/resume |
| 172 | 172 | void suspend(UINT32 reason, bool eatcycles); |
| 173 | 173 | void resume(UINT32 reason); |
| 174 | bool suspended(UINT32 reason = SUSPEND_ANY_REASON) { return (m_nextsuspend & reason) != 0; } | |
| 174 | bool suspended(UINT32 reason = SUSPEND_ANY_REASON) const { return (m_nextsuspend & reason) != 0; } | |
| 175 | 175 | void yield() { suspend(SUSPEND_REASON_TIMESLICE, false); } |
| 176 | 176 | void spin() { suspend(SUSPEND_REASON_TIMESLICE, true); } |
| 177 | 177 | void spin_until_trigger(int trigid) { suspend_until_trigger(trigid, true); } |
| r250189 | r250190 | |
| 195 | 195 | device_execute_interface &execute() { return *this; } |
| 196 | 196 | |
| 197 | 197 | protected: |
| 198 | // internal helpers | |
| 199 | void run_thread_wrapper(); | |
| 200 | ||
| 201 | 198 | // clock and cycle information getters |
| 202 | 199 | virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const; |
| 203 | 200 | virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const; |
| r250189 | r250190 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | device_gfx_interface::device_gfx_interface(const machine_config &mconfig, device_t &device, |
| 24 | 24 | const gfx_decode_entry *gfxinfo, const char *palette_tag) |
| 25 | : device_interface(device, "gfx"), | |
| 25 | : device_interface(device, "gfx"), | |
| 26 | m_palette(NULL), | |
| 26 | 27 | m_gfxdecodeinfo(gfxinfo), |
| 27 | 28 | m_palette_tag(palette_tag), |
| 28 | 29 | m_palette_is_sibling(palette_tag == NULL), |
| r250189 | r250190 | |
|---|---|---|
| 14 | 14 | #include "ui/ui.h" |
| 15 | 15 | #include "ui/menu.h" |
| 16 | 16 | #include "zippath.h" |
| 17 | #include "ui/filesel.h" | |
| 18 | #include "ui/swlist.h" | |
| 19 | 17 | #include "ui/imgcntrl.h" |
| 20 | 18 | #include "softlist.h" |
| 21 | 19 | #include "image.h" |
| r250189 | r250190 | |
| 57 | 55 | |
| 58 | 56 | device_image_interface::device_image_interface(const machine_config &mconfig, device_t &device) |
| 59 | 57 | : device_interface(device, "image"), |
| 58 | m_err(), | |
| 60 | 59 | m_file(NULL), |
| 61 | 60 | m_mame_file(NULL), |
| 62 | 61 | m_software_info_ptr(NULL), |
| 63 | m_software_part_ptr(NULL), | |
| 62 | m_software_part_ptr(NULL), | |
| 63 | m_supported(0), | |
| 64 | 64 | m_readonly(false), |
| 65 | m_created(false), | |
| 65 | m_created(false), | |
| 66 | m_init_phase(false), | |
| 67 | m_from_swlist(false), | |
| 68 | m_create_format(0), | |
| 69 | m_create_args(NULL), | |
| 66 | 70 | m_is_loading(FALSE) |
| 67 | 71 | { |
| 68 | 72 | } |
| r250189 | r250190 | |
| 575 | 579 | |
| 576 | 580 | image_error_t device_image_interface::load_image_by_path(UINT32 open_flags, const char *path) |
| 577 | 581 | { |
| 578 | file_error filerr = FILERR_NOT_FOUND; | |
| 579 | image_error_t err = IMAGE_ERROR_FILENOTFOUND; | |
| 582 | file_error filerr; | |
| 583 | image_error_t err; | |
| 580 | 584 | std::string revised_path; |
| 581 | 585 | |
| 582 | 586 | /* attempt to read the file */ |
| r250189 | r250190 | |
| 629 | 633 | if(m_file) |
| 630 | 634 | core_fclose(m_file); |
| 631 | 635 | |
| 632 | file_error filerr = FILERR_NOT_FOUND; | |
| 633 | image_error_t err = IMAGE_ERROR_FILENOTFOUND; | |
| 636 | file_error filerr; | |
| 637 | image_error_t err; | |
| 634 | 638 | std::string revised_path; |
| 635 | 639 | |
| 636 | 640 | /* attempt to open the file for writing*/ |
| r250189 | r250190 | |
|---|---|---|
| 253 | 253 | void setup_working_directory(); |
| 254 | 254 | bool try_change_working_directory(const char *subdir); |
| 255 | 255 | |
| 256 | int read_hash_config(const char *sysname); | |
| 257 | 256 | void run_hash(void (*partialhash)(hash_collection &, const unsigned char *, unsigned long, const char *), hash_collection &hashes, const char *types); |
| 258 | 257 | void image_checkhash(); |
| 259 | 258 | void update_names(const device_type device_type = NULL, const char *inst = NULL, const char *brief = NULL); |
| r250189 | r250190 | |
|---|---|---|
| 16 | 16 | { |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | int device_network_interface::send(UINT8 *buf, int len) | |
| 19 | int device_network_interface::send(UINT8 *buf, int len) const | |
| 20 | 20 | { |
| 21 | 21 | if(!m_dev) return 0; |
| 22 | 22 | return m_dev->send(buf, len); |
| r250189 | r250190 | |
|---|---|---|
| 19 | 19 | bool get_promisc() { return m_promisc; } |
| 20 | 20 | int get_interface() { return m_intf; } |
| 21 | 21 | |
| 22 | int send(UINT8 *buf, int len); | |
| 22 | int send(UINT8 *buf, int len) const; | |
| 23 | 23 | virtual void recv_cb(UINT8 *buf, int len); |
| 24 | 24 | |
| 25 | 25 | protected: |
| r250189 | r250190 | |
|---|---|---|
| 35 | 35 | { |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | void device_output_interface::set_output_value(int value) | |
| 38 | void device_output_interface::set_output_value(int value) const | |
| 39 | 39 | { |
| 40 | 40 | if (m_output_name) |
| 41 | 41 | output_set_value(m_output_name, value); |
| r250189 | r250190 | |
| 43 | 43 | fatalerror("Output name not set!"); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | void device_output_interface::set_led_value(int value) | |
| 46 | void device_output_interface::set_led_value(int value) const | |
| 47 | 47 | { |
| 48 | 48 | if (m_output_name) |
| 49 | 49 | output_set_value(m_output_name, value); |
| r250189 | r250190 | |
| 51 | 51 | output_set_led_value(m_output_index, value); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | void device_output_interface::set_lamp_value(int value) | |
| 54 | void device_output_interface::set_lamp_value(int value) const | |
| 55 | 55 | { |
| 56 | 56 | if (m_output_name) |
| 57 | 57 | output_set_value(m_output_name, value); |
| r250189 | r250190 | |
| 59 | 59 | output_set_lamp_value(m_output_index, value); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | void device_output_interface::set_digit_value(int value) | |
| 62 | void device_output_interface::set_digit_value(int value) const | |
| 63 | 63 | { |
| 64 | 64 | if (m_output_name) |
| 65 | 65 | output_set_value(m_output_name, value); |
| r250189 | r250190 | |
|---|---|---|
| 47 | 47 | static void set_output_index(device_t &device, int index) { dynamic_cast<device_output_interface &>(device).m_output_index = index; } |
| 48 | 48 | static void set_output_name(device_t &device, const char *name) { dynamic_cast<device_output_interface &>(device).m_output_name = name; } |
| 49 | 49 | |
| 50 | void set_output_value(int value); | |
| 51 | void set_led_value(int value); | |
| 52 | void set_lamp_value(int value); | |
| 53 | void set_digit_value(int value); | |
| 50 | void set_output_value(int value) const; | |
| 51 | void set_led_value(int value) const; | |
| 52 | void set_lamp_value(int value) const; | |
| 53 | void set_digit_value(int value) const; | |
| 54 | 54 | |
| 55 | 55 | protected: |
| 56 | 56 | int m_output_index; |
| r250189 | r250190 | |
|---|---|---|
| 53 | 53 | return m_opened; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count) | |
| 56 | ssize_t device_pty_interface::read(UINT8 *rx_chars , size_t count) const | |
| 57 | 57 | { |
| 58 | 58 | UINT32 actual_bytes; |
| 59 | 59 | |
| r250189 | r250190 | |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | void device_pty_interface::write(UINT8 tx_char) | |
| 67 | void device_pty_interface::write(UINT8 tx_char) const | |
| 68 | 68 | { |
| 69 | 69 | UINT32 actual_bytes; |
| 70 | 70 |
| r250189 | r250190 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | bool is_open(void) const; |
| 31 | 31 | |
| 32 | ssize_t read(UINT8 *rx_chars , size_t count); | |
| 33 | void write(UINT8 tx_char); | |
| 32 | ssize_t read(UINT8 *rx_chars , size_t count) const; | |
| 33 | void write(UINT8 tx_char) const; | |
| 34 | 34 | |
| 35 | 35 | bool is_slave_connected(void) const; |
| 36 | 36 |
| r250189 | r250190 | |
|---|---|---|
| 55 | 55 | void set_current_time(running_machine &machine); |
| 56 | 56 | |
| 57 | 57 | protected: |
| 58 | UINT8 convert_to_bcd(int val); | |
| 59 | int bcd_to_integer(UINT8 val); | |
| 58 | static UINT8 convert_to_bcd(int val); | |
| 59 | static int bcd_to_integer(UINT8 val); | |
| 60 | 60 | |
| 61 | 61 | void set_clock_register(int register, int value); |
| 62 | 62 | int get_clock_register(int register); |
| r250189 | r250190 | |
|---|---|---|
| 19 | 19 | m_rcv_register_data(0x8000), |
| 20 | 20 | m_rcv_flags(0), |
| 21 | 21 | m_rcv_bit_count_received(0), |
| 22 | m_rcv_bit_count(0), | |
| 22 | m_rcv_bit_count(0), | |
| 23 | m_rcv_byte_received(0), | |
| 23 | 24 | m_rcv_framing_error(false), |
| 24 | 25 | m_rcv_parity_error(false), |
| 25 | m_tra_flags(TRANSMIT_REGISTER_EMPTY), | |
| 26 | m_tra_register_data(0), | |
| 27 | m_tra_flags(TRANSMIT_REGISTER_EMPTY), | |
| 28 | m_tra_bit_count_transmitted(0), | |
| 29 | m_tra_bit_count(0), | |
| 26 | 30 | m_rcv_clock(NULL), |
| 27 | 31 | m_tra_clock(NULL), |
| 28 | 32 | m_rcv_rate(attotime::never), |
| r250189 | r250190 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | device_slot_option::device_slot_option(const char *name, const device_type &devtype): | |
| 24 | m_name(name), | |
| 23 | device_slot_option::device_slot_option(const char *name, const device_type &devtype): | |
| 24 | m_next(NULL), | |
| 25 | m_name(name), | |
| 25 | 26 | m_devtype(devtype), |
| 26 | 27 | m_selectable(true), |
| 27 | 28 | m_default_bios(NULL), |
| r250189 | r250190 | |
|---|---|---|
| 194 | 194 | { |
| 195 | 195 | for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next()) |
| 196 | 196 | if (&stream->device() == &device()) |
| 197 | for (int outputnum = 0; outputnum < stream->output_count(); outputnum++) | |
| 198 | stream->set_output_gain(outputnum, gain); | |
| 197 | for (int num = 0; num < stream->output_count(); num++) | |
| 198 | stream->set_output_gain(num, gain); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // look up the stream and stream output index |
| r250189 | r250190 | |
|---|---|---|
| 146 | 146 | UINT64 device_state_entry::value() const |
| 147 | 147 | { |
| 148 | 148 | // pick up the value |
| 149 | UINT64 result | |
| 149 | UINT64 result; | |
| 150 | 150 | switch (m_datasize) |
| 151 | 151 | { |
| 152 | 152 | default: |
| r250189 | r250190 | |
| 172 | 172 | bool leadzero = false; |
| 173 | 173 | bool percent = false; |
| 174 | 174 | bool explicitsign = false; |
| 175 | bool hitnonzero | |
| 175 | bool hitnonzero; | |
| 176 | 176 | bool reset = true; |
| 177 | 177 | int width = 0; |
| 178 | 178 | for (const char *fptr = m_format.c_str(); *fptr != 0; fptr++) |
| r250189 | r250190 | |
|---|---|---|
| 195 | 195 | // or 0 if no state object exists |
| 196 | 196 | //------------------------------------------------- |
| 197 | 197 | |
| 198 | inline offs_t device_t::safe_pc() | |
| 198 | inline offs_t device_t::safe_pc() const | |
| 199 | 199 | { |
| 200 | 200 | return (m_state != NULL) ? m_state->pc() : 0; |
| 201 | 201 | } |
| r250189 | r250190 | |
| 206 | 206 | // base or 0 if no state object exists |
| 207 | 207 | //------------------------------------------------- |
| 208 | 208 | |
| 209 | inline offs_t device_t::safe_pcbase() | |
| 209 | inline offs_t device_t::safe_pcbase() const | |
| 210 | 210 | { |
| 211 | 211 | return (m_state != NULL) ? m_state->pcbase() : 0; |
| 212 | 212 | } |
| r250189 | r250190 | |
|---|---|---|
| 50 | 50 | #ifndef __DRAWGFXM_H__ |
| 51 | 51 | #define __DRAWGFXM_H__ |
| 52 | 52 | |
| 53 | #include "profiler.h" | |
| 54 | ||
| 55 | ||
| 56 | 53 | /* special priority type meaning "none" */ |
| 57 | 54 | struct NO_PRIORITY { char dummy[3]; }; |
| 58 | 55 |
| r250189 | r250190 | |
|---|---|---|
| 395 | 395 | // we're done with it |
| 396 | 396 | //------------------------------------------------- |
| 397 | 397 | |
| 398 | void driver_enumerator::release_current() | |
| 398 | void driver_enumerator::release_current() const | |
| 399 | 399 | { |
| 400 | 400 | // skip if no current entry |
| 401 | 401 | if (m_current < 0 || m_current >= s_driver_count) |
| r250189 | r250190 | |
|---|---|---|
| 117 | 117 | |
| 118 | 118 | private: |
| 119 | 119 | // internal helpers |
| 120 | void release_current(); | |
| 120 | void release_current() const; | |
| 121 | 121 | |
| 122 | 122 | // entry in the config cache |
| 123 | 123 | struct config_entry |
| r250189 | r250190 | |
|---|---|---|
| 32 | 32 | testcpu_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | 33 | : driver_device(mconfig, type, tag), |
| 34 | 34 | m_cpu(*this, "maincpu"), |
| 35 | m_ram(*this, "ram") | |
| 35 | m_ram(*this, "ram"), | |
| 36 | m_space(NULL) | |
| 36 | 37 | { |
| 37 | 38 | } |
| 38 | 39 |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emucore.h" |
| 12 | #include "coreutil.h" | |
| 13 | 12 | |
| 14 | 13 | |
| 15 | 14 | //************************************************************************** |
| r250189 | r250190 | |
|---|---|---|
| 24 | 24 | m_entries(0), |
| 25 | 25 | m_indirect_entries(0), |
| 26 | 26 | m_enable_shadows(0), |
| 27 | m_enable_hilights(0), | |
| 28 | m_membits_supplied(false), | |
| 27 | m_enable_hilights(0), | |
| 28 | m_membits(0), | |
| 29 | m_membits_supplied(false), | |
| 30 | m_endianness(), | |
| 29 | 31 | m_endianness_supplied(false), |
| 30 | 32 | m_raw_to_rgb(raw_to_rgb_converter()), |
| 31 | 33 | m_palette(NULL), |
| 32 | m_pens(NULL), | |
| 34 | m_pens(NULL), | |
| 35 | m_format(), | |
| 33 | 36 | m_shadow_table(NULL), |
| 34 | 37 | m_shadow_group(0), |
| 35 | m_hilight_group(0), | |
| 38 | m_hilight_group(0), | |
| 39 | m_white_pen(0), | |
| 40 | m_black_pen(0), | |
| 36 | 41 | m_init(palette_init_delegate()) |
| 37 | 42 | { |
| 38 | 43 | } |
| r250189 | r250190 | |
|---|---|---|
| 540 | 540 | bool read_hash_config(device_image_interface &image, const char *sysname, std::string &result) |
| 541 | 541 | { |
| 542 | 542 | hash_file *hashfile = NULL; |
| 543 | const hash_info *info | |
| 543 | const hash_info *info; | |
| 544 | 544 | |
| 545 | 545 | /* open the hash file */ |
| 546 | 546 | hashfile = hashfile_open(image.device().mconfig().options(), sysname, FALSE, NULL); |
| r250189 | r250190 | |
|---|---|---|
| 843 | 843 | assert(m_item[itemid] == NULL); |
| 844 | 844 | |
| 845 | 845 | // determine the class and create the appropriate item class |
| 846 | input_device_item *item | |
| 846 | input_device_item *item; | |
| 847 | 847 | switch (m_class.standard_item_class(originalid)) |
| 848 | 848 | { |
| 849 | 849 | case ITEM_CLASS_SWITCH: |
| r250189 | r250190 | |
|---|---|---|
| 97 | 97 | #include "profiler.h" |
| 98 | 98 | #include "ui/ui.h" |
| 99 | 99 | #include "uiinput.h" |
| 100 | #include "debug/debugcon.h" | |
| 101 | 100 | |
| 102 | 101 | #include "osdepend.h" |
| 103 | 102 | |
| r250189 | r250190 | |
| 727 | 726 | //------------------------------------------------- |
| 728 | 727 | |
| 729 | 728 | digital_joystick::digital_joystick(int player, int number) |
| 730 | : m_player(player), | |
| 729 | : m_next(NULL), | |
| 730 | m_player(player), | |
| 731 | 731 | m_number(number), |
| 732 | 732 | m_current(0), |
| 733 | 733 | m_current4way(0), |
| r250189 | r250190 | |
| 2454 | 2454 | m_record_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS), |
| 2455 | 2455 | m_playback_file(machine.options().input_directory(), OPEN_FLAG_READ), |
| 2456 | 2456 | m_playback_accumulated_speed(0), |
| 2457 | m_playback_accumulated_frames(0) | |
| 2457 | m_playback_accumulated_frames(0), | |
| 2458 | m_has_configs(false), | |
| 2459 | m_has_analog(false), | |
| 2460 | m_has_dips(false), | |
| 2461 | m_has_bioses(false) | |
| 2458 | 2462 | { |
| 2459 | 2463 | memset(m_type_to_entry, 0, sizeof(m_type_to_entry)); |
| 2460 | 2464 | } |
| r250189 | r250190 | |
| 3233 | 3237 | xml_set_attribute(portnode, "type", input_type_to_token(tempstr, entry->type(), entry->player())); |
| 3234 | 3238 | |
| 3235 | 3239 | // add only the sequences that have changed from the defaults |
| 3236 | for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; seqtype++) | |
| 3237 | if (entry->seq(seqtype) != entry->defseq(seqtype)) | |
| 3238 | save_sequence(portnode, seqtype, entry->type(), entry->seq(seqtype)); | |
| 3240 | for (input_seq_type type = SEQ_TYPE_STANDARD; type < SEQ_TYPE_TOTAL; type++) | |
| 3241 | if (entry->seq(type) != entry->defseq(type)) | |
| 3242 | save_sequence(portnode, type, entry->type(), entry->seq(type)); | |
| 3239 | 3243 | } |
| 3240 | 3244 | } |
| 3241 | 3245 | } |
| r250189 | r250190 | |
|---|---|---|
| 1394 | 1394 | int count_players() const; |
| 1395 | 1395 | bool crosshair_position(int player, float &x, float &y); |
| 1396 | 1396 | bool has_keyboard() const; |
| 1397 | void setup_natural_keyboard(ioport_queue_chars_delegate queue_chars, ioport_accept_char_delegate accept_char, ioport_charqueue_empty_delegate charqueue_empty); | |
| 1398 | 1397 | INT32 frame_interpolate(INT32 oldval, INT32 newval); |
| 1399 | 1398 | ioport_type token_to_input_type(const char *string, int &player) const; |
| 1400 | 1399 | const char *input_type_to_token(std::string &str, ioport_type type, int player); |
| r250189 | r250190 | |
|---|---|---|
| 13 | 13 | #include "luabridge/Source/LuaBridge/LuaBridge.h" |
| 14 | 14 | #include <signal.h> |
| 15 | 15 | #include "emu.h" |
| 16 | #include "emuopts.h" | |
| 17 | #include "osdepend.h" | |
| 18 | 16 | #include "drivenum.h" |
| 19 | 17 | #include "ui/ui.h" |
| 20 | 18 | #include "luaengine.h" |
| r250189 | r250190 | |
| 838 | 836 | osd_lock_release(lock); |
| 839 | 837 | |
| 840 | 838 | // Wait for response |
| 841 | int done | |
| 839 | int done; | |
| 842 | 840 | do { |
| 843 | 841 | osd_sleep(osd_ticks_per_second() / 1000); |
| 844 | 842 | osd_lock_acquire(lock); |
| r250189 | r250190 | |
|---|---|---|
| 75 | 75 | #include "debugger.h" |
| 76 | 76 | #include "render.h" |
| 77 | 77 | #include "cheat.h" |
| 78 | #include "ui/selgame.h" | |
| 79 | 78 | #include "uiinput.h" |
| 80 | 79 | #include "crsshair.h" |
| 81 | #include "validity.h" | |
| 82 | 80 | #include "unzip.h" |
| 83 | #include "debug/debugcon.h" | |
| 84 | 81 | #include "debug/debugvw.h" |
| 85 | 82 | #include "image.h" |
| 86 | 83 | #include "luaengine.h" |
| r250189 | r250190 | |
| 322 | 319 | |
| 323 | 320 | // notify this device and all its subdevices that they are now configured |
| 324 | 321 | device_iterator iter(root_device()); |
| 325 | for (device_t *device = iter.first(); device != NULL; device = iter.next()) | |
| 326 | if (!device->configured()) | |
| 327 | device->config_complete(); | |
| 322 | for (device_t *dev = iter.first(); dev != NULL; dev = iter.next()) | |
| 323 | if (!dev->configured()) | |
| 324 | dev->config_complete(); | |
| 328 | 325 | return *device; |
| 329 | 326 | } |
| 330 | 327 | |
| r250189 | r250190 | |
| 578 | 575 | // find length of the device name |
| 579 | 576 | int end1 = statename_str.find("/", pos + 3); |
| 580 | 577 | int end2 = statename_str.find("%", pos + 3); |
| 581 | int end | |
| 578 | int end; | |
| 582 | 579 | |
| 583 | 580 | if ((end1 != -1) && (end2 != -1)) |
| 584 | 581 | end = MIN(end1, end2); |
| r250189 | r250190 | |
|---|---|---|
| 73 | 73 | #define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine &>(m).respool(), t, c) |
| 74 | 74 | #define auto_free(m, v) pool_free(static_cast<running_machine &>(m).respool(), v) |
| 75 | 75 | |
| 76 | #define auto_bitmap_alloc(m, w, h, f) auto_alloc(m, bitmap_t(w, h, f)) | |
| 77 | 76 | #define auto_bitmap_ind8_alloc(m, w, h) auto_alloc(m, bitmap_ind8(w, h)) |
| 78 | 77 | #define auto_bitmap_ind16_alloc(m, w, h) auto_alloc(m, bitmap_ind16(w, h)) |
| 79 | 78 | #define auto_bitmap_ind32_alloc(m, w, h) auto_alloc(m, bitmap_ind32(w, h)) |
| r250189 | r250190 | |
| 191 | 190 | bool scheduled_event_pending() const { return m_exit_pending || m_hard_reset_pending; } |
| 192 | 191 | |
| 193 | 192 | // fetch items by name |
| 194 | inline device_t *device(const char *tag) { return root_device().subdevice(tag); } | |
| 193 | inline device_t *device(const char *tag) const { return root_device().subdevice(tag); } | |
| 195 | 194 | template<class _DeviceClass> inline _DeviceClass *device(const char *tag) { return downcast<_DeviceClass *>(device(tag)); } |
| 196 | 195 | |
| 197 | 196 | // configuration helpers |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | *********************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "emuopts.h" | |
| 13 | 12 | #include "config.h" |
| 14 | 13 | |
| 15 | 14 |
| r250189 | r250190 | |
|---|---|---|
| 73 | 73 | #include "emu.h" |
| 74 | 74 | #include "emuopts.h" |
| 75 | 75 | #include "osdepend.h" |
| 76 | #include "config.h" | |
| 77 | #include "debugger.h" | |
| 78 | #include "render.h" | |
| 79 | #include "cheat.h" | |
| 80 | #include "ui/ui.h" | |
| 81 | #include "uiinput.h" | |
| 82 | #include "crsshair.h" | |
| 83 | 76 | #include "validity.h" |
| 84 | #include "debug/debugcon.h" | |
| 85 | 77 | #include "luaengine.h" |
| 86 | 78 | #include <time.h> |
| 87 | 79 |
| r250189 | r250190 | |
|---|---|---|
| 335 | 335 | |
| 336 | 336 | // construction/destruction |
| 337 | 337 | handler_entry_read(UINT8 width, endianness_t endianness, UINT8 **rambaseptr) |
| 338 | : handler_entry(width, endianness, rambaseptr) | |
| 338 | : handler_entry(width, endianness, rambaseptr), | |
| 339 | m_ioport(NULL) | |
| 339 | 340 | { |
| 340 | 341 | } |
| 341 | 342 | |
| r250189 | r250190 | |
| 397 | 398 | |
| 398 | 399 | // construction/destruction |
| 399 | 400 | handler_entry_write(UINT8 width, endianness_t endianness, UINT8 **rambaseptr) |
| 400 | : handler_entry(width, endianness, rambaseptr) | |
| 401 | : handler_entry(width, endianness, rambaseptr), | |
| 402 | m_ioport(NULL) | |
| 401 | 403 | { |
| 402 | 404 | } |
| 403 | 405 | |
| r250189 | r250190 | |
| 4079 | 4081 | m_byteend(0), |
| 4080 | 4082 | m_bytemask(~0), |
| 4081 | 4083 | m_rambaseptr(rambaseptr), |
| 4082 | m_subunits(0) | |
| 4084 | m_subunits(0), | |
| 4085 | m_invsubmask(0) | |
| 4083 | 4086 | { |
| 4084 | 4087 | } |
| 4085 | 4088 |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | #include <ctype.h> |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "emuopts.h" | |
| 13 | 12 | #include "network.h" |
| 14 | 13 | #include "config.h" |
| 15 | 14 | #include "xmlfile.h" |
| r250189 | r250190 | |
|---|---|---|
| 2500 | 2500 | |
| 2501 | 2501 | float render_manager::ui_aspect(render_container *rc) |
| 2502 | 2502 | { |
| 2503 | int orient = 0; | |
| 2504 | float aspect = 1.0f; | |
| 2503 | int orient; | |
| 2504 | float aspect; | |
| 2505 | 2505 | |
| 2506 | 2506 | if (rc == m_ui_container || rc == NULL) { |
| 2507 | 2507 | // ui container, aggregated multi-screen target |
| r250189 | r250190 | |
|---|---|---|
| 304 | 304 | friend class simple_list<render_primitive>; |
| 305 | 305 | |
| 306 | 306 | public: |
| 307 | render_primitive(): | |
| 308 | type(), | |
| 309 | flags(0), | |
| 310 | width(0), | |
| 311 | container(NULL), | |
| 312 | m_next(NULL) | |
| 313 | {} | |
| 314 | ||
| 307 | 315 | // render primitive types |
| 308 | 316 | enum primitive_type |
| 309 | 317 | { |
| r250189 | r250190 | |
| 522 | 530 | friend class simple_list<item>; |
| 523 | 531 | |
| 524 | 532 | public: |
| 533 | item() : m_next(NULL), m_type(0), m_flags(0), m_internal(0), m_width(0), m_texture(NULL) { } | |
| 534 | ||
| 525 | 535 | // getters |
| 526 | 536 | item *next() const { return m_next; } |
| 527 | 537 | UINT8 type() const { return m_type; } |
| r250189 | r250190 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "rendfont.h" |
| 13 | #include "rendutil.h" | |
| 14 | 13 | #include "emuopts.h" |
| 15 | 14 | #include "coreutil.h" |
| 16 | 15 |
| r250189 | r250190 | |
|---|---|---|
| 53 | 53 | #include "rendlay.h" |
| 54 | 54 | #include "rendutil.h" |
| 55 | 55 | #include "xmlfile.h" |
| 56 | #include "png.h" | |
| 57 | #include "ui/ui.h" | |
| 58 | 56 | |
| 59 | 57 | |
| 60 | 58 | |
| r250189 | r250190 | |
| 632 | 630 | std::string symbollist = xml_get_attribute_string_with_subst(machine, compnode, "symbollist", "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"); |
| 633 | 631 | |
| 634 | 632 | // split out position names from string and figure out our number of symbols |
| 635 | int location | |
| 633 | int location; | |
| 636 | 634 | m_numstops = 0; |
| 637 | 635 | location=symbollist.find(","); |
| 638 | 636 | while (location!=-1) |
| r250189 | r250190 | |
|---|---|---|
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "emuopts.h" |
| 12 | 12 | #include "drivenum.h" |
| 13 | #include "png.h" | |
| 14 | 13 | #include "chd.h" |
| 15 | #include "config.h" | |
| 16 | 14 | #include "softlist.h" |
| 17 | 15 | #include "ui/ui.h" |
| 18 | 16 |
| r250189 | r250190 | |
|---|---|---|
| 194 | 194 | save_error save_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...)) |
| 195 | 195 | { |
| 196 | 196 | // if we want to validate the signature, compute it |
| 197 | UINT32 sig | |
| 197 | UINT32 sig; | |
| 198 | 198 | sig = machine.save().signature(); |
| 199 | 199 | |
| 200 | 200 | // seek to the beginning and read the header |
| r250189 | r250190 | |
|---|---|---|
| 490 | 490 | exec->m_totalcycles += ran; |
| 491 | 491 | |
| 492 | 492 | // update the local time for this CPU |
| 493 | attotime delta(0, exec->m_attoseconds_per_cycle * ran); | |
| 494 | assert(delta >= attotime::zero); | |
| 495 | exec->m_localtime += delta; | |
| 493 | attotime deltatime(0, exec->m_attoseconds_per_cycle * ran); | |
| 494 | assert(deltatime >= attotime::zero); | |
| 495 | exec->m_localtime += deltatime; | |
| 496 | 496 | LOG((" %d ran, %d total, time = %s\n", ran, (INT32)exec->m_totalcycles, exec->m_localtime.as_string(PRECISION))); |
| 497 | 497 | |
| 498 | 498 | // if the new local CPU time is less than our target, move the target up, but not before the base |
| r250189 | r250190 | |
|---|---|---|
| 58 | 58 | m_container(NULL), |
| 59 | 59 | m_width(100), |
| 60 | 60 | m_height(100), |
| 61 | m_visarea(0, 99, 0, 99), | |
| 61 | m_visarea(0, 99, 0, 99), | |
| 62 | m_texformat(), | |
| 62 | 63 | m_curbitmap(0), |
| 63 | 64 | m_curtexture(0), |
| 64 | 65 | m_changed(true), |
| r250189 | r250190 | |
| 634 | 635 | LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y)); |
| 635 | 636 | g_profiler.start(PROFILER_VIDEO); |
| 636 | 637 | |
| 637 | UINT32 flags | |
| 638 | UINT32 flags; | |
| 638 | 639 | screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; |
| 639 | 640 | switch (curbitmap.format()) |
| 640 | 641 | { |
| r250189 | r250190 | |
| 751 | 752 | |
| 752 | 753 | LOG_PARTIAL_UPDATES(("doing scanline partial draw: Y %d X %d-%d\n", clip.max_y, clip.min_x, clip.max_x)); |
| 753 | 754 | |
| 754 | UINT32 flags | |
| 755 | UINT32 flags; | |
| 755 | 756 | screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; |
| 756 | 757 | switch (curbitmap.format()) |
| 757 | 758 | { |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "pool.h" | |
| 13 | 12 | #include "emuopts.h" |
| 14 | 13 | #include "softlist.h" |
| 15 | 14 | #include "clifront.h" |
| r250189 | r250190 | |
| 279 | 278 | m_list_type(SOFTWARE_LIST_ORIGINAL_SYSTEM), |
| 280 | 279 | m_filter(NULL), |
| 281 | 280 | m_parsed(false), |
| 282 | m_file(mconfig.options().hash_path(), OPEN_FLAG_READ) | |
| 281 | m_file(mconfig.options().hash_path(), OPEN_FLAG_READ), | |
| 282 | m_description(NULL) | |
| 283 | 283 | { |
| 284 | 284 | } |
| 285 | 285 |
| r250189 | r250190 | |
|---|---|---|
| 791 | 791 | //------------------------------------------------- |
| 792 | 792 | |
| 793 | 793 | sound_stream::stream_output::stream_output() |
| 794 | : m_dependents(0), | |
| 795 | m_gain(0x100) | |
| 794 | : m_stream(NULL), | |
| 795 | m_dependents(0), | |
| 796 | m_gain(0x100) | |
| 796 | 797 | { |
| 797 | 798 | } |
| 798 | 799 |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "emuopts.h" | |
| 13 | #include "osdepend.h" | |
| 14 | #include "config.h" | |
| 15 | #include "sound/wavwrite.h" | |
| 16 | 12 | |
| 17 | 13 | |
| 18 | 14 |
| r250189 | r250190 | |
|---|---|---|
| 20 | 20 | |
| 21 | 21 | // class representing a single dirty region |
| 22 | 22 | class sparse_dirty_rect : public rectangle |
| 23 | { | |
| 23 | { | |
| 24 | 24 | friend class simple_list<sparse_dirty_rect>; |
| 25 | 25 | |
| 26 | 26 | public: |
| 27 | sparse_dirty_rect(): m_next(NULL) { } | |
| 27 | 28 | // getters |
| 28 | 29 | const sparse_dirty_rect *next() const { return m_next; } |
| 29 | 30 |
| r250189 | r250190 | |
|---|---|---|
| 1589 | 1589 | tilemap_device::tilemap_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1590 | 1590 | : device_t(mconfig, TILEMAP, "Tilemap", tag, owner, clock, "tilemap", __FILE__), |
| 1591 | 1591 | m_gfxdecode(*this), |
| 1592 | m_standard_mapper(TILEMAP_STANDARD_COUNT), | |
| 1592 | m_standard_mapper(TILEMAP_STANDARD_COUNT), | |
| 1593 | m_bytes_per_entry(0), | |
| 1593 | 1594 | m_tile_width(8), |
| 1594 | 1595 | m_tile_height(8), |
| 1595 | 1596 | m_num_columns(64), |
| r250189 | r250190 | |
|---|---|---|
| 217 | 217 | case TIMER_TYPE_PERIODIC: |
| 218 | 218 | { |
| 219 | 219 | // convert the period into attotime |
| 220 | attotime period | |
| 220 | attotime period; | |
| 221 | 221 | if (m_period > attotime::zero) |
| 222 | 222 | { |
| 223 | 223 | period = m_period; |
| r250189 | r250190 | |
|---|---|---|
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "cheat.h" |
| 13 | 13 | |
| 14 | #include "uiinput.h" | |
| 15 | 14 | #include "ui/ui.h" |
| 16 | 15 | #include "ui/menu.h" |
| 17 | 16 | #include "ui/cheatopt.h" |
| r250189 | r250190 | |
|---|---|---|
| 14 | 14 | #include "emu.h" |
| 15 | 15 | #include "ui/ui.h" |
| 16 | 16 | #include "ui/menu.h" |
| 17 | #include "ui/swlist.h" | |
| 18 | 17 | #include "ui/filemngr.h" |
| 19 | 18 | #include "ui/filesel.h" |
| 20 | 19 | #include "ui/miscmenu.h" |
| r250189 | r250190 | |
| 29 | 28 | // ctor |
| 30 | 29 | //------------------------------------------------- |
| 31 | 30 | |
| 32 | ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container) | |
| 31 | ui_menu_file_manager::ui_menu_file_manager(running_machine &machine, render_container *container, const char *warnings) : ui_menu(machine, container), selected_device(NULL) | |
| 33 | 32 | { |
| 34 | 33 | // This warning string is used when accessing from the force_file_manager call, i.e. |
| 35 | 34 | // when the file manager is loaded top front in the case of mandatory image devices |
| r250189 | r250190 | |
| 127 | 126 | if (subiter.count() > 0) |
| 128 | 127 | { |
| 129 | 128 | // if so, cycle through all its image interfaces |
| 130 | image_interface_iterator subiter(*dev); | |
| 131 | for (device_image_interface *scan = subiter.first(); scan != NULL; scan = subiter.next()) | |
| 129 | image_interface_iterator subiterator(*dev); | |
| 130 | for (device_image_interface *scan = subiterator.first(); scan != NULL; scan = subiterator.next()) | |
| 132 | 131 | { |
| 133 | 132 | // if it is a children device, and not something further down the device tree, we want it in the menu! |
| 134 | 133 | if (strcmp(scan->device().owner()->tag(), dev->tag()) == 0) |
| r250189 | r250190 | |
|---|---|---|
| 16 | 16 | #include "ui/ui.h" |
| 17 | 17 | #include "ui/menu.h" |
| 18 | 18 | #include "zippath.h" |
| 19 | #include "ui/menu.h" | |
| 20 | 19 | #include "ui/filesel.h" |
| 21 | #include "ui/swlist.h" | |
| 22 | 20 | #include "imagedev/floppy.h" |
| 23 | 21 | |
| 24 | 22 | |
| r250189 | r250190 | |
| 100 | 98 | |
| 101 | 99 | // take off the borders |
| 102 | 100 | x1 += UI_BOX_LR_BORDER; |
| 103 | x2 -= UI_BOX_LR_BORDER; | |
| 104 | 101 | y1 += UI_BOX_TB_BORDER; |
| 105 | y2 -= UI_BOX_TB_BORDER; | |
| 106 | 102 | |
| 107 | 103 | // draw the text within it |
| 108 | 104 | container->manager().machine().ui().draw_text_full(container,text, x1, y1, text_width, JUSTIFY_LEFT, WRAP_WORD, |
| r250189 | r250190 | |
| 222 | 218 | ui_menu_file_create::ui_menu_file_create(running_machine &machine, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool *ok) |
| 223 | 219 | : ui_menu(machine, container), |
| 224 | 220 | m_current_directory(current_directory), |
| 225 | m_current_file(current_file) | |
| 221 | m_current_file(current_file), | |
| 222 | m_current_format(NULL) | |
| 226 | 223 | { |
| 227 | 224 | m_image = image; |
| 228 | 225 | m_ok = ok; |
| r250189 | r250190 | |
| 347 | 344 | ui_menu_file_selector::ui_menu_file_selector(running_machine &machine, render_container *container, device_image_interface *image, std::string ¤t_directory, std::string ¤t_file, bool has_empty, bool has_softlist, bool has_create, int *result) |
| 348 | 345 | : ui_menu(machine, container), |
| 349 | 346 | m_current_directory(current_directory), |
| 350 | m_current_file(current_file) | |
| 347 | m_current_file(current_file), | |
| 348 | m_entrylist(NULL) | |
| 351 | 349 | { |
| 352 | 350 | m_image = image; |
| 353 | 351 | m_has_empty = has_empty; |
| r250189 | r250190 | |
| 538 | 536 | void ui_menu_file_selector::populate() |
| 539 | 537 | { |
| 540 | 538 | zippath_directory *directory = NULL; |
| 541 | file_error err | |
| 539 | file_error err; | |
| 542 | 540 | const osd_directory_entry *dirent; |
| 543 | 541 | const file_selector_entry *entry; |
| 544 | 542 | const file_selector_entry *selected_entry = NULL; |
| r250189 | r250190 | |
|---|---|---|
| 28 | 28 | //------------------------------------------------- |
| 29 | 29 | |
| 30 | 30 | ui_menu_control_device_image::ui_menu_control_device_image(running_machine &machine, render_container *container, device_image_interface *_image) |
| 31 | : ui_menu(machine, container) | |
| 31 | : ui_menu(machine, container), | |
| 32 | submenu_result(0), | |
| 33 | create_ok(false), | |
| 34 | create_confirmed(false) | |
| 32 | 35 | { |
| 33 | 36 | image = _image; |
| 34 | 37 |
| r250189 | r250190 | |
|---|---|---|
| 224 | 224 | /*------------------------------------------------- |
| 225 | 225 | menu_input - display a menu for inputs |
| 226 | 226 | -------------------------------------------------*/ |
| 227 | ui_menu_input::ui_menu_input(running_machine &machine, render_container *container) : ui_menu(machine, container) | |
| 227 | ui_menu_input::ui_menu_input(running_machine &machine, render_container *container) : ui_menu(machine, container), last_sortorder(0), record_next(false) | |
| 228 | 228 | { |
| 229 | 229 | pollingitem = 0; |
| 230 | 230 | pollingref = 0; |
| r250189 | r250190 | |
| 264 | 264 | if (pollingitem != NULL) |
| 265 | 265 | { |
| 266 | 266 | input_item_data *item = pollingitem; |
| 267 | input_seq newseq; | |
| 268 | 267 | |
| 269 | 268 | /* if UI_CANCEL is pressed, abort */ |
| 270 | 269 | if (ui_input_pressed(machine(), IPT_UI_CANCEL)) |
| r250189 | r250190 | |
| 533 | 532 | switches menus |
| 534 | 533 | -------------------------------------------------*/ |
| 535 | 534 | |
| 536 | ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *container, UINT32 _type) : ui_menu(machine, container) | |
| 535 | ui_menu_settings::ui_menu_settings(running_machine &machine, render_container *container, UINT32 _type) : ui_menu(machine, container), diplist(NULL), dipcount(0) | |
| 537 | 536 | { |
| 538 | 537 | type = _type; |
| 539 | 538 | } |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | *********************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "audit.h" | |
| 13 | 12 | #include "crsshair.h" |
| 14 | #include "osdnet.h" | |
| 15 | 13 | #include "emuopts.h" |
| 16 | 14 | #include "rendutil.h" |
| 17 | 15 | #include "cheat.h" |
| 18 | #include "uiinput.h" | |
| 19 | #include "ui/ui.h" | |
| 20 | 16 | #include "ui/menu.h" |
| 21 | 17 | #include "ui/filemngr.h" |
| 22 | #include "ui/filesel.h" | |
| 23 | 18 | #include "ui/barcode.h" |
| 24 | 19 | #include "ui/cheatopt.h" |
| 25 | 20 | #include "ui/info.h" |
| r250189 | r250190 | |
| 33 | 28 | #include "ui/tapectrl.h" |
| 34 | 29 | #include "ui/videoopt.h" |
| 35 | 30 | #include "imagedev/cassette.h" |
| 36 | #include "imagedev/bitbngr.h" | |
| 37 | 31 | #include "machine/bcreader.h" |
| 38 | 32 | |
| 39 | 33 |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | *********************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "emuopts.h" | |
| 13 | 12 | #include "rendutil.h" |
| 14 | 13 | #include "cheat.h" |
| 15 | 14 | #include "uiinput.h" |
| 16 | 15 | #include "ui/ui.h" |
| 17 | 16 | #include "ui/menu.h" |
| 18 | 17 | #include "ui/mainmenu.h" |
| 19 | #include "ui/cheatopt.h" | |
| 20 | 18 | |
| 21 | 19 | |
| 22 | 20 | |
| r250189 | r250190 | |
| 411 | 409 | |
| 412 | 410 | float effective_width, effective_left; |
| 413 | 411 | float visible_width, visible_main_menu_height; |
| 414 | float visible_extra_menu_height | |
| 412 | float visible_extra_menu_height; | |
| 415 | 413 | float visible_top, visible_left; |
| 416 | 414 | int selected_subitem_too_big = FALSE; |
| 417 | 415 | int visible_lines; |
| r250189 | r250190 | |
| 812 | 810 | void ui_menu::handle_keys(UINT32 flags) |
| 813 | 811 | { |
| 814 | 812 | int ignorepause = ui_menu::stack_has_special_main_menu(); |
| 815 | int ignoreright = FALSE; | |
| 816 | int ignoreleft = FALSE; | |
| 813 | int ignoreright; | |
| 814 | int ignoreleft; | |
| 817 | 815 | int code; |
| 818 | 816 | |
| 819 | 817 | // bail if no items |
| r250189 | r250190 | |
|---|---|---|
| 180 | 180 | void draw_text_box(); |
| 181 | 181 | void handle_events(); |
| 182 | 182 | void handle_keys(UINT32 flags); |
| 183 | void clear_free_list(); | |
| 184 | 183 | |
| 185 | 184 | inline bool exclusive_input_pressed(int key, int repeat); |
| 186 | 185 | static void clear_free_list(running_machine &machine); |
| r250189 | r250190 | |
|---|---|---|
| 15 | 15 | #include "ui/ui.h" |
| 16 | 16 | #include "ui/menu.h" |
| 17 | 17 | #include "ui/miscmenu.h" |
| 18 | #include "ui/filemngr.h" | |
| 19 | 18 | |
| 20 | 19 | |
| 21 | 20 | /*************************************************************************** |
| r250189 | r250190 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | #include "osdnet.h" | |
| 13 | 12 | #include "emuopts.h" |
| 14 | 13 | #include "ui/ui.h" |
| 15 | 14 | #include "ui/menu.h" |
| 16 | #include "rendutil.h" | |
| 17 | #include "cheat.h" | |
| 18 | 15 | #include "uiinput.h" |
| 19 | 16 | #include "ui/selgame.h" |
| 20 | 17 | #include "ui/inputmap.h" |
| 21 | 18 | #include "ui/miscmenu.h" |
| 22 | 19 | #include "audit.h" |
| 23 | #include "crsshair.h" | |
| 24 | 20 | #include <ctype.h> |
| 25 | 21 | |
| 26 | 22 | |
| r250189 | r250190 | |
| 409 | 405 | x1 += UI_BOX_LR_BORDER; |
| 410 | 406 | x2 -= UI_BOX_LR_BORDER; |
| 411 | 407 | y1 += UI_BOX_TB_BORDER; |
| 412 | y2 -= UI_BOX_TB_BORDER; | |
| 413 | 408 | |
| 414 | 409 | // draw all lines |
| 415 | 410 | for (line = 0; line < 4; line++) |
| r250189 | r250190 | |
|---|---|---|
| 270 | 270 | // handle selections |
| 271 | 271 | else if (event->iptkey == IPT_UI_SELECT) |
| 272 | 272 | { |
| 273 | entry_info *entry = (entry_info *) event->itemref; | |
| 274 | m_result = entry->short_name; | |
| 273 | entry_info *info = (entry_info *) event->itemref; | |
| 274 | m_result = info->short_name; | |
| 275 | 275 | ui_menu::stack_pop(machine()); |
| 276 | 276 | } |
| 277 | 277 | else if (event->iptkey == IPT_SPECIAL) |
| r250189 | r250190 | |
|---|---|---|
| 18 | 18 | #include "uiinput.h" |
| 19 | 19 | #include "ui/ui.h" |
| 20 | 20 | #include "ui/menu.h" |
| 21 | #include "ui/cheatopt.h" | |
| 22 | 21 | #include "ui/mainmenu.h" |
| 23 | #include "ui/miscmenu.h" | |
| 24 | 22 | #include "ui/filemngr.h" |
| 25 | 23 | #include "ui/sliders.h" |
| 26 | 24 | #include "ui/viewgfx.h" |
| r250189 | r250190 | |
| 1688 | 1686 | UINT32 ui_manager::handler_load_save(running_machine &machine, render_container *container, UINT32 state) |
| 1689 | 1687 | { |
| 1690 | 1688 | char filename[20]; |
| 1691 | input_code code; | |
| 1692 | 1689 | char file = 0; |
| 1693 | 1690 | |
| 1694 | 1691 | // if we're not in the middle of anything, skip |
| r250189 | r250190 | |
|---|---|---|
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "rendutil.h" |
| 13 | 13 | |
| 14 | #include "uiinput.h" | |
| 15 | #include "ui/ui.h" | |
| 16 | 14 | #include "ui/menu.h" |
| 17 | 15 | #include "ui/videoopt.h" |
| 18 | 16 |
| r250189 | r250190 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | #include "emu.h" |
| 12 | 12 | #include "ui/ui.h" |
| 13 | #include "ui/menu.h" | |
| 14 | 13 | #include "uiinput.h" |
| 15 | 14 | #include "render.h" |
| 16 | 15 | #include "rendfont.h" |
| r250189 | r250190 | |
|---|---|---|
| 249 | 249 | bool ui_input_pressed_repeat(running_machine &machine, int code, int speed) |
| 250 | 250 | { |
| 251 | 251 | ui_input_private *uidata = machine.ui_input_data; |
| 252 | int pressed | |
| 252 | int pressed; | |
| 253 | 253 | |
| 254 | 254 | g_profiler.start(PROFILER_INPUT); |
| 255 | 255 |
| r250189 | r250190 | |
|---|---|---|
| 1142 | 1142 | // find length of the device name |
| 1143 | 1143 | int end1 = snapstr.find("/", pos + 3); |
| 1144 | 1144 | int end2 = snapstr.find("%", pos + 3); |
| 1145 | int end | |
| 1145 | int end; | |
| 1146 | 1146 | |
| 1147 | 1147 | if ((end1 != -1) && (end2 != -1)) |
| 1148 | 1148 | end = MIN(end1, end2); |
| r250189 | r250190 | |
|---|---|---|
| 346 | 346 | max = minval; |
| 347 | 347 | for( i = 0; i < networks_no; i++ ) |
| 348 | 348 | { |
| 349 | double val | |
| 349 | double val; | |
| 350 | 350 | double max_tmp = minval; |
| 351 | 351 | double min_tmp = maxval; |
| 352 | 352 |
| r250189 | r250190 | |
|---|---|---|
| 19 | 19 | class rgbaint_t |
| 20 | 20 | { |
| 21 | 21 | public: |
| 22 | inline rgbaint_t() { } | |
| 22 | inline rgbaint_t(): m_a(0), m_r(0), m_g(0), m_b(0) { } | |
| 23 | 23 | inline rgbaint_t(UINT32 rgba) { set(rgba); } |
| 24 | 24 | inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } |
| 25 | 25 | inline rgbaint_t(rgb_t& rgba) { set(rgba); } |
| r250189 | r250190 | |
|---|---|---|
| 28 | 28 | typedef __vector unsigned int VECU32; |
| 29 | 29 | |
| 30 | 30 | public: |
| 31 | inline rgbaint_t() { } | |
| 31 | inline rgbaint_t(): VECS8(0), VECU8(0), VECS16(0), VECU16(0), VECS32(0), VECU32(0) { } | |
| 32 | 32 | inline rgbaint_t(UINT32 rgba) { set(rgba); } |
| 33 | 33 | inline rgbaint_t(INT32 a, INT32 r, INT32 g, INT32 b) { set(a, r, g, b); } |
| 34 | 34 | inline rgbaint_t(rgb_t& rgb) { set(rgb); } |
| 35 | inline rgbaint_t(VECS32 rgba) { m_value = rgba; } | |
| 35 | inline rgbaint_t(VECS32 rgba): VECS8(0), VECU8(0), VECS16(0), VECU16(0), VECS32(0), VECU32(0) { m_value = rgba; } | |
| 36 | 36 | |
| 37 | 37 | inline void set(rgbaint_t& other) { m_value = other.m_value; } |
| 38 | 38 |
| r250189 | r250190 | |
|---|---|---|
| 130 | 130 | |
| 131 | 131 | vector_device::vector_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 132 | 132 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 133 | device_video_interface(mconfig, *this) | |
| 133 | device_video_interface(mconfig, *this), | |
| 134 | m_vector_list(NULL) | |
| 134 | 135 | { |
| 135 | 136 | } |
| 136 | 137 | |
| 137 | 138 | vector_device::vector_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 138 | 139 | : device_t(mconfig, VECTOR, "VECTOR", tag, owner, clock, "vector_device", __FILE__), |
| 139 | device_video_interface(mconfig, *this) | |
| 140 | device_video_interface(mconfig, *this), | |
| 141 | m_vector_list(NULL) | |
| 140 | 142 | { |
| 141 | 143 | } |
| 142 | 144 |
| https://github.com/mamedev/mame/commit/d1dc775f9b686170416fbca6a615fbea108d0ff1 |
| Previous | 199869 Revisions | Next |