Repository navigation
Expand file tree
/
Copy pathdingbat.nimble
More file actions
184 lines (138 loc) · 10.3 KB
/
Copy pathdingbat.nimble
File metadata and controls
184 lines (138 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# Package
version = "0.1.0"
author = "Matthew Beck"
description = "A GBA/GBC emulator"
license = "MIT"
srcDir = "src"
bin = @["dingbat"]
# Dependencies
requires "nim >= 2.0.0"
# The desktop app. The registry's "sdl3" is an older, unofficial binding
# (nim-lang/sdl3 issue #11), so the official one is named by URL.
requires "https://github.com/nim-lang/sdl3#bb137829ff619b0a27a473628cb28fc1c86f3fe5"
requires "imguin"
requires "yaml"
requires "stb_image"
requires "zippy"
task wasm, "Build the WASM/Emscripten target":
exec "nim c -d:emscripten src/dingbat_wasm.nim"
task test_build, "Build the test harness":
exec "nim c -d:test_harness -d:release --path:src -o:dingbat_test tests/dingbat_test.nim"
exec "nim c -d:test_harness -d:release --path:src --path:tests -o:dingbat_test_runner tests/dingbat_test_runner.nim"
exec "nim c -d:test_harness -d:cpu_testbus -d:release --warning:UnreachableCode:off --path:src --path:tests -o:singlestep_test tests/singlestep_test.nim"
task bench_build, "Build the headless benchmark harness":
exec "nim c -d:test_harness -d:release --path:src -o:dingbat_bench tests/dingbat_bench.nim"
# Every test task builds with -d:test_harness: it stops nim.cfg from adding
# the GUI SDL3/OpenGL link flags, which only resolve on a machine with the
# SDL3/GL dev libraries installed. Keep it on when adding a task.
task test_timestretch, "Run the WSOLA time-stretch unit test":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ts_test tests/timestretch_test.nim"
task test_ppucomposite, "Run the GBA PPU compositor invariant tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ppucomposite_test tests/ppucomposite_test.nim"
task test_ppubgunpack, "Run the 4bpp BG tile-unpack equivalence tests":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_ppubgunpack_test tests/ppubgunpack_test.nim"
task test_renderskip, "Run the GBA whole-frame render skip against a never-skipping twin":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_renderskip_test tests/render_skip_test.nim"
task test_mp2kpass, "Run the MP2K HLE pass-detection and level-control tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_mp2kpass_test tests/mp2k_pass_test.nim"
task test_ppuobjlist, "Run the GBA per-line OBJ candidate list differential fuzz":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ppuobjlist_test tests/ppuobjlist_test.nim"
task test_savestate_compat, "Run the save-state format compatibility guards":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_savestate_compat_test tests/savestate_compat_test.nim"
task test_gbartc, "Run the GBA cartridge RTC, battery-save RTC trailer and EEPROM frame tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_gbartc_test tests/gba_rtc_test.nim"
task test_ndsspu, "Run the DS ARM7 sound (SPU) tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndsspu_test tests/nds_spu_test.nim"
task test_ndssystem, "Run the DS system device tests (maths unit, RTC, save chip, IPC, card)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndssystem_test tests/nds_system_test.nim"
task test_ndsslot2, "Run the DS GBA-slot (slot 2) tests (devices + the slot2_probe ROM)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndsslot2_test tests/nds_slot2_test.nim"
task test_ndswifi, "Run the DS wifi tests (the Air between consoles, the wifi_link ROM on two machines)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndswifi_test tests/nds_wifi_test.nim"
task test_ndsperiph, "Run the DS peripheral tests (RTC interrupts, SPI timing, power manager, touchscreen, mic, flash, sleep/lid)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndsperiph_test tests/nds_periph_test.nim"
task test_nds3d, "Run the DS 3D engine tests (command scenes + the 3d_* test ROMs)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_nds3d_test tests/nds_3d_test.nim nds3d_out"
task test_ndssavestate, "Run the DS save-state tests (round trips at awkward moments, refusals)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndssavestate_test tests/nds_savestate_test.nim"
task test_ndscheats, "Run the DS cheat-code engine tests (Action Replay DS, CodeBreaker DS)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndscheats_test tests/nds_cheats_test.nim"
task test_ndscompat, "Run the DS homebrew-sweep fix checks (docs/nds/compat.md)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndscompat_test tests/nds_compat_test.nim"
task test_ndsperf, "Run the DS speed-up checks: idle-loop skipping and 3D frame reuse change nothing (docs/nds/perf.md)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndsperf_test tests/nds_perf_test.nim"
task test_ndstestroms, "Run the DS hardware test-ROM fix checks (docs/nds/test-roms.md)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndstestroms_test tests/nds_testroms_test.nim"
task test_ndshlebios,"Run the DS HLE BIOS SWIs against the real BIOS (or computed expectations)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndshlebios_test tests/nds_hle_bios_test.nim"
task test_ndsboot, "Run the DS boot tests (card KEY1/KEY2 handshake, secure area, direct boot)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_ndsboot_test tests/nds_boot_test.nim"
task ndsref_build, "Build the DS reference tools (tools/ndsref: a headless libretro runner, and ndsrun beside it)":
exec "sh tools/ndsref/build.sh"
exec "nim c -d:test_harness -d:release --hints:off --path:src -o:tools/ndsref/ndsrun tools/ndsrun.nim"
task test_desktop, "Run the desktop frontend tests (input, settings, link, saves, game loading, modals, DS Beta)":
# modal drives Dear ImGui headless, so it needs imguin (CI's test job
# installs it: .github/scripts/install-test-deps.sh).
for t in ["input", "settings", "netlink", "persist", "lifecycle", "modal", "nds"]:
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_desktop_" & t & "_test tests/desktop_" & t & "_test.nim"
task statefuzz_build, "Build the hostile-input save-state fuzzer":
# Run by hand, not in the suite (minutes per core): `./statefuzz <rom>
# sweep 255` (a GB, GBA or DS ROM) exits non-zero on any uncontained
# Defect. The DS core is built unquirky and index-checked (nds/quirky.nim).
exec "nim c -d:test_harness -d:release -d:gba_quirky=false -d:nds_quirky=false " &
"-d:nds_render_checks --path:src -o:statefuzz tools/statefuzz.nim"
task test_rewind, "Run the rewind-ring property tests (IDs, eviction, keyframes)":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_rewind_test tests/rewind_test.nim"
task test_gbapurebase, "Run the GB APU deadline checks across the per-frame scheduler rebase":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_gbapurebase_test tests/gbapu_rebase_test.nim"
task test_gbtimedinput, "Run the GB harness's timed joypad input checks (--input lands on its M-cycle)":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_gbtimedinput_test tests/gb_timed_input_test.nim"
task test_gbwindowscx, "Run the GB window position checks across WX x SCX & 7":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_gbwindowscx_test tests/gb_window_scx_test.nim"
task test_psgagb, "Run the PSG's AGB-only checks (the SP's answers) on both cores":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_psgagb_test tests/psg_agb_test.nim"
task test_ndscpu, "Run the DS CPU interpreter's one-instruction checks (ARM9 and ARM7)":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_ndscpu_test tests/nds_cpu_test.nim"
task test_statesoak, "Run the range-checked serialize-while-running soak (both cores)":
exec "nim c -r -d:test_harness -d:release -d:gba_quirky=false --path:src " &
"-o:dingbat_state_soak_test tests/state_soak_test.nim"
task test_silentaudio, "Check a core that skips mixing (muted) runs exactly as one that mixes":
exec "nim c -r -d:test_harness -d:release -d:soak_lib --path:src --path:tests " &
"-o:dingbat_silent_audio_test tests/silent_audio_test.nim"
task test_iosapi, "Drive the iOS app's C API (src/dingbat_ios.nim) on committed ROMs":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_ios_api_test tests/ios_api_test.nim"
task test_cyclelaws,"Hold the core to the cycle laws recorded from an AGB SP":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_cyclelaws_test tests/cyclelaws_test.nim"
task test_swihalt, "Run Halt and Stop from the cartridge in every GBA BIOS mode":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_swihalt_test tests/swihalt_test.nim"
task test_irqburst, "Run the timer interrupt raised just before a preemptible DMA burst":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_irqburst_test tests/irqburst_test.nim"
task test_clipreplay, "Run the clip-capture replay determinism tests":
exec "nim c -r -d:test_harness -d:release --path:src " &
"-o:dingbat_clipreplay_test tests/clip_replay_test.nim"
task test_printer, "Run the Game Boy Printer protocol unit tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_printer_test tests/gb_printer_test.nim"
task test_lcdresponse, "Run the LCD panel-response model invariants":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_lcdresponse_test tests/lcdresponse_test.nim"
task test_mbc3, "Run the MBC3/MBC30 banking checks (8-bit ROM bank, 64 KiB RAM, .sav, states)":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_mbc3_test tests/mbc3_test.nim"
task test_cheats, "Run the cheat-engine unit + integration tests":
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_cheat_test tests/cheats_test.nim"
exec "nim c -r -d:test_harness -d:release --path:src -o:dingbat_cheat_int_test tests/cheats_integration_test.nim"
task test_sgb, "Run the Super Game Boy acceptance test (packets, palettes, border)":
exec "python3 tests/roms/sgbtest.py"
exec "nim c -r -d:test_harness -d:release -d:sgb_png --path:src " &
"-o:dingbat_sgb_test tests/sgb_test.nim"