From fdbbe212fa765fe3a69dd0bb593c1e41bc935946 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Sun, 23 Apr 2023 07:20:13 +0000 Subject: [PATCH] MAME: added inital config and submodules [skip ci] --- emu-configs/mame/mame.ini | 411 ++++++++++++++++++++++++++++++++ emu-configs/mame/ui.ini | 70 ++++++ rd-submodules/mame/floppy.patch | 41 ++++ rd-submodules/mame/mame.ini | 33 +++ rd-submodules/mame/sound.patch | 28 +++ rd-submodules/mame/ym3802.patch | 13 + rd-submodules/retroarch | 2 +- 7 files changed, 597 insertions(+), 1 deletion(-) create mode 100644 emu-configs/mame/mame.ini create mode 100644 emu-configs/mame/ui.ini create mode 100644 rd-submodules/mame/floppy.patch create mode 100644 rd-submodules/mame/mame.ini create mode 100644 rd-submodules/mame/sound.patch create mode 100644 rd-submodules/mame/ym3802.patch diff --git a/emu-configs/mame/mame.ini b/emu-configs/mame/mame.ini new file mode 100644 index 00000000..115e6d2b --- /dev/null +++ b/emu-configs/mame/mame.ini @@ -0,0 +1,411 @@ +# +# CORE CONFIGURATION OPTIONS +# +readconfig 1 +writeconfig 0 + +# +# CORE SEARCH PATH OPTIONS +# +homepath /var/config/mame +rompath /home/deck/retrodeck/roms/arcade +hashpath /app/share/mame/hash +samplepath /app/share/mame/samples +artpath $HOME/retrodeck/downloaded_media/arcade/screenshots/ +ctrlrpath /app/share/mame/ctrlr +inipath /var/config/mame +fontpath /app/bin/ +cheatpath /app/share/mame/cheat +crosshairpath /app/share/mame/crosshair +pluginspath /app/share/mame/plugins +languagepath /app/share/mame/language +swpath /app/share/mame/software + +# +# CORE OUTPUT DIRECTORY OPTIONS +# +cfg_directory /var/config/mame/cfg +nvram_directory /var/config/mame/nvram +input_directory /var/config/mame/inp +state_directory /var/config/mame/sta +snapshot_directory $HOME/retrodeck/screenshots +diff_directory /var/config/mame/diff +comment_directory /var/config/mame/comments +share_directory /var/config/mame/share + +# +# CORE STATE/PLAYBACK OPTIONS +# +state +autosave 0 +rewind 0 +rewind_capacity 100 +playback +record +exit_after_playback 0 +mngwrite +aviwrite +wavwrite +snapname %g/%i +snapsize auto +snapview auto +snapbilinear 1 +statename %g +burnin 0 + +# +# CORE PERFORMANCE OPTIONS +# +autoframeskip 0 +frameskip 0 +seconds_to_run 0 +throttle 1 +sleep 1 +speed 1.0 +refreshspeed 0 +lowlatency 0 + +# +# CORE RENDER OPTIONS +# +keepaspect 1 +unevenstretch 1 +unevenstretchx 0 +unevenstretchy 0 +autostretchxy 0 +intoverscan 0 +intscalex 0 +intscaley 0 + +# +# CORE ROTATION OPTIONS +# +rotate 1 +ror 0 +rol 0 +autoror 0 +autorol 0 +flipx 0 +flipy 0 + +# +# CORE ARTWORK OPTIONS +# +artwork_crop 0 +fallback_artwork +override_artwork + +# +# CORE SCREEN OPTIONS +# +brightness 1.0 +contrast 1.0 +gamma 1.0 +pause_brightness 0.65 +effect none + +# +# CORE VECTOR OPTIONS +# +beam_width_min 1.0 +beam_width_max 1.0 +beam_dot_size 1.0 +beam_intensity_weight 0 +flicker 0 + +# +# CORE SOUND OPTIONS +# +samplerate 48000 +samples 1 +volume 0 +compressor 1 +speaker_report 0 + +# +# CORE INPUT OPTIONS +# +coin_lockout 1 +ctrlr +mouse 0 +joystick 1 +lightgun 0 +multikeyboard 0 +multimouse 0 +steadykey 0 +ui_active 0 +offscreen_reload 0 +joystick_map auto +joystick_deadzone 0.15 +joystick_saturation 0.85 +joystick_threshold 0.3 +natural 0 +joystick_contradictory 0 +coin_impulse 0 + +# +# CORE INPUT AUTOMATIC ENABLE OPTIONS +# +paddle_device keyboard +adstick_device keyboard +pedal_device keyboard +dial_device keyboard +trackball_device keyboard +lightgun_device keyboard +positional_device keyboard +mouse_device mouse + +# +# CORE DEBUGGING OPTIONS +# +verbose 0 +log 0 +oslog 0 +debug 0 +update_in_pause 0 +debugscript +debuglog 0 + +# +# CORE COMM OPTIONS +# +comm_localhost 0.0.0.0 +comm_localport 15112 +comm_remotehost 127.0.0.1 +comm_remoteport 15112 +comm_framesync 0 + +# +# CORE MISC OPTIONS +# +drc 1 +drc_use_c 0 +drc_log_uml 0 +drc_log_native 0 +bios +cheat 0 +skip_gameinfo 1 +uifont default +ui cabinet +ramsize +confirm_quit 0 +ui_mouse 1 +language +nvram_save 1 + +# +# SCRIPTING OPTIONS +# +autoboot_command +autoboot_delay 0 +autoboot_script +console 0 +plugins 1 +plugin +noplugin + +# +# HTTP SERVER OPTIONS +# +http 0 +http_port 8080 +http_root web + +# +# OSD INPUT MAPPING OPTIONS +# +uimodekey auto +controller_map none +background_input 0 + +# +# OSD FONT OPTIONS +# +uifontprovider auto + +# +# OSD OUTPUT OPTIONS +# +output auto + +# +# OSD INPUT OPTIONS +# +keyboardprovider auto +mouseprovider auto +lightgunprovider auto +joystickprovider auto + +# +# OSD DEBUGGING OPTIONS +# +debugger auto +debugger_port 23946 +debugger_font auto +debugger_font_size 0 +watchdog 0 + +# +# OSD PERFORMANCE OPTIONS +# +numprocessors auto +bench 0 + +# +# OSD VIDEO OPTIONS +# +video opengl +numscreens 1 +window 0 +maximize 1 +waitvsync 0 +syncrefresh 0 +monitorprovider auto + +# +# OSD PER-WINDOW VIDEO OPTIONS +# +screen auto +aspect auto +resolution auto +view auto +screen0 auto +aspect0 auto +resolution0 auto +view0 auto +screen1 auto +aspect1 auto +resolution1 auto +view1 auto +screen2 auto +aspect2 auto +resolution2 auto +view2 auto +screen3 auto +aspect3 auto +resolution3 auto +view3 auto + +# +# OSD FULL SCREEN OPTIONS +# +switchres 0 + +# +# OSD ACCELERATED VIDEO OPTIONS +# +filter 1 +prescale 1 + +# +# OpenGL-SPECIFIC OPTIONS +# +gl_forcepow2texture 0 +gl_notexturerect 0 +gl_vbo 1 +gl_pbo 1 +gl_glsl 0 +gl_glsl_filter 1 +glsl_shader_mame0 none +glsl_shader_mame1 none +glsl_shader_mame2 none +glsl_shader_mame3 none +glsl_shader_mame4 none +glsl_shader_mame5 none +glsl_shader_mame6 none +glsl_shader_mame7 none +glsl_shader_mame8 none +glsl_shader_mame9 none +glsl_shader_screen0 none +glsl_shader_screen1 none +glsl_shader_screen2 none +glsl_shader_screen3 none +glsl_shader_screen4 none +glsl_shader_screen5 none +glsl_shader_screen6 none +glsl_shader_screen7 none +glsl_shader_screen8 none +glsl_shader_screen9 none + +# +# OSD SOUND OPTIONS +# +sound auto +audio_latency 2 + +# +# PORTAUDIO OPTIONS +# +pa_api none +pa_device none +pa_latency 0 + +# +# OSD MIDI OPTIONS +# +midiprovider auto + +# +# OSD EMULATED NETWORKING OPTIONS +# +networkprovider auto + +# +# BGFX POST-PROCESSING OPTIONS +# +bgfx_path bgfx +bgfx_backend auto +bgfx_debug 0 +bgfx_screen_chains +bgfx_shadow_mask slot-mask.png +bgfx_lut lut-default.png +bgfx_avi_name auto + +# +# SDL PERFORMANCE OPTIONS +# +sdlvideofps 0 + +# +# SDL VIDEO OPTIONS +# +centerh 1 +centerv 1 +scalemode none + +# +# SDL FULL SCREEN OPTIONS +# +useallheads 0 +attach_window + +# +# SDL KEYBOARD MAPPING +# +keymap 0 +keymap_file keymap.dat + +# +# SDL JOYSTICK MAPPING +# +sixaxis 0 + +# +# SDL LIGHTGUN MAPPING +# +lightgun_index1 auto +lightgun_index2 auto +lightgun_index3 auto +lightgun_index4 auto +lightgun_index5 auto +lightgun_index6 auto +lightgun_index7 auto +lightgun_index8 auto + +# +# SDL LOW-LEVEL DRIVER OPTIONS +# +videodriver auto +renderdriver auto +audiodriver auto +gl_lib auto diff --git a/emu-configs/mame/ui.ini b/emu-configs/mame/ui.ini new file mode 100644 index 00000000..db76cbf3 --- /dev/null +++ b/emu-configs/mame/ui.ini @@ -0,0 +1,70 @@ +# +# UI SEARCH PATH OPTIONS +# +historypath history;dats;. +categorypath folders +cabinets_directory cabinets;cabdevs +cpanels_directory cpanel +pcbs_directory pcb +flyers_directory flyers +titles_directory titles +ends_directory ends +marquees_directory marquees;$HOME/retrodeck/downloaded_media/arcade/marquees +artwork_preview_directory "artwork preview;artpreview" +bosses_directory bosses +logos_directory logo +scores_directory scores +versus_directory versus +gameover_directory gameover +howto_directory howto +select_directory select +icons_directory icons +covers_directory covers;$HOME/retrodeck/downloaded_media/arcade/covers +ui_path ui + +# +# UI MISC OPTIONS +# +system_names +skip_warnings 1 +unthrottle_mute 0 + +# +# UI OPTIONS +# +infos_text_size 0.75 +font_rows 30 +ui_border_color ffffffff +ui_bg_color ef101030 +ui_clone_color ff808080 +ui_dipsw_color ffffff00 +ui_gfxviewer_color ef101030 +ui_mousedown_bg_color b0606000 +ui_mousedown_color ffffff80 +ui_mouseover_bg_color 70404000 +ui_mouseover_color ffffff80 +ui_selected_bg_color ef808000 +ui_selected_color ffffff00 +ui_slider_color ffffffff +ui_subitem_color ffffffff +ui_text_bg_color ef000000 +ui_text_color ffffffff +ui_unavail_color ff404040 + +# +# SYSTEM/SOFTWARE SELECTION MENU OPTIONS +# +hide_main_panel 0 +use_background 1 +skip_biosmenu 0 +skip_partsmenu 0 +remember_last 0 +last_used_filter Available +system_right_panel image +software_right_panel image +system_right_image cover +software_right_image snap +enlarge_snaps 1 +forced4x3 1 +info_audit_enabled 0 +hide_romless 1 diff --git a/rd-submodules/mame/floppy.patch b/rd-submodules/mame/floppy.patch new file mode 100644 index 00000000..1754f616 --- /dev/null +++ b/rd-submodules/mame/floppy.patch @@ -0,0 +1,41 @@ +diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp +index 3c00336d..cda94d92 100644 +--- a/src/devices/imagedev/floppy.cpp ++++ b/src/devices/imagedev/floppy.cpp +@@ -1707,9 +1707,10 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector< + { + idx = m_spin_playback_sample; + sampleend = m_sample[idx].data.size(); +- out = m_sample[idx].data[m_spin_samplepos++]; +- +- if (m_spin_samplepos >= sampleend) ++ m_spin_samplepos++; ++ if (m_spin_samplepos < sampleend) ++ out = m_sample[idx].data[m_spin_samplepos]; ++ else + { + // Motor sample has completed + switch (m_spin_playback_sample) +@@ -1763,7 +1764,8 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector< + idx = m_step_base + m_seek_playback_sample; + sampleend = m_sample[idx].data.size(); + // Mix it into the stream value +- out += m_sample[idx].data[(int)m_seek_samplepos]; ++ if (m_seek_samplepos < sampleend) ++ out += m_sample[idx].data[(int)m_seek_samplepos]; + // By adding different values than 1, we can change the playback speed + // This will be used to adjust the seek sound + m_seek_samplepos += m_seek_pitch; +@@ -1781,8 +1783,10 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector< + sampleend = m_sample[idx].data.size(); + + // Mix it into the stream value +- out += m_sample[idx].data[m_step_samplepos++]; +- if (m_step_samplepos >= sampleend) ++ m_step_samplepos++; ++ if (m_step_samplepos < sampleend) ++ out += m_sample[idx].data[m_step_samplepos]; ++ else + { + // Step sample done + m_step_samplepos = 0; \ No newline at end of file diff --git a/rd-submodules/mame/mame.ini b/rd-submodules/mame/mame.ini new file mode 100644 index 00000000..0164486f --- /dev/null +++ b/rd-submodules/mame/mame.ini @@ -0,0 +1,33 @@ +# +# CORE SEARCH PATH OPTIONS +# +homepath $HOME/.mame +rompath /app/share/mame/roms +hashpath /app/share/mame/hash +samplepath /app/share/mame/samples +artpath /app/share/mame/artwork +ctrlrpath /app/share/mame/ctrlr +inipath $HOME/.mame;/app/share/mame/ini +fontpath /app/bin/ +cheatpath /app/share/mame/cheat +crosshairpath /app/share/mame/crosshair +pluginspath /app/share/mame/plugins +languagepath /app/share/mame/language +swpath /app/share/mame/software + +# +# CORE OUTPUT DIRECTORY OPTIONS +# +cfg_directory $HOME/.mame/cfg +nvram_directory $HOME/.mame/nvram +input_directory $HOME/.mame/inp +state_directory $HOME/.mame/sta +snapshot_directory $HOME/.mame/snap +diff_directory $HOME/.mame/diff +comment_directory $HOME/.mame/comments +share_directory $HOME/.mame/share + +# +# OSD VIDEO OPTIONS +# +video opengl \ No newline at end of file diff --git a/rd-submodules/mame/sound.patch b/rd-submodules/mame/sound.patch new file mode 100644 index 00000000..84b51ff6 --- /dev/null +++ b/rd-submodules/mame/sound.patch @@ -0,0 +1,28 @@ +diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp +index a0293063..c4989abb 100644 +--- a/src/emu/sound.cpp ++++ b/src/emu/sound.cpp +@@ -761,6 +761,9 @@ read_stream_view sound_stream::update_view(attotime start, attotime end, u32 out + } + g_profiler.stop(); + ++ if (!m_output_view[outputnum].valid()) ++ m_output_view[outputnum] = empty_view(start, end); ++ + // return the requested view + return read_stream_view(m_output_view[outputnum], start); + } +diff --git a/src/emu/sound.h b/src/emu/sound.h +index 15f6a574..bfa45c45 100644 +--- a/src/emu/sound.h ++++ b/src/emu/sound.h +@@ -284,6 +284,9 @@ public: + return *this; + } + ++ // check basic constraints ++ bool valid() const { return m_buffer != nullptr; } ++ + // return the local gain + sample_t gain() const { return m_gain; } + \ No newline at end of file diff --git a/rd-submodules/mame/ym3802.patch b/rd-submodules/mame/ym3802.patch new file mode 100644 index 00000000..a48925ab --- /dev/null +++ b/rd-submodules/mame/ym3802.patch @@ -0,0 +1,13 @@ +diff --git a/src/devices/machine/ym3802.cpp b/src/devices/machine/ym3802.cpp +index 4a8f6a7ffae..d1bf2b961f6 100644 +--- a/src/devices/machine/ym3802.cpp ++++ b/src/devices/machine/ym3802.cpp +@@ -45,7 +45,7 @@ void ym3802_device::device_start() + + void ym3802_device::device_reset() + { +- m_reg.clear(); ++ m_reg.assign(REG_MAX, 0); + reset_irq(0xff); + transmit_register_reset(); + receive_register_reset(); \ No newline at end of file diff --git a/rd-submodules/retroarch b/rd-submodules/retroarch index 0b1cfb79..717b7809 160000 --- a/rd-submodules/retroarch +++ b/rd-submodules/retroarch @@ -1 +1 @@ -Subproject commit 0b1cfb79e591e10488a3262d6b38db843c39a409 +Subproject commit 717b78093797270877ec416e58082f1c71d435d8