build(fbneo): consolidate Meson build into a single top-level meson.b… (#2629)

* 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 <malloc.h>` 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=<driver>` 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
This commit is contained in:
ZengGengSen authored and GitHub committed 2026-06-16 13:00:44 -04:00
1 parent 0c274e794d
commit 4540c68e06
20 files changed
+3565

No files matched your search

+746
View File
@@ -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',
)
+45
View File
@@ -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')
+107
View File
@@ -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('.'),
)
File diff suppressed because it is too large. Load diff
+91
View File
@@ -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,
)
+131
View File
@@ -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('.'),
)
+21
View File
@@ -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 = []
+90
View File
@@ -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,
)
+35
View File
@@ -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 = []
+27
View File
@@ -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 = []
+62
View File
@@ -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 = []
+50
View File
@@ -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 = []
+205
View File
@@ -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,
)
+505
View File
@@ -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_<name>_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_<name>_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_<name>_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 <hmcs40.h> etc.
cpu_dep = declare_dependency(
link_with: cpu_lib,
include_directories: include_directories(cpu_include_dirs),
)
+45
View File
@@ -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('.'),
)
+38
View File
@@ -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],
)
+39
View File
@@ -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('.'),
)
+24
View File
@@ -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('.'),
)
+4
View File
@@ -11,6 +11,10 @@
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
#include <malloc.h>
#endif
const INT32 MAXIMUM_NUMBER_TRACKS = 100;
const INT32 CD_FRAMES_MINUTE = 60 * 75;
+209
View File
@@ -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())