From 4540c68e067b4ee902b57eec83f53d1d296bbcec Mon Sep 17 00:00:00 2001 From: ZengGengSen <54354608+ZengGengSen@users.noreply.github.com> Date: Wed, 17 Jun 2026 01:00:44 +0800 Subject: [PATCH] =?UTF-8?q?build(fbneo):=20consolidate=20Meson=20build=20i?= =?UTF-8?q?nto=20a=20single=20top-level=20meson.b=E2=80=A6=20(#2629)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(fbneo): consolidate Meson build into a single top-level meson.build Replace the previously scattered per-subdirectory meson.build stubs with a single self-contained top-level meson.build that covers the entire project, and add a driver-level CI test script. Top-level meson.build: - Project is declared as 'fbneo' v1.0.0.3 (C99 / C++11) - Auto-select frontend: win32 on Windows, macos on Darwin, sdl2 elsewhere; can be overridden via -Dfrontend= - Options: include_7z, force_pulse_audio, rom_verify, fastcall_support (probed at configure time for GCC/Clang/MSVC) - burn_driver_dependencies dict maps every driver family (atari, capcom, cave, channelf, coleco, cps3, dataeast, galaxian, irem, konami, megadrive, midway, msx, neogeo, nes, pce, …) to its required cpu, device, and sound modules, enabling per-driver tree-shaking - Bundled third-party libs (lua, zlib) each get their own meson.build producing a static_library + declare_dependency; libchdr and lib7z follow the same pattern src/intf/cd/win32/cd_img.cpp: - Guard `#include ` with `#ifdef _MSC_VER` to fix compilation on non-MSVC toolchains tools/test_driver_list.py (new): - Python 3 script that iterates over every driver in driver_list, runs `meson setup --wipe -Ddriver_list=` followed by `meson compile`, and reports pass/fail per driver - Writes a JSON summary to build-driver-tests/logs/summary.json - Accepts --frontend, --buildtype, --target, --jobs, --timeout, --setup-only, --no-clean, --tail, and per-driver filtering * move joyprocess to src/burn/devices --- meson.build | 746 ++++++++++++++++++++ meson_options.txt | 45 ++ src/burn/devices/meson.build | 107 +++ src/burn/drv/meson.build | 1091 ++++++++++++++++++++++++++++++ src/burn/meson.build | 91 +++ src/burn/snd/meson.build | 131 ++++ src/burner/macos/meson.build | 21 + src/burner/meson.build | 90 +++ src/burner/pi/meson.build | 35 + src/burner/psp/meson.build | 27 + src/burner/qt/meson.build | 62 ++ src/burner/sdl/meson.build | 50 ++ src/burner/win32/meson.build | 205 ++++++ src/cpu/meson.build | 505 ++++++++++++++ src/dep/libs/lib7z/meson.build | 45 ++ src/dep/libs/libchdr/meson.build | 38 ++ src/dep/libs/lua/meson.build | 39 ++ src/dep/libs/zlib/meson.build | 24 + src/intf/cd/win32/cd_img.cpp | 4 + tools/test_driver_list.py | 209 ++++++ 20 files changed, 3565 insertions(+) create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 src/burn/devices/meson.build create mode 100644 src/burn/drv/meson.build create mode 100644 src/burn/meson.build create mode 100644 src/burn/snd/meson.build create mode 100644 src/burner/macos/meson.build create mode 100644 src/burner/meson.build create mode 100644 src/burner/pi/meson.build create mode 100644 src/burner/psp/meson.build create mode 100644 src/burner/qt/meson.build create mode 100644 src/burner/sdl/meson.build create mode 100644 src/burner/win32/meson.build create mode 100644 src/cpu/meson.build create mode 100644 src/dep/libs/lib7z/meson.build create mode 100644 src/dep/libs/libchdr/meson.build create mode 100644 src/dep/libs/lua/meson.build create mode 100644 src/dep/libs/zlib/meson.build create mode 100644 tools/test_driver_list.py diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..75b392ff1 --- /dev/null +++ b/meson.build @@ -0,0 +1,746 @@ +project( + 'fbneo', + ['c', 'cpp'], + version: '1.0.0.3', + default_options: ['c_std=c99', 'cpp_std=c++11'], +) + +perl = find_program('perl', required: true) +cc = meson.get_compiler('c') +cpp = meson.get_compiler('cpp') + +if cc.get_id() in ['gcc', 'clang'] + add_project_arguments('-D_GNU_SOURCE', language: 'c') +endif +if cpp.get_id() in ['gcc', 'clang'] + add_project_arguments('-D_GNU_SOURCE', language: 'cpp') +endif + +if cpp.get_id() in ['gcc', 'clang'] + add_project_arguments('-Wno-write-strings', language: 'cpp') +elif cpp.get_id() == 'msvc' + add_project_arguments('/Zc:strictStrings-', language: 'cpp') +endif + +include_7z = get_option('include_7z') +frontend = get_option('frontend') +if frontend == 'auto' + if host_machine.system() == 'windows' + frontend = 'win32' + elif host_machine.system() == 'darwin' + frontend = 'macos' + else + frontend = 'sdl2' + endif +endif + +message('FBNeo frontend: ' + frontend) +force_pulse_audio = get_option('force_pulse_audio') +rom_verify = get_option('rom_verify') +fastcall_support = get_option('fastcall_support') + +if fastcall_support + fastcall_test = [] + warn_as_error_args = [] + + if cc.get_id() in ['gcc', 'clang'] + fastcall_test = ''' + int __attribute__((fastcall)) test_fastcall(int a) { return a; } + int main(void) { return test_fastcall(0); } + ''' + + warn_as_error_args = '-Werror' + elif cc.get_id() == 'msvc' + fastcall_test = ''' + int __fastcall test_fastcall(int a) { return a; } + int main(void) { return test_fastcall(0); } + ''' + + warn_as_error_args = ['/WX'] + endif + + if not cc.compiles( + fastcall_test, + name: '__fastcall keyword (C)', + args: warn_as_error_args, + ) + add_project_arguments('-D__fastcall=', language: 'c') + else + add_project_arguments('-DFASTCALL', language: 'c') + endif + + if not cpp.compiles( + fastcall_test, + name: '__fastcall keyword (C++)', + args: warn_as_error_args, + ) + add_project_arguments('-D__fastcall=', language: 'cpp') + else + add_project_arguments('-DFASTCALL', language: 'cpp') + endif +endif + +burn_driver_list = get_option('driver_list') +burn_driver_dependencies = { + 'atari': { + 'cpus': ['adsp2100', 'm6502', 'm68000', 'm6809', 'tms34010'], + 'devices': [ + 'atariic', + 'atarijsa', + 'atarimo', + 'atarirle', + 'atarivad', + 'avgdvg', + 'eeprom', + 'slapstic', + 'tms34061', + 'watchdog', + ], + 'sounds': [ + 'asteroids', + 'ay8910', + 'bzone', + 'dac', + 'llander', + 'pokey', + 'redbaron', + 'samples', + 'ym2151', + ], + }, + 'capcom': { + 'cpus': ['m68000', 'z80'], + 'devices': ['eeprom', 'resnet', 'watchdog'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym2413', + 'burn_ym2151', + 'burn_ym2610', + 'burn_ym2612', + 'burn_ym3526', + 'burn_ym3812', + 'burn_y8950', + 'dac', + 'fm', + 'fmopl', + 'msm5205', + 'msm6295', + 'samples', + 'ym2151', + 'ym2413', + 'ym2612', + ], + }, + 'cave': { + 'cpus': ['m68000', 'sh2', 'sh4', 'z80'], + 'devices': ['eeprom', 'watchdog'], + 'sounds': ['burn_ym2151', 'burn_ym2203', 'burn_ym2610', 'msm6295', 'ym2151'], + }, + 'channelf': { + 'cpus': ['f8'], + 'devices': [], + 'sounds': ['dac'], + }, + 'coleco': { + 'cpus': ['z80'], + 'devices': [], + 'sounds': ['sn76496'], + }, + 'cps3': { + 'cpus': ['sh2'], + 'devices': ['eeprom', 'intelfsh'], + 'sounds': ['dac'], + }, + 'dataeast': { + 'cpus': [ + 'arm', + 'h6280', + 'i8051', + 'i8x41', + 'm6502', + 'm68000', + 'm6809', + 'tms32010', + 'z80', + ], + 'devices': ['decobsmt', 'eeprom'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym3526', + 'burn_ym3812', + 'dac', + 'fm', + 'fmopl', + 'msm5205', + 'msm6295', + 'ym2151', + ], + }, + 'galaxian': { + 'cpus': ['m6809', 's2650', 'z80'], + 'devices': ['resnet', 'watchdog'], + 'sounds': ['ay8910', 'samples', 'sn76477', 'sn76496'], + }, + 'irem': { + 'cpus': ['i8039', 'i8051', 'm68000', 'm6809', 'nec', 'z80'], + 'devices': ['eeprom', 'watchdog'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym2151', + 'dac', + 'iremga20', + 'msm5205', + 'msm6295', + 'ym2151', + ], + }, + 'konami': { + 'cpus': [ + 'hd6309', + 'i8039', + 'i8x41', + 'konami', + 'm6800', + 'm68000', + 'm6805', + 'm6809', + 'z80', + ], + 'devices': ['eeprom', 'watchdog'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym3812', + 'dac', + 'k005289', + 'k007232', + 'k051649', + 'k053260', + 'k054539', + 'samples', + 'sn76496', + 'upd7759', + 'vlm5030', + 'ym2151', + ], + }, + 'megadrive': { + 'cpus': ['m68000', 'z80'], + 'devices': ['eeprom'], + 'sounds': ['burn_md2612', 'burn_ym2612', 'dac', 'sn76496', 'ym2612'], + }, + 'midway': { + 'cpus': [ + 'adsp2100', + 'i386', + 'm6502', + 'm68000', + 'm6809', + 'mips3', + 'tms34010', + ], + 'devices': [ + '6821pia', + '6840ptm', + '8255ppi', + 'eeprom', + 'midcsd', + 'midcvsd', + 'midsat', + 'midsg', + 'midssio', + 'midtcs', + 'pic8259', + 'pit8253', + 'tms34061', + 'watchdog', + ], + 'sounds': ['ay8910', 'dac', 'hc55516', 'msm6295', 'samples', 'ym2151'], + }, + 'msx': { + 'cpus': ['z80'], + 'devices': ['tms9928a'], + 'sounds': ['ay8910', 'dac', 'ym2413'], + }, + 'neogeo': { + 'cpus': ['m68000', 'z80'], + 'devices': ['eeprom', 'watchdog'], + 'sounds': ['burn_ym2610', 'dac', 'ym2612', 'ymdeltat'], + }, + 'nes': { + 'cpus': ['m6502'], + 'devices': [], + 'sounds': ['nes_apu'], + }, + 'pce': { + 'cpus': ['h6280'], + 'devices': ['vdc'], + 'sounds': ['c6280'], + }, + 'pgm': { + 'cpus': ['arm7', 'm68000', 'z80'], + 'devices': ['eeprom', 'i2ceeprom', 'watchdog'], + 'sounds': ['ics2115', 'msm6295'], + }, + 'pgm2': { + 'cpus': ['arm7'], + 'devices': ['eeprom', 'i2ceeprom'], + 'sounds': ['ics2115'], + }, + 'pre90s': { + 'cpus': [ + 'adsp2100', + 'h6280', + 'hd6309', + 'hmcs40', + 'i8039', + 'i8051', + 'i8085', + 'i8x41', + 'konami', + 'm6502', + 'm6800', + 'm6805', + 'm6809', + 'm68000', + 'mb88xx', + 'nec', + 'pic16c5x', + 's2650', + 'tms32010', + 'tms34010', + 'z80', + ], + 'devices': [ + '6821pia', + '6840ptm', + '74259', + '8255ppi', + '8257dma', + 'ad59mc07', + 'alpha8201', + 'avgdvg', + 'bsmt2000', + 'ds2404', + 'dtimer', + 'earom', + 'eeprom', + 'i8155', + 'mathbox', + 'namcoio', + 'nb1414m4', + 'nb1414m4_8bit', + 'nmk004', + 'pandora', + 'poly', + 'resnet', + 't5182', + 'timekpr', + 'tlc34076', + 'tms34061', + 'tms9928a', + 'v3021', + 'watchdog', + 'x2212', + ], + 'sounds': [ + 'asteroids', + 'astrocde', + 'ay8910', + 'beep', + 'bzone', + 'dac', + 'digitalk', + 'exidy440', + 'flower', + 'flt_rc', + 'fm', + 'fmopl', + 'hc55516', + 'k005289', + 'k007232', + 'llander', + 'msm5205', + 'msm5232', + 'msm6295', + 'namco_snd', + 'phoenixsound', + 'pleiadssound', + 'pokey', + 'redbaron', + 's14001a', + 'saa1099', + 'samples', + 'sn76477', + 'sn76496', + 'snk6502_sound', + 'sp0250', + 'sp0256', + 't6w28', + 'tiamc1', + 'tms36xx', + 'tms5110', + 'tms5220', + 'upd7759', + 'vlm5030', + 'votrax', + 'wiping', + 'x1010', + 'ym2151', + 'ym2413', + 'ym2612', + 'ymdeltat', + ], + }, + 'psikyo': { + 'cpus': ['m68000', 'sh2', 'z80'], + 'devices': ['eeprom'], + 'sounds': ['burn_ym2610', 'ym2151'], + }, + 'pst90s': { + 'cpus': [ + 'arm7', + 'arm9', + 'e132xs', + 'i386', + 'i8051', + 'm377', + 'm6502', + 'm68000', + 'm6805', + 'mips3', + 'nec', + 'sh2', + 'sh4', + 'tlcs90', + 'tlcs900', + 'tms32010', + 'upd7725', + 'upd7810', + 'v60', + 'z80', + 'z180', + ], + 'devices': [ + 'c169', + 'eeprom', + 'epic12', + 'gaelco_crypt', + 'i2ceeprom', + 'i4x00', + 'intelfsh', + 'k1ge', + 'kaneko_hit', + 'kaneko_tmap', + 'mb87078', + 'mermaid', + 'namco_c45', + 'nmk112', + 'qs1000', + 'rtc9701', + 'seibucop', + 'seibusnd', + 'serflash', + 'sknsspr', + 'st0020', + 'watchdog', + ], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym2413', + 'burn_ym2608', + 'burn_ym2610', + 'burn_ym2612', + 'burn_ym3526', + 'burn_ym3812', + 'burn_ymf262', + 'burn_ymf271', + 'burn_ymf278b', + 'c140', + 'c352', + 'dac', + 'es5506', + 'es8712', + 'gaelco', + 'i5000', + 'ics2115', + 'mpeg_audio', + 'msm5205', + 'msm6295', + 'multipcm', + 'rf5c68', + 'samples', + 'segapcm', + 'ym2151', + 'ym2413', + 'ym2612', + 'ymdeltat', + 'ymf262', + 'ymf271', + 'ymf278b', + 'ymz280b', + 'ymz770', + ], + }, + 'sega': { + 'cpus': [ + 'i8039', + 'i8051', + 'i8x41', + 'm6502', + 'm68000', + 'm6809', + 'nec', + 'sh2', + 'v60', + 'z80', + ], + 'devices': ['eeprom', 'seibusnd', 'watchdog'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym2413', + 'burn_ym2610', + 'burn_ym2612', + 'dac', + 'multipcm', + 'samples', + 'segapcm', + 'sn76496', + 'upd7759', + 'ym2151', + 'ym2413', + 'ym2612', + ], + }, + 'sg1000': { + 'cpus': ['z80'], + 'devices': ['tms9928a'], + 'sounds': ['sn76496'], + }, + 'sms': { + 'cpus': ['z80'], + 'devices': ['tms9928a'], + 'sounds': ['sn76496', 'ym2413'], + }, + 'snes': { + 'cpus': ['m6502', 'upd7725'], + 'devices': [], + 'sounds': ['dac'], + }, + 'spectrum': { + 'cpus': ['z80'], + 'devices': [], + 'sounds': ['ay8910', 'beep'], + }, + 'taito': { + 'cpus': [ + 'hd6309', + 'i8051', + 'i8x41', + 'm6800', + 'm68000', + 'm6805', + 'm6809', + 'upd7810', + 'z80', + ], + 'devices': ['eeprom', 'watchdog'], + 'sounds': [ + 'ay8910', + 'burn_ym2151', + 'burn_ym2203', + 'burn_ym2610', + 'dac', + 'msm5205', + 'msm6295', + 'samples', + 'ym2151', + ], + }, + 'toaplan': { + 'cpus': [ + 'i8x41', + 'm68000', + 'm6805', + 'tms32010', + 'z180', + 'z80', + ], + 'devices': ['eeprom', 'watchdog'], + 'sounds': ['burn_ym2151', 'burn_ym3812', 'dac', 'msm6295', 'ym2151'], + }, +} + +cpu_list = [] +burn_device_list = [] +burn_sound_list = [] +foreach name : burn_driver_list + deps = burn_driver_dependencies[name] + foreach cpu_name : deps['cpus'] + if not cpu_list.contains(cpu_name) + cpu_list += cpu_name + endif + endforeach + foreach device_name : deps['devices'] + if not burn_device_list.contains(device_name) + burn_device_list += device_name + endif + endforeach + foreach sound_name : deps['sounds'] + if not burn_sound_list.contains(sound_name) + burn_sound_list += sound_name + endif + endforeach +endforeach + +subdir('src/burn') +subdir('src/cpu') +subdir('src/burn/devices') +subdir('src/burn/snd') +subdir('src/burn/drv') + +subdir('src/dep/libs/zlib') +subdir('src/dep/libs/lua') +subdir('src/dep/libs/libchdr') +if include_7z + subdir('src/dep/libs/lib7z') +endif + +subdir('src/burner') + +fbneo_sources = [] +build_details_exe = executable( + 'build_details', + 'src/dep/scripts/build_details.cpp', + cpp_args: ['-D_UNICODE'] + + (host_machine.cpu_family() == 'x86_64' ? ['-DBUILD_X64_EXE'] : []), + native: true, +) +build_details_h = custom_target( + 'build_details_h', + output: 'build_details.h', + command: [build_details_exe], + capture: true, +) +fbneo_sources += build_details_h + +if frontend == 'sdl2' + subdir('src/burner/sdl') +elif frontend == 'win32' + subdir('src/burner/win32') +elif frontend == 'qt' + subdir('src/burner/qt') +elif frontend == 'macos' + subdir('src/burner/macos') +elif frontend == 'pi' + subdir('src/burner/pi') +elif frontend == 'psp' + subdir('src/burner/psp') +endif + +fbneo_sources += frontend_sources + +defs = [] +extra_deps = [] +if include_7z + fbneo_sources += ['src/burner/un7z.cpp'] + defs += ['-DINCLUDE_7Z_SUPPORT'] + extra_deps += lib7z_dep +endif +if force_pulse_audio + defs += ['-DFORCE_PULSE_AUDIO'] +endif +if rom_verify + defs += ['-DROM_VERIFY'] +endif +fbneo_includes = include_directories( + [ + 'src/intf', + 'src/intf/video', + 'src/intf/video/scalers', + 'src/intf/audio', + 'src/intf/input', + 'src/intf/cd', + 'src/intf/perfcount', + ], +) + +deps = [ + dependency('threads'), +] +if force_pulse_audio + deps += [dependency('pulse-simple')] +endif + +c_warning_args = [] +cpp_warning_args = [] +if cc.get_id() in ['gcc', 'clang'] + c_warning_args = [ + '-Wno-long-long', + '-Wno-sign-compare', + '-Wno-uninitialized', + '-Wno-unused', + '-Wno-conversion', + '-Wno-attributes', + '-Wno-unused-parameter', + '-Wno-unused-value', + ] +endif +if cpp.get_id() in ['gcc', 'clang'] + cpp_warning_args = [ + '-Wconversion', + '-Winline', + '-Wno-attributes', + '-Wno-conversion', + '-Wno-long-long', + '-Wno-missing-braces', + '-Wno-multichar', + '-Wno-narrowing', + '-Wno-sign-compare', + '-Wno-unused-parameter', + '-Wno-unused-value', + '-Wno-write-strings', + '-Wpointer-arith', + '-Wundef', + '-Wuninitialized', + '-Wunknown-pragmas', + ] +endif + +link_args = [] +if host_machine.system() != 'windows' + link_args += ['-lm'] +endif +link_args += frontend_link_args + +executable( + 'fbneo', + fbneo_sources, + include_directories: [fbneo_includes], + dependencies: deps + + [ + cpu_dep, + burn_dep, + burn_devices_dep, + burn_snd_dep, + burn_drv_dep, + burner_dep, + frontend_dep, + ] + + extra_deps, + c_args: defs + c_warning_args, + cpp_args: defs + cpp_warning_args, + link_args: link_args, + win_subsystem: frontend == 'win32' ? 'windows' : 'console', +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..236cde50d --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,45 @@ +option('frontend', + type: 'combo', + choices: ['auto', 'sdl2', 'win32', 'qt', 'macos', 'pi', 'psp'], + value: 'auto', + description: 'Frontend implementation to build') +option('include_7z', type: 'boolean', value: true, description: 'Include 7-zip archive support') +option('force_pulse_audio', type: 'boolean', value: false, description: 'Use PulseAudio simple backend') +option('rom_verify', type: 'boolean', value: false, description: 'Include ROM set verification features') +option('fastcall_support', + type: 'boolean', + value: true, + description: 'Use the __fastcall calling convention when interfacing with A68K/Musashi/Doze') +option('driver_list', + type: 'array', + value: [ + 'atari', + 'capcom', + 'cave', + 'channelf', + 'coleco', + 'cps3', + 'dataeast', + 'galaxian', + 'irem', + 'konami', + 'megadrive', + 'midway', + 'msx', + 'neogeo', + 'nes', + 'pce', + 'pgm', + 'pgm2', + 'pre90s', + 'psikyo', + 'pst90s', + 'sega', + 'sg1000', + 'sms', + 'snes', + 'spectrum', + 'taito', + 'toaplan', + ], + description: 'Burn driver list to build; empty builds all groups') diff --git a/src/burn/devices/meson.build b/src/burn/devices/meson.build new file mode 100644 index 000000000..e6f7ef882 --- /dev/null +++ b/src/burn/devices/meson.build @@ -0,0 +1,107 @@ +burn_devices_sources = ['joyprocess.cpp'] + +all_burn_devices = { + '6821pia': {'desc': 'Motorola 6821 PIA', 'sources': ['6821pia.cpp']}, + '6840ptm': {'desc': 'Motorola 6840 PTM', 'sources': ['6840ptm.cpp']}, + '74259': {'desc': 'TTL 74259 addressable latch', 'sources': ['74259.cpp']}, + '8255ppi': {'desc': 'Intel 8255 PPI', 'sources': ['8255ppi.cpp']}, + '8257dma': {'desc': 'Intel 8257 DMA controller', 'sources': ['8257dma.cpp']}, + 'ad59mc07': {'desc': 'AD-59MC07 protection MCU', 'sources': ['ad59mc07.cpp']}, + 'alpha8201': {'desc': 'Alpha 8201 protection MCU', 'sources': ['alpha8201.cpp']}, + 'atariic': {'desc': 'Atari custom IC helpers', 'sources': ['atariic.cpp']}, + 'atarijsa': {'desc': 'Atari JSA sound board', 'sources': ['atarijsa.cpp']}, + 'atarimo': {'desc': 'Atari motion object generator', 'sources': ['atarimo.cpp']}, + 'atarirle': {'desc': 'Atari RLE object renderer', 'sources': ['atarirle.cpp']}, + 'atarivad': {'desc': 'Atari VAD tilemap generator', 'sources': ['atarivad.cpp']}, + 'avgdvg': {'desc': 'Atari AVG/DVG vector generator', 'sources': ['avgdvg.cpp']}, + 'bsmt2000': {'desc': 'BSMT2000 sound device', 'sources': ['bsmt2000.cpp']}, + 'c169': {'desc': 'Namco C169 ROZ device', 'sources': ['c169.cpp']}, + 'decobsmt': {'desc': 'Data East BSMT sound board', 'sources': ['decobsmt.cpp']}, + 'ds2404': {'desc': 'Dallas DS2404 RTC/NVRAM', 'sources': ['ds2404.cpp']}, + 'dtimer': {'desc': 'Generic device timer', 'sources': ['dtimer.cpp']}, + 'earom': {'desc': 'EAROM non-volatile memory', 'sources': ['earom.cpp']}, + 'eeprom': {'desc': 'Serial EEPROM device', 'sources': ['eeprom.cpp']}, + 'epic12': {'desc': 'EPIC12 custom blitter', 'sources': ['epic12.cpp']}, + 'gaelco_crypt': {'desc': 'Gaelco encryption device', 'sources': ['gaelco_crypt.cpp']}, + 'i2ceeprom': {'desc': 'I2C EEPROM device', 'sources': ['i2ceeprom.cpp']}, + 'i4x00': {'desc': 'I4X00 custom video device', 'sources': ['i4x00.cpp']}, + 'i8155': {'desc': 'Intel 8155 RAM/I/O/timer', 'sources': ['i8155.cpp']}, + 'intelfsh': {'desc': 'Intel/AMD flash memory', 'sources': ['intelfsh.cpp']}, + 'k1ge': {'desc': 'SNK K1GE/K2GE video device', 'sources': ['k1ge.cpp']}, + 'kaneko_hit': {'desc': 'Kaneko HIT protection', 'sources': ['kaneko_hit.cpp']}, + 'kaneko_tmap': {'desc': 'Kaneko tilemap device', 'sources': ['kaneko_tmap.cpp']}, + 'mathbox': {'desc': 'Mathbox co-processor', 'sources': ['mathbox.cpp']}, + 'mb87078': { + 'desc': 'Fujitsu MB87078 volume controller', + 'sources': ['mb87078.cpp'], + }, + 'mermaid': {'desc': 'Mermaid video device', 'sources': ['mermaid.cpp']}, + 'midcsd': {'desc': 'Midway CSD sound board', 'sources': ['midcsd.cpp']}, + 'midcvsd': {'desc': 'Midway CVSD sound board', 'sources': ['midcvsd.cpp']}, + 'midsat': {'desc': 'Midway Seattle audio board', 'sources': ['midsat.cpp']}, + 'midsg': {'desc': 'Midway Sounds Good board', 'sources': ['midsg.cpp']}, + 'midssio': {'desc': 'Midway SSIO sound board', 'sources': ['midssio.cpp']}, + 'midtcs': {'desc': 'Midway TCS sound board', 'sources': ['midtcs.cpp']}, + 'namco_c45': {'desc': 'Namco C45 road generator', 'sources': ['namco_c45.cpp']}, + 'namcoio': {'desc': 'Namco I/O controller', 'sources': ['namcoio.cpp']}, + 'nb1414m4': {'desc': 'Nichibutsu NB1414M4 device', 'sources': ['nb1414m4.cpp']}, + 'nb1414m4_8bit': { + 'desc': 'Nichibutsu NB1414M4 8-bit device', + 'sources': ['nb1414m4_8bit.cpp'], + }, + 'nmk004': {'desc': 'NMK004 sound MCU', 'sources': ['nmk004.cpp']}, + 'nmk112': {'desc': 'NMK112 sample banking device', 'sources': ['nmk112.cpp']}, + 'pandora': {'desc': 'Pandora sprite generator', 'sources': ['pandora.cpp']}, + 'pic8259': {'desc': 'Intel 8259 PIC', 'sources': ['pic8259.cpp']}, + 'pit8253': {'desc': 'Intel 8253 PIT', 'sources': ['pit8253.cpp']}, + 'poly': {'desc': 'Polygon rendering device', 'sources': ['poly.cpp']}, + 'qs1000': {'desc': 'QS1000 sound device', 'sources': ['qs1000.cpp']}, + 'resnet': {'desc': 'Resistor network helper', 'sources': ['resnet.cpp']}, + 'rtc9701': {'desc': 'Epson RTC-9701 clock', 'sources': ['rtc9701.cpp']}, + 'seibucop': {'desc': 'Seibu COP protection', 'sources': ['seibucop.cpp']}, + 'seibusnd': {'desc': 'Seibu sound system', 'sources': ['seibusnd.cpp']}, + 'serflash': {'desc': 'Serial flash memory', 'sources': ['serflash.cpp']}, + 'sknsspr': {'desc': 'Super Kaneko Nova sprite device', 'sources': ['sknsspr.cpp']}, + 'slapstic': {'desc': 'Atari Slapstic protection', 'sources': ['slapstic.cpp']}, + 'st0020': {'desc': 'Seta ST-0020 sprite device', 'sources': ['st0020.cpp']}, + 't5182': {'desc': 'Toshiba T5182 sound MCU interface', 'sources': ['t5182.cpp']}, + 'timekpr': {'desc': 'M48T02 Timekeeper NVRAM', 'sources': ['timekpr.cpp']}, + 'tlc34076': {'desc': 'TI TLC34076 RAMDAC', 'sources': ['tlc34076.cpp']}, + 'tms34061': {'desc': 'TI TMS34061 video controller', 'sources': ['tms34061.cpp']}, + 'tms9928a': {'desc': 'TI TMS9928A VDP', 'sources': ['tms9928a.cpp']}, + 'v3021': {'desc': 'V3021 RTC device', 'sources': ['v3021.cpp']}, + 'vdc': {'desc': 'PC Engine VDC/VCE device', 'sources': ['vdc.cpp']}, + 'watchdog': {'desc': 'Watchdog timer', 'sources': ['watchdog.cpp']}, + 'x2212': {'desc': 'Xicor X2212 NVRAM', 'sources': ['x2212.cpp']}, +} + +burn_device_status = {} +all_burn_device_names = all_burn_devices.keys() +foreach name : burn_device_list + assert( + all_burn_device_names.contains(name), + 'Unknown burn device in burn_device_list: ' + name, + ) +endforeach + +foreach name, device : all_burn_devices + enabled = burn_device_list.contains(name) + burn_device_status += {device['desc']: enabled ? 'ON' : 'OFF'} + if enabled + burn_devices_sources += device['sources'] + endif +endforeach +summary(burn_device_status, section: 'Burn devices', list_sep: '') + +burn_devices_lib = static_library( + 'burn_devices', + burn_devices_sources, + # TODO: snd/pce dep must split + include_directories: include_directories(['../drv/pce', '../snd']), + dependencies: [burn_dep, cpu_dep], +) + +burn_devices_dep = declare_dependency( + link_with: burn_devices_lib, + include_directories: include_directories('.'), +) diff --git a/src/burn/drv/meson.build b/src/burn/drv/meson.build new file mode 100644 index 000000000..aea017356 --- /dev/null +++ b/src/burn/drv/meson.build @@ -0,0 +1,1091 @@ +burn_drv_sources = ['d_parent.cpp'] + +all_burn_drivers = { + 'atari': { + 'desc': 'Atari drivers', + 'sources': [ + 'atari/d_akkaarrh.cpp', + 'atari/d_arcadecl.cpp', + 'atari/d_atarig1.cpp', + 'atari/d_atarisy1.cpp', + 'atari/d_badlands.cpp', + 'atari/d_batman.cpp', + 'atari/d_blstroid.cpp', + 'atari/d_eprom.cpp', + 'atari/d_gauntlet.cpp', + 'atari/d_klax.cpp', + 'atari/d_marblmd2.cpp', + 'atari/d_missile.cpp', + 'atari/d_offtwall.cpp', + 'atari/d_rampart.cpp', + 'atari/d_relief.cpp', + 'atari/d_shuuz.cpp', + 'atari/d_skullxbo.cpp', + 'atari/d_thunderj.cpp', + 'atari/d_toobin.cpp', + 'atari/d_vindictr.cpp', + 'atari/d_xybots.cpp', + ], + }, + 'capcom': { + 'desc': 'Capcom drivers', + 'sources': [ + 'capcom/cps.cpp', + 'capcom/cps2_crpt.cpp', + 'capcom/cps_config.cpp', + 'capcom/cps_draw.cpp', + 'capcom/cps_mem.cpp', + 'capcom/cps_obj.cpp', + 'capcom/cps_pal.cpp', + 'capcom/cps_run.cpp', + 'capcom/cps_rw.cpp', + 'capcom/cps_scr.cpp', + 'capcom/cpsr.cpp', + 'capcom/cpsrd.cpp', + 'capcom/cpst.cpp', + 'capcom/ctv.cpp', + 'capcom/d_cps1.cpp', + 'capcom/d_cps2.cpp', + 'capcom/fcrash_snd.cpp', + 'capcom/kabuki.cpp', + 'capcom/ps.cpp', + 'capcom/ps_m.cpp', + 'capcom/ps_z.cpp', + 'capcom/qs.cpp', + 'capcom/qs_c.cpp', + 'capcom/qs_z.cpp', + 'capcom/sf2mdt_snd.cpp', + ], + }, + 'cave': { + 'desc': 'Cave drivers', + 'sources': [ + 'cave/cave.cpp', + 'cave/cave_palette.cpp', + 'cave/cave_sprite.cpp', + 'cave/cave_tile.cpp', + 'cave/d_cv1k.cpp', + 'cave/d_dodonpachi.cpp', + 'cave/d_donpachi.cpp', + 'cave/d_esprade.cpp', + 'cave/d_feversos.cpp', + 'cave/d_gaia.cpp', + 'cave/d_guwange.cpp', + 'cave/d_hotdogst.cpp', + 'cave/d_korokoro.cpp', + 'cave/d_mazinger.cpp', + 'cave/d_metmqstr.cpp', + 'cave/d_pwrinst2.cpp', + 'cave/d_sailormn.cpp', + 'cave/d_tjumpman.cpp', + 'cave/d_uopoko.cpp', + ], + }, + 'channelf': { + 'desc': 'Fairchild Channel F drivers', + 'sources': [ + 'channelf/d_channelf.cpp', + ], + }, + 'coleco': { + 'desc': 'ColecoVision drivers', + 'sources': [ + 'coleco/d_coleco.cpp', + ], + }, + 'cps3': { + 'desc': 'Capcom CPS-3 drivers', + 'sources': [ + 'cps3/cps3run.cpp', + 'cps3/cps3snd.cpp', + 'cps3/d_cps3.cpp', + ], + }, + 'dataeast': { + 'desc': 'Data East drivers', + 'sources': [ + 'dataeast/d_actfancr.cpp', + 'dataeast/d_backfire.cpp', + 'dataeast/d_boogwing.cpp', + 'dataeast/d_brkthru.cpp', + 'dataeast/d_bwing.cpp', + 'dataeast/d_cbuster.cpp', + 'dataeast/d_chanbara.cpp', + 'dataeast/d_cninja.cpp', + 'dataeast/d_compgolf.cpp', + 'dataeast/d_darkseal.cpp', + 'dataeast/d_dassault.cpp', + 'dataeast/d_dblewing.cpp', + 'dataeast/d_dec0.cpp', + 'dataeast/d_dec8.cpp', + 'dataeast/d_deco156.cpp', + 'dataeast/d_deco32.cpp', + 'dataeast/d_decocass.cpp', + 'dataeast/d_decomlc.cpp', + 'dataeast/d_dietgogo.cpp', + 'dataeast/d_dreambal.cpp', + 'dataeast/d_funkyjet.cpp', + 'dataeast/d_karnov.cpp', + 'dataeast/d_kchamp.cpp', + 'dataeast/d_lemmings.cpp', + 'dataeast/d_liberate.cpp', + 'dataeast/d_metlclsh.cpp', + 'dataeast/d_pcktgal.cpp', + 'dataeast/d_pktgaldx.cpp', + 'dataeast/d_progolf.cpp', + 'dataeast/d_rohga.cpp', + 'dataeast/d_shootout.cpp', + 'dataeast/d_sidepckt.cpp', + 'dataeast/d_simpl156.cpp', + 'dataeast/d_sshangha.cpp', + 'dataeast/d_stadhero.cpp', + 'dataeast/d_supbtime.cpp', + 'dataeast/d_tumblep.cpp', + 'dataeast/d_vaportra.cpp', + 'dataeast/deco146.cpp', + 'dataeast/deco16ic.cpp', + 'dataeast/decobac06.cpp', + ], + }, + 'galaxian': { + 'desc': 'Galaxian hardware drivers', + 'sources': [ + 'galaxian/d_galaxian.cpp', + 'galaxian/gal_gfx.cpp', + 'galaxian/gal_run.cpp', + 'galaxian/gal_sound.cpp', + 'galaxian/gal_stars.cpp', + ], + }, + 'irem': { + 'desc': 'Irem drivers', + 'sources': [ + 'irem/d_m107.cpp', + 'irem/d_m52.cpp', + 'irem/d_m57.cpp', + 'irem/d_m58.cpp', + 'irem/d_m62.cpp', + 'irem/d_m63.cpp', + 'irem/d_m72.cpp', + 'irem/d_m90.cpp', + 'irem/d_m92.cpp', + 'irem/d_vigilant.cpp', + 'irem/irem_cpu.cpp', + 'irem/irem_sound.cpp', + ], + }, + 'konami': { + 'desc': 'Konami drivers', + 'sources': [ + 'konami/d_88games.cpp', + 'konami/d_ajax.cpp', + 'konami/d_aliens.cpp', + 'konami/d_asterix.cpp', + 'konami/d_battlnts.cpp', + 'konami/d_bishi.cpp', + 'konami/d_bladestl.cpp', + 'konami/d_blockhl.cpp', + 'konami/d_bottom9.cpp', + 'konami/d_chqflag.cpp', + 'konami/d_circusc.cpp', + 'konami/d_combatsc.cpp', + 'konami/d_contra.cpp', + 'konami/d_crimfght.cpp', + 'konami/d_dbz.cpp', + 'konami/d_ddribble.cpp', + 'konami/d_divebomb.cpp', + 'konami/d_fastlane.cpp', + 'konami/d_finalzr.cpp', + 'konami/d_flkatck.cpp', + 'konami/d_gberet.cpp', + 'konami/d_gbusters.cpp', + 'konami/d_gijoe.cpp', + 'konami/d_gradius3.cpp', + 'konami/d_gyruss.cpp', + 'konami/d_hcastle.cpp', + 'konami/d_hexion.cpp', + 'konami/d_hyperspt.cpp', + 'konami/d_ironhors.cpp', + 'konami/d_jackal.cpp', + 'konami/d_jailbrek.cpp', + 'konami/d_junofrst.cpp', + 'konami/d_kontest.cpp', + 'konami/d_labyrunr.cpp', + 'konami/d_lethal.cpp', + 'konami/d_mainevt.cpp', + 'konami/d_megazone.cpp', + 'konami/d_mikie.cpp', + 'konami/d_mogura.cpp', + 'konami/d_moo.cpp', + 'konami/d_mystwarr.cpp', + 'konami/d_nemesis.cpp', + 'konami/d_pandoras.cpp', + 'konami/d_parodius.cpp', + 'konami/d_pingpong.cpp', + 'konami/d_pooyan.cpp', + 'konami/d_rockrage.cpp', + 'konami/d_rocnrope.cpp', + 'konami/d_rollerg.cpp', + 'konami/d_sbasketb.cpp', + 'konami/d_scotrsht.cpp', + 'konami/d_shaolins.cpp', + 'konami/d_simpsons.cpp', + 'konami/d_spy.cpp', + 'konami/d_surpratk.cpp', + 'konami/d_thunderx.cpp', + 'konami/d_timeplt.cpp', + 'konami/d_tmnt.cpp', + 'konami/d_tp84.cpp', + 'konami/d_trackfld.cpp', + 'konami/d_tutankhm.cpp', + 'konami/d_twin16.cpp', + 'konami/d_ultraman.cpp', + 'konami/d_vendetta.cpp', + 'konami/d_wecleman.cpp', + 'konami/d_xexex.cpp', + 'konami/d_xmen.cpp', + 'konami/d_yiear.cpp', + 'konami/k007121.cpp', + 'konami/k007342_k007420.cpp', + 'konami/k007452.cpp', + 'konami/k051316.cpp', + 'konami/k051733.cpp', + 'konami/k051960.cpp', + 'konami/k052109.cpp', + 'konami/k053245.cpp', + 'konami/k053247.cpp', + 'konami/k053250.cpp', + 'konami/k053251.cpp', + 'konami/k053936.cpp', + 'konami/k054000.cpp', + 'konami/k054338.cpp', + 'konami/k055555.cpp', + 'konami/k056832.cpp', + 'konami/konamigx.cpp', + 'konami/konamiic.cpp', + 'konami/timeplt_snd.cpp', + ], + }, + 'megadrive': { + 'desc': 'Sega Mega Drive drivers', + 'sources': [ + 'megadrive/d_mdarcbl.cpp', + 'megadrive/d_megadrive.cpp', + 'megadrive/megadrive.cpp', + 'megadrive/stm95.cpp', + ], + }, + 'midway': { + 'desc': 'Midway drivers', + 'sources': [ + 'midway/d_kinst.cpp', + 'midway/d_tunit.cpp', + 'midway/d_wunit.cpp', + 'midway/d_xunit.cpp', + 'midway/d_yunit.cpp', + 'midway/dcs2k.cpp', + 'midway/ide.cpp', + 'midway/midtunit.cpp', + 'midway/midwayic.cpp', + 'midway/midwunit.cpp', + 'midway/narc_sound.cpp', + 'midway/williams_adpcm.cpp', + 'midway/williams_cvsd.cpp', + 'midway/yawdim_sound.cpp', + ], + }, + 'msx': { + 'desc': 'MSX drivers', + 'sources': [ + 'msx/d_msx.cpp', + ], + }, + 'neogeo': { + 'desc': 'SNK Neo Geo drivers', + 'sources': [ + 'neogeo/d_neogeo.cpp', + 'neogeo/neo_decrypt.cpp', + 'neogeo/neo_palette.cpp', + 'neogeo/neo_run.cpp', + 'neogeo/neo_sprite.cpp', + 'neogeo/neo_text.cpp', + 'neogeo/neo_upd4990a.cpp', + 'neogeo/neogeo.cpp', + ], + }, + 'nes': { + 'desc': 'Nintendo NES drivers', + 'sources': [ + 'nes/d_nes.cpp', + 'nes/nes.cpp', + ], + }, + 'pce': { + 'desc': 'NEC PC Engine drivers', + 'sources': [ + 'pce/d_pce.cpp', + 'pce/pce.cpp', + ], + }, + 'pgm': { + 'desc': 'IGS PGM drivers', + 'sources': [ + 'pgm/d_pgm.cpp', + 'pgm/pgm_asic25.cpp', + 'pgm/pgm_asic27a_type1.cpp', + 'pgm/pgm_asic27a_type2.cpp', + 'pgm/pgm_asic27a_type3.cpp', + 'pgm/pgm_asic3.cpp', + 'pgm/pgm_crypt.cpp', + 'pgm/pgm_draw.cpp', + 'pgm/pgm_run.cpp', + ], + }, + 'pgm2': { + 'desc': 'IGS PGM2 drivers', + 'sources': [ + 'pgm2/d_pgm2.cpp', + 'pgm2/pgm2_crypt.cpp', + 'pgm2/pgm2_draw.cpp', + 'pgm2/pgm2_run.cpp', + ], + }, + 'pre90s': { + 'desc': 'Pre-1990 arcade drivers', + 'sources': [ + 'pre90s/d_1942.cpp', + 'pre90s/d_1943.cpp', + 'pre90s/d_4enraya.cpp', + 'pre90s/d_aeroboto.cpp', + 'pre90s/d_akazukin.cpp', + 'pre90s/d_alinvade.cpp', + 'pre90s/d_alpha68k.cpp', + 'pre90s/d_alpha68k1.cpp', + 'pre90s/d_alpha68k2.cpp', + 'pre90s/d_ambush.cpp', + 'pre90s/d_amspdwy.cpp', + 'pre90s/d_arabian.cpp', + 'pre90s/d_argus.cpp', + 'pre90s/d_armedf.cpp', + 'pre90s/d_asteroids.cpp', + 'pre90s/d_astrocde.cpp', + 'pre90s/d_atetris.cpp', + 'pre90s/d_aztarac.cpp', + 'pre90s/d_bagman.cpp', + 'pre90s/d_baraduke.cpp', + 'pre90s/d_battlane.cpp', + 'pre90s/d_battlex.cpp', + 'pre90s/d_bbusters.cpp', + 'pre90s/d_beaminv.cpp', + 'pre90s/d_berzerk.cpp', + 'pre90s/d_bionicc.cpp', + 'pre90s/d_blktiger.cpp', + 'pre90s/d_blockade.cpp', + 'pre90s/d_blockout.cpp', + 'pre90s/d_blueprnt.cpp', + 'pre90s/d_bogeyman.cpp', + 'pre90s/d_bombjack.cpp', + 'pre90s/d_btime.cpp', + 'pre90s/d_bwidow.cpp', + 'pre90s/d_bzone.cpp', + 'pre90s/d_cabal.cpp', + 'pre90s/d_calorie.cpp', + 'pre90s/d_canyon.cpp', + 'pre90s/d_capbowl.cpp', + 'pre90s/d_carjmbre.cpp', + 'pre90s/d_ccastles.cpp', + 'pre90s/d_cclimber.cpp', + 'pre90s/d_champbas.cpp', + 'pre90s/d_cheekyms.cpp', + 'pre90s/d_chinagat.cpp', + 'pre90s/d_circus.cpp', + 'pre90s/d_citycon.cpp', + 'pre90s/d_cloak.cpp', + 'pre90s/d_cloud9.cpp', + 'pre90s/d_clshroad.cpp', + 'pre90s/d_commando.cpp', + 'pre90s/d_cop01.cpp', + 'pre90s/d_copsnrob.cpp', + 'pre90s/d_cybertnk.cpp', + 'pre90s/d_dacholer.cpp', + 'pre90s/d_darkmist.cpp', + 'pre90s/d_dday.cpp', + 'pre90s/d_ddayjlc.cpp', + 'pre90s/d_ddragon.cpp', + 'pre90s/d_deadang.cpp', + 'pre90s/d_djboy.cpp', + 'pre90s/d_dkong.cpp', + 'pre90s/d_docastle.cpp', + 'pre90s/d_dogfgt.cpp', + 'pre90s/d_dorachan.cpp', + 'pre90s/d_dribling.cpp', + 'pre90s/d_drmicro.cpp', + 'pre90s/d_dynduke.cpp', + 'pre90s/d_efdt.cpp', + 'pre90s/d_epos.cpp', + 'pre90s/d_equites.cpp', + 'pre90s/d_espial.cpp', + 'pre90s/d_ettrivia.cpp', + 'pre90s/d_exedexes.cpp', + 'pre90s/d_exerion.cpp', + 'pre90s/d_exidy.cpp', + 'pre90s/d_exidy440.cpp', + 'pre90s/d_exprraid.cpp', + 'pre90s/d_exterm.cpp', + 'pre90s/d_fantland.cpp', + 'pre90s/d_fastfred.cpp', + 'pre90s/d_fcombat.cpp', + 'pre90s/d_firetrap.cpp', + 'pre90s/d_flipjack.cpp', + 'pre90s/d_flower.cpp', + 'pre90s/d_foodf.cpp', + 'pre90s/d_freekick.cpp', + 'pre90s/d_funkybee.cpp', + 'pre90s/d_galaga.cpp', + 'pre90s/d_galivan.cpp', + 'pre90s/d_gaplus.cpp', + 'pre90s/d_ginganin.cpp', + 'pre90s/d_gng.cpp', + 'pre90s/d_goindol.cpp', + 'pre90s/d_gotya.cpp', + 'pre90s/d_gridlee.cpp', + 'pre90s/d_gunsmoke.cpp', + 'pre90s/d_headonb.cpp', + 'pre90s/d_higemaru.cpp', + 'pre90s/d_himesiki.cpp', + 'pre90s/d_holeland.cpp', + 'pre90s/d_hvyunit.cpp', + 'pre90s/d_invaders.cpp', + 'pre90s/d_iqblock.cpp', + 'pre90s/d_jack.cpp', + 'pre90s/d_jedi.cpp', + 'pre90s/d_jrpacman.cpp', + 'pre90s/d_kangaroo.cpp', + 'pre90s/d_kingofbox.cpp', + 'pre90s/d_kncljoe.cpp', + 'pre90s/d_kyugo.cpp', + 'pre90s/d_ladybug.cpp', + 'pre90s/d_lasso.cpp', + 'pre90s/d_lastduel.cpp', + 'pre90s/d_lockon.cpp', + 'pre90s/d_lwings.cpp', + 'pre90s/d_madmotor.cpp', + 'pre90s/d_magmax.cpp', + 'pre90s/d_mainsnk.cpp', + 'pre90s/d_mappy.cpp', + 'pre90s/d_marineb.cpp', + 'pre90s/d_mario.cpp', + 'pre90s/d_markham.cpp', + 'pre90s/d_mastboyo.cpp', + 'pre90s/d_matmania.cpp', + 'pre90s/d_mcr.cpp', + 'pre90s/d_mcr3.cpp', + 'pre90s/d_mcr68.cpp', + 'pre90s/d_megasys1.cpp', + 'pre90s/d_meijinsn.cpp', + 'pre90s/d_metlfrzr.cpp', + 'pre90s/d_mhavoc.cpp', + 'pre90s/d_miconkit.cpp', + 'pre90s/d_millipede.cpp', + 'pre90s/d_mirax.cpp', + 'pre90s/d_mitchell.cpp', + 'pre90s/d_mjkjidai.cpp', + 'pre90s/d_mmagic.cpp', + 'pre90s/d_mole.cpp', + 'pre90s/d_momoko.cpp', + 'pre90s/d_mouser.cpp', + 'pre90s/d_mrdo.cpp', + 'pre90s/d_mrflea.cpp', + 'pre90s/d_mrjong.cpp', + 'pre90s/d_munchmo.cpp', + 'pre90s/d_mustache.cpp', + 'pre90s/d_mystston.cpp', + 'pre90s/d_namcos1.cpp', + 'pre90s/d_namcos86.cpp', + 'pre90s/d_naughtyb.cpp', + 'pre90s/d_ninjakd2.cpp', + 'pre90s/d_nitedrvr.cpp', + 'pre90s/d_olibochu.cpp', + 'pre90s/d_omegrace.cpp', + 'pre90s/d_pac2650.cpp', + 'pre90s/d_pacland.cpp', + 'pre90s/d_pacman.cpp', + 'pre90s/d_pbaction.cpp', + 'pre90s/d_pengadvb.cpp', + 'pre90s/d_phoenix.cpp', + 'pre90s/d_pitnrun.cpp', + 'pre90s/d_pkunwar.cpp', + 'pre90s/d_popeye.cpp', + 'pre90s/d_popper.cpp', + 'pre90s/d_prehisle.cpp', + 'pre90s/d_psychic5.cpp', + 'pre90s/d_pturn.cpp', + 'pre90s/d_punchout.cpp', + 'pre90s/d_qbert.cpp', + 'pre90s/d_quantum.cpp', + 'pre90s/d_quizo.cpp', + 'pre90s/d_r2dtank.cpp', + 'pre90s/d_rallyx.cpp', + 'pre90s/d_redclash.cpp', + 'pre90s/d_renegade.cpp', + 'pre90s/d_route16.cpp', + 'pre90s/d_rpunch.cpp', + 'pre90s/d_safarir.cpp', + 'pre90s/d_sauro.cpp', + 'pre90s/d_scregg.cpp', + 'pre90s/d_seicross.cpp', + 'pre90s/d_senjyo.cpp', + 'pre90s/d_sf.cpp', + 'pre90s/d_shangkid.cpp', + 'pre90s/d_shisen.cpp', + 'pre90s/d_sidearms.cpp', + 'pre90s/d_skyarmy.cpp', + 'pre90s/d_skyfox.cpp', + 'pre90s/d_skykid.cpp', + 'pre90s/d_snk.cpp', + 'pre90s/d_snk6502.cpp', + 'pre90s/d_snk68.cpp', + 'pre90s/d_solomon.cpp', + 'pre90s/d_sonson.cpp', + 'pre90s/d_spacefb.cpp', + 'pre90s/d_spdodgeb.cpp', + 'pre90s/d_speedbal.cpp', + 'pre90s/d_splndrbt.cpp', + 'pre90s/d_sprcros2.cpp', + 'pre90s/d_srumbler.cpp', + 'pre90s/d_ssozumo.cpp', + 'pre90s/d_sstrangr.cpp', + 'pre90s/d_starwars.cpp', + 'pre90s/d_stfight.cpp', + 'pre90s/d_stuntair.cpp', + 'pre90s/d_sub.cpp', + 'pre90s/d_suna8.cpp', + 'pre90s/d_tagteam.cpp', + 'pre90s/d_tail2nose.cpp', + 'pre90s/d_tankbust.cpp', + 'pre90s/d_taxidriv.cpp', + 'pre90s/d_tbowl.cpp', + 'pre90s/d_tceptor.cpp', + 'pre90s/d_tecmo.cpp', + 'pre90s/d_tehkanwc.cpp', + 'pre90s/d_tempest.cpp', + 'pre90s/d_terracre.cpp', + 'pre90s/d_thedeep.cpp', + 'pre90s/d_thepit.cpp', + 'pre90s/d_thief.cpp', + 'pre90s/d_tiamc1.cpp', + 'pre90s/d_tigeroad.cpp', + 'pre90s/d_timelimt.cpp', + 'pre90s/d_toki.cpp', + 'pre90s/d_toypop.cpp', + 'pre90s/d_travrusa.cpp', + 'pre90s/d_tsamurai.cpp', + 'pre90s/d_tubep.cpp', + 'pre90s/d_usgames.cpp', + 'pre90s/d_vampire.cpp', + 'pre90s/d_vastar.cpp', + 'pre90s/d_vball.cpp', + 'pre90s/d_vicdual.cpp', + 'pre90s/d_vulgus.cpp', + 'pre90s/d_wallc.cpp', + 'pre90s/d_warpsped.cpp', + 'pre90s/d_warpwarp.cpp', + 'pre90s/d_wc90.cpp', + 'pre90s/d_wc90b.cpp', + 'pre90s/d_williams.cpp', + 'pre90s/d_wink.cpp', + 'pre90s/d_wiping.cpp', + 'pre90s/d_wiz.cpp', + 'pre90s/d_wwfsstar.cpp', + 'pre90s/d_xain.cpp', + 'pre90s/d_xxmissio.cpp', + 'pre90s/d_xyonix.cpp', + 'pre90s/d_zaccaria.cpp', + 'pre90s/d_zodiack.cpp', + 'pre90s/d_zwackery.cpp', + ], + }, + 'psikyo': { + 'desc': 'Psikyo drivers', + 'sources': [ + 'psikyo/d_psikyo.cpp', + 'psikyo/d_psikyo4.cpp', + 'psikyo/d_psikyosh.cpp', + 'psikyo/psikyo_palette.cpp', + 'psikyo/psikyo_sprite.cpp', + 'psikyo/psikyo_tile.cpp', + 'psikyo/psikyosh_render.cpp', + ], + }, + 'pst90s': { + 'desc': 'Post-1990 arcade drivers', + 'sources': [ + 'pst90s/d_1945kiii.cpp', + 'pst90s/d_20pacgal.cpp', + 'pst90s/d_3x3puzzl.cpp', + 'pst90s/d_aerofgt.cpp', + 'pst90s/d_airbustr.cpp', + 'pst90s/d_aquarium.cpp', + 'pst90s/d_artmagic.cpp', + 'pst90s/d_bestleag.cpp', + 'pst90s/d_bigstrkb.cpp', + 'pst90s/d_blackt96.cpp', + 'pst90s/d_blmbycar.cpp', + 'pst90s/d_bloodbro.cpp', + 'pst90s/d_bloodbro_ms.cpp', + 'pst90s/d_btoads.cpp', + 'pst90s/d_cischeat.cpp', + 'pst90s/d_crospang.cpp', + 'pst90s/d_crshrace.cpp', + 'pst90s/d_cultures.cpp', + 'pst90s/d_dcon.cpp', + 'pst90s/d_ddragon3.cpp', + 'pst90s/d_deniam.cpp', + 'pst90s/d_discoboy.cpp', + 'pst90s/d_diverboy.cpp', + 'pst90s/d_dooyong.cpp', + 'pst90s/d_dreamwld.cpp', + 'pst90s/d_drgnmst.cpp', + 'pst90s/d_drtomy.cpp', + 'pst90s/d_egghunt.cpp', + 'pst90s/d_eolith.cpp', + 'pst90s/d_eolith16.cpp', + 'pst90s/d_esd16.cpp', + 'pst90s/d_expro02.cpp', + 'pst90s/d_f-32.cpp', + 'pst90s/d_f1gp.cpp', + 'pst90s/d_funybubl.cpp', + 'pst90s/d_fuukifg2.cpp', + 'pst90s/d_fuukifg3.cpp', + 'pst90s/d_gaelco.cpp', + 'pst90s/d_gaelco2.cpp', + 'pst90s/d_gaiden.cpp', + 'pst90s/d_galpani3.cpp', + 'pst90s/d_galpanic.cpp', + 'pst90s/d_galspnbl.cpp', + 'pst90s/d_glass.cpp', + 'pst90s/d_go2000.cpp', + 'pst90s/d_goori.cpp', + 'pst90s/d_gotcha.cpp', + 'pst90s/d_gstream.cpp', + 'pst90s/d_gumbo.cpp', + 'pst90s/d_hyperpac.cpp', + 'pst90s/d_hyprduel.cpp', + 'pst90s/d_igs011.cpp', + 'pst90s/d_inufuku.cpp', + 'pst90s/d_itech32.cpp', + 'pst90s/d_itech8.cpp', + 'pst90s/d_jchan.cpp', + 'pst90s/d_kaneko16.cpp', + 'pst90s/d_kickgoal.cpp', + 'pst90s/d_ladyfrog.cpp', + 'pst90s/d_legionna.cpp', + 'pst90s/d_limenko.cpp', + 'pst90s/d_littlerb.cpp', + 'pst90s/d_lordgun.cpp', + 'pst90s/d_macrossp.cpp', + 'pst90s/d_mcatadv.cpp', + 'pst90s/d_metro.cpp', + 'pst90s/d_midas.cpp', + 'pst90s/d_mirage.cpp', + 'pst90s/d_missb2.cpp', + 'pst90s/d_mosaic.cpp', + 'pst90s/d_ms32.cpp', + 'pst90s/d_mugsmash.cpp', + 'pst90s/d_musclem.cpp', + 'pst90s/d_mwarr.cpp', + 'pst90s/d_namcona1.cpp', + 'pst90s/d_namconb1.cpp', + 'pst90s/d_namcos2.cpp', + 'pst90s/d_news.cpp', + 'pst90s/d_ngp.cpp', + 'pst90s/d_nmg5.cpp', + 'pst90s/d_nmk16.cpp', + 'pst90s/d_ohmygod.cpp', + 'pst90s/d_oneshot.cpp', + 'pst90s/d_onetwo.cpp', + 'pst90s/d_pasha2.cpp', + 'pst90s/d_pass.cpp', + 'pst90s/d_patapata.cpp', + 'pst90s/d_pipedrm.cpp', + 'pst90s/d_pirates.cpp', + 'pst90s/d_pkscram.cpp', + 'pst90s/d_playmark.cpp', + 'pst90s/d_powerbal.cpp', + 'pst90s/d_powerins.cpp', + 'pst90s/d_ppmast93.cpp', + 'pst90s/d_pushman.cpp', + 'pst90s/d_rabbit.cpp', + 'pst90s/d_raiden.cpp', + 'pst90s/d_raiden2.cpp', + 'pst90s/d_sandscrp.cpp', + 'pst90s/d_sderby.cpp', + 'pst90s/d_seibuspi.cpp', + 'pst90s/d_seta.cpp', + 'pst90s/d_seta2.cpp', + 'pst90s/d_shadfrce.cpp', + 'pst90s/d_shangha3.cpp', + 'pst90s/d_silkroad.cpp', + 'pst90s/d_silvmil.cpp', + 'pst90s/d_speedspn.cpp', + 'pst90s/d_splash.cpp', + 'pst90s/d_ssv.cpp', + 'pst90s/d_suna16.cpp', + 'pst90s/d_supduck.cpp', + 'pst90s/d_suprnova.cpp', + 'pst90s/d_taotaido.cpp', + 'pst90s/d_targeth.cpp', + 'pst90s/d_tecmo16.cpp', + 'pst90s/d_tecmosys.cpp', + 'pst90s/d_tetrisp2.cpp', + 'pst90s/d_thoop2.cpp', + 'pst90s/d_topdrive.cpp', + 'pst90s/d_tumbleb.cpp', + 'pst90s/d_unico.cpp', + 'pst90s/d_vamphalf.cpp', + 'pst90s/d_vegaeo.cpp', + 'pst90s/d_welltris.cpp', + 'pst90s/d_wrally.cpp', + 'pst90s/d_wwfwfest.cpp', + 'pst90s/d_x2222.cpp', + 'pst90s/d_xorworld.cpp', + 'pst90s/d_xorworld_ms.cpp', + 'pst90s/d_yunsun16.cpp', + 'pst90s/d_yunsung8.cpp', + 'pst90s/d_zerozone.cpp', + ], + }, + 'sega': { + 'desc': 'Sega arcade drivers', + 'sources': [ + 'sega/d_119.cpp', + 'sega/d_angelkds.cpp', + 'sega/d_appoooh.cpp', + 'sega/d_bankp.cpp', + 'sega/d_dotrikun.cpp', + 'sega/d_hangon.cpp', + 'sega/d_outrun.cpp', + 'sega/d_segac2.cpp', + 'sega/d_segae.cpp', + 'sega/d_segag80r.cpp', + 'sega/d_segag80v.cpp', + 'sega/d_segas32.cpp', + 'sega/d_suprloco.cpp', + 'sega/d_sys1.cpp', + 'sega/d_sys16a.cpp', + 'sega/d_sys16b.cpp', + 'sega/d_sys18.cpp', + 'sega/d_sys24.cpp', + 'sega/d_turbo.cpp', + 'sega/d_xbrd.cpp', + 'sega/d_ybrd.cpp', + 'sega/d_zaxxon.cpp', + 'sega/fd1089.cpp', + 'sega/fd1094.cpp', + 'sega/fd1094_intf.cpp', + 'sega/genesis_vid.cpp', + 'sega/mc8123.cpp', + 'sega/sega_315_5195.cpp', + 'sega/sega_speech.cpp', + 'sega/sys16_fd1094.cpp', + 'sega/sys16_gfx.cpp', + 'sega/sys16_run.cpp', + 'sega/usb_snd.cpp', + ], + }, + 'sg1000': { + 'desc': 'Sega SG-1000 drivers', + 'sources': [ + 'sg1000/d_sg1000.cpp', + ], + }, + 'sms': { + 'desc': 'Sega Master System drivers', + 'sources': [ + 'sms/d_sms.cpp', + 'sms/sms.cpp', + 'sms/smsfmintf.cpp', + 'sms/smspio.cpp', + 'sms/smsrender.cpp', + 'sms/smssound.cpp', + 'sms/smssystem.cpp', + 'sms/smstms.cpp', + 'sms/smsvdp.cpp', + ], + }, + 'snes': { + 'desc': 'Nintendo SNES drivers', + 'sources': [ + 'snes/apu.cpp', + 'snes/cart.cpp', + 'snes/cpu.cpp', + 'snes/cpu_sa1.cpp', + 'snes/cx4.cpp', + 'snes/d_snes.cpp', + 'snes/dma.cpp', + 'snes/dsp.cpp', + 'snes/input.cpp', + 'snes/ppu.cpp', + 'snes/sa1.cpp', + 'snes/sdd1.cpp', + 'snes/snes.cpp', + 'snes/snes_other.cpp', + 'snes/spc.cpp', + 'snes/statehandler.cpp', + ], + }, + 'spectrum': { + 'desc': 'ZX Spectrum drivers', + 'sources': [ + 'spectrum/d_spectrum.cpp', + 'spectrum/spectrum.cpp', + ], + }, + 'taito': { + 'desc': 'Taito drivers', + 'sources': [ + 'taito/cchip.cpp', + 'taito/d_arkanoid.cpp', + 'taito/d_ashnojoe.cpp', + 'taito/d_asuka.cpp', + 'taito/d_bublbobl.cpp', + 'taito/d_buggychl.cpp', + 'taito/d_chaknpop.cpp', + 'taito/d_crbaloon.cpp', + 'taito/d_cyclemb.cpp', + 'taito/d_darius2.cpp', + 'taito/d_exzisus.cpp', + 'taito/d_flstory.cpp', + 'taito/d_galastrm.cpp', + 'taito/d_gladiatr.cpp', + 'taito/d_groundfx.cpp', + 'taito/d_gunbuster.cpp', + 'taito/d_halleys.cpp', + 'taito/d_jollyjgr.cpp', + 'taito/d_ksayakyu.cpp', + 'taito/d_lkage.cpp', + 'taito/d_lsasquad.cpp', + 'taito/d_mexico86.cpp', + 'taito/d_minivdr.cpp', + 'taito/d_msisaac.cpp', + 'taito/d_nycaptor.cpp', + 'taito/d_othunder.cpp', + 'taito/d_qix.cpp', + 'taito/d_retofinv.cpp', + 'taito/d_rollrace.cpp', + 'taito/d_slapshot.cpp', + 'taito/d_ssrj.cpp', + 'taito/d_superchs.cpp', + 'taito/d_superqix.cpp', + 'taito/d_supridr.cpp', + 'taito/d_taitob.cpp', + 'taito/d_taitof2.cpp', + 'taito/d_taitof3.cpp', + 'taito/d_taitoh.cpp', + 'taito/d_taitol.cpp', + 'taito/d_taitomisc.cpp', + 'taito/d_taitosj.cpp', + 'taito/d_taitox.cpp', + 'taito/d_taitoz.cpp', + 'taito/d_tnzs.cpp', + 'taito/d_undrfire.cpp', + 'taito/d_wyvernf0.cpp', + 'taito/pc080sn.cpp', + 'taito/pc090oj.cpp', + 'taito/taito.cpp', + 'taito/taito_ic.cpp', + 'taito/taito_m68705.cpp', + 'taito/taitof3_snd.cpp', + 'taito/taitof3_video.cpp', + 'taito/tc0100scn.cpp', + 'taito/tc0110pcr.cpp', + 'taito/tc0140syt.cpp', + 'taito/tc0150rod.cpp', + 'taito/tc0180vcu.cpp', + 'taito/tc0220ioc.cpp', + 'taito/tc0280grd.cpp', + 'taito/tc0360pri.cpp', + 'taito/tc0480scp.cpp', + 'taito/tc0510nio.cpp', + 'taito/tc0640fio.cpp', + 'taito/tnzs_prot.cpp', + ], + }, + 'toaplan': { + 'desc': 'Toaplan drivers', + 'sources': [ + 'toaplan/d_batrider.cpp', + 'toaplan/d_batsugun.cpp', + 'toaplan/d_battleg.cpp', + 'toaplan/d_bbakraid.cpp', + 'toaplan/d_dogyuun.cpp', + 'toaplan/d_enmadaio.cpp', + 'toaplan/d_fixeight.cpp', + 'toaplan/d_ghox.cpp', + 'toaplan/d_kbash.cpp', + 'toaplan/d_kbash2.cpp', + 'toaplan/d_mahoudai.cpp', + 'toaplan/d_pipibibs.cpp', + 'toaplan/d_shippumd.cpp', + 'toaplan/d_slapfght.cpp', + 'toaplan/d_snowbro2.cpp', + 'toaplan/d_tekipaki.cpp', + 'toaplan/d_toaplan1.cpp', + 'toaplan/d_truxton2.cpp', + 'toaplan/d_twincobr.cpp', + 'toaplan/d_vfive.cpp', + 'toaplan/d_wardner.cpp', + 'toaplan/toa_bcu2.cpp', + 'toaplan/toa_extratext.cpp', + 'toaplan/toa_gp9001.cpp', + 'toaplan/toa_palette.cpp', + 'toaplan/toaplan.cpp', + 'toaplan/toaplan1.cpp', + ], + }, +} + +burn_driver_status = {} +all_burn_driver_source_names = all_burn_drivers.keys() +foreach name : burn_driver_list + assert( + all_burn_driver_source_names.contains(name), + 'Missing burn driver source metadata for burn_driver_list entry: ' + name, + ) +endforeach + +foreach name : burn_driver_dependencies.keys() + assert( + all_burn_driver_source_names.contains(name), + 'Missing burn driver source metadata for burn_driver_dependencies entry: ' + name, + ) +endforeach + +foreach name, driver : all_burn_drivers + enabled = burn_driver_list.contains(name) + burn_driver_status += {driver['desc']: enabled ? 'ON' : 'OFF'} + if enabled + burn_drv_sources += driver['sources'] + endif +endforeach +summary(burn_driver_status, section: 'Burn drivers', list_sep: '') + +ctv_make = executable('ctv_make', 'capcom/ctv_make.cpp', native: true) +pgm_sprite_create = executable( + 'pgm_sprite_create', + 'pgm/pgm_sprite_create.cpp', + native: true, +) + +ctv_h = custom_target('ctv_h', output: 'ctv.h', command: [ctv_make], capture: true) +pgm_sprite_h = custom_target( + 'pgm_sprite_h', + output: 'pgm_sprite.h', + command: [pgm_sprite_create], + capture: true, +) + +toa_gp9001_func_h = custom_target( + 'toa_gp9001_func_h', + output: ['toa_gp9001_func.h', 'toa_gp9001_func_table.h'], + command: [ + perl, + meson.current_source_dir() / '..' / '..' / 'dep' / 'scripts' / 'toa_gp9001_func.pl', + '-o', meson.current_build_dir() / 'toa_gp9001_func.h', + ], +) +neo_sprite_func_h = custom_target( + 'neo_sprite_func_h', + output: ['neo_sprite_func.h', 'neo_sprite_func_table.h'], + command: [ + perl, + meson.current_source_dir() / '..' / '..' / 'dep' / 'scripts' / 'neo_sprite_func.pl', + '-o', meson.current_build_dir() / 'neo_sprite_func.h', + ], +) +cave_tile_func_h = custom_target( + 'cave_tile_func_h', + output: ['cave_tile_func.h', 'cave_tile_func_table.h'], + command: [ + perl, + meson.current_source_dir() / '..' / '..' / 'dep' / 'scripts' / 'cave_tile_func.pl', + '-o', meson.current_build_dir() / 'cave_tile_func.h', + ], +) +cave_sprite_func_h = custom_target( + 'cave_sprite_func_h', + output: ['cave_sprite_func.h', 'cave_sprite_func_table.h'], + command: [ + perl, + meson.current_source_dir() / '..' / '..' / 'dep' / 'scripts' / 'cave_sprite_func.pl', + '-o', meson.current_build_dir() / 'cave_sprite_func.h', + ], +) +psikyo_tile_func_h = custom_target( + 'psikyo_tile_func_h', + output: ['psikyo_tile_func.h', 'psikyo_tile_func_table.h'], + command: [ + perl, + meson.current_source_dir() / '..' / '..' / 'dep' / 'scripts' / 'psikyo_tile_func.pl', + '-o', meson.current_build_dir() / 'psikyo_tile_func.h', + ], +) + +burn_drv_sources += [ + ctv_h, + pgm_sprite_h, + toa_gp9001_func_h, + neo_sprite_func_h, + cave_tile_func_h, + cave_sprite_func_h, + psikyo_tile_func_h, +] + +burn_drv_defs = [] +if host_machine.system() == 'windows' + burn_drv_defs += '-D_USE_MATH_DEFINES' + burn_drv_defs += '-DUSE_SPEEDHACKS' +endif + +burn_drv_cpp_warning_args = [] +if cpp.get_id() in ['gcc', 'clang'] + burn_drv_cpp_warning_args = [ + '-Wno-sequence-point', + '-Wno-sign-compare', + '-Wno-unused-but-set-variable', + '-Wno-unused-parameter', + '-Wno-unused-value', + '-Wno-unused-variable', + ] +endif + +burn_drv_cpp_args = burn_drv_defs + burn_drv_cpp_warning_args + +burn_drv_lib = static_library( + 'burn_drv', + burn_drv_sources, + # TODO: cd deps split + include_directories: [ + 'capcom', + 'cave', + 'dataeast', + 'galaxian', + 'irem', + 'konami', + 'neogeo', + 'psikyo', + 'sega', + 'taito', + 'toaplan', + '../../intf/audio', + '../../intf/cd', + '../../burner', + ], + dependencies: [burn_dep, burn_devices_dep, burn_snd_dep, cpu_dep], + cpp_args: burn_drv_cpp_args, +) + +burn_drv_dep = declare_dependency( + link_with: burn_drv_lib, + include_directories: include_directories('.'), +) diff --git a/src/burn/meson.build b/src/burn/meson.build new file mode 100644 index 000000000..c6833bc63 --- /dev/null +++ b/src/burn/meson.build @@ -0,0 +1,91 @@ +burn_sources = [ + 'burn.cpp', + 'burn_bitmap.cpp', + 'burn_gun.cpp', + 'burn_led.cpp', + 'burn_memory.cpp', + 'burn_pal.cpp', + 'burn_sha1.cpp', + 'burn_shift.cpp', + 'burn_sound.cpp', + 'burn_sound_c.cpp', + 'cheat.cpp', + 'debug_track.cpp', + 'hiscore.cpp', + 'load.cpp', + 'tilemap_generic.cpp', + 'tiles_generic.cpp', + 'timer.cpp', + 'vector.cpp', +] + +burn_inc = ['.', 'devices', '../burner'] +if frontend == 'win32' + # TODO: split dep + burn_inc += '../burner/win32' +elif frontend == 'sdl2' + burn_inc += '../burner/sdl' +endif + +driver_dirs_abs = [] +foreach dir : burn_driver_list + driver_dirs_abs += meson.current_source_dir() / 'drv' / dir +endforeach + +driverlist_h = custom_target( + 'driverlist_h', + output: 'driverlist.h', + command: [ + perl, + meson.current_source_dir() / '..' / 'dep' / 'scripts' / 'gamelist.pl', + '-o', '@OUTPUT@', + '-l', meson.current_build_dir() / 'gamelist.txt', + ] + + driver_dirs_abs, +) + +burn_sources += driverlist_h + +burn_defs = [] +if host_machine.endian() == 'little' + burn_defs += '-DLSB_FIRST' +endif + +if get_option('buildtype').contains('debug') + burn_defs += '-DFBNEO_DEBUG' +endif + +if frontend == 'win32' + burn_defs += '-DBUILD_WIN32' + burn_defs += '-DUNICODE' + burn_defs += '-D_UNICODE' +elif frontend == 'macos' + burn_defs += '-DBUILD_MACOS' +elif frontend == 'sdl2' + burn_defs += '-DBUILD_SDL2' +elif frontend == 'qt' + burn_defs += '-DBUILD_QT' +elif frontend == 'pi' + burn_defs += '-DBUILD_PI' +elif frontend == 'psp' + burn_defs += '-DBUILD_PSP' +endif + +burn_c_args = burn_defs +burn_cpp_args = burn_defs + +burn_lib = static_library( + 'burn', + burn_sources, + include_directories: include_directories(burn_inc), + c_args: burn_c_args, + cpp_args: burn_cpp_args, +) + +burn_dep = declare_dependency( + link_with: burn_lib, + # devices inc for sh4 serflash interface + # TODO: refactor the sh4 serflash to remove devices deps + include_directories: include_directories(burn_inc), + compile_args: burn_defs, +) diff --git a/src/burn/snd/meson.build b/src/burn/snd/meson.build new file mode 100644 index 000000000..80f628569 --- /dev/null +++ b/src/burn/snd/meson.build @@ -0,0 +1,131 @@ +burn_snd_sources = [] + +all_burn_sounds = { + 'asteroids': {'desc': 'Atari Asteroids discrete sound', 'sources': ['asteroids.cpp']}, + 'astrocde': {'desc': 'Bally Astrocade sound', 'sources': ['astrocde_snd.cpp']}, + 'ay8910': {'desc': 'AY-3-8910 PSG', 'sources': ['ay8910.c']}, + 'beep': {'desc': 'Beep speaker', 'sources': ['beep.cpp']}, + 'burn_md2612': {'desc': 'Mega Drive YM2612 wrapper', 'sources': ['burn_md2612.cpp']}, + 'burn_y8950': {'desc': 'Yamaha Y8950 wrapper', 'sources': ['burn_y8950.cpp']}, + 'burn_ym2151': {'desc': 'Yamaha YM2151 wrapper', 'sources': ['burn_ym2151.cpp']}, + 'burn_ym2203': {'desc': 'Yamaha YM2203 wrapper', 'sources': ['burn_ym2203.cpp']}, + 'burn_ym2413': {'desc': 'Yamaha YM2413 wrapper', 'sources': ['burn_ym2413.cpp']}, + 'burn_ym2608': {'desc': 'Yamaha YM2608 wrapper', 'sources': ['burn_ym2608.cpp']}, + 'burn_ym2610': {'desc': 'Yamaha YM2610 wrapper', 'sources': ['burn_ym2610.cpp']}, + 'burn_ym2612': {'desc': 'Yamaha YM2612 wrapper', 'sources': ['burn_ym2612.cpp']}, + 'burn_ym3526': {'desc': 'Yamaha YM3526 wrapper', 'sources': ['burn_ym3526.cpp']}, + 'burn_ym3812': {'desc': 'Yamaha YM3812 wrapper', 'sources': ['burn_ym3812.cpp']}, + 'burn_ymf262': {'desc': 'Yamaha YMF262 wrapper', 'sources': ['burn_ymf262.cpp']}, + 'burn_ymf271': {'desc': 'Yamaha YMF271 wrapper', 'sources': ['burn_ymf271.cpp']}, + 'burn_ymf278b': {'desc': 'Yamaha YMF278B wrapper', 'sources': ['burn_ymf278b.cpp']}, + 'bzone': {'desc': 'Atari Battlezone discrete sound', 'sources': ['bzone.cpp']}, + 'c140': {'desc': 'Namco C140 PCM', 'sources': ['c140.cpp']}, + 'c352': {'desc': 'Namco C352 PCM', 'sources': ['c352.cpp']}, + 'c6280': {'desc': 'Hudson C6280 PSG', 'sources': ['c6280.cpp']}, + 'dac': {'desc': 'Generic DAC', 'sources': ['dac.cpp']}, + 'digitalk': {'desc': 'Digitalker speech', 'sources': ['digitalk.cpp']}, + 'es5506': {'desc': 'Ensoniq ES5506 wavetable', 'sources': ['es5506.cpp']}, + 'es8712': {'desc': 'ES8712 ADPCM', 'sources': ['es8712.cpp']}, + 'exidy440': {'desc': 'Exidy 440 sound', 'sources': ['exidy440_snd.cpp']}, + 'flower': {'desc': 'Flower custom sound', 'sources': ['flower.cpp']}, + 'flt_rc': {'desc': 'RC filter', 'sources': ['flt_rc.cpp']}, + 'fm': {'desc': 'Yamaha FM core', 'sources': ['fm.c']}, + 'fmopl': {'desc': 'Yamaha OPL core', 'sources': ['fmopl.c']}, + 'gaelco': {'desc': 'Gaelco sound', 'sources': ['gaelco.cpp']}, + 'hc55516': {'desc': 'HC55516 CVSD decoder', 'sources': ['hc55516.cpp']}, + 'i5000': {'desc': 'I5000 sound device', 'sources': ['i5000.cpp']}, + 'ics2115': {'desc': 'ICS2115 wavetable', 'sources': ['ics2115.cpp']}, + 'iremga20': {'desc': 'Irem GA20 PCM', 'sources': ['iremga20.cpp']}, + 'k005289': {'desc': 'Konami K005289 SCC', 'sources': ['k005289.cpp']}, + 'k007232': {'desc': 'Konami K007232 PCM', 'sources': ['k007232.cpp']}, + 'k051649': {'desc': 'Konami K051649 SCC', 'sources': ['k051649.cpp']}, + 'k053260': {'desc': 'Konami K053260 PCM', 'sources': ['k053260.cpp']}, + 'k054539': {'desc': 'Konami K054539 PCM', 'sources': ['k054539.cpp']}, + 'llander': { + 'desc': 'Atari Lunar Lander discrete sound', + 'sources': ['llander.cpp'], + }, + 'mpeg_audio': {'desc': 'MPEG audio decoder', 'sources': ['mpeg_audio.cpp']}, + 'msm5205': {'desc': 'OKI MSM5205 ADPCM', 'sources': ['msm5205.cpp']}, + 'msm5232': {'desc': 'OKI MSM5232 tone generator', 'sources': ['msm5232.cpp']}, + 'msm6295': {'desc': 'OKI MSM6295 ADPCM', 'sources': ['msm6295.cpp']}, + 'multipcm': {'desc': 'Sega MultiPCM', 'sources': ['multipcm.cpp']}, + 'namco_snd': {'desc': 'Namco WSG sound', 'sources': ['namco_snd.cpp']}, + 'nes_apu': {'desc': 'NES APU', 'sources': ['nes_apu.cpp']}, + 'phoenixsound': {'desc': 'Phoenix sound hardware', 'sources': ['phoenixsound.cpp']}, + 'pleiadssound': {'desc': 'Pleiads sound hardware', 'sources': ['pleiadssound.cpp']}, + 'pokey': {'desc': 'Atari POKEY', 'sources': ['pokey.cpp']}, + 'redbaron': {'desc': 'Atari Red Baron discrete sound', 'sources': ['redbaron.cpp']}, + 'rf5c68': {'desc': 'Ricoh RF5C68 PCM', 'sources': ['rf5c68.cpp']}, + 's14001a': {'desc': 'TMS/SI S14001A speech', 'sources': ['s14001a.cpp']}, + 'saa1099': {'desc': 'Philips SAA1099 PSG', 'sources': ['saa1099.cpp']}, + 'samples': {'desc': 'Sample playback', 'sources': ['samples.cpp']}, + 'segapcm': {'desc': 'Sega PCM', 'sources': ['segapcm.cpp']}, + 'sn76477': { + 'desc': 'TI SN76477 complex sound generator', + 'sources': ['sn76477.cpp'], + }, + 'sn76496': {'desc': 'TI SN76489/SN76496 PSG', 'sources': ['sn76496.cpp']}, + 'snk6502_sound': {'desc': 'SNK 6502 sound board', 'sources': ['snk6502_sound.cpp']}, + 'sp0250': {'desc': 'GI SP0250 speech', 'sources': ['sp0250.cpp']}, + 'sp0256': {'desc': 'GI SP0256 speech', 'sources': ['sp0256.cpp']}, + 't6w28': {'desc': 'Toshiba T6W28 PSG', 'sources': ['t6w28.cpp']}, + 'tiamc1': {'desc': 'TI AMC1 sound hardware', 'sources': ['tiamc1_snd.cpp']}, + 'tms36xx': {'desc': 'TI TMS36xx melody generator', 'sources': ['tms36xx.cpp']}, + 'tms5110': {'desc': 'TI TMS5110 speech', 'sources': ['tms5110.cpp']}, + 'tms5220': {'desc': 'TI TMS5220 speech', 'sources': ['tms5220.cpp']}, + 'upd7759': {'desc': 'NEC uPD7759 ADPCM', 'sources': ['upd7759.cpp']}, + 'vlm5030': {'desc': 'Sanyo VLM5030 speech', 'sources': ['vlm5030.cpp']}, + 'votrax': {'desc': 'Votrax SC-01 speech', 'sources': ['votrax.cpp']}, + 'wiping': {'desc': 'Wiping custom sound', 'sources': ['wiping.cpp']}, + 'x1010': {'desc': 'Namco CUS30/X1010 sound', 'sources': ['x1010.cpp']}, + 'ym2151': {'desc': 'Yamaha YM2151 core', 'sources': ['ym2151.c']}, + 'ym2413': {'desc': 'Yamaha YM2413 core', 'sources': ['ym2413.c']}, + 'ym2612': {'desc': 'Yamaha YM2612 core', 'sources': ['ym2612.c']}, + 'ymdeltat': {'desc': 'Yamaha Delta-T ADPCM core', 'sources': ['ymdeltat.c']}, + 'ymf262': {'desc': 'Yamaha YMF262 core', 'sources': ['ymf262.cpp']}, + 'ymf271': {'desc': 'Yamaha YMF271 core', 'sources': ['ymf271.cpp']}, + 'ymf278b': {'desc': 'Yamaha YMF278B core', 'sources': ['ymf278b.c']}, + 'ymz280b': {'desc': 'Yamaha YMZ280B PCM', 'sources': ['ymz280b.cpp']}, + 'ymz770': {'desc': 'Yamaha YMZ770 sound', 'sources': ['ymz770.cpp']}, +} + +burn_sound_status = {} +all_burn_sound_names = all_burn_sounds.keys() +foreach name : burn_sound_list + assert( + all_burn_sound_names.contains(name), + 'Unknown burn sound in burn_sound_list: ' + name, + ) +endforeach + +foreach name, sound : all_burn_sounds + enabled = burn_sound_list.contains(name) + burn_sound_status += {sound['desc']: enabled ? 'ON' : 'OFF'} + if enabled + burn_snd_sources += sound['sources'] + endif +endforeach +summary(burn_sound_status, section: 'Burn sound devices', list_sep: '') + +burn_snd_inc = ['../../dep/libs/dr_libs'] + +burn_snd_defs = [] +if host_machine.system() == 'windows' + burn_snd_defs += '-D_USE_MATH_DEFINES' +endif + +burn_snd_cpp_args = burn_snd_defs + +burn_snd_lib = static_library( + 'burn_snd', + burn_snd_sources, + dependencies: [burn_dep, cpu_dep], + include_directories: include_directories(burn_snd_inc), + cpp_args: burn_snd_cpp_args, +) + +burn_snd_dep = declare_dependency( + link_with: burn_snd_lib, + include_directories: include_directories('.'), +) diff --git a/src/burner/macos/meson.build b/src/burner/macos/meson.build new file mode 100644 index 000000000..92e50a0df --- /dev/null +++ b/src/burner/macos/meson.build @@ -0,0 +1,21 @@ +add_languages('objc', 'objcpp') + +frontend_sources = files( + 'FBImporter.m', + 'FBMainThread+Etc.mm', + 'FBMainThread.mm', + 'FBScanner.mm', + 'NSString+Etc.m', + 'main.cpp', + 'misc.cpp', +) + +frontend_dep = declare_dependency( + include_directories: include_directories('.'), + dependencies: [ + dependency('appleframeworks', modules: ['Cocoa', 'OpenGL']), + ], + compile_args: ['-DBUILD_MACOS'], +) + +frontend_link_args = [] diff --git a/src/burner/meson.build b/src/burner/meson.build new file mode 100644 index 000000000..61125cab4 --- /dev/null +++ b/src/burner/meson.build @@ -0,0 +1,90 @@ +fbneo_burner_sources = [ + 'conc.cpp', + 'cong.cpp', + 'dat.cpp', + 'gamc.cpp', + 'gami.cpp', + 'image.cpp', + 'inputbuf.cpp', + 'ioapi.c', + 'misc.cpp', + 'sshot.cpp', + 'state.cpp', + 'statec.cpp', + 'unzip.c', + 'zipfn.cpp', + '../dep/libs/libspng/spng.c', + '../dep/libs/zip/zip.c', + '../dep/libs/lzma/libchdr_lzma.c', + '../dep/libs/zstd/zstddeclib.c', + '../intf/audio/aud_dsp.cpp', + '../intf/audio/aud_interface.cpp', + '../intf/audio/lowpass2.cpp', + '../intf/cd/cd_interface.cpp', + '../intf/input/inp_interface.cpp', + '../intf/interface.cpp', + '../intf/video/vid_interface.cpp', + '../intf/video/vid_support.cpp', +] + +burner_lib_inc = [ + '../dep/libs/dr_libs', + '../dep/libs/libspng', + '../dep/libs/lzma', + '../dep/libs/lzma/include', + '../dep/libs/zip', + '../dep/libs/zstd', + '../intf', + '../intf/audio', + '../intf/video', + '../intf/input', + '../intf/cd', + '../intf/perfcount', +] + +burner_lib_deps = [ + burn_dep, + burn_devices_dep, + burn_snd_dep, + burn_drv_dep, + cpu_dep, + zlib_dep, + libchdr_dep, +] +if include_7z + burner_lib_deps += lib7z_dep +endif + +if frontend == 'win32' + burner_lib_inc += 'win32' + burner_lib_inc += '../dep/kaillera/client' + if cpp.get_id() == 'msvc' + burner_lib_inc += '../dep/vc/include' + else + burner_lib_inc += '../dep/mingw/include' + endif + burner_lib_deps += lua_dep +elif frontend == 'sdl2' + burner_lib_inc += 'sdl' + burner_lib_deps += dependency('sdl2') +endif + +burner_lib_defs = ['-DCHDR_SYSTEM_ZLIB'] +if include_7z + burner_lib_defs += ['-DINCLUDE_7Z_SUPPORT'] +endif + +burner_lib = static_library( + 'burner', + fbneo_burner_sources, + include_directories: [include_directories(burner_lib_inc)], + dependencies: burner_lib_deps, + c_args: burner_lib_defs, + cpp_args: burner_lib_defs, +) + +burner_dep = declare_dependency( + link_with: burner_lib, + include_directories: include_directories('.'), + dependencies: burner_lib_deps, +) diff --git a/src/burner/pi/meson.build b/src/burner/pi/meson.build new file mode 100644 index 000000000..d0181d4d4 --- /dev/null +++ b/src/burner/pi/meson.build @@ -0,0 +1,35 @@ +frontend_sources = files( + '../inputbuf.cpp', + 'main_pi.cpp', + 'run_pi.cpp', + '../sdl/bzip.cpp', + '../sdl/config.cpp', + '../sdl/drv.cpp', + '../sdl/inpdipsw.cpp', + '../sdl/ips_manager.cpp', + '../sdl/media.cpp', + '../sdl/replay.cpp', + '../sdl/romdata.cpp', + '../sdl/scrn.cpp', + '../sdl/stated.cpp', + '../sdl/stringset.cpp', + '../sdl/support_paths.cpp', + '../../dep/pi/gles/pigl_drm.c', + '../../intf/audio/sdl/aud_sdl.cpp', + '../../intf/cd/sdl/cd_sdl2.cpp', + '../../intf/input/pi/inp_pi.cpp', + '../../intf/video/pi/vid_pi.cpp', +) + +frontend_dep = declare_dependency( + include_directories: include_directories( + '.', + '../sdl', + '../../dep/pi/gles', + '../../intf/input/pi', + '../../intf/video/pi', + ), + compile_args: ['-DBUILD_SDL', '-DBUILD_PI'], +) + +frontend_link_args = [] diff --git a/src/burner/psp/meson.build b/src/burner/psp/meson.build new file mode 100644 index 000000000..d2f6ce880 --- /dev/null +++ b/src/burner/psp/meson.build @@ -0,0 +1,27 @@ +frontend_sources = files( + 'config.cpp', + 'drv.cpp', + 'font.c', + 'inpdipsw.cpp', + 'main.cpp', + 'pg.c', + 'run.cpp', + 'select.cpp', + 'stated.cpp', + '../../intf/audio/psp/aud_psp.cpp', + '../../intf/input/psp/inp_psp.cpp', + '../../intf/video/psp/vid_psp.c', + '../../intf/video/psp/vid_pspfx.cpp', +) + +frontend_dep = declare_dependency( + include_directories: include_directories( + '.', + '../../intf/audio/psp', + '../../intf/input/psp', + '../../intf/video/psp', + ), + compile_args: ['-DBUILD_PSP'], +) + +frontend_link_args = [] diff --git a/src/burner/qt/meson.build b/src/burner/qt/meson.build new file mode 100644 index 000000000..e9a5b51c4 --- /dev/null +++ b/src/burner/qt/meson.build @@ -0,0 +1,62 @@ +qt5 = import('qt5') + +qt_sources = qt5.preprocess( + ui_files: files( + 'aboutdialog.ui', + 'dipswitchdialog.ui', + 'inputdialog.ui', + 'inputsetdialog.ui', + 'logdialog.ui', + 'romdirsdialog.ui', + 'rominfodialog.ui', + 'romscandialog.ui', + 'selectdialog.ui', + 'supportdirsdialog.ui', + ), + qresources: files('rscr.qrc'), +) + +frontend_sources = files( + 'aboutdialog.cpp', + 'bzip.cpp', + 'dipswitchdialog.cpp', + 'driver.cpp', + 'emuworker.cpp', + 'inputdialog.cpp', + 'inputsetdialog.cpp', + 'logdialog.cpp', + 'main.cpp', + 'mainwindow.cpp', + 'neocdlist.cpp', + 'oglviewport.cpp', + 'progress.cpp', + 'qaudiointerface.cpp', + 'qinputinterface.cpp', + 'qutil.cpp', + 'romdirsdialog.cpp', + 'rominfodialog.cpp', + 'romscandialog.cpp', + 'selectdialog.cpp', + 'stringset.cpp', + 'supportdirsdialog.cpp', + 'widgets/hexspinbox.cpp', +) + +frontend_sources += qt_sources + +frontend_dep = declare_dependency( + include_directories: include_directories('.', '../../dep/qtcreator'), + dependencies: [ + dependency('qt5', modules: ['Widgets', 'Multimedia', 'OpenGL']), + dependency('opengl'), + ], + compile_args: [ + '-DBUILD_QT', + '-DWITH_QTCREATOR', + '-DINCLUDE_LIB_PNGH', + '-D__fastcall=', + '-D_fastcall=', + ], +) + +frontend_link_args = [] diff --git a/src/burner/sdl/meson.build b/src/burner/sdl/meson.build new file mode 100644 index 000000000..65b08ee8e --- /dev/null +++ b/src/burner/sdl/meson.build @@ -0,0 +1,50 @@ +frontend_sources = files( + 'bzip.cpp', + 'config.cpp', + 'drv.cpp', + 'inpdipsw.cpp', + 'input_sdl2.cpp', + 'ips_manager.cpp', + 'localise_gamelist.cpp', + 'main.cpp', + 'media.cpp', + 'neocdlist.cpp', + 'replay.cpp', + 'romdata.cpp', + 'run.cpp', + 'scrn.cpp', + 'sdl2_gui.cpp', + 'sdl2_gui_common.cpp', + 'sdl2_gui_ingame.cpp', + 'sdl2_inprint.cpp', + 'stated.cpp', + 'stringset.cpp', + 'support_paths.cpp', + '../../intf/audio/sdl/aud_sdl.cpp', + '../../intf/cd/sdl/cd_sdl2.cpp', + '../../intf/input/sdl/inp_sdl2.cpp', + '../../intf/video/sdl/vid_sdl2.cpp', + '../../intf/video/sdl/vid_sdl2opengl.cpp', +) + +sdl2_defs = ['-DBUILD_SDL2', '-DUSE_FILE32API', '-DHAVE_UNISTD_H'] +if host_machine.system() == 'windows' + sdl2_defs += ['-DSDL_WINDOWS'] +endif + +frontend_dep = declare_dependency( + include_directories: include_directories( + '.', + '../../intf/input/sdl', + '../../intf/audio/sdl', + '../../intf/video/sdl', + '../../intf/cd/sdl', + ), + dependencies: [ + dependency('SDL2_image'), + dependency('opengl'), + ], + compile_args: sdl2_defs, +) + +frontend_link_args = [] diff --git a/src/burner/win32/meson.build b/src/burner/win32/meson.build new file mode 100644 index 000000000..5d51ac1f0 --- /dev/null +++ b/src/burner/win32/meson.build @@ -0,0 +1,205 @@ +win = import('windows') +proj = meson.project_source_root() + +frontend_sources = files( + '../../dep/kaillera/client/net.cpp', + '../../intf/audio/win32/aud_dsound3.cpp', + '../../intf/audio/win32/aud_xaudio2.cpp', + '../../intf/audio/win32/dsound_core.cpp', + '../../intf/cd/win32/cd_img.cpp', + '../../intf/input/win32/dinput_core.cpp', + '../../intf/input/win32/inp_dinput.cpp', + '../../intf/perfcount/prf_interface.cpp', + '../../intf/perfcount/win32/prf_performance_counter.cpp', + '../../intf/video/scalers/2xpm.cpp', + '../../intf/video/scalers/2xsai.cpp', + '../../intf/video/scalers/crt.cpp', + '../../intf/video/scalers/ddt3x.cpp', + '../../intf/video/scalers/epx.cpp', + '../../intf/video/scalers/hq2xs.cpp', + '../../intf/video/scalers/hq2xs_16.cpp', + '../../intf/video/scalers/hq3xs.cpp', + '../../intf/video/scalers/hq_shared32.cpp', + '../../intf/video/scalers/xbr.cpp', + '../../intf/video/scalers/xbr32.cpp', + '../../intf/video/vid_softfx.cpp', + '../../intf/video/win32/ddraw_core.cpp', + '../../intf/video/win32/directx9_core.cpp', + '../../intf/video/win32/vid_d3d.cpp', + '../../intf/video/win32/vid_ddraw.cpp', + '../../intf/video/win32/vid_ddrawfx.cpp', + '../../intf/video/win32/vid_directx9.cpp', + '../../intf/video/win32/vid_directx_support.cpp', + '../../intf/video/win32/vid_effect.cpp', + '../luaengine.cpp', + '../luasav.cpp', + 'about.cpp', + 'avi.cpp', + 'bzip.cpp', + 'choose_monitor.cpp', + 'cona.cpp', + 'd3dkmt_sync.cpp', + 'debugger.cpp', + 'drv.cpp', + 'fba_kaillera.cpp', + 'gameinfo.cpp', + 'image_win32.cpp', + 'inpc.cpp', + 'inpcheat.cpp', + 'inpd.cpp', + 'inpdipsw.cpp', + 'inps.cpp', + 'ips_manager.cpp', + 'localise.cpp', + 'localise_download.cpp', + 'localise_gamelist.cpp', + 'luaconsole.cpp', + 'main.cpp', + 'mbtwc.cpp', + 'media.cpp', + 'memcard.cpp', + 'menu.cpp', + 'misc_win32.cpp', + 'neocdlist.cpp', + 'neocdsel.cpp', + 'numdial.cpp', + 'paletteviewer.cpp', + 'placeholder.cpp', + 'popup_win32.cpp', + 'progress.cpp', + 'replay.cpp', + 'res.cpp', + 'romdata.cpp', + 'roms.cpp', + 'run.cpp', + 'scrn.cpp', + 'sel.cpp', + 'sfactd.cpp', + 'splash.cpp', + 'stated.cpp', + 'support_paths.cpp', + 'systeminfo.cpp', + 'wave.cpp', +) + +license_rtf = custom_target( + 'license_rtf', + input: proj / 'src/license.txt', + output: 'license.rtf', + command: [ + perl, + proj / 'src/dep/scripts/license2rtf.pl', + '@INPUT@', + '-o', meson.current_build_dir() / 'license.rtf', + ], +) + +rc_sources_incs = ['.', '..', '../../burn', '../../intf/video/win32'] +rc_sources_deps = [build_details_h, license_rtf] + +if cpp.get_id() == 'msvc' + rc_sources_incs += '../../dep/vc/include' +else + app_gnuc_rc = custom_target( + 'app_gnuc_rc', + input: 'app.rc', + output: 'app_gnuc.rc', + command: [ + perl, + proj / 'src/dep/scripts/fixrc.pl', + '@INPUT@', + '-o', meson.current_build_dir() / 'app_gnuc.rc', + ], + depend_files: files( + '../resource/about.bmp', + '../resource/fba.ico', + '../resource/misc.bmp', + '../resource/splash.bmp', + 'app.rc', + proj / 'src/dep/scripts/fixrc.pl', + ), + depends: license_rtf, + ) + + rc_sources_deps += app_gnuc_rc +endif + +rc_args = [] +foreach inc : rc_sources_incs + rc_args += ['-I', meson.current_source_dir() / inc] +endforeach +rc_args += ['-DFINENAME=fbneo'] +message('rc incs', rc_args) + +rc_sources = win.compile_resources( + 'resource.rc', + args: rc_args, + depends: rc_sources_deps, +) + +if cpp.get_id() == 'msvc' + frontend_link_args = [ + 'user32.lib', + 'gdi32.lib', + 'comdlg32.lib', + 'comctl32.lib', + 'shell32.lib', + 'winmm.lib', + 'shlwapi.lib', + 'advapi32.lib', + 'setupapi.lib', + 'ole32.lib', + 'uuid.lib', + 'wininet.lib', + 'vfw32.lib', + ] + frontend_win32_dep_inc = [ + '../../dep/vc/include', + '../../dep/vc/include/xaudio2', + '../../dep/mingw/include/directx9', + ] +else + frontend_link_args = [ + '-luser32', + '-lgdi32', + '-lcomdlg32', + '-lcomctl32', + '-lshell32', + '-lwinmm', + '-lshlwapi', + '-ladvapi32', + '-lsetupapi', + '-lole32', + '-luuid', + '-lwininet', + '-lvfw32', + ] + frontend_win32_dep_inc = [ + '../../dep/mingw/include', + '../../dep/mingw/include/directx9', + '../../dep/mingw/include/xaudio2', + ] +endif + +frontend_inc = [ + '.', + '../../intf/audio/win32', + '../../intf/input/win32', + '../../intf/video/win32', + '../../intf/cd/win32', + '../../intf/perfcount/win32', + '../../dep/kaillera/client', + '../../dep/libs/lua', + '../../dep/libs/zip', +] + frontend_win32_dep_inc + +frontend_dep = declare_dependency( + include_directories: include_directories(frontend_inc), + compile_args: [ + '-DWIN32', + '-D_WIN32', + '-DINCLUDE_AVI_RECORDING', + '-D_USE_MATH_DEFINES', + ], + sources: rc_sources, +) diff --git a/src/cpu/meson.build b/src/cpu/meson.build new file mode 100644 index 000000000..5e12ade16 --- /dev/null +++ b/src/cpu/meson.build @@ -0,0 +1,505 @@ +# ============================================================================= +# CPU emulation core selection & static library +# +# The parent meson.build provides a `cpu_driver_list` array listing which +# CPUs should be compiled. This file checks every known CPU name against +# that list, sets a `cpu__enable` boolean for each, accumulates +# source / include lists, and finally builds them as a static library. +# ============================================================================= + +cpu_sources = [] +cpu_include_dirs = ['.'] + +# --------------------------------------------------------------------------- +# Master dictionary of every CPU core known to the project. +# Key = cpu driver name (used as `cpu__enable` variable name) +# Value = human-readable description printed in the configure summary +# --------------------------------------------------------------------------- +all_cpu = { + 'adsp2100': 'Analog Devices ADSP-2100 DSP', + 'arm': 'ARM (ARM2 / ARM6)', + 'arm7': 'ARM7 (ARM7TDMI)', + 'arm9': 'ARM9', + 'e132xs': 'NEC E132XS RISC', + 'f8': 'Fairchild F8', + 'h6280': 'Hudson H6280', + 'hd6309': 'Hitachi HD6309', + 'hmcs40': 'Hitachi HMCS40 4-bit MCU', + 'i386': 'Intel 386', + 'i8039': 'Intel 8039 (MCS-48)', + 'i8051': 'Intel 8051 (MCS-51)', + 'i8085': 'Intel 8085', + 'i8x41': 'Intel 8041 / 8048 UPI', + 'konami': 'Konami custom CPU', + 'm377': 'Mitsubishi M37710', + 'm6502': 'MOS 6502', + 'm6800': 'Motorola 6800', + 'm68000': 'Motorola 68000 (Musashi core)', + 'm6805': 'Motorola 6805', + 'm6809': 'Motorola 6809', + 'mb88xx': 'Fujitsu MB88xx', + 'mips3': 'MIPS III', + 'nec': 'NEC V30 / V33', + 'pic16c5x': 'Microchip PIC16C5x', + 's2650': 'Signetics S2650', + 'sh2': 'Hitachi SH-2', + 'sh4': 'Hitachi SH-4', + 'tlcs90': 'Toshiba TLCS-90', + 'tlcs900': 'Toshiba TLCS-900', + 'tms32010': 'TI TMS32010 DSP', + 'tms34010': 'TI TMS34010 GSP', + 'upd7725': 'NEC uPD7725 DSP', + 'upd7810': 'NEC uPD7810', + 'v60': 'NEC V60', + 'z80': 'Zilog Z80', + 'z180': 'Zilog Z180', +} + +# --------------------------------------------------------------------------- +# +# --------------------------------------------------------------------------- +all_cpu_names = all_cpu.keys() +foreach name : cpu_list + assert( + all_cpu_names.contains(name), + 'Missing cpu metabata for cpu_driver_list entry: ' + name, + ) +endforeach + +# --------------------------------------------------------------------------- +# Derive per-CPU enable booleans from the parent's cpu_driver_list +# --------------------------------------------------------------------------- +cpu_status = {} +foreach name, desc : all_cpu + enabled = cpu_list.contains(name) + set_variable('cpu_@0@_enable'.format(name), enabled) + cpu_status += {desc: enabled ? 'ON' : 'OFF'} +endforeach +summary(cpu_status, section: 'CPU cores', list_sep: '') + +# ============================================================================= +# Per-CPU source / include blocks — gated by cpu__enable +# ============================================================================= + +# --------------------------------------------------------------------------- +# ADSP-2100 – Analog Devices DSP +# --------------------------------------------------------------------------- +if cpu_adsp2100_enable + cpu_sources += [ + 'adsp2100/adsp2100.cpp', + 'adsp2100_intf.cpp', + ] + cpu_include_dirs += ['adsp2100'] +endif + +# --------------------------------------------------------------------------- +# ARM – ARM2 / ARM6 +# --------------------------------------------------------------------------- +if cpu_arm_enable + cpu_sources += [ + 'arm/arm.cpp', + 'arm_intf.cpp', + ] + cpu_include_dirs += ['arm'] +endif + +# --------------------------------------------------------------------------- +# ARM7 – ARM7TDMI +# --------------------------------------------------------------------------- +if cpu_arm7_enable + cpu_sources += [ + 'arm7/arm7.cpp', + 'arm7_intf.cpp', + ] + cpu_include_dirs += ['arm7'] +endif + +# --------------------------------------------------------------------------- +# ARM9 +# --------------------------------------------------------------------------- +if cpu_arm9_enable + cpu_sources += [ + 'arm9/arm9.cpp', + 'arm9_intf.cpp', + ] + cpu_include_dirs += ['arm9'] +endif + +# --------------------------------------------------------------------------- +# E132XS – NEC RISC +# --------------------------------------------------------------------------- +if cpu_e132xs_enable + cpu_sources += ['e132xs/e132xs.cpp'] + cpu_include_dirs += ['e132xs'] +endif + +# --------------------------------------------------------------------------- +# F8 – Fairchild F8 +# --------------------------------------------------------------------------- +if cpu_f8_enable + cpu_sources += ['f8/f8.cpp'] + cpu_include_dirs += ['f8'] +endif + +# --------------------------------------------------------------------------- +# H6280 – Hudson +# --------------------------------------------------------------------------- +if cpu_h6280_enable + cpu_sources += [ + 'h6280/h6280.cpp', + 'h6280_intf.cpp', + ] + cpu_include_dirs += ['h6280'] +endif + +# --------------------------------------------------------------------------- +# HD6309 – Hitachi +# --------------------------------------------------------------------------- +if cpu_hd6309_enable + cpu_sources += [ + 'hd6309/hd6309.cpp', + 'hd6309_intf.cpp', + ] + cpu_include_dirs += ['hd6309'] +endif + +# --------------------------------------------------------------------------- +# HMCS40 – Hitachi 4-bit MCU +# --------------------------------------------------------------------------- +if cpu_hmcs40_enable + cpu_sources += ['hmcs40/hmcs40.cpp'] + cpu_include_dirs += ['hmcs40'] +endif + +# --------------------------------------------------------------------------- +# I386 – Intel 386 +# --------------------------------------------------------------------------- +if cpu_i386_enable + cpu_sources += ['i386/i386.cpp'] + cpu_include_dirs += ['i386'] +endif + +# --------------------------------------------------------------------------- +# I8039 – Intel MCS-48 +# --------------------------------------------------------------------------- +if cpu_i8039_enable + cpu_sources += ['i8039/i8039.cpp'] + cpu_include_dirs += ['i8039'] +endif + +# --------------------------------------------------------------------------- +# I8051 – Intel MCS-51 +# --------------------------------------------------------------------------- +if cpu_i8051_enable + cpu_sources += ['i8051/mcs51.cpp'] + cpu_include_dirs += ['i8051'] +endif + +# --------------------------------------------------------------------------- +# I8085 – Intel 8085 +# --------------------------------------------------------------------------- +if cpu_i8085_enable + cpu_sources += ['i8085/i8085.cpp'] + cpu_include_dirs += ['i8085'] +endif + +# --------------------------------------------------------------------------- +# I8X41 – Intel UPI (8041 / 8048) +# --------------------------------------------------------------------------- +if cpu_i8x41_enable + cpu_sources += ['i8x41/mcs48.cpp'] + cpu_include_dirs += ['i8x41'] +endif + +# --------------------------------------------------------------------------- +# Konami – custom CPU +# --------------------------------------------------------------------------- +if cpu_konami_enable + cpu_sources += [ + 'konami/konami.cpp', + 'konami_intf.cpp', + ] + cpu_include_dirs += ['konami'] +endif + +# --------------------------------------------------------------------------- +# M377 – Mitsubishi M37710 +# --------------------------------------------------------------------------- +if cpu_m377_enable + cpu_sources += ['m377/m37710.cpp'] + cpu_include_dirs += ['m377'] +endif + +# --------------------------------------------------------------------------- +# M6502 – MOS 6502 +# --------------------------------------------------------------------------- +if cpu_m6502_enable + cpu_sources += [ + 'm6502/m6502.cpp', + 'm6502_intf.cpp', + ] + cpu_include_dirs += ['m6502'] +endif + +# --------------------------------------------------------------------------- +# M6800 – Motorola 6800 +# --------------------------------------------------------------------------- +if cpu_m6800_enable + cpu_sources += [ + 'm6800/m6800.cpp', + 'm6800_intf.cpp', + ] + cpu_include_dirs += ['m6800'] +endif + +# --------------------------------------------------------------------------- +# M68000 – Motorola 68000 (Musashi core + generated opcode table) +# --------------------------------------------------------------------------- +if cpu_m68000_enable + cpu_sources += [ + 'm68000_intf.cpp', + 'm68k/m68kcpu.c', + 'm68k/m68kdasm.c', + ] + cpu_include_dirs += ['m68k'] + + if get_option('buildtype').contains('debug') + cpu_sources += 'm68k/m68kdasm.c' + endif + + # Native helper to generate the 68000 opcode table + m68kmake = executable('m68kmake', 'm68k/m68kmake.c', native: true) + m68kops = custom_target( + 'm68kops', + output: ['m68kops.c', 'm68kops.h'], + command: [ + m68kmake, + meson.current_build_dir() + '/', + meson.current_source_dir() / 'm68k' / 'm68k_in.c', + ], + ) + cpu_sources += m68kops +else + # Stub so the parent build file can always reference m68kops. + m68kops = [] +endif + +# --------------------------------------------------------------------------- +# M6805 – Motorola 6805 +# --------------------------------------------------------------------------- +if cpu_m6805_enable + cpu_sources += [ + 'm6805/m6805.cpp', + 'm6805_intf.cpp', + ] + cpu_include_dirs += ['m6805'] +endif + +# --------------------------------------------------------------------------- +# M6809 – Motorola 6809 +# --------------------------------------------------------------------------- +if cpu_m6809_enable + cpu_sources += [ + 'm6809/m6809.cpp', + 'm6809_intf.cpp', + ] + cpu_include_dirs += ['m6809'] +endif + +# --------------------------------------------------------------------------- +# MB88XX – Fujitsu MB88xx +# --------------------------------------------------------------------------- +if cpu_mb88xx_enable + cpu_sources += ['mb88xx/mb88xx.cpp'] + cpu_include_dirs += ['mb88xx'] +endif + +# --------------------------------------------------------------------------- +# MIPS3 – MIPS III +# --------------------------------------------------------------------------- +if cpu_mips3_enable + cpu_sources += [ + 'mips3/cop0.cpp', + 'mips3/cop1.cpp', + 'mips3/mips3.cpp', + 'mips3_intf.cpp', + ] + cpu_include_dirs += ['mips3'] +endif + +# --------------------------------------------------------------------------- +# NEC – V30 / V33 +# --------------------------------------------------------------------------- +if cpu_nec_enable + cpu_sources += [ + 'nec/nec.cpp', + 'nec/v25.cpp', + 'nec_intf.cpp', + ] + cpu_include_dirs += ['nec'] +endif + +# --------------------------------------------------------------------------- +# PIC16C5X – Microchip PIC +# --------------------------------------------------------------------------- +if cpu_pic16c5x_enable + cpu_sources += [ + 'pic16c5x/pic16c5x.cpp', + 'pic16c5x_intf.cpp', + ] + cpu_include_dirs += ['pic16c5x'] +endif + +# --------------------------------------------------------------------------- +# S2650 – Signetics +# --------------------------------------------------------------------------- +if cpu_s2650_enable + cpu_sources += [ + 's2650/s2650.cpp', + 's2650_intf.cpp', + ] + cpu_include_dirs += ['s2650'] +endif + +# --------------------------------------------------------------------------- +# SH-2 – Hitachi +# --------------------------------------------------------------------------- +if cpu_sh2_enable + cpu_sources += ['sh2/sh2.cpp'] + cpu_include_dirs += ['sh2'] +endif + +# --------------------------------------------------------------------------- +# SH-4 – Hitachi +# --------------------------------------------------------------------------- +if cpu_sh4_enable + cpu_sources += ['sh4/sh4.cpp'] + cpu_include_dirs += ['sh4'] +endif + +# --------------------------------------------------------------------------- +# TLCS-90 – Toshiba +# --------------------------------------------------------------------------- +if cpu_tlcs90_enable + cpu_sources += [ + 'tlcs90/tlcs90.cpp', + 'tlcs90_intf.cpp', + ] + cpu_include_dirs += ['tlcs90'] +endif + +# --------------------------------------------------------------------------- +# TLCS-900 – Toshiba +# --------------------------------------------------------------------------- +if cpu_tlcs900_enable + cpu_sources += ['tlcs900/tlcs900.cpp'] + cpu_include_dirs += ['tlcs900'] +endif + +# --------------------------------------------------------------------------- +# TMS32010 – TI DSP +# --------------------------------------------------------------------------- +if cpu_tms32010_enable + cpu_sources += ['tms32010/tms32010.cpp'] + cpu_include_dirs += ['tms32010'] +endif + +# --------------------------------------------------------------------------- +# TMS34010 – TI Graphics System Processor +# --------------------------------------------------------------------------- +if cpu_tms34010_enable + cpu_sources += [ + 'tms34/tms34010.cpp', + 'tms34_intf.cpp', + ] + cpu_include_dirs += ['tms34'] +endif + +# --------------------------------------------------------------------------- +# uPD7725 – NEC DSP +# --------------------------------------------------------------------------- +if cpu_upd7725_enable + cpu_sources += ['upd7725/upd7725.cpp'] + cpu_include_dirs += ['upd7725'] +endif + +# --------------------------------------------------------------------------- +# uPD7810 – NEC +# --------------------------------------------------------------------------- +if cpu_upd7810_enable + cpu_sources += ['upd7810/upd7810.cpp'] + cpu_include_dirs += ['upd7810'] +endif + +# --------------------------------------------------------------------------- +# V60 – NEC +# --------------------------------------------------------------------------- +if cpu_v60_enable + cpu_sources += ['v60/v60.cpp'] + cpu_include_dirs += ['v60'] +endif + +# --------------------------------------------------------------------------- +# Z80 – Zilog Z80 +# --------------------------------------------------------------------------- +if cpu_z80_enable + cpu_sources += [ + 'z80/z80.cpp', + 'z80/z80ctc.cpp', + 'z80/z80daisy.cpp', + 'z80/z80pio.cpp', + 'z80_intf.cpp', + ] + cpu_include_dirs += ['z80'] +endif + +# --------------------------------------------------------------------------- +# Z180 – Zilog Z180 +# --------------------------------------------------------------------------- +if cpu_z180_enable + cpu_sources += [ + 'z180/z180.cpp', + 'z180_intf.cpp', + ] + cpu_include_dirs += ['z180'] +endif + +# ============================================================================= +# Static library — all enabled CPU core objects go here +# ============================================================================= + +cpu_lib_inc = ['..', '../burn'] + cpu_include_dirs + +cpu_defs = [] +if host_machine.system() == 'windows' + cpu_defs += '-D_USE_MATH_DEFINES' +endif + +cpu_cpp_warning_args = [] +if cpp.get_id() in ['gcc', 'clang'] + cpu_cpp_warning_args = [ + '-Wno-sequence-point', + '-Wno-sign-compare', + '-Wno-unused-but-set-variable', + '-Wno-unused-parameter', + '-Wno-unused-value', + '-Wno-unused-variable', + ] +endif + +cpu_cpp_args = cpu_defs + cpu_cpp_warning_args +cpu_lib = static_library( + 'cpu', + cpu_sources, + include_directories: include_directories(cpu_lib_inc), + dependencies: burn_dep, + cpp_args: cpu_cpp_args, + c_args: cpu_defs, +) + +# Dependency object — consumers get the library + all CPU public and +# internal include directories so they can include etc. +cpu_dep = declare_dependency( + link_with: cpu_lib, + include_directories: include_directories(cpu_include_dirs), +) diff --git a/src/dep/libs/lib7z/meson.build b/src/dep/libs/lib7z/meson.build new file mode 100644 index 000000000..1882af7be --- /dev/null +++ b/src/dep/libs/lib7z/meson.build @@ -0,0 +1,45 @@ +lib7z_sources = [ + '7zArcIn.c', + '7zBuf.c', + '7zBuf2.c', + '7zCrc.c', + '7zCrcOpt.c', + '7zDec.c', + '7zFile.c', + '7zStream.c', + 'Alloc.c', + 'Bcj2.c', + 'Bra.c', + 'Bra86.c', + 'BraIA64.c', + 'CpuArch.c', + 'Delta.c', + 'LzFindOpt.c', + 'Lzma2Dec.c', + 'LzmaDec.c', + 'MtDec.c', + 'Ppmd7.c', + 'Ppmd7Dec.c', + 'Ppmd7aDec.c', + 'Sha1Opt.c', + 'Sha256.c', + 'Sha256Opt.c', + 'Threads.c', + 'Xxh64.c', + 'Xz.c', + 'XzCrc64.c', + 'XzCrc64Opt.c', + 'XzDec.c', + 'ZstdDec.c', +] + +lib7z_lib = static_library( + 'lib7z', + lib7z_sources, + c_args: ['-D_7ZIP_PPMD_SUPPPORT', '-D_7ZIP_ST'], +) + +lib7z_dep = declare_dependency( + link_with: lib7z_lib, + include_directories: include_directories('.'), +) diff --git a/src/dep/libs/libchdr/meson.build b/src/dep/libs/libchdr/meson.build new file mode 100644 index 000000000..7e9167319 --- /dev/null +++ b/src/dep/libs/libchdr/meson.build @@ -0,0 +1,38 @@ +libchdr_sources = [ + 'libchdr_bitstream.c', + 'libchdr_cdrom.c', + 'libchdr_chd.c', + 'libchdr_codec_cdfl.c', + 'libchdr_codec_cdlz.c', + 'libchdr_codec_cdzl.c', + 'libchdr_codec_cdzs.c', + 'libchdr_codec_flac.c', + 'libchdr_codec_huff.c', + 'libchdr_codec_lzma.c', + 'libchdr_codec_zlib.c', + 'libchdr_codec_zstd.c', + 'libchdr_flac.c', + 'libchdr_huffman.c', +] + +libchdr_lib = static_library( + 'libchdr', + libchdr_sources, + include_directories: [ + include_directories('.', 'include'), + include_directories('../zlib'), + include_directories('../lzma'), + include_directories('../lzma/include'), + include_directories('../zstd'), + ], + c_args: ['-DCHDR_SYSTEM_ZLIB'], + dependencies: [zlib_dep], +) + +libchdr_dep = declare_dependency( + link_with: libchdr_lib, + include_directories: [ + include_directories('.', 'include'), + ], + dependencies: [zlib_dep], +) diff --git a/src/dep/libs/lua/meson.build b/src/dep/libs/lua/meson.build new file mode 100644 index 000000000..198a99dd1 --- /dev/null +++ b/src/dep/libs/lua/meson.build @@ -0,0 +1,39 @@ +lua_sources = [ + 'lapi.c', + 'lauxlib.c', + 'lbaselib.c', + 'lcode.c', + 'ldblib.c', + 'ldebug.c', + 'ldo.c', + 'ldump.c', + 'lfunc.c', + 'lgc.c', + 'linit.c', + 'liolib.c', + 'llex.c', + 'lmathlib.c', + 'lmem.c', + 'loadlib.c', + 'lobject.c', + 'lopcodes.c', + 'loslib.c', + 'lparser.c', + 'lstate.c', + 'lstring.c', + 'lstrlib.c', + 'ltable.c', + 'ltablib.c', + 'ltm.c', + 'lundump.c', + 'lvm.c', + 'lzio.c', + 'print.c', +] + +lua_lib = static_library('lua', lua_sources) + +lua_dep = declare_dependency( + link_with: lua_lib, + include_directories: include_directories('.'), +) diff --git a/src/dep/libs/zlib/meson.build b/src/dep/libs/zlib/meson.build new file mode 100644 index 000000000..265e6cb42 --- /dev/null +++ b/src/dep/libs/zlib/meson.build @@ -0,0 +1,24 @@ +zlib_sources = [ + 'adler32.c', + 'compress.c', + 'crc32.c', + 'deflate.c', + 'gzclose.c', + 'gzlib.c', + 'gzread.c', + 'gzwrite.c', + 'infback.c', + 'inffast.c', + 'inflate.c', + 'inftrees.c', + 'trees.c', + 'uncompr.c', + 'zutil.c', +] + +zlib_lib = static_library('zlib', zlib_sources) + +zlib_dep = declare_dependency( + link_with: zlib_lib, + include_directories: include_directories('.'), +) diff --git a/src/intf/cd/win32/cd_img.cpp b/src/intf/cd/win32/cd_img.cpp index 9307aa0f7..2dd1dbb1f 100644 --- a/src/intf/cd/win32/cd_img.cpp +++ b/src/intf/cd/win32/cd_img.cpp @@ -11,6 +11,10 @@ #include #include +#ifdef _MSC_VER +#include +#endif + const INT32 MAXIMUM_NUMBER_TRACKS = 100; const INT32 CD_FRAMES_MINUTE = 60 * 75; diff --git a/tools/test_driver_list.py b/tools/test_driver_list.py new file mode 100644 index 000000000..793256834 --- /dev/null +++ b/tools/test_driver_list.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python3 +"""Build each Meson Burn driver independently and report failures.""" + +from __future__ import annotations + +import argparse +import json +import os +import re +import shutil +import subprocess +import sys +import time +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +DEFAULT_BUILD_ROOT = ROOT / "build-driver-tests" +DEFAULT_LOG_DIR = DEFAULT_BUILD_ROOT / "logs" + + +def parse_default_driver_list(options_file: Path) -> list[str]: + text = options_file.read_text(encoding="utf-8") + match = re.search(r"option\(\s*'driver_list'.*?value\s*:\s*\[(.*?)\]", text, re.S) + if not match: + raise RuntimeError( + "Could not find driver_list default value in meson_options.txt" + ) + return re.findall(r"'([^']+)'", match.group(1)) + + +def run_command( + command: list[str], cwd: Path, log_file: Path, timeout: int | None +) -> int: + start = time.monotonic() + with log_file.open("w", encoding="utf-8", errors="replace") as log: + log.write("$ " + " ".join(command) + "\n\n") + log.flush() + try: + proc = subprocess.run( + command, + cwd=cwd, + stdout=log, + stderr=subprocess.STDOUT, + timeout=timeout, + text=True, + ) + code = proc.returncode + except subprocess.TimeoutExpired: + code = 124 + log.write(f"\nTIMEOUT after {timeout} seconds\n") + log.write(f"\nExit code: {code}\nElapsed: {time.monotonic() - start:.1f}s\n") + return code + + +def tail_log(path: Path, lines: int) -> str: + if lines <= 0 or not path.exists(): + return "" + content = path.read_text(encoding="utf-8", errors="replace").splitlines() + return "\n".join(content[-lines:]) + + +def test_driver(args: argparse.Namespace, driver: str) -> dict[str, object]: + build_dir = args.build_root / driver + log_dir = args.log_dir + setup_log = log_dir / f"{driver}.setup.log" + build_log = log_dir / f"{driver}.build.log" + + if args.clean and build_dir.exists(): + shutil.rmtree(build_dir) + + setup_command = [ + args.meson, + "setup", + str(build_dir), + "--wipe", + f"-Dfrontend={args.frontend}", + f"-Dbuildtype={args.buildtype}", + f"-Ddriver_list={driver}", + ] + setup_command.extend(args.setup_arg) + + setup_code = run_command(setup_command, ROOT, setup_log, args.timeout) + result: dict[str, object] = { + "driver": driver, + "build_dir": str(build_dir), + "setup_log": str(setup_log), + "build_log": str(build_log), + "setup_code": setup_code, + "build_code": None, + "ok": False, + } + if setup_code != 0: + result["stage"] = "setup" + return result + + if args.setup_only: + result["ok"] = True + result["stage"] = "setup" + return result + + build_command = [ + args.meson, + "compile", + "-C", + str(build_dir), + "-j", + str(args.jobs), + args.target, + ] + build_code = run_command(build_command, ROOT, build_log, args.timeout) + result["build_code"] = build_code + result["stage"] = "build" + result["ok"] = build_code == 0 + return result + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "drivers", + nargs="*", + help="Drivers to test; default tests every driver in driver_list", + ) + parser.add_argument("--build-root", type=Path, default=DEFAULT_BUILD_ROOT) + parser.add_argument("--log-dir", type=Path, default=DEFAULT_LOG_DIR) + parser.add_argument("--frontend", default="auto") + parser.add_argument("--buildtype", default="debug") + parser.add_argument( + "--target", default="burn_drv", help="Meson target to compile for each driver" + ) + parser.add_argument("--jobs", type=int, default=2) + parser.add_argument( + "--timeout", type=int, default=None, help="Per-command timeout in seconds" + ) + parser.add_argument("--meson", default=os.environ.get("MESON", "meson")) + parser.add_argument( + "--setup-arg", + action="append", + default=[], + help="Extra argument passed to meson setup", + ) + parser.add_argument( + "--setup-only", action="store_true", help="Only configure each driver" + ) + parser.add_argument( + "--no-clean", + dest="clean", + action="store_false", + help="Do not remove per-driver build dirs first", + ) + parser.add_argument( + "--tail", type=int, default=40, help="Failure log lines to print" + ) + args = parser.parse_args() + + all_drivers = parse_default_driver_list(ROOT / "meson_options.txt") + drivers = args.drivers or all_drivers + unknown = [driver for driver in drivers if driver not in all_drivers] + if unknown: + print("Unknown drivers: " + ", ".join(unknown), file=sys.stderr) + return 2 + + args.build_root.mkdir(parents=True, exist_ok=True) + args.log_dir.mkdir(parents=True, exist_ok=True) + + results: list[dict[str, object]] = [] + start = time.monotonic() + for index, driver in enumerate(drivers, 1): + print(f"[{index}/{len(drivers)}] Testing {driver}...", flush=True) + result = test_driver(args, driver) + results.append(result) + status = "PASS" if result["ok"] else "FAIL" + print(f"[{index}/{len(drivers)}] {driver}: {status}", flush=True) + if not result["ok"] and args.tail > 0: + failed_log = Path( + str( + result["build_log"] + if result.get("build_code") is not None + else result["setup_log"] + ) + ) + print(f"--- tail {failed_log} ---") + print(tail_log(failed_log, args.tail)) + print("--- end tail ---") + + summary = { + "ok": all(bool(result["ok"]) for result in results), + "elapsed_seconds": round(time.monotonic() - start, 1), + "total": len(results), + "passed": sum(1 for result in results if result["ok"]), + "failed": [result for result in results if not result["ok"]], + "results": results, + } + summary_path = args.log_dir / "summary.json" + summary_path.write_text(json.dumps(summary, indent=2), encoding="utf-8") + + print() + print(f"Passed: {summary['passed']}/{summary['total']}") + print(f"Summary: {summary_path}") + if summary["failed"]: + print( + "Failed drivers: " + + ", ".join(str(result["driver"]) for result in summary["failed"]) + ) + return 0 if summary["ok"] else 1 + + +if __name__ == "__main__": + raise SystemExit(main())