logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-All-Avoid-extraneous-semicolons-at-top-level.patch (82870B)


  1. From 44be0c1af5be67d662b9a92cddc5d8b85b4e788c Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Sat, 7 Nov 2020 13:58:35 -0800
  4. Subject: [PATCH] All: Avoid extraneous semicolons at top-level
  5. These are unnecessary and not allowed in ISO C.
  6. ---
  7. include/mgba-util/common.h | 2 +-
  8. include/mgba-util/elf-read.h | 4 +-
  9. include/mgba-util/patch/fast.h | 2 +-
  10. include/mgba-util/vector.h | 2 +-
  11. include/mgba/core/bitmap-cache.h | 18 +-
  12. include/mgba/core/cache-set.h | 6 +-
  13. include/mgba/core/cheats.h | 6 +-
  14. include/mgba/core/interface.h | 2 +-
  15. include/mgba/core/library.h | 2 +-
  16. include/mgba/core/map-cache.h | 34 ++--
  17. include/mgba/core/mem-search.h | 2 +-
  18. include/mgba/core/rewind.h | 2 +-
  19. include/mgba/core/tile-cache.h | 12 +-
  20. include/mgba/debugger/debugger.h | 6 +-
  21. include/mgba/internal/arm/debugger/debugger.h | 2 +-
  22. include/mgba/internal/debugger/parser.h | 2 +-
  23. include/mgba/internal/gb/audio.h | 116 ++++++------
  24. include/mgba/internal/gb/cheats.h | 2 +-
  25. include/mgba/internal/gb/gb.h | 2 +-
  26. include/mgba/internal/gb/io.h | 2 +-
  27. include/mgba/internal/gb/mbc.h | 2 +-
  28. include/mgba/internal/gb/memory.h | 14 +-
  29. include/mgba/internal/gb/serialize.h | 110 ++++++------
  30. include/mgba/internal/gb/sio.h | 10 +-
  31. include/mgba/internal/gb/timer.h | 6 +-
  32. include/mgba/internal/gb/video.h | 62 +++----
  33. include/mgba/internal/gba/audio.h | 34 ++--
  34. include/mgba/internal/gba/bios.h | 2 +-
  35. include/mgba/internal/gba/dma.h | 18 +-
  36. include/mgba/internal/gba/gba.h | 10 +-
  37. include/mgba/internal/gba/hardware.h | 20 +--
  38. include/mgba/internal/gba/io.h | 2 +-
  39. include/mgba/internal/gba/memory.h | 2 +-
  40. include/mgba/internal/gba/rr/rr.h | 2 +-
  41. include/mgba/internal/gba/savedata.h | 2 +-
  42. include/mgba/internal/gba/serialize.h | 38 ++--
  43. include/mgba/internal/gba/sio.h | 34 ++--
  44. include/mgba/internal/gba/timer.h | 10 +-
  45. include/mgba/internal/gba/video.h | 168 +++++++++---------
  46. src/arm/debugger/debugger.c | 2 +-
  47. src/arm/isa-arm.c | 2 +-
  48. src/core/cache-set.c | 6 +-
  49. src/core/cheats.c | 6 +-
  50. src/core/input.c | 4 +-
  51. src/core/interface.c | 2 +-
  52. src/core/library.c | 2 +-
  53. src/core/mem-search.c | 2 +-
  54. src/core/rewind.c | 2 +-
  55. src/core/serialize.c | 2 +-
  56. src/debugger/debugger.c | 6 +-
  57. src/debugger/parser.c | 2 +-
  58. src/gb/cheats.c | 2 +-
  59. src/gb/gb.c | 2 +-
  60. src/gb/io.c | 2 +-
  61. src/gb/mbc.c | 2 +-
  62. src/gb/memory.c | 2 +-
  63. src/gb/serialize.c | 2 +-
  64. src/gb/sio.c | 2 +-
  65. src/gba/audio.c | 2 +-
  66. src/gba/bios.c | 10 +-
  67. src/gba/dma.c | 2 +-
  68. src/gba/extra/battlechip.c | 4 +-
  69. src/gba/gba.c | 4 +-
  70. src/gba/hardware.c | 2 +-
  71. src/gba/io.c | 2 +-
  72. src/gba/memory.c | 2 +-
  73. src/gba/savedata.c | 2 +-
  74. src/gba/serialize.c | 2 +-
  75. src/gba/sio.c | 2 +-
  76. src/gba/video.c | 2 +-
  77. src/platform/opengl/gles2.c | 8 +-
  78. src/platform/sdl/sdl-audio.c | 2 +-
  79. src/platform/sdl/sdl-audio.h | 2 +-
  80. src/platform/sdl/sdl-events.c | 4 +-
  81. src/platform/sdl/sdl-events.h | 4 +-
  82. src/sm83/decoder.c | 88 ++++-----
  83. src/sm83/isa-sm83.c | 110 ++++++------
  84. src/util/elf-read.c | 4 +-
  85. src/util/patch-fast.c | 2 +-
  86. src/util/string.c | 2 +-
  87. 80 files changed, 543 insertions(+), 543 deletions(-)
  88. diff --git a/include/mgba-util/common.h b/include/mgba-util/common.h
  89. index 8c52f3463..e2b0529b6 100644
  90. --- a/include/mgba-util/common.h
  91. +++ b/include/mgba-util/common.h
  92. @@ -258,7 +258,7 @@ typedef intptr_t ssize_t;
  93. #define CONSTRUCTOR(FN) static __attribute__((constructor)) void FN(void)
  94. #endif
  95. -#define DECL_BITFIELD(NAME, TYPE) typedef TYPE NAME
  96. +#define DECL_BITFIELD(NAME, TYPE) typedef TYPE NAME;
  97. #define DECL_BITS(TYPE, FIELD, START, SIZE) \
  98. ATTRIBUTE_UNUSED static inline TYPE TYPE ## Is ## FIELD (TYPE src) { \
  99. diff --git a/include/mgba-util/elf-read.h b/include/mgba-util/elf-read.h
  100. index 86683ea82..d57c16a4a 100644
  101. --- a/include/mgba-util/elf-read.h
  102. +++ b/include/mgba-util/elf-read.h
  103. @@ -19,8 +19,8 @@ CXX_GUARD_START
  104. struct ELF;
  105. struct VFile;
  106. -DECLARE_VECTOR(ELFProgramHeaders, Elf32_Phdr);
  107. -DECLARE_VECTOR(ELFSectionHeaders, Elf32_Shdr);
  108. +DECLARE_VECTOR(ELFProgramHeaders, Elf32_Phdr)
  109. +DECLARE_VECTOR(ELFSectionHeaders, Elf32_Shdr)
  110. struct ELF* ELFOpen(struct VFile*);
  111. void ELFClose(struct ELF*);
  112. diff --git a/include/mgba-util/patch/fast.h b/include/mgba-util/patch/fast.h
  113. index ee59cd23f..2130a8fb4 100644
  114. --- a/include/mgba-util/patch/fast.h
  115. +++ b/include/mgba-util/patch/fast.h
  116. @@ -21,7 +21,7 @@ struct PatchFastExtent {
  117. uint32_t extent[PATCH_FAST_EXTENT];
  118. };
  119. -DECLARE_VECTOR(PatchFastExtents, struct PatchFastExtent);
  120. +DECLARE_VECTOR(PatchFastExtents, struct PatchFastExtent)
  121. struct PatchFast {
  122. struct Patch d;
  123. diff --git a/include/mgba-util/vector.h b/include/mgba-util/vector.h
  124. index c18b6c8b5..8d911d3d0 100644
  125. --- a/include/mgba-util/vector.h
  126. +++ b/include/mgba-util/vector.h
  127. @@ -96,7 +96,7 @@ CXX_GUARD_START
  128. dest->size = src->size; \
  129. } \
  130. -DECLARE_VECTOR(StringList, char*);
  131. +DECLARE_VECTOR(StringList, char*)
  132. CXX_GUARD_END
  133. diff --git a/include/mgba/core/bitmap-cache.h b/include/mgba/core/bitmap-cache.h
  134. index d8bd416e9..48a4b8cd0 100644
  135. --- a/include/mgba/core/bitmap-cache.h
  136. +++ b/include/mgba/core/bitmap-cache.h
  137. @@ -12,15 +12,15 @@ CXX_GUARD_START
  138. #include <mgba/core/interface.h>
  139. -DECL_BITFIELD(mBitmapCacheConfiguration, uint32_t);
  140. -DECL_BIT(mBitmapCacheConfiguration, ShouldStore, 0);
  141. -
  142. -DECL_BITFIELD(mBitmapCacheSystemInfo, uint32_t);
  143. -DECL_BITS(mBitmapCacheSystemInfo, EntryBPP, 0, 3);
  144. -DECL_BIT(mBitmapCacheSystemInfo, UsesPalette, 3);
  145. -DECL_BITS(mBitmapCacheSystemInfo, Width, 4, 10);
  146. -DECL_BITS(mBitmapCacheSystemInfo, Height, 14, 10);
  147. -DECL_BITS(mBitmapCacheSystemInfo, Buffers, 24, 2);
  148. +DECL_BITFIELD(mBitmapCacheConfiguration, uint32_t)
  149. +DECL_BIT(mBitmapCacheConfiguration, ShouldStore, 0)
  150. +
  151. +DECL_BITFIELD(mBitmapCacheSystemInfo, uint32_t)
  152. +DECL_BITS(mBitmapCacheSystemInfo, EntryBPP, 0, 3)
  153. +DECL_BIT(mBitmapCacheSystemInfo, UsesPalette, 3)
  154. +DECL_BITS(mBitmapCacheSystemInfo, Width, 4, 10)
  155. +DECL_BITS(mBitmapCacheSystemInfo, Height, 14, 10)
  156. +DECL_BITS(mBitmapCacheSystemInfo, Buffers, 24, 2)
  157. struct mBitmapCacheEntry {
  158. uint32_t paletteVersion;
  159. diff --git a/include/mgba/core/cache-set.h b/include/mgba/core/cache-set.h
  160. index 5749c0e64..abeb639e7 100644
  161. --- a/include/mgba/core/cache-set.h
  162. +++ b/include/mgba/core/cache-set.h
  163. @@ -15,9 +15,9 @@ CXX_GUARD_START
  164. #include <mgba/core/tile-cache.h>
  165. #include <mgba-util/vector.h>
  166. -DECLARE_VECTOR(mMapCacheSet, struct mMapCache);
  167. -DECLARE_VECTOR(mBitmapCacheSet, struct mBitmapCache);
  168. -DECLARE_VECTOR(mTileCacheSet, struct mTileCache);
  169. +DECLARE_VECTOR(mMapCacheSet, struct mMapCache)
  170. +DECLARE_VECTOR(mBitmapCacheSet, struct mBitmapCache)
  171. +DECLARE_VECTOR(mTileCacheSet, struct mTileCache)
  172. struct mCacheSet {
  173. struct mMapCacheSet maps;
  174. diff --git a/include/mgba/core/cheats.h b/include/mgba/core/cheats.h
  175. index d05ac8e5f..885aee7ec 100644
  176. --- a/include/mgba/core/cheats.h
  177. +++ b/include/mgba/core/cheats.h
  178. @@ -44,9 +44,9 @@ struct mCheat {
  179. int32_t operandOffset;
  180. };
  181. -mLOG_DECLARE_CATEGORY(CHEATS);
  182. +mLOG_DECLARE_CATEGORY(CHEATS)
  183. -DECLARE_VECTOR(mCheatList, struct mCheat);
  184. +DECLARE_VECTOR(mCheatList, struct mCheat)
  185. struct mCheatDevice;
  186. struct mCheatSet {
  187. @@ -69,7 +69,7 @@ struct mCheatSet {
  188. struct StringList lines;
  189. };
  190. -DECLARE_VECTOR(mCheatSets, struct mCheatSet*);
  191. +DECLARE_VECTOR(mCheatSets, struct mCheatSet*)
  192. struct mCheatDevice {
  193. struct mCPUComponent d;
  194. diff --git a/include/mgba/core/interface.h b/include/mgba/core/interface.h
  195. index 51ba6447f..73bb091ec 100644
  196. --- a/include/mgba/core/interface.h
  197. +++ b/include/mgba/core/interface.h
  198. @@ -93,7 +93,7 @@ struct mCoreCallbacks {
  199. void (*keysRead)(void* context);
  200. };
  201. -DECLARE_VECTOR(mCoreCallbacksList, struct mCoreCallbacks);
  202. +DECLARE_VECTOR(mCoreCallbacksList, struct mCoreCallbacks)
  203. struct mAVStream {
  204. void (*videoDimensionsChanged)(struct mAVStream*, unsigned width, unsigned height);
  205. diff --git a/include/mgba/core/library.h b/include/mgba/core/library.h
  206. index d55ad4094..b53ff833d 100644
  207. --- a/include/mgba/core/library.h
  208. +++ b/include/mgba/core/library.h
  209. @@ -26,7 +26,7 @@ struct mLibraryEntry {
  210. #ifdef USE_SQLITE3
  211. -DECLARE_VECTOR(mLibraryListing, struct mLibraryEntry);
  212. +DECLARE_VECTOR(mLibraryListing, struct mLibraryEntry)
  213. struct mLibrary;
  214. struct mLibrary* mLibraryCreateEmpty(void);
  215. diff --git a/include/mgba/core/map-cache.h b/include/mgba/core/map-cache.h
  216. index 6dc9e72f6..a1521e462 100644
  217. --- a/include/mgba/core/map-cache.h
  218. +++ b/include/mgba/core/map-cache.h
  219. @@ -13,23 +13,23 @@ CXX_GUARD_START
  220. #include <mgba/core/interface.h>
  221. #include <mgba/core/tile-cache.h>
  222. -DECL_BITFIELD(mMapCacheConfiguration, uint32_t);
  223. -DECL_BIT(mMapCacheConfiguration, ShouldStore, 0);
  224. -
  225. -DECL_BITFIELD(mMapCacheSystemInfo, uint32_t);
  226. -DECL_BITS(mMapCacheSystemInfo, PaletteBPP, 0, 2);
  227. -DECL_BITS(mMapCacheSystemInfo, PaletteCount, 2, 4);
  228. -DECL_BITS(mMapCacheSystemInfo, TilesWide, 8, 4);
  229. -DECL_BITS(mMapCacheSystemInfo, TilesHigh, 12, 4);
  230. -DECL_BITS(mMapCacheSystemInfo, MacroTileSize, 16, 7);
  231. -DECL_BITS(mMapCacheSystemInfo, MapAlign, 23, 2);
  232. -
  233. -DECL_BITFIELD(mMapCacheEntryFlags, uint16_t);
  234. -DECL_BITS(mMapCacheEntryFlags, PaletteId, 0, 4);
  235. -DECL_BIT(mMapCacheEntryFlags, VramClean, 4);
  236. -DECL_BIT(mMapCacheEntryFlags, HMirror, 5);
  237. -DECL_BIT(mMapCacheEntryFlags, VMirror, 6);
  238. -DECL_BITS(mMapCacheEntryFlags, Mirror, 5, 2);
  239. +DECL_BITFIELD(mMapCacheConfiguration, uint32_t)
  240. +DECL_BIT(mMapCacheConfiguration, ShouldStore, 0)
  241. +
  242. +DECL_BITFIELD(mMapCacheSystemInfo, uint32_t)
  243. +DECL_BITS(mMapCacheSystemInfo, PaletteBPP, 0, 2)
  244. +DECL_BITS(mMapCacheSystemInfo, PaletteCount, 2, 4)
  245. +DECL_BITS(mMapCacheSystemInfo, TilesWide, 8, 4)
  246. +DECL_BITS(mMapCacheSystemInfo, TilesHigh, 12, 4)
  247. +DECL_BITS(mMapCacheSystemInfo, MacroTileSize, 16, 7)
  248. +DECL_BITS(mMapCacheSystemInfo, MapAlign, 23, 2)
  249. +
  250. +DECL_BITFIELD(mMapCacheEntryFlags, uint16_t)
  251. +DECL_BITS(mMapCacheEntryFlags, PaletteId, 0, 4)
  252. +DECL_BIT(mMapCacheEntryFlags, VramClean, 4)
  253. +DECL_BIT(mMapCacheEntryFlags, HMirror, 5)
  254. +DECL_BIT(mMapCacheEntryFlags, VMirror, 6)
  255. +DECL_BITS(mMapCacheEntryFlags, Mirror, 5, 2)
  256. struct mMapCacheEntry {
  257. uint32_t vramVersion;
  258. diff --git a/include/mgba/core/mem-search.h b/include/mgba/core/mem-search.h
  259. index d45601556..110c13982 100644
  260. --- a/include/mgba/core/mem-search.h
  261. +++ b/include/mgba/core/mem-search.h
  262. @@ -51,7 +51,7 @@ struct mCoreMemorySearchResult {
  263. int32_t oldValue;
  264. };
  265. -DECLARE_VECTOR(mCoreMemorySearchResults, struct mCoreMemorySearchResult);
  266. +DECLARE_VECTOR(mCoreMemorySearchResults, struct mCoreMemorySearchResult)
  267. struct mCore;
  268. void mCoreMemorySearch(struct mCore* core, const struct mCoreMemorySearchParams* params, struct mCoreMemorySearchResults* out, size_t limit);
  269. diff --git a/include/mgba/core/rewind.h b/include/mgba/core/rewind.h
  270. index 04549761d..0779c5b67 100644
  271. --- a/include/mgba/core/rewind.h
  272. +++ b/include/mgba/core/rewind.h
  273. @@ -15,7 +15,7 @@ CXX_GUARD_START
  274. #include <mgba-util/threading.h>
  275. #endif
  276. -DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast);
  277. +DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast)
  278. struct VFile;
  279. struct mCoreRewindContext {
  280. diff --git a/include/mgba/core/tile-cache.h b/include/mgba/core/tile-cache.h
  281. index f8600b3ad..64a9937b2 100644
  282. --- a/include/mgba/core/tile-cache.h
  283. +++ b/include/mgba/core/tile-cache.h
  284. @@ -12,13 +12,13 @@ CXX_GUARD_START
  285. #include <mgba/core/interface.h>
  286. -DECL_BITFIELD(mTileCacheConfiguration, uint32_t);
  287. -DECL_BIT(mTileCacheConfiguration, ShouldStore, 0);
  288. +DECL_BITFIELD(mTileCacheConfiguration, uint32_t)
  289. +DECL_BIT(mTileCacheConfiguration, ShouldStore, 0)
  290. -DECL_BITFIELD(mTileCacheSystemInfo, uint32_t);
  291. -DECL_BITS(mTileCacheSystemInfo, PaletteBPP, 0, 2);
  292. -DECL_BITS(mTileCacheSystemInfo, PaletteCount, 2, 4);
  293. -DECL_BITS(mTileCacheSystemInfo, MaxTiles, 16, 13);
  294. +DECL_BITFIELD(mTileCacheSystemInfo, uint32_t)
  295. +DECL_BITS(mTileCacheSystemInfo, PaletteBPP, 0, 2)
  296. +DECL_BITS(mTileCacheSystemInfo, PaletteCount, 2, 4)
  297. +DECL_BITS(mTileCacheSystemInfo, MaxTiles, 16, 13)
  298. struct mTileCacheEntry {
  299. uint32_t paletteVersion;
  300. diff --git a/include/mgba/debugger/debugger.h b/include/mgba/debugger/debugger.h
  301. index 2a4bc2dce..353b5da4e 100644
  302. --- a/include/mgba/debugger/debugger.h
  303. +++ b/include/mgba/debugger/debugger.h
  304. @@ -14,7 +14,7 @@ CXX_GUARD_START
  305. #include <mgba/core/log.h>
  306. #include <mgba-util/vector.h>
  307. -mLOG_DECLARE_CATEGORY(DEBUGGER);
  308. +mLOG_DECLARE_CATEGORY(DEBUGGER)
  309. extern const uint32_t DEBUGGER_ID;
  310. @@ -87,8 +87,8 @@ struct mWatchpoint {
  311. struct ParseTree* condition;
  312. };
  313. -DECLARE_VECTOR(mBreakpointList, struct mBreakpoint);
  314. -DECLARE_VECTOR(mWatchpointList, struct mWatchpoint);
  315. +DECLARE_VECTOR(mBreakpointList, struct mBreakpoint)
  316. +DECLARE_VECTOR(mWatchpointList, struct mWatchpoint)
  317. struct mDebugger;
  318. struct ParseTree;
  319. diff --git a/include/mgba/internal/arm/debugger/debugger.h b/include/mgba/internal/arm/debugger/debugger.h
  320. index 5dc73485c..a2d9e581a 100644
  321. --- a/include/mgba/internal/arm/debugger/debugger.h
  322. +++ b/include/mgba/internal/arm/debugger/debugger.h
  323. @@ -24,7 +24,7 @@ struct ARMDebugBreakpoint {
  324. } sw;
  325. };
  326. -DECLARE_VECTOR(ARMDebugBreakpointList, struct ARMDebugBreakpoint);
  327. +DECLARE_VECTOR(ARMDebugBreakpointList, struct ARMDebugBreakpoint)
  328. struct ARMDebugger {
  329. struct mDebuggerPlatform d;
  330. diff --git a/include/mgba/internal/debugger/parser.h b/include/mgba/internal/debugger/parser.h
  331. index 37f194ddb..6edea602f 100644
  332. --- a/include/mgba/internal/debugger/parser.h
  333. +++ b/include/mgba/internal/debugger/parser.h
  334. @@ -13,7 +13,7 @@
  335. CXX_GUARD_START
  336. struct Token;
  337. -DECLARE_VECTOR(LexVector, struct Token);
  338. +DECLARE_VECTOR(LexVector, struct Token)
  339. enum Operation {
  340. OP_ASSIGN,
  341. diff --git a/include/mgba/internal/gb/audio.h b/include/mgba/internal/gb/audio.h
  342. index e01e60a3f..62367bbb8 100644
  343. --- a/include/mgba/internal/gb/audio.h
  344. +++ b/include/mgba/internal/gb/audio.h
  345. @@ -12,64 +12,64 @@ CXX_GUARD_START
  346. #include <mgba/core/timing.h>
  347. -DECL_BITFIELD(GBAudioRegisterDuty, uint8_t);
  348. -DECL_BITS(GBAudioRegisterDuty, Length, 0, 6);
  349. -DECL_BITS(GBAudioRegisterDuty, Duty, 6, 2);
  350. -
  351. -DECL_BITFIELD(GBAudioRegisterSweep, uint8_t);
  352. -DECL_BITS(GBAudioRegisterSweep, StepTime, 0, 3);
  353. -DECL_BIT(GBAudioRegisterSweep, Direction, 3);
  354. -DECL_BITS(GBAudioRegisterSweep, InitialVolume, 4, 4);
  355. -
  356. -DECL_BITFIELD(GBAudioRegisterControl, uint16_t);
  357. -DECL_BITS(GBAudioRegisterControl, Rate, 0, 11);
  358. -DECL_BITS(GBAudioRegisterControl, Frequency, 0, 11);
  359. -DECL_BIT(GBAudioRegisterControl, Stop, 14);
  360. -DECL_BIT(GBAudioRegisterControl, Restart, 15);
  361. -
  362. -DECL_BITFIELD(GBAudioRegisterSquareSweep, uint8_t);
  363. -DECL_BITS(GBAudioRegisterSquareSweep, Shift, 0, 3);
  364. -DECL_BIT(GBAudioRegisterSquareSweep, Direction, 3);
  365. -DECL_BITS(GBAudioRegisterSquareSweep, Time, 4, 3);
  366. -
  367. -DECL_BITFIELD(GBAudioRegisterBank, uint8_t);
  368. -DECL_BIT(GBAudioRegisterBank, Size, 5);
  369. -DECL_BIT(GBAudioRegisterBank, Bank, 6);
  370. -DECL_BIT(GBAudioRegisterBank, Enable, 7);
  371. -
  372. -DECL_BITFIELD(GBAudioRegisterBankVolume, uint8_t);
  373. -DECL_BITS(GBAudioRegisterBankVolume, VolumeGB, 5, 2);
  374. -DECL_BITS(GBAudioRegisterBankVolume, VolumeGBA, 5, 3);
  375. -
  376. -DECL_BITFIELD(GBAudioRegisterNoiseFeedback, uint8_t);
  377. -DECL_BITS(GBAudioRegisterNoiseFeedback, Ratio, 0, 3);
  378. -DECL_BIT(GBAudioRegisterNoiseFeedback, Power, 3);
  379. -DECL_BITS(GBAudioRegisterNoiseFeedback, Frequency, 4, 4);
  380. -
  381. -DECL_BITFIELD(GBAudioRegisterNoiseControl, uint8_t);
  382. -DECL_BIT(GBAudioRegisterNoiseControl, Stop, 6);
  383. -DECL_BIT(GBAudioRegisterNoiseControl, Restart, 7);
  384. -
  385. -DECL_BITFIELD(GBRegisterNR50, uint8_t);
  386. -DECL_BITS(GBRegisterNR50, VolumeRight, 0, 3);
  387. -DECL_BITS(GBRegisterNR50, VolumeLeft, 4, 3);
  388. -
  389. -DECL_BITFIELD(GBRegisterNR51, uint8_t);
  390. -DECL_BIT(GBRegisterNR51, Ch1Right, 0);
  391. -DECL_BIT(GBRegisterNR51, Ch2Right, 1);
  392. -DECL_BIT(GBRegisterNR51, Ch3Right, 2);
  393. -DECL_BIT(GBRegisterNR51, Ch4Right, 3);
  394. -DECL_BIT(GBRegisterNR51, Ch1Left, 4);
  395. -DECL_BIT(GBRegisterNR51, Ch2Left, 5);
  396. -DECL_BIT(GBRegisterNR51, Ch3Left, 6);
  397. -DECL_BIT(GBRegisterNR51, Ch4Left, 7);
  398. -
  399. -DECL_BITFIELD(GBAudioEnable, uint8_t);
  400. -DECL_BIT(GBAudioEnable, PlayingCh1, 0);
  401. -DECL_BIT(GBAudioEnable, PlayingCh2, 1);
  402. -DECL_BIT(GBAudioEnable, PlayingCh3, 2);
  403. -DECL_BIT(GBAudioEnable, PlayingCh4, 3);
  404. -DECL_BIT(GBAudioEnable, Enable, 7);
  405. +DECL_BITFIELD(GBAudioRegisterDuty, uint8_t)
  406. +DECL_BITS(GBAudioRegisterDuty, Length, 0, 6)
  407. +DECL_BITS(GBAudioRegisterDuty, Duty, 6, 2)
  408. +
  409. +DECL_BITFIELD(GBAudioRegisterSweep, uint8_t)
  410. +DECL_BITS(GBAudioRegisterSweep, StepTime, 0, 3)
  411. +DECL_BIT(GBAudioRegisterSweep, Direction, 3)
  412. +DECL_BITS(GBAudioRegisterSweep, InitialVolume, 4, 4)
  413. +
  414. +DECL_BITFIELD(GBAudioRegisterControl, uint16_t)
  415. +DECL_BITS(GBAudioRegisterControl, Rate, 0, 11)
  416. +DECL_BITS(GBAudioRegisterControl, Frequency, 0, 11)
  417. +DECL_BIT(GBAudioRegisterControl, Stop, 14)
  418. +DECL_BIT(GBAudioRegisterControl, Restart, 15)
  419. +
  420. +DECL_BITFIELD(GBAudioRegisterSquareSweep, uint8_t)
  421. +DECL_BITS(GBAudioRegisterSquareSweep, Shift, 0, 3)
  422. +DECL_BIT(GBAudioRegisterSquareSweep, Direction, 3)
  423. +DECL_BITS(GBAudioRegisterSquareSweep, Time, 4, 3)
  424. +
  425. +DECL_BITFIELD(GBAudioRegisterBank, uint8_t)
  426. +DECL_BIT(GBAudioRegisterBank, Size, 5)
  427. +DECL_BIT(GBAudioRegisterBank, Bank, 6)
  428. +DECL_BIT(GBAudioRegisterBank, Enable, 7)
  429. +
  430. +DECL_BITFIELD(GBAudioRegisterBankVolume, uint8_t)
  431. +DECL_BITS(GBAudioRegisterBankVolume, VolumeGB, 5, 2)
  432. +DECL_BITS(GBAudioRegisterBankVolume, VolumeGBA, 5, 3)
  433. +
  434. +DECL_BITFIELD(GBAudioRegisterNoiseFeedback, uint8_t)
  435. +DECL_BITS(GBAudioRegisterNoiseFeedback, Ratio, 0, 3)
  436. +DECL_BIT(GBAudioRegisterNoiseFeedback, Power, 3)
  437. +DECL_BITS(GBAudioRegisterNoiseFeedback, Frequency, 4, 4)
  438. +
  439. +DECL_BITFIELD(GBAudioRegisterNoiseControl, uint8_t)
  440. +DECL_BIT(GBAudioRegisterNoiseControl, Stop, 6)
  441. +DECL_BIT(GBAudioRegisterNoiseControl, Restart, 7)
  442. +
  443. +DECL_BITFIELD(GBRegisterNR50, uint8_t)
  444. +DECL_BITS(GBRegisterNR50, VolumeRight, 0, 3)
  445. +DECL_BITS(GBRegisterNR50, VolumeLeft, 4, 3)
  446. +
  447. +DECL_BITFIELD(GBRegisterNR51, uint8_t)
  448. +DECL_BIT(GBRegisterNR51, Ch1Right, 0)
  449. +DECL_BIT(GBRegisterNR51, Ch2Right, 1)
  450. +DECL_BIT(GBRegisterNR51, Ch3Right, 2)
  451. +DECL_BIT(GBRegisterNR51, Ch4Right, 3)
  452. +DECL_BIT(GBRegisterNR51, Ch1Left, 4)
  453. +DECL_BIT(GBRegisterNR51, Ch2Left, 5)
  454. +DECL_BIT(GBRegisterNR51, Ch3Left, 6)
  455. +DECL_BIT(GBRegisterNR51, Ch4Left, 7)
  456. +
  457. +DECL_BITFIELD(GBAudioEnable, uint8_t)
  458. +DECL_BIT(GBAudioEnable, PlayingCh1, 0)
  459. +DECL_BIT(GBAudioEnable, PlayingCh2, 1)
  460. +DECL_BIT(GBAudioEnable, PlayingCh3, 2)
  461. +DECL_BIT(GBAudioEnable, PlayingCh4, 3)
  462. +DECL_BIT(GBAudioEnable, Enable, 7)
  463. struct GB;
  464. struct GBAudioEnvelope {
  465. diff --git a/include/mgba/internal/gb/cheats.h b/include/mgba/internal/gb/cheats.h
  466. index 0eb7d3b3c..45a01d167 100644
  467. --- a/include/mgba/internal/gb/cheats.h
  468. +++ b/include/mgba/internal/gb/cheats.h
  469. @@ -29,7 +29,7 @@ struct GBCheatPatch {
  470. bool checkByte;
  471. };
  472. -DECLARE_VECTOR(GBCheatPatchList, struct GBCheatPatch);
  473. +DECLARE_VECTOR(GBCheatPatchList, struct GBCheatPatch)
  474. struct GBCheatSet {
  475. struct mCheatSet d;
  476. diff --git a/include/mgba/internal/gb/gb.h b/include/mgba/internal/gb/gb.h
  477. index d0e59e07e..7750a2d92 100644
  478. --- a/include/mgba/internal/gb/gb.h
  479. +++ b/include/mgba/internal/gb/gb.h
  480. @@ -25,7 +25,7 @@ extern const uint32_t DMG_SM83_FREQUENCY;
  481. extern const uint32_t CGB_SM83_FREQUENCY;
  482. extern const uint32_t SGB_SM83_FREQUENCY;
  483. -mLOG_DECLARE_CATEGORY(GB);
  484. +mLOG_DECLARE_CATEGORY(GB)
  485. // TODO: Prefix GBAIRQ
  486. enum GBIRQ {
  487. diff --git a/include/mgba/internal/gb/io.h b/include/mgba/internal/gb/io.h
  488. index 1df09da2f..c642970b5 100644
  489. --- a/include/mgba/internal/gb/io.h
  490. +++ b/include/mgba/internal/gb/io.h
  491. @@ -12,7 +12,7 @@ CXX_GUARD_START
  492. #include <mgba/core/log.h>
  493. -mLOG_DECLARE_CATEGORY(GB_IO);
  494. +mLOG_DECLARE_CATEGORY(GB_IO)
  495. enum GBIORegisters {
  496. REG_JOYP = 0x00,
  497. diff --git a/include/mgba/internal/gb/mbc.h b/include/mgba/internal/gb/mbc.h
  498. index 72f4e1a47..22ed2f407 100644
  499. --- a/include/mgba/internal/gb/mbc.h
  500. +++ b/include/mgba/internal/gb/mbc.h
  501. @@ -12,7 +12,7 @@ CXX_GUARD_START
  502. #include <mgba/core/log.h>
  503. -mLOG_DECLARE_CATEGORY(GB_MBC);
  504. +mLOG_DECLARE_CATEGORY(GB_MBC)
  505. struct GB;
  506. struct GBMemory;
  507. diff --git a/include/mgba/internal/gb/memory.h b/include/mgba/internal/gb/memory.h
  508. index 3c7387b14..43134c723 100644
  509. --- a/include/mgba/internal/gb/memory.h
  510. +++ b/include/mgba/internal/gb/memory.h
  511. @@ -14,8 +14,8 @@ CXX_GUARD_START
  512. #include <mgba/core/timing.h>
  513. #include <mgba/gb/interface.h>
  514. -mLOG_DECLARE_CATEGORY(GB_MBC);
  515. -mLOG_DECLARE_CATEGORY(GB_MEM);
  516. +mLOG_DECLARE_CATEGORY(GB_MBC)
  517. +mLOG_DECLARE_CATEGORY(GB_MEM)
  518. struct GB;
  519. @@ -72,11 +72,11 @@ struct GBMemory;
  520. typedef void (*GBMemoryBankControllerWrite)(struct GB*, uint16_t address, uint8_t value);
  521. typedef uint8_t (*GBMemoryBankControllerRead)(struct GBMemory*, uint16_t address);
  522. -DECL_BITFIELD(GBMBC7Field, uint8_t);
  523. -DECL_BIT(GBMBC7Field, CS, 7);
  524. -DECL_BIT(GBMBC7Field, CLK, 6);
  525. -DECL_BIT(GBMBC7Field, DI, 1);
  526. -DECL_BIT(GBMBC7Field, DO, 0);
  527. +DECL_BITFIELD(GBMBC7Field, uint8_t)
  528. +DECL_BIT(GBMBC7Field, CS, 7)
  529. +DECL_BIT(GBMBC7Field, CLK, 6)
  530. +DECL_BIT(GBMBC7Field, DI, 1)
  531. +DECL_BIT(GBMBC7Field, DO, 0)
  532. enum GBMBC7MachineState {
  533. GBMBC7_STATE_IDLE = 0,
  534. diff --git a/include/mgba/internal/gb/serialize.h b/include/mgba/internal/gb/serialize.h
  535. index ef2d5c4bc..90faeeafa 100644
  536. --- a/include/mgba/internal/gb/serialize.h
  537. +++ b/include/mgba/internal/gb/serialize.h
  538. @@ -16,7 +16,7 @@ CXX_GUARD_START
  539. extern const uint32_t GB_SAVESTATE_MAGIC;
  540. extern const uint32_t GB_SAVESTATE_VERSION;
  541. -mLOG_DECLARE_CATEGORY(GB_STATE);
  542. +mLOG_DECLARE_CATEGORY(GB_STATE)
  543. /* Savestate format:
  544. * 0x00000 - 0x00003: Version Magic (0x01000002)
  545. @@ -182,25 +182,25 @@ mLOG_DECLARE_CATEGORY(GB_STATE);
  546. * Total size: 0x11800 (71,680) bytes
  547. */
  548. -DECL_BITFIELD(GBSerializedAudioFlags, uint32_t);
  549. -DECL_BITS(GBSerializedAudioFlags, Ch1Volume, 0, 4);
  550. -DECL_BITS(GBSerializedAudioFlags, Ch1Dead, 4, 2);
  551. -DECL_BIT(GBSerializedAudioFlags, Ch1Hi, 6);
  552. -DECL_BITS(GBSerializedAudioFlags, Ch2Volume, 8, 4);
  553. -DECL_BITS(GBSerializedAudioFlags, Ch2Dead, 12, 2);
  554. -DECL_BIT(GBSerializedAudioFlags, Ch2Hi, 14);
  555. -DECL_BITS(GBSerializedAudioFlags, Ch4Volume, 16, 4);
  556. -DECL_BITS(GBSerializedAudioFlags, Ch4Dead, 20, 2);
  557. -DECL_BITS(GBSerializedAudioFlags, Frame, 22, 3);
  558. -DECL_BIT(GBSerializedAudioFlags, Ch1SweepEnabled, 25);
  559. -DECL_BIT(GBSerializedAudioFlags, Ch1SweepOccurred, 26);
  560. -DECL_BIT(GBSerializedAudioFlags, Ch3Readable, 27);
  561. -DECL_BIT(GBSerializedAudioFlags, SkipFrame, 28);
  562. -
  563. -DECL_BITFIELD(GBSerializedAudioEnvelope, uint32_t);
  564. -DECL_BITS(GBSerializedAudioEnvelope, Length, 0, 7);
  565. -DECL_BITS(GBSerializedAudioEnvelope, NextStep, 7, 3);
  566. -DECL_BITS(GBSerializedAudioEnvelope, Frequency, 10, 11);
  567. +DECL_BITFIELD(GBSerializedAudioFlags, uint32_t)
  568. +DECL_BITS(GBSerializedAudioFlags, Ch1Volume, 0, 4)
  569. +DECL_BITS(GBSerializedAudioFlags, Ch1Dead, 4, 2)
  570. +DECL_BIT(GBSerializedAudioFlags, Ch1Hi, 6)
  571. +DECL_BITS(GBSerializedAudioFlags, Ch2Volume, 8, 4)
  572. +DECL_BITS(GBSerializedAudioFlags, Ch2Dead, 12, 2)
  573. +DECL_BIT(GBSerializedAudioFlags, Ch2Hi, 14)
  574. +DECL_BITS(GBSerializedAudioFlags, Ch4Volume, 16, 4)
  575. +DECL_BITS(GBSerializedAudioFlags, Ch4Dead, 20, 2)
  576. +DECL_BITS(GBSerializedAudioFlags, Frame, 22, 3)
  577. +DECL_BIT(GBSerializedAudioFlags, Ch1SweepEnabled, 25)
  578. +DECL_BIT(GBSerializedAudioFlags, Ch1SweepOccurred, 26)
  579. +DECL_BIT(GBSerializedAudioFlags, Ch3Readable, 27)
  580. +DECL_BIT(GBSerializedAudioFlags, SkipFrame, 28)
  581. +
  582. +DECL_BITFIELD(GBSerializedAudioEnvelope, uint32_t)
  583. +DECL_BITS(GBSerializedAudioEnvelope, Length, 0, 7)
  584. +DECL_BITS(GBSerializedAudioEnvelope, NextStep, 7, 3)
  585. +DECL_BITS(GBSerializedAudioEnvelope, Frequency, 10, 11)
  586. struct GBSerializedPSGState {
  587. struct {
  588. @@ -229,41 +229,41 @@ struct GBSerializedPSGState {
  589. } ch4;
  590. };
  591. -DECL_BITFIELD(GBSerializedCpuFlags, uint32_t);
  592. -DECL_BIT(GBSerializedCpuFlags, Condition, 0);
  593. -DECL_BIT(GBSerializedCpuFlags, IrqPending, 1);
  594. -DECL_BIT(GBSerializedCpuFlags, DoubleSpeed, 2);
  595. -DECL_BIT(GBSerializedCpuFlags, EiPending, 3);
  596. -
  597. -DECL_BITFIELD(GBSerializedTimerFlags, uint8_t);
  598. -DECL_BIT(GBSerializedTimerFlags, IrqPending, 0);
  599. -
  600. -DECL_BITFIELD(GBSerializedVideoFlags, uint8_t);
  601. -DECL_BIT(GBSerializedVideoFlags, BcpIncrement, 0);
  602. -DECL_BIT(GBSerializedVideoFlags, OcpIncrement, 1);
  603. -DECL_BITS(GBSerializedVideoFlags, Mode, 2, 2);
  604. -DECL_BIT(GBSerializedVideoFlags, NotModeEventScheduled, 4);
  605. -DECL_BIT(GBSerializedVideoFlags, NotFrameEventScheduled, 5);
  606. -
  607. -DECL_BITFIELD(GBSerializedMBC7Flags, uint8_t);
  608. -DECL_BITS(GBSerializedMBC7Flags, Command, 0, 2);
  609. -DECL_BIT(GBSerializedMBC7Flags, Writable, 2);
  610. -
  611. -DECL_BITFIELD(GBSerializedMemoryFlags, uint16_t);
  612. -DECL_BIT(GBSerializedMemoryFlags, SramAccess, 0);
  613. -DECL_BIT(GBSerializedMemoryFlags, RtcAccess, 1);
  614. -DECL_BIT(GBSerializedMemoryFlags, RtcLatched, 2);
  615. -DECL_BIT(GBSerializedMemoryFlags, Ime, 3);
  616. -DECL_BIT(GBSerializedMemoryFlags, IsHdma, 4);
  617. -DECL_BITS(GBSerializedMemoryFlags, ActiveRtcReg, 5, 3);
  618. -
  619. -DECL_BITFIELD(GBSerializedSGBFlags, uint32_t);
  620. -DECL_BITS(GBSerializedSGBFlags, P1Bits, 0, 2);
  621. -DECL_BITS(GBSerializedSGBFlags, RenderMode, 2, 2);
  622. -DECL_BITS(GBSerializedSGBFlags, BufferIndex, 4, 3);
  623. -DECL_BITS(GBSerializedSGBFlags, CurrentController, 7, 2);
  624. -DECL_BITS(GBSerializedSGBFlags, ReqControllers, 9, 2);
  625. -DECL_BIT(GBSerializedSGBFlags, Increment, 11);
  626. +DECL_BITFIELD(GBSerializedCpuFlags, uint32_t)
  627. +DECL_BIT(GBSerializedCpuFlags, Condition, 0)
  628. +DECL_BIT(GBSerializedCpuFlags, IrqPending, 1)
  629. +DECL_BIT(GBSerializedCpuFlags, DoubleSpeed, 2)
  630. +DECL_BIT(GBSerializedCpuFlags, EiPending, 3)
  631. +
  632. +DECL_BITFIELD(GBSerializedTimerFlags, uint8_t)
  633. +DECL_BIT(GBSerializedTimerFlags, IrqPending, 0)
  634. +
  635. +DECL_BITFIELD(GBSerializedVideoFlags, uint8_t)
  636. +DECL_BIT(GBSerializedVideoFlags, BcpIncrement, 0)
  637. +DECL_BIT(GBSerializedVideoFlags, OcpIncrement, 1)
  638. +DECL_BITS(GBSerializedVideoFlags, Mode, 2, 2)
  639. +DECL_BIT(GBSerializedVideoFlags, NotModeEventScheduled, 4)
  640. +DECL_BIT(GBSerializedVideoFlags, NotFrameEventScheduled, 5)
  641. +
  642. +DECL_BITFIELD(GBSerializedMBC7Flags, uint8_t)
  643. +DECL_BITS(GBSerializedMBC7Flags, Command, 0, 2)
  644. +DECL_BIT(GBSerializedMBC7Flags, Writable, 2)
  645. +
  646. +DECL_BITFIELD(GBSerializedMemoryFlags, uint16_t)
  647. +DECL_BIT(GBSerializedMemoryFlags, SramAccess, 0)
  648. +DECL_BIT(GBSerializedMemoryFlags, RtcAccess, 1)
  649. +DECL_BIT(GBSerializedMemoryFlags, RtcLatched, 2)
  650. +DECL_BIT(GBSerializedMemoryFlags, Ime, 3)
  651. +DECL_BIT(GBSerializedMemoryFlags, IsHdma, 4)
  652. +DECL_BITS(GBSerializedMemoryFlags, ActiveRtcReg, 5, 3)
  653. +
  654. +DECL_BITFIELD(GBSerializedSGBFlags, uint32_t)
  655. +DECL_BITS(GBSerializedSGBFlags, P1Bits, 0, 2)
  656. +DECL_BITS(GBSerializedSGBFlags, RenderMode, 2, 2)
  657. +DECL_BITS(GBSerializedSGBFlags, BufferIndex, 4, 3)
  658. +DECL_BITS(GBSerializedSGBFlags, CurrentController, 7, 2)
  659. +DECL_BITS(GBSerializedSGBFlags, ReqControllers, 9, 2)
  660. +DECL_BIT(GBSerializedSGBFlags, Increment, 11)
  661. #pragma pack(push, 1)
  662. struct GBSerializedState {
  663. diff --git a/include/mgba/internal/gb/sio.h b/include/mgba/internal/gb/sio.h
  664. index 50d62868b..6744a76ec 100644
  665. --- a/include/mgba/internal/gb/sio.h
  666. +++ b/include/mgba/internal/gb/sio.h
  667. @@ -18,7 +18,7 @@ CXX_GUARD_START
  668. extern const int GBSIOCyclesPerTransfer[2];
  669. -mLOG_DECLARE_CATEGORY(GB_SIO);
  670. +mLOG_DECLARE_CATEGORY(GB_SIO)
  671. struct GB;
  672. struct GBSIODriver;
  673. @@ -35,10 +35,10 @@ struct GBSIO {
  674. uint8_t pendingSB;
  675. };
  676. -DECL_BITFIELD(GBRegisterSC, uint8_t);
  677. -DECL_BIT(GBRegisterSC, ShiftClock, 0);
  678. -DECL_BIT(GBRegisterSC, ClockSpeed, 1);
  679. -DECL_BIT(GBRegisterSC, Enable, 7);
  680. +DECL_BITFIELD(GBRegisterSC, uint8_t)
  681. +DECL_BIT(GBRegisterSC, ShiftClock, 0)
  682. +DECL_BIT(GBRegisterSC, ClockSpeed, 1)
  683. +DECL_BIT(GBRegisterSC, Enable, 7)
  684. void GBSIOInit(struct GBSIO* sio);
  685. void GBSIOReset(struct GBSIO* sio);
  686. diff --git a/include/mgba/internal/gb/timer.h b/include/mgba/internal/gb/timer.h
  687. index b81ff1c34..31f5fb849 100644
  688. --- a/include/mgba/internal/gb/timer.h
  689. +++ b/include/mgba/internal/gb/timer.h
  690. @@ -12,9 +12,9 @@ CXX_GUARD_START
  691. #include <mgba/core/timing.h>
  692. -DECL_BITFIELD(GBRegisterTAC, uint8_t);
  693. -DECL_BITS(GBRegisterTAC, Clock, 0, 2);
  694. -DECL_BIT(GBRegisterTAC, Run, 2);
  695. +DECL_BITFIELD(GBRegisterTAC, uint8_t)
  696. +DECL_BITS(GBRegisterTAC, Clock, 0, 2)
  697. +DECL_BIT(GBRegisterTAC, Run, 2)
  698. enum {
  699. GB_DMG_DIV_PERIOD = 16
  700. diff --git a/include/mgba/internal/gb/video.h b/include/mgba/internal/gb/video.h
  701. index 69a3b0420..56c6cda0f 100644
  702. --- a/include/mgba/internal/gb/video.h
  703. +++ b/include/mgba/internal/gb/video.h
  704. @@ -37,20 +37,20 @@ enum {
  705. SGB_SIZE_ATF_RAM = 0x1000
  706. };
  707. -DECL_BITFIELD(GBObjAttributes, uint8_t);
  708. -DECL_BITS(GBObjAttributes, CGBPalette, 0, 3);
  709. -DECL_BIT(GBObjAttributes, Bank, 3);
  710. -DECL_BIT(GBObjAttributes, Palette, 4);
  711. -DECL_BIT(GBObjAttributes, XFlip, 5);
  712. -DECL_BIT(GBObjAttributes, YFlip, 6);
  713. -DECL_BIT(GBObjAttributes, Priority, 7);
  714. -
  715. -DECL_BITFIELD(SGBBgAttributes, uint16_t);
  716. -DECL_BITS(SGBBgAttributes, Tile, 0, 10);
  717. -DECL_BITS(SGBBgAttributes, Palette, 10, 3);
  718. -DECL_BIT(SGBBgAttributes, Priority, 13);
  719. -DECL_BIT(SGBBgAttributes, XFlip, 14);
  720. -DECL_BIT(SGBBgAttributes, YFlip, 15);
  721. +DECL_BITFIELD(GBObjAttributes, uint8_t)
  722. +DECL_BITS(GBObjAttributes, CGBPalette, 0, 3)
  723. +DECL_BIT(GBObjAttributes, Bank, 3)
  724. +DECL_BIT(GBObjAttributes, Palette, 4)
  725. +DECL_BIT(GBObjAttributes, XFlip, 5)
  726. +DECL_BIT(GBObjAttributes, YFlip, 6)
  727. +DECL_BIT(GBObjAttributes, Priority, 7)
  728. +
  729. +DECL_BITFIELD(SGBBgAttributes, uint16_t)
  730. +DECL_BITS(SGBBgAttributes, Tile, 0, 10)
  731. +DECL_BITS(SGBBgAttributes, Palette, 10, 3)
  732. +DECL_BIT(SGBBgAttributes, Priority, 13)
  733. +DECL_BIT(SGBBgAttributes, XFlip, 14)
  734. +DECL_BIT(SGBBgAttributes, YFlip, 15)
  735. struct GBObj {
  736. uint8_t y;
  737. @@ -98,23 +98,23 @@ struct GBVideoRenderer {
  738. bool disableWIN;
  739. };
  740. -DECL_BITFIELD(GBRegisterLCDC, uint8_t);
  741. -DECL_BIT(GBRegisterLCDC, BgEnable, 0);
  742. -DECL_BIT(GBRegisterLCDC, ObjEnable, 1);
  743. -DECL_BIT(GBRegisterLCDC, ObjSize, 2);
  744. -DECL_BIT(GBRegisterLCDC, TileMap, 3);
  745. -DECL_BIT(GBRegisterLCDC, TileData, 4);
  746. -DECL_BIT(GBRegisterLCDC, Window, 5);
  747. -DECL_BIT(GBRegisterLCDC, WindowTileMap, 6);
  748. -DECL_BIT(GBRegisterLCDC, Enable, 7);
  749. -
  750. -DECL_BITFIELD(GBRegisterSTAT, uint8_t);
  751. -DECL_BITS(GBRegisterSTAT, Mode, 0, 2);
  752. -DECL_BIT(GBRegisterSTAT, LYC, 2);
  753. -DECL_BIT(GBRegisterSTAT, HblankIRQ, 3);
  754. -DECL_BIT(GBRegisterSTAT, VblankIRQ, 4);
  755. -DECL_BIT(GBRegisterSTAT, OAMIRQ, 5);
  756. -DECL_BIT(GBRegisterSTAT, LYCIRQ, 6);
  757. +DECL_BITFIELD(GBRegisterLCDC, uint8_t)
  758. +DECL_BIT(GBRegisterLCDC, BgEnable, 0)
  759. +DECL_BIT(GBRegisterLCDC, ObjEnable, 1)
  760. +DECL_BIT(GBRegisterLCDC, ObjSize, 2)
  761. +DECL_BIT(GBRegisterLCDC, TileMap, 3)
  762. +DECL_BIT(GBRegisterLCDC, TileData, 4)
  763. +DECL_BIT(GBRegisterLCDC, Window, 5)
  764. +DECL_BIT(GBRegisterLCDC, WindowTileMap, 6)
  765. +DECL_BIT(GBRegisterLCDC, Enable, 7)
  766. +
  767. +DECL_BITFIELD(GBRegisterSTAT, uint8_t)
  768. +DECL_BITS(GBRegisterSTAT, Mode, 0, 2)
  769. +DECL_BIT(GBRegisterSTAT, LYC, 2)
  770. +DECL_BIT(GBRegisterSTAT, HblankIRQ, 3)
  771. +DECL_BIT(GBRegisterSTAT, VblankIRQ, 4)
  772. +DECL_BIT(GBRegisterSTAT, OAMIRQ, 5)
  773. +DECL_BIT(GBRegisterSTAT, LYCIRQ, 6)
  774. struct GBVideo {
  775. struct GB* p;
  776. diff --git a/include/mgba/internal/gba/audio.h b/include/mgba/internal/gba/audio.h
  777. index f08f845b6..2eebdf81b 100644
  778. --- a/include/mgba/internal/gba/audio.h
  779. +++ b/include/mgba/internal/gba/audio.h
  780. @@ -18,7 +18,7 @@ CXX_GUARD_START
  781. #define MP2K_MAGIC 0x68736D53
  782. #define MP2K_MAX_SOUND_CHANNELS 12
  783. -mLOG_DECLARE_CATEGORY(GBA_AUDIO);
  784. +mLOG_DECLARE_CATEGORY(GBA_AUDIO)
  785. struct GBADMA;
  786. @@ -31,22 +31,22 @@ struct GBAAudioFIFO {
  787. int8_t sample;
  788. };
  789. -DECL_BITFIELD(GBARegisterSOUNDCNT_HI, uint16_t);
  790. -DECL_BITS(GBARegisterSOUNDCNT_HI, Volume, 0, 2);
  791. -DECL_BIT(GBARegisterSOUNDCNT_HI, VolumeChA, 2);
  792. -DECL_BIT(GBARegisterSOUNDCNT_HI, VolumeChB, 3);
  793. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChARight, 8);
  794. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChALeft, 9);
  795. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChATimer, 10);
  796. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChAReset, 11);
  797. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChBRight, 12);
  798. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChBLeft, 13);
  799. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChBTimer, 14);
  800. -DECL_BIT(GBARegisterSOUNDCNT_HI, ChBReset, 15);
  801. -
  802. -DECL_BITFIELD(GBARegisterSOUNDBIAS, uint16_t);
  803. -DECL_BITS(GBARegisterSOUNDBIAS, Bias, 0, 10);
  804. -DECL_BITS(GBARegisterSOUNDBIAS, Resolution, 14, 2);
  805. +DECL_BITFIELD(GBARegisterSOUNDCNT_HI, uint16_t)
  806. +DECL_BITS(GBARegisterSOUNDCNT_HI, Volume, 0, 2)
  807. +DECL_BIT(GBARegisterSOUNDCNT_HI, VolumeChA, 2)
  808. +DECL_BIT(GBARegisterSOUNDCNT_HI, VolumeChB, 3)
  809. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChARight, 8)
  810. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChALeft, 9)
  811. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChATimer, 10)
  812. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChAReset, 11)
  813. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChBRight, 12)
  814. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChBLeft, 13)
  815. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChBTimer, 14)
  816. +DECL_BIT(GBARegisterSOUNDCNT_HI, ChBReset, 15)
  817. +
  818. +DECL_BITFIELD(GBARegisterSOUNDBIAS, uint16_t)
  819. +DECL_BITS(GBARegisterSOUNDBIAS, Bias, 0, 10)
  820. +DECL_BITS(GBARegisterSOUNDBIAS, Resolution, 14, 2)
  821. struct GBAAudioMixer;
  822. struct GBAAudio {
  823. diff --git a/include/mgba/internal/gba/bios.h b/include/mgba/internal/gba/bios.h
  824. index a89edfd68..efa2a1025 100644
  825. --- a/include/mgba/internal/gba/bios.h
  826. +++ b/include/mgba/internal/gba/bios.h
  827. @@ -12,7 +12,7 @@ CXX_GUARD_START
  828. #include <mgba/core/log.h>
  829. -mLOG_DECLARE_CATEGORY(GBA_BIOS);
  830. +mLOG_DECLARE_CATEGORY(GBA_BIOS)
  831. struct ARMCore;
  832. void GBASwi16(struct ARMCore* cpu, int immediate);
  833. diff --git a/include/mgba/internal/gba/dma.h b/include/mgba/internal/gba/dma.h
  834. index 6f880c971..815077f8d 100644
  835. --- a/include/mgba/internal/gba/dma.h
  836. +++ b/include/mgba/internal/gba/dma.h
  837. @@ -24,15 +24,15 @@ enum GBADMATiming {
  838. GBA_DMA_TIMING_CUSTOM = 3
  839. };
  840. -DECL_BITFIELD(GBADMARegister, uint16_t);
  841. -DECL_BITS(GBADMARegister, DestControl, 5, 2);
  842. -DECL_BITS(GBADMARegister, SrcControl, 7, 2);
  843. -DECL_BIT(GBADMARegister, Repeat, 9);
  844. -DECL_BIT(GBADMARegister, Width, 10);
  845. -DECL_BIT(GBADMARegister, DRQ, 11);
  846. -DECL_BITS(GBADMARegister, Timing, 12, 2);
  847. -DECL_BIT(GBADMARegister, DoIRQ, 14);
  848. -DECL_BIT(GBADMARegister, Enable, 15);
  849. +DECL_BITFIELD(GBADMARegister, uint16_t)
  850. +DECL_BITS(GBADMARegister, DestControl, 5, 2)
  851. +DECL_BITS(GBADMARegister, SrcControl, 7, 2)
  852. +DECL_BIT(GBADMARegister, Repeat, 9)
  853. +DECL_BIT(GBADMARegister, Width, 10)
  854. +DECL_BIT(GBADMARegister, DRQ, 11)
  855. +DECL_BITS(GBADMARegister, Timing, 12, 2)
  856. +DECL_BIT(GBADMARegister, DoIRQ, 14)
  857. +DECL_BIT(GBADMARegister, Enable, 15)
  858. struct GBADMA {
  859. GBADMARegister reg;
  860. diff --git a/include/mgba/internal/gba/gba.h b/include/mgba/internal/gba/gba.h
  861. index fffd46936..343ed6f10 100644
  862. --- a/include/mgba/internal/gba/gba.h
  863. +++ b/include/mgba/internal/gba/gba.h
  864. @@ -55,12 +55,12 @@ struct GBA;
  865. struct Patch;
  866. struct VFile;
  867. -mLOG_DECLARE_CATEGORY(GBA);
  868. -mLOG_DECLARE_CATEGORY(GBA_DEBUG);
  869. +mLOG_DECLARE_CATEGORY(GBA)
  870. +mLOG_DECLARE_CATEGORY(GBA_DEBUG)
  871. -DECL_BITFIELD(GBADebugFlags, uint16_t);
  872. -DECL_BITS(GBADebugFlags, Level, 0, 3);
  873. -DECL_BIT(GBADebugFlags, Send, 8);
  874. +DECL_BITFIELD(GBADebugFlags, uint16_t)
  875. +DECL_BITS(GBADebugFlags, Level, 0, 3)
  876. +DECL_BIT(GBADebugFlags, Send, 8)
  877. struct GBA {
  878. struct mCPUComponent d;
  879. diff --git a/include/mgba/internal/gba/hardware.h b/include/mgba/internal/gba/hardware.h
  880. index fab175538..54b2f5971 100644
  881. --- a/include/mgba/internal/gba/hardware.h
  882. +++ b/include/mgba/internal/gba/hardware.h
  883. @@ -14,7 +14,7 @@ CXX_GUARD_START
  884. #include <mgba/core/timing.h>
  885. #include <mgba/gba/interface.h>
  886. -mLOG_DECLARE_CATEGORY(GBA_HW);
  887. +mLOG_DECLARE_CATEGORY(GBA_HW)
  888. #define IS_GPIO_REGISTER(reg) ((reg) == GPIO_REG_DATA || (reg) == GPIO_REG_DIRECTION || (reg) == GPIO_REG_CONTROL)
  889. @@ -48,10 +48,10 @@ enum GPIODirection {
  890. GPIO_READ_WRITE = 1
  891. };
  892. -DECL_BITFIELD(RTCControl, uint32_t);
  893. -DECL_BIT(RTCControl, MinIRQ, 3);
  894. -DECL_BIT(RTCControl, Hour24, 6);
  895. -DECL_BIT(RTCControl, Poweroff, 7);
  896. +DECL_BITFIELD(RTCControl, uint32_t)
  897. +DECL_BIT(RTCControl, MinIRQ, 3)
  898. +DECL_BIT(RTCControl, Hour24, 6)
  899. +DECL_BIT(RTCControl, Poweroff, 7)
  900. enum RTCCommand {
  901. RTC_RESET = 0,
  902. @@ -61,10 +61,10 @@ enum RTCCommand {
  903. RTC_TIME = 6
  904. };
  905. -DECL_BITFIELD(RTCCommandData, uint32_t);
  906. -DECL_BITS(RTCCommandData, Magic, 0, 4);
  907. -DECL_BITS(RTCCommandData, Command, 4, 3);
  908. -DECL_BIT(RTCCommandData, Reading, 7);
  909. +DECL_BITFIELD(RTCCommandData, uint32_t)
  910. +DECL_BITS(RTCCommandData, Magic, 0, 4)
  911. +DECL_BITS(RTCCommandData, Command, 4, 3)
  912. +DECL_BIT(RTCCommandData, Reading, 7)
  913. #ifndef PYCPARSE
  914. #pragma pack(push, 1)
  915. @@ -93,7 +93,7 @@ struct GBAGBPSIODriver {
  916. struct GBACartridgeHardware* p;
  917. };
  918. -DECL_BITFIELD(GPIOPin, uint16_t);
  919. +DECL_BITFIELD(GPIOPin, uint16_t)
  920. struct GBACartridgeHardware {
  921. struct GBA* p;
  922. diff --git a/include/mgba/internal/gba/io.h b/include/mgba/internal/gba/io.h
  923. index 9875061f3..7075e0e9e 100644
  924. --- a/include/mgba/internal/gba/io.h
  925. +++ b/include/mgba/internal/gba/io.h
  926. @@ -159,7 +159,7 @@ enum GBAIORegisters {
  927. REG_DEBUG_ENABLE = 0xFFF780,
  928. };
  929. -mLOG_DECLARE_CATEGORY(GBA_IO);
  930. +mLOG_DECLARE_CATEGORY(GBA_IO)
  931. extern MGBA_EXPORT const char* const GBAIORegisterNames[];
  932. diff --git a/include/mgba/internal/gba/memory.h b/include/mgba/internal/gba/memory.h
  933. index f98b7e94a..4c3746ef9 100644
  934. --- a/include/mgba/internal/gba/memory.h
  935. +++ b/include/mgba/internal/gba/memory.h
  936. @@ -88,7 +88,7 @@ enum {
  937. AGB_PRINT_FLUSH_ADDR = 0x01FE209C,
  938. };
  939. -mLOG_DECLARE_CATEGORY(GBA_MEM);
  940. +mLOG_DECLARE_CATEGORY(GBA_MEM)
  941. struct GBAPrintContext {
  942. uint16_t request;
  943. diff --git a/include/mgba/internal/gba/rr/rr.h b/include/mgba/internal/gba/rr/rr.h
  944. index b4fc2e627..e8fda37bc 100644
  945. --- a/include/mgba/internal/gba/rr/rr.h
  946. +++ b/include/mgba/internal/gba/rr/rr.h
  947. @@ -15,7 +15,7 @@ CXX_GUARD_START
  948. struct VFile;
  949. -mLOG_DECLARE_CATEGORY(GBA_RR);
  950. +mLOG_DECLARE_CATEGORY(GBA_RR)
  951. enum GBARRInitFrom {
  952. INIT_EX_NIHILO = 0,
  953. diff --git a/include/mgba/internal/gba/savedata.h b/include/mgba/internal/gba/savedata.h
  954. index 05cd65963..3fa6813c2 100644
  955. --- a/include/mgba/internal/gba/savedata.h
  956. +++ b/include/mgba/internal/gba/savedata.h
  957. @@ -13,7 +13,7 @@ CXX_GUARD_START
  958. #include <mgba/core/log.h>
  959. #include <mgba/core/timing.h>
  960. -mLOG_DECLARE_CATEGORY(GBA_SAVE);
  961. +mLOG_DECLARE_CATEGORY(GBA_SAVE)
  962. struct VFile;
  963. diff --git a/include/mgba/internal/gba/serialize.h b/include/mgba/internal/gba/serialize.h
  964. index 3d2e0e69c..83b337b2c 100644
  965. --- a/include/mgba/internal/gba/serialize.h
  966. +++ b/include/mgba/internal/gba/serialize.h
  967. @@ -17,7 +17,7 @@ CXX_GUARD_START
  968. extern const uint32_t GBA_SAVESTATE_MAGIC;
  969. extern const uint32_t GBA_SAVESTATE_VERSION;
  970. -mLOG_DECLARE_CATEGORY(GBA_STATE);
  971. +mLOG_DECLARE_CATEGORY(GBA_STATE)
  972. /* Savestate format:
  973. * 0x00000 - 0x00003: Version Magic (0x01000001)
  974. @@ -208,28 +208,28 @@ mLOG_DECLARE_CATEGORY(GBA_STATE);
  975. * Total size: 0x61000 (397,312) bytes
  976. */
  977. -DECL_BITFIELD(GBASerializedHWFlags1, uint16_t);
  978. -DECL_BIT(GBASerializedHWFlags1, ReadWrite, 0);
  979. -DECL_BIT(GBASerializedHWFlags1, GyroEdge, 1);
  980. -DECL_BIT(GBASerializedHWFlags1, LightEdge, 2);
  981. -DECL_BITS(GBASerializedHWFlags1, LightCounter, 4, 12);
  982. +DECL_BITFIELD(GBASerializedHWFlags1, uint16_t)
  983. +DECL_BIT(GBASerializedHWFlags1, ReadWrite, 0)
  984. +DECL_BIT(GBASerializedHWFlags1, GyroEdge, 1)
  985. +DECL_BIT(GBASerializedHWFlags1, LightEdge, 2)
  986. +DECL_BITS(GBASerializedHWFlags1, LightCounter, 4, 12)
  987. -DECL_BITFIELD(GBASerializedHWFlags2, uint8_t);
  988. -DECL_BITS(GBASerializedHWFlags2, TiltState, 0, 2);
  989. -DECL_BITS(GBASerializedHWFlags2, GbpInputsPosted, 2, 2);
  990. -DECL_BITS(GBASerializedHWFlags2, GbpTxPosition, 4, 5);
  991. +DECL_BITFIELD(GBASerializedHWFlags2, uint8_t)
  992. +DECL_BITS(GBASerializedHWFlags2, TiltState, 0, 2)
  993. +DECL_BITS(GBASerializedHWFlags2, GbpInputsPosted, 2, 2)
  994. +DECL_BITS(GBASerializedHWFlags2, GbpTxPosition, 4, 5)
  995. -DECL_BITFIELD(GBASerializedHWFlags3, uint16_t);
  996. +DECL_BITFIELD(GBASerializedHWFlags3, uint16_t)
  997. -DECL_BITFIELD(GBASerializedSavedataFlags, uint8_t);
  998. -DECL_BITS(GBASerializedSavedataFlags, FlashState, 0, 2);
  999. -DECL_BIT(GBASerializedSavedataFlags, FlashBank, 4);
  1000. -DECL_BIT(GBASerializedSavedataFlags, DustSettling, 5);
  1001. +DECL_BITFIELD(GBASerializedSavedataFlags, uint8_t)
  1002. +DECL_BITS(GBASerializedSavedataFlags, FlashState, 0, 2)
  1003. +DECL_BIT(GBASerializedSavedataFlags, FlashBank, 4)
  1004. +DECL_BIT(GBASerializedSavedataFlags, DustSettling, 5)
  1005. -DECL_BITFIELD(GBASerializedMiscFlags, uint32_t);
  1006. -DECL_BIT(GBASerializedMiscFlags, Halted, 0);
  1007. -DECL_BIT(GBASerializedMiscFlags, POSTFLG, 1);
  1008. -DECL_BIT(GBASerializedMiscFlags, IrqPending, 2);
  1009. +DECL_BITFIELD(GBASerializedMiscFlags, uint32_t)
  1010. +DECL_BIT(GBASerializedMiscFlags, Halted, 0)
  1011. +DECL_BIT(GBASerializedMiscFlags, POSTFLG, 1)
  1012. +DECL_BIT(GBASerializedMiscFlags, IrqPending, 2)
  1013. struct GBASerializedState {
  1014. uint32_t versionMagic;
  1015. diff --git a/include/mgba/internal/gba/sio.h b/include/mgba/internal/gba/sio.h
  1016. index 7a4e3ecfb..263def9b8 100644
  1017. --- a/include/mgba/internal/gba/sio.h
  1018. +++ b/include/mgba/internal/gba/sio.h
  1019. @@ -17,7 +17,7 @@ CXX_GUARD_START
  1020. extern const int GBASIOCyclesPerTransfer[4][MAX_GBAS];
  1021. -mLOG_DECLARE_CATEGORY(GBA_SIO);
  1022. +mLOG_DECLARE_CATEGORY(GBA_SIO)
  1023. enum {
  1024. RCNT_INITIAL = 0x8000
  1025. @@ -33,22 +33,22 @@ enum {
  1026. JOYSTAT_RECV_BIT = 2,
  1027. };
  1028. -DECL_BITFIELD(GBASIONormal, uint16_t);
  1029. -DECL_BIT(GBASIONormal, Sc, 0);
  1030. -DECL_BIT(GBASIONormal, InternalSc, 1);
  1031. -DECL_BIT(GBASIONormal, Si, 2);
  1032. -DECL_BIT(GBASIONormal, IdleSo, 3);
  1033. -DECL_BIT(GBASIONormal, Start, 7);
  1034. -DECL_BIT(GBASIONormal, Length, 12);
  1035. -DECL_BIT(GBASIONormal, Irq, 14);
  1036. -DECL_BITFIELD(GBASIOMultiplayer, uint16_t);
  1037. -DECL_BITS(GBASIOMultiplayer, Baud, 0, 2);
  1038. -DECL_BIT(GBASIOMultiplayer, Slave, 2);
  1039. -DECL_BIT(GBASIOMultiplayer, Ready, 3);
  1040. -DECL_BITS(GBASIOMultiplayer, Id, 4, 2);
  1041. -DECL_BIT(GBASIOMultiplayer, Error, 6);
  1042. -DECL_BIT(GBASIOMultiplayer, Busy, 7);
  1043. -DECL_BIT(GBASIOMultiplayer, Irq, 14);
  1044. +DECL_BITFIELD(GBASIONormal, uint16_t)
  1045. +DECL_BIT(GBASIONormal, Sc, 0)
  1046. +DECL_BIT(GBASIONormal, InternalSc, 1)
  1047. +DECL_BIT(GBASIONormal, Si, 2)
  1048. +DECL_BIT(GBASIONormal, IdleSo, 3)
  1049. +DECL_BIT(GBASIONormal, Start, 7)
  1050. +DECL_BIT(GBASIONormal, Length, 12)
  1051. +DECL_BIT(GBASIONormal, Irq, 14)
  1052. +DECL_BITFIELD(GBASIOMultiplayer, uint16_t)
  1053. +DECL_BITS(GBASIOMultiplayer, Baud, 0, 2)
  1054. +DECL_BIT(GBASIOMultiplayer, Slave, 2)
  1055. +DECL_BIT(GBASIOMultiplayer, Ready, 3)
  1056. +DECL_BITS(GBASIOMultiplayer, Id, 4, 2)
  1057. +DECL_BIT(GBASIOMultiplayer, Error, 6)
  1058. +DECL_BIT(GBASIOMultiplayer, Busy, 7)
  1059. +DECL_BIT(GBASIOMultiplayer, Irq, 14)
  1060. struct GBASIODriverSet {
  1061. struct GBASIODriver* normal;
  1062. diff --git a/include/mgba/internal/gba/timer.h b/include/mgba/internal/gba/timer.h
  1063. index 664842e6b..b10335f72 100644
  1064. --- a/include/mgba/internal/gba/timer.h
  1065. +++ b/include/mgba/internal/gba/timer.h
  1066. @@ -12,11 +12,11 @@ CXX_GUARD_START
  1067. #include <mgba/core/timing.h>
  1068. -DECL_BITFIELD(GBATimerFlags, uint32_t);
  1069. -DECL_BITS(GBATimerFlags, PrescaleBits, 0, 4);
  1070. -DECL_BIT(GBATimerFlags, CountUp, 4);
  1071. -DECL_BIT(GBATimerFlags, DoIrq, 5);
  1072. -DECL_BIT(GBATimerFlags, Enable, 6);
  1073. +DECL_BITFIELD(GBATimerFlags, uint32_t)
  1074. +DECL_BITS(GBATimerFlags, PrescaleBits, 0, 4)
  1075. +DECL_BIT(GBATimerFlags, CountUp, 4)
  1076. +DECL_BIT(GBATimerFlags, DoIrq, 5)
  1077. +DECL_BIT(GBATimerFlags, Enable, 6)
  1078. struct GBA;
  1079. struct GBATimer {
  1080. diff --git a/include/mgba/internal/gba/video.h b/include/mgba/internal/gba/video.h
  1081. index 77ff3cf0e..5cc14c18c 100644
  1082. --- a/include/mgba/internal/gba/video.h
  1083. +++ b/include/mgba/internal/gba/video.h
  1084. @@ -14,7 +14,7 @@ CXX_GUARD_START
  1085. #include <mgba/core/timing.h>
  1086. #include <mgba/gba/interface.h>
  1087. -mLOG_DECLARE_CATEGORY(GBA_VIDEO);
  1088. +mLOG_DECLARE_CATEGORY(GBA_VIDEO)
  1089. enum {
  1090. VIDEO_HBLANK_PIXELS = 68,
  1091. @@ -52,27 +52,27 @@ enum GBAVideoBlendEffect {
  1092. BLEND_DARKEN = 3
  1093. };
  1094. -DECL_BITFIELD(GBAObjAttributesA, uint16_t);
  1095. -DECL_BITS(GBAObjAttributesA, Y, 0, 8);
  1096. -DECL_BIT(GBAObjAttributesA, Transformed, 8);
  1097. -DECL_BIT(GBAObjAttributesA, Disable, 9);
  1098. -DECL_BIT(GBAObjAttributesA, DoubleSize, 9);
  1099. -DECL_BITS(GBAObjAttributesA, Mode, 10, 2);
  1100. -DECL_BIT(GBAObjAttributesA, Mosaic, 12);
  1101. -DECL_BIT(GBAObjAttributesA, 256Color, 13);
  1102. -DECL_BITS(GBAObjAttributesA, Shape, 14, 2);
  1103. -
  1104. -DECL_BITFIELD(GBAObjAttributesB, uint16_t);
  1105. -DECL_BITS(GBAObjAttributesB, X, 0, 9);
  1106. -DECL_BITS(GBAObjAttributesB, MatIndex, 9, 5);
  1107. -DECL_BIT(GBAObjAttributesB, HFlip, 12);
  1108. -DECL_BIT(GBAObjAttributesB, VFlip, 13);
  1109. -DECL_BITS(GBAObjAttributesB, Size, 14, 2);
  1110. -
  1111. -DECL_BITFIELD(GBAObjAttributesC, uint16_t);
  1112. -DECL_BITS(GBAObjAttributesC, Tile, 0, 10);
  1113. -DECL_BITS(GBAObjAttributesC, Priority, 10, 2);
  1114. -DECL_BITS(GBAObjAttributesC, Palette, 12, 4);
  1115. +DECL_BITFIELD(GBAObjAttributesA, uint16_t)
  1116. +DECL_BITS(GBAObjAttributesA, Y, 0, 8)
  1117. +DECL_BIT(GBAObjAttributesA, Transformed, 8)
  1118. +DECL_BIT(GBAObjAttributesA, Disable, 9)
  1119. +DECL_BIT(GBAObjAttributesA, DoubleSize, 9)
  1120. +DECL_BITS(GBAObjAttributesA, Mode, 10, 2)
  1121. +DECL_BIT(GBAObjAttributesA, Mosaic, 12)
  1122. +DECL_BIT(GBAObjAttributesA, 256Color, 13)
  1123. +DECL_BITS(GBAObjAttributesA, Shape, 14, 2)
  1124. +
  1125. +DECL_BITFIELD(GBAObjAttributesB, uint16_t)
  1126. +DECL_BITS(GBAObjAttributesB, X, 0, 9)
  1127. +DECL_BITS(GBAObjAttributesB, MatIndex, 9, 5)
  1128. +DECL_BIT(GBAObjAttributesB, HFlip, 12)
  1129. +DECL_BIT(GBAObjAttributesB, VFlip, 13)
  1130. +DECL_BITS(GBAObjAttributesB, Size, 14, 2)
  1131. +
  1132. +DECL_BITFIELD(GBAObjAttributesC, uint16_t)
  1133. +DECL_BITS(GBAObjAttributesC, Tile, 0, 10)
  1134. +DECL_BITS(GBAObjAttributesC, Priority, 10, 2)
  1135. +DECL_BITS(GBAObjAttributesC, Palette, 12, 4)
  1136. struct GBAObj {
  1137. GBAObjAttributesA a;
  1138. @@ -108,68 +108,68 @@ struct GBAVideoWindowRegion {
  1139. #define GBA_TEXT_MAP_VFLIP(MAP) ((MAP) & 0x0800)
  1140. #define GBA_TEXT_MAP_PALETTE(MAP) (((MAP) & 0xF000) >> 12)
  1141. -DECL_BITFIELD(GBARegisterDISPCNT, uint16_t);
  1142. -DECL_BITS(GBARegisterDISPCNT, Mode, 0, 3);
  1143. -DECL_BIT(GBARegisterDISPCNT, Cgb, 3);
  1144. -DECL_BIT(GBARegisterDISPCNT, FrameSelect, 4);
  1145. -DECL_BIT(GBARegisterDISPCNT, HblankIntervalFree, 5);
  1146. -DECL_BIT(GBARegisterDISPCNT, ObjCharacterMapping, 6);
  1147. -DECL_BIT(GBARegisterDISPCNT, ForcedBlank, 7);
  1148. -DECL_BIT(GBARegisterDISPCNT, Bg0Enable, 8);
  1149. -DECL_BIT(GBARegisterDISPCNT, Bg1Enable, 9);
  1150. -DECL_BIT(GBARegisterDISPCNT, Bg2Enable, 10);
  1151. -DECL_BIT(GBARegisterDISPCNT, Bg3Enable, 11);
  1152. -DECL_BIT(GBARegisterDISPCNT, ObjEnable, 12);
  1153. -DECL_BIT(GBARegisterDISPCNT, Win0Enable, 13);
  1154. -DECL_BIT(GBARegisterDISPCNT, Win1Enable, 14);
  1155. -DECL_BIT(GBARegisterDISPCNT, ObjwinEnable, 15);
  1156. -
  1157. -DECL_BITFIELD(GBARegisterDISPSTAT, uint16_t);
  1158. -DECL_BIT(GBARegisterDISPSTAT, InVblank, 0);
  1159. -DECL_BIT(GBARegisterDISPSTAT, InHblank, 1);
  1160. -DECL_BIT(GBARegisterDISPSTAT, Vcounter, 2);
  1161. -DECL_BIT(GBARegisterDISPSTAT, VblankIRQ, 3);
  1162. -DECL_BIT(GBARegisterDISPSTAT, HblankIRQ, 4);
  1163. -DECL_BIT(GBARegisterDISPSTAT, VcounterIRQ, 5);
  1164. -DECL_BITS(GBARegisterDISPSTAT, VcountSetting, 8, 8);
  1165. -
  1166. -DECL_BITFIELD(GBARegisterBGCNT, uint16_t);
  1167. -DECL_BITS(GBARegisterBGCNT, Priority, 0, 2);
  1168. -DECL_BITS(GBARegisterBGCNT, CharBase, 2, 2);
  1169. -DECL_BIT(GBARegisterBGCNT, Mosaic, 6);
  1170. -DECL_BIT(GBARegisterBGCNT, 256Color, 7);
  1171. -DECL_BITS(GBARegisterBGCNT, ScreenBase, 8, 5);
  1172. -DECL_BIT(GBARegisterBGCNT, Overflow, 13);
  1173. -DECL_BITS(GBARegisterBGCNT, Size, 14, 2);
  1174. -
  1175. -DECL_BITFIELD(GBARegisterBLDCNT, uint16_t);
  1176. -DECL_BIT(GBARegisterBLDCNT, Target1Bg0, 0);
  1177. -DECL_BIT(GBARegisterBLDCNT, Target1Bg1, 1);
  1178. -DECL_BIT(GBARegisterBLDCNT, Target1Bg2, 2);
  1179. -DECL_BIT(GBARegisterBLDCNT, Target1Bg3, 3);
  1180. -DECL_BIT(GBARegisterBLDCNT, Target1Obj, 4);
  1181. -DECL_BIT(GBARegisterBLDCNT, Target1Bd, 5);
  1182. -DECL_BITS(GBARegisterBLDCNT, Effect, 6, 2);
  1183. -DECL_BIT(GBARegisterBLDCNT, Target2Bg0, 8);
  1184. -DECL_BIT(GBARegisterBLDCNT, Target2Bg1, 9);
  1185. -DECL_BIT(GBARegisterBLDCNT, Target2Bg2, 10);
  1186. -DECL_BIT(GBARegisterBLDCNT, Target2Bg3, 11);
  1187. -DECL_BIT(GBARegisterBLDCNT, Target2Obj, 12);
  1188. -DECL_BIT(GBARegisterBLDCNT, Target2Bd, 13);
  1189. -
  1190. -DECL_BITFIELD(GBAWindowControl, uint8_t);
  1191. -DECL_BIT(GBAWindowControl, Bg0Enable, 0);
  1192. -DECL_BIT(GBAWindowControl, Bg1Enable, 1);
  1193. -DECL_BIT(GBAWindowControl, Bg2Enable, 2);
  1194. -DECL_BIT(GBAWindowControl, Bg3Enable, 3);
  1195. -DECL_BIT(GBAWindowControl, ObjEnable, 4);
  1196. -DECL_BIT(GBAWindowControl, BlendEnable, 5);
  1197. -
  1198. -DECL_BITFIELD(GBAMosaicControl, uint16_t);
  1199. -DECL_BITS(GBAMosaicControl, BgH, 0, 4);
  1200. -DECL_BITS(GBAMosaicControl, BgV, 4, 4);
  1201. -DECL_BITS(GBAMosaicControl, ObjH, 8, 4);
  1202. -DECL_BITS(GBAMosaicControl, ObjV, 12, 4);
  1203. +DECL_BITFIELD(GBARegisterDISPCNT, uint16_t)
  1204. +DECL_BITS(GBARegisterDISPCNT, Mode, 0, 3)
  1205. +DECL_BIT(GBARegisterDISPCNT, Cgb, 3)
  1206. +DECL_BIT(GBARegisterDISPCNT, FrameSelect, 4)
  1207. +DECL_BIT(GBARegisterDISPCNT, HblankIntervalFree, 5)
  1208. +DECL_BIT(GBARegisterDISPCNT, ObjCharacterMapping, 6)
  1209. +DECL_BIT(GBARegisterDISPCNT, ForcedBlank, 7)
  1210. +DECL_BIT(GBARegisterDISPCNT, Bg0Enable, 8)
  1211. +DECL_BIT(GBARegisterDISPCNT, Bg1Enable, 9)
  1212. +DECL_BIT(GBARegisterDISPCNT, Bg2Enable, 10)
  1213. +DECL_BIT(GBARegisterDISPCNT, Bg3Enable, 11)
  1214. +DECL_BIT(GBARegisterDISPCNT, ObjEnable, 12)
  1215. +DECL_BIT(GBARegisterDISPCNT, Win0Enable, 13)
  1216. +DECL_BIT(GBARegisterDISPCNT, Win1Enable, 14)
  1217. +DECL_BIT(GBARegisterDISPCNT, ObjwinEnable, 15)
  1218. +
  1219. +DECL_BITFIELD(GBARegisterDISPSTAT, uint16_t)
  1220. +DECL_BIT(GBARegisterDISPSTAT, InVblank, 0)
  1221. +DECL_BIT(GBARegisterDISPSTAT, InHblank, 1)
  1222. +DECL_BIT(GBARegisterDISPSTAT, Vcounter, 2)
  1223. +DECL_BIT(GBARegisterDISPSTAT, VblankIRQ, 3)
  1224. +DECL_BIT(GBARegisterDISPSTAT, HblankIRQ, 4)
  1225. +DECL_BIT(GBARegisterDISPSTAT, VcounterIRQ, 5)
  1226. +DECL_BITS(GBARegisterDISPSTAT, VcountSetting, 8, 8)
  1227. +
  1228. +DECL_BITFIELD(GBARegisterBGCNT, uint16_t)
  1229. +DECL_BITS(GBARegisterBGCNT, Priority, 0, 2)
  1230. +DECL_BITS(GBARegisterBGCNT, CharBase, 2, 2)
  1231. +DECL_BIT(GBARegisterBGCNT, Mosaic, 6)
  1232. +DECL_BIT(GBARegisterBGCNT, 256Color, 7)
  1233. +DECL_BITS(GBARegisterBGCNT, ScreenBase, 8, 5)
  1234. +DECL_BIT(GBARegisterBGCNT, Overflow, 13)
  1235. +DECL_BITS(GBARegisterBGCNT, Size, 14, 2)
  1236. +
  1237. +DECL_BITFIELD(GBARegisterBLDCNT, uint16_t)
  1238. +DECL_BIT(GBARegisterBLDCNT, Target1Bg0, 0)
  1239. +DECL_BIT(GBARegisterBLDCNT, Target1Bg1, 1)
  1240. +DECL_BIT(GBARegisterBLDCNT, Target1Bg2, 2)
  1241. +DECL_BIT(GBARegisterBLDCNT, Target1Bg3, 3)
  1242. +DECL_BIT(GBARegisterBLDCNT, Target1Obj, 4)
  1243. +DECL_BIT(GBARegisterBLDCNT, Target1Bd, 5)
  1244. +DECL_BITS(GBARegisterBLDCNT, Effect, 6, 2)
  1245. +DECL_BIT(GBARegisterBLDCNT, Target2Bg0, 8)
  1246. +DECL_BIT(GBARegisterBLDCNT, Target2Bg1, 9)
  1247. +DECL_BIT(GBARegisterBLDCNT, Target2Bg2, 10)
  1248. +DECL_BIT(GBARegisterBLDCNT, Target2Bg3, 11)
  1249. +DECL_BIT(GBARegisterBLDCNT, Target2Obj, 12)
  1250. +DECL_BIT(GBARegisterBLDCNT, Target2Bd, 13)
  1251. +
  1252. +DECL_BITFIELD(GBAWindowControl, uint8_t)
  1253. +DECL_BIT(GBAWindowControl, Bg0Enable, 0)
  1254. +DECL_BIT(GBAWindowControl, Bg1Enable, 1)
  1255. +DECL_BIT(GBAWindowControl, Bg2Enable, 2)
  1256. +DECL_BIT(GBAWindowControl, Bg3Enable, 3)
  1257. +DECL_BIT(GBAWindowControl, ObjEnable, 4)
  1258. +DECL_BIT(GBAWindowControl, BlendEnable, 5)
  1259. +
  1260. +DECL_BITFIELD(GBAMosaicControl, uint16_t)
  1261. +DECL_BITS(GBAMosaicControl, BgH, 0, 4)
  1262. +DECL_BITS(GBAMosaicControl, BgV, 4, 4)
  1263. +DECL_BITS(GBAMosaicControl, ObjH, 8, 4)
  1264. +DECL_BITS(GBAMosaicControl, ObjV, 12, 4)
  1265. struct GBAVideoRenderer {
  1266. void (*init)(struct GBAVideoRenderer* renderer);
  1267. diff --git a/src/arm/debugger/debugger.c b/src/arm/debugger/debugger.c
  1268. index 7449ece33..8e8f4b523 100644
  1269. --- a/src/arm/debugger/debugger.c
  1270. +++ b/src/arm/debugger/debugger.c
  1271. @@ -12,7 +12,7 @@
  1272. #include <mgba/internal/arm/debugger/memory-debugger.h>
  1273. #include <mgba/internal/debugger/parser.h>
  1274. -DEFINE_VECTOR(ARMDebugBreakpointList, struct ARMDebugBreakpoint);
  1275. +DEFINE_VECTOR(ARMDebugBreakpointList, struct ARMDebugBreakpoint)
  1276. static struct ARMDebugBreakpoint* _lookupBreakpoint(struct ARMDebugBreakpointList* breakpoints, uint32_t address) {
  1277. size_t i;
  1278. diff --git a/src/arm/isa-arm.c b/src/arm/isa-arm.c
  1279. index 68a9726dc..46dfb8bae 100644
  1280. --- a/src/arm/isa-arm.c
  1281. +++ b/src/arm/isa-arm.c
  1282. @@ -682,7 +682,7 @@ DEFINE_INSTRUCTION_ARM(MRC, ARM_STUB)
  1283. // Begin miscellaneous definitions
  1284. -DEFINE_INSTRUCTION_ARM(BKPT, cpu->irqh.bkpt32(cpu, ((opcode >> 4) & 0xFFF0) | (opcode & 0xF))); // Not strictly in ARMv4T, but here for convenience
  1285. +DEFINE_INSTRUCTION_ARM(BKPT, cpu->irqh.bkpt32(cpu, ((opcode >> 4) & 0xFFF0) | (opcode & 0xF))) // Not strictly in ARMv4T, but here for convenience
  1286. DEFINE_INSTRUCTION_ARM(ILL, ARM_ILL) // Illegal opcode
  1287. DEFINE_INSTRUCTION_ARM(MSR,
  1288. diff --git a/src/core/cache-set.c b/src/core/cache-set.c
  1289. index a638c786e..f107fca04 100644
  1290. --- a/src/core/cache-set.c
  1291. +++ b/src/core/cache-set.c
  1292. @@ -5,9 +5,9 @@
  1293. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  1294. #include <mgba/core/cache-set.h>
  1295. -DEFINE_VECTOR(mMapCacheSet, struct mMapCache);
  1296. -DEFINE_VECTOR(mBitmapCacheSet, struct mBitmapCache);
  1297. -DEFINE_VECTOR(mTileCacheSet, struct mTileCache);
  1298. +DEFINE_VECTOR(mMapCacheSet, struct mMapCache)
  1299. +DEFINE_VECTOR(mBitmapCacheSet, struct mBitmapCache)
  1300. +DEFINE_VECTOR(mTileCacheSet, struct mTileCache)
  1301. void mCacheSetInit(struct mCacheSet* cache, size_t nMaps, size_t nBitmaps, size_t nTiles) {
  1302. mMapCacheSetInit(&cache->maps, nMaps);
  1303. diff --git a/src/core/cheats.c b/src/core/cheats.c
  1304. index acd994393..92b6ff481 100644
  1305. --- a/src/core/cheats.c
  1306. +++ b/src/core/cheats.c
  1307. @@ -14,10 +14,10 @@
  1308. const uint32_t M_CHEAT_DEVICE_ID = 0xABADC0DE;
  1309. -mLOG_DEFINE_CATEGORY(CHEATS, "Cheats", "core.cheats");
  1310. +mLOG_DEFINE_CATEGORY(CHEATS, "Cheats", "core.cheats")
  1311. -DEFINE_VECTOR(mCheatList, struct mCheat);
  1312. -DEFINE_VECTOR(mCheatSets, struct mCheatSet*);
  1313. +DEFINE_VECTOR(mCheatList, struct mCheat)
  1314. +DEFINE_VECTOR(mCheatSets, struct mCheatSet*)
  1315. static int32_t _readMem(struct mCore* core, uint32_t address, int width) {
  1316. switch (width) {
  1317. diff --git a/src/core/input.c b/src/core/input.c
  1318. index fe24d0822..fab88a50e 100644
  1319. --- a/src/core/input.c
  1320. +++ b/src/core/input.c
  1321. @@ -16,8 +16,8 @@
  1322. #define KEY_VALUE_MAX 16
  1323. #define AXIS_INFO_MAX 12
  1324. -DECLARE_VECTOR(mInputHatList, struct mInputHatBindings);
  1325. -DEFINE_VECTOR(mInputHatList, struct mInputHatBindings);
  1326. +DECLARE_VECTOR(mInputHatList, struct mInputHatBindings)
  1327. +DEFINE_VECTOR(mInputHatList, struct mInputHatBindings)
  1328. struct mInputMapImpl {
  1329. int* map;
  1330. diff --git a/src/core/interface.c b/src/core/interface.c
  1331. index 961b83619..e6288e274 100644
  1332. --- a/src/core/interface.c
  1333. +++ b/src/core/interface.c
  1334. @@ -8,7 +8,7 @@
  1335. #include <mgba/core/core.h>
  1336. #include <mgba/core/serialize.h>
  1337. -DEFINE_VECTOR(mCoreCallbacksList, struct mCoreCallbacks);
  1338. +DEFINE_VECTOR(mCoreCallbacksList, struct mCoreCallbacks)
  1339. static void _rtcGenericSample(struct mRTCSource* source) {
  1340. struct mRTCGenericSource* rtc = (struct mRTCGenericSource*) source;
  1341. diff --git a/src/core/library.c b/src/core/library.c
  1342. index 60e16592f..61c144a02 100644
  1343. --- a/src/core/library.c
  1344. +++ b/src/core/library.c
  1345. @@ -13,7 +13,7 @@
  1346. #include <sqlite3.h>
  1347. #include "feature/sqlite3/no-intro.h"
  1348. -DEFINE_VECTOR(mLibraryListing, struct mLibraryEntry);
  1349. +DEFINE_VECTOR(mLibraryListing, struct mLibraryEntry)
  1350. struct mLibrary {
  1351. sqlite3* db;
  1352. diff --git a/src/core/mem-search.c b/src/core/mem-search.c
  1353. index 7f0c215a1..8ffa540d5 100644
  1354. --- a/src/core/mem-search.c
  1355. +++ b/src/core/mem-search.c
  1356. @@ -8,7 +8,7 @@
  1357. #include <mgba/core/core.h>
  1358. #include <mgba/core/interface.h>
  1359. -DEFINE_VECTOR(mCoreMemorySearchResults, struct mCoreMemorySearchResult);
  1360. +DEFINE_VECTOR(mCoreMemorySearchResults, struct mCoreMemorySearchResult)
  1361. static bool _op(int32_t value, int32_t match, enum mCoreMemorySearchOp op) {
  1362. switch (op) {
  1363. diff --git a/src/core/rewind.c b/src/core/rewind.c
  1364. index 3a554ff4e..41a6ce3db 100644
  1365. --- a/src/core/rewind.c
  1366. +++ b/src/core/rewind.c
  1367. @@ -10,7 +10,7 @@
  1368. #include <mgba-util/patch/fast.h>
  1369. #include <mgba-util/vfs.h>
  1370. -DEFINE_VECTOR(mCoreRewindPatches, struct PatchFast);
  1371. +DEFINE_VECTOR(mCoreRewindPatches, struct PatchFast)
  1372. void _rewindDiff(struct mCoreRewindContext* context);
  1373. diff --git a/src/core/serialize.c b/src/core/serialize.c
  1374. index ed99107dd..800076f7b 100644
  1375. --- a/src/core/serialize.c
  1376. +++ b/src/core/serialize.c
  1377. @@ -17,7 +17,7 @@
  1378. #include <zlib.h>
  1379. #endif
  1380. -mLOG_DEFINE_CATEGORY(SAVESTATE, "Savestate", "core.serialize");
  1381. +mLOG_DEFINE_CATEGORY(SAVESTATE, "Savestate", "core.serialize")
  1382. struct mBundledState {
  1383. size_t stateSize;
  1384. diff --git a/src/debugger/debugger.c b/src/debugger/debugger.c
  1385. index 675e04698..b894c341a 100644
  1386. --- a/src/debugger/debugger.c
  1387. +++ b/src/debugger/debugger.c
  1388. @@ -20,10 +20,10 @@
  1389. const uint32_t DEBUGGER_ID = 0xDEADBEEF;
  1390. -mLOG_DEFINE_CATEGORY(DEBUGGER, "Debugger", "core.debugger");
  1391. +mLOG_DEFINE_CATEGORY(DEBUGGER, "Debugger", "core.debugger")
  1392. -DEFINE_VECTOR(mBreakpointList, struct mBreakpoint);
  1393. -DEFINE_VECTOR(mWatchpointList, struct mWatchpoint);
  1394. +DEFINE_VECTOR(mBreakpointList, struct mBreakpoint)
  1395. +DEFINE_VECTOR(mWatchpointList, struct mWatchpoint)
  1396. static void mDebuggerInit(void* cpu, struct mCPUComponent* component);
  1397. static void mDebuggerDeinit(struct mCPUComponent* component);
  1398. diff --git a/src/debugger/parser.c b/src/debugger/parser.c
  1399. index 41197b53e..ea94c7600 100644
  1400. --- a/src/debugger/parser.c
  1401. +++ b/src/debugger/parser.c
  1402. @@ -9,7 +9,7 @@
  1403. #include <mgba/debugger/debugger.h>
  1404. #include <mgba-util/string.h>
  1405. -DEFINE_VECTOR(LexVector, struct Token);
  1406. +DEFINE_VECTOR(LexVector, struct Token)
  1407. enum LexState {
  1408. LEX_ERROR = -1,
  1409. diff --git a/src/gb/cheats.c b/src/gb/cheats.c
  1410. index 5c202782c..a157e3e28 100644
  1411. --- a/src/gb/cheats.c
  1412. +++ b/src/gb/cheats.c
  1413. @@ -10,7 +10,7 @@
  1414. #include <mgba/internal/gb/memory.h>
  1415. #include <mgba-util/string.h>
  1416. -DEFINE_VECTOR(GBCheatPatchList, struct GBCheatPatch);
  1417. +DEFINE_VECTOR(GBCheatPatchList, struct GBCheatPatch)
  1418. static void _patchROM(struct mCheatDevice* device, struct GBCheatSet* cheats) {
  1419. if (!device->p) {
  1420. diff --git a/src/gb/gb.c b/src/gb/gb.c
  1421. index 461b574a6..e34f17d6a 100644
  1422. --- a/src/gb/gb.c
  1423. +++ b/src/gb/gb.c
  1424. @@ -33,7 +33,7 @@ static const uint8_t _knownHeader[4] = { 0xCE, 0xED, 0x66, 0x66};
  1425. #define SGB2_BIOS_CHECKSUM 0X53D0DD63
  1426. #define CGB_BIOS_CHECKSUM 0x41884E46
  1427. -mLOG_DEFINE_CATEGORY(GB, "GB", "gb");
  1428. +mLOG_DEFINE_CATEGORY(GB, "GB", "gb")
  1429. static void GBInit(void* cpu, struct mCPUComponent* component);
  1430. static void GBDeinit(struct mCPUComponent* component);
  1431. diff --git a/src/gb/io.c b/src/gb/io.c
  1432. index 535e0995a..9e0727b98 100644
  1433. --- a/src/gb/io.c
  1434. +++ b/src/gb/io.c
  1435. @@ -9,7 +9,7 @@
  1436. #include <mgba/internal/gb/sio.h>
  1437. #include <mgba/internal/gb/serialize.h>
  1438. -mLOG_DEFINE_CATEGORY(GB_IO, "GB I/O", "gb.io");
  1439. +mLOG_DEFINE_CATEGORY(GB_IO, "GB I/O", "gb.io")
  1440. MGBA_EXPORT const char* const GBIORegisterNames[] = {
  1441. [REG_JOYP] = "JOYP",
  1442. diff --git a/src/gb/mbc.c b/src/gb/mbc.c
  1443. index 6014a200c..333d1e576 100644
  1444. --- a/src/gb/mbc.c
  1445. +++ b/src/gb/mbc.c
  1446. @@ -14,7 +14,7 @@
  1447. const uint32_t GB_LOGO_HASH = 0x46195417;
  1448. -mLOG_DEFINE_CATEGORY(GB_MBC, "GB MBC", "gb.mbc");
  1449. +mLOG_DEFINE_CATEGORY(GB_MBC, "GB MBC", "gb.mbc")
  1450. static void _GBMBCNone(struct GB* gb, uint16_t address, uint8_t value) {
  1451. UNUSED(gb);
  1452. diff --git a/src/gb/memory.c b/src/gb/memory.c
  1453. index a5c047d0f..5aa3ec204 100644
  1454. --- a/src/gb/memory.c
  1455. +++ b/src/gb/memory.c
  1456. @@ -14,7 +14,7 @@
  1457. #include <mgba-util/memory.h>
  1458. -mLOG_DEFINE_CATEGORY(GB_MEM, "GB Memory", "gb.memory");
  1459. +mLOG_DEFINE_CATEGORY(GB_MEM, "GB Memory", "gb.memory")
  1460. static const uint8_t _yankBuffer[] = { 0xFF };
  1461. diff --git a/src/gb/serialize.c b/src/gb/serialize.c
  1462. index 0c1884c67..3568971da 100644
  1463. --- a/src/gb/serialize.c
  1464. +++ b/src/gb/serialize.c
  1465. @@ -11,7 +11,7 @@
  1466. #include <mgba-util/memory.h>
  1467. -mLOG_DEFINE_CATEGORY(GB_STATE, "GB Savestate", "gb.serialize");
  1468. +mLOG_DEFINE_CATEGORY(GB_STATE, "GB Savestate", "gb.serialize")
  1469. const uint32_t GB_SAVESTATE_MAGIC = 0x00400000;
  1470. const uint32_t GB_SAVESTATE_VERSION = 0x00000002;
  1471. diff --git a/src/gb/sio.c b/src/gb/sio.c
  1472. index f2bb20fe8..6ffb98775 100644
  1473. --- a/src/gb/sio.c
  1474. +++ b/src/gb/sio.c
  1475. @@ -9,7 +9,7 @@
  1476. #include <mgba/internal/gb/io.h>
  1477. #include <mgba/internal/gb/serialize.h>
  1478. -mLOG_DEFINE_CATEGORY(GB_SIO, "GB Serial I/O", "gb.sio");
  1479. +mLOG_DEFINE_CATEGORY(GB_SIO, "GB Serial I/O", "gb.sio")
  1480. const int GBSIOCyclesPerTransfer[2] = {
  1481. 512,
  1482. diff --git a/src/gba/audio.c b/src/gba/audio.c
  1483. index 72f49b7e3..48febf959 100644
  1484. --- a/src/gba/audio.c
  1485. +++ b/src/gba/audio.c
  1486. @@ -20,7 +20,7 @@
  1487. #define blip_add_delta blip_add_delta_fast
  1488. #endif
  1489. -mLOG_DEFINE_CATEGORY(GBA_AUDIO, "GBA Audio", "gba.audio");
  1490. +mLOG_DEFINE_CATEGORY(GBA_AUDIO, "GBA Audio", "gba.audio")
  1491. const unsigned GBA_AUDIO_SAMPLES = 2048;
  1492. const unsigned GBA_AUDIO_FIFO_SIZE = 8 * sizeof(int32_t);
  1493. diff --git a/src/gba/bios.c b/src/gba/bios.c
  1494. index 0a7982ad5..c9c96d72d 100644
  1495. --- a/src/gba/bios.c
  1496. +++ b/src/gba/bios.c
  1497. @@ -15,7 +15,7 @@
  1498. const uint32_t GBA_BIOS_CHECKSUM = 0xBAAE187F;
  1499. const uint32_t GBA_DS_BIOS_CHECKSUM = 0xBAAE1880;
  1500. -mLOG_DEFINE_CATEGORY(GBA_BIOS, "GBA BIOS", "gba.bios");
  1501. +mLOG_DEFINE_CATEGORY(GBA_BIOS, "GBA BIOS", "gba.bios")
  1502. static void _unLz77(struct GBA* gba, int width);
  1503. static void _unHuffman(struct GBA* gba);
  1504. @@ -681,10 +681,10 @@ static void _unLz77(struct GBA* gba, int width) {
  1505. cpu->gprs[3] = 0;
  1506. }
  1507. -DECL_BITFIELD(HuffmanNode, uint8_t);
  1508. -DECL_BITS(HuffmanNode, Offset, 0, 6);
  1509. -DECL_BIT(HuffmanNode, RTerm, 6);
  1510. -DECL_BIT(HuffmanNode, LTerm, 7);
  1511. +DECL_BITFIELD(HuffmanNode, uint8_t)
  1512. +DECL_BITS(HuffmanNode, Offset, 0, 6)
  1513. +DECL_BIT(HuffmanNode, RTerm, 6)
  1514. +DECL_BIT(HuffmanNode, LTerm, 7)
  1515. static void _unHuffman(struct GBA* gba) {
  1516. struct ARMCore* cpu = gba->cpu;
  1517. diff --git a/src/gba/dma.c b/src/gba/dma.c
  1518. index 2c112716f..cccff346e 100644
  1519. --- a/src/gba/dma.c
  1520. +++ b/src/gba/dma.c
  1521. @@ -102,7 +102,7 @@ uint16_t GBADMAWriteCNT_HI(struct GBA* gba, int dma, uint16_t control) {
  1522. }
  1523. // If the DMA has already occurred, this value might have changed since the function started
  1524. return currentDma->reg;
  1525. -};
  1526. +}
  1527. void GBADMASchedule(struct GBA* gba, int number, struct GBADMA* info) {
  1528. switch (GBADMARegisterGetTiming(info->reg)) {
  1529. diff --git a/src/gba/extra/battlechip.c b/src/gba/extra/battlechip.c
  1530. index ae8aedff0..1731fb20f 100644
  1531. --- a/src/gba/extra/battlechip.c
  1532. +++ b/src/gba/extra/battlechip.c
  1533. @@ -9,8 +9,8 @@
  1534. #include <mgba/internal/gba/io.h>
  1535. #include <mgba/internal/gba/sio.h>
  1536. -mLOG_DECLARE_CATEGORY(GBA_BATTLECHIP);
  1537. -mLOG_DEFINE_CATEGORY(GBA_BATTLECHIP, "GBA BattleChip Gate", "gba.battlechip");
  1538. +mLOG_DECLARE_CATEGORY(GBA_BATTLECHIP)
  1539. +mLOG_DEFINE_CATEGORY(GBA_BATTLECHIP, "GBA BattleChip Gate", "gba.battlechip")
  1540. enum {
  1541. BATTLECHIP_STATE_SYNC = -1,
  1542. diff --git a/src/gba/gba.c b/src/gba/gba.c
  1543. index 07043c8eb..02b7cee16 100644
  1544. --- a/src/gba/gba.c
  1545. +++ b/src/gba/gba.c
  1546. @@ -27,8 +27,8 @@
  1547. #define GBA_IRQ_DELAY 7
  1548. -mLOG_DEFINE_CATEGORY(GBA, "GBA", "gba");
  1549. -mLOG_DEFINE_CATEGORY(GBA_DEBUG, "GBA Debug", "gba.debug");
  1550. +mLOG_DEFINE_CATEGORY(GBA, "GBA", "gba")
  1551. +mLOG_DEFINE_CATEGORY(GBA_DEBUG, "GBA Debug", "gba.debug")
  1552. const uint32_t GBA_COMPONENT_MAGIC = 0x1000000;
  1553. diff --git a/src/gba/hardware.c b/src/gba/hardware.c
  1554. index 5ee4c55e8..cb7ac44d6 100644
  1555. --- a/src/gba/hardware.c
  1556. +++ b/src/gba/hardware.c
  1557. @@ -11,7 +11,7 @@
  1558. #include <mgba-util/formatting.h>
  1559. #include <mgba-util/hash.h>
  1560. -mLOG_DEFINE_CATEGORY(GBA_HW, "GBA Pak Hardware", "gba.hardware");
  1561. +mLOG_DEFINE_CATEGORY(GBA_HW, "GBA Pak Hardware", "gba.hardware")
  1562. MGBA_EXPORT const int GBA_LUX_LEVELS[10] = { 5, 11, 18, 27, 42, 62, 84, 109, 139, 183 };
  1563. diff --git a/src/gba/io.c b/src/gba/io.c
  1564. index 209335ec6..5df243b49 100644
  1565. --- a/src/gba/io.c
  1566. +++ b/src/gba/io.c
  1567. @@ -11,7 +11,7 @@
  1568. #include <mgba/internal/gba/rr/rr.h>
  1569. #include <mgba/internal/gba/serialize.h>
  1570. -mLOG_DEFINE_CATEGORY(GBA_IO, "GBA I/O", "gba.io");
  1571. +mLOG_DEFINE_CATEGORY(GBA_IO, "GBA I/O", "gba.io")
  1572. const char* const GBAIORegisterNames[] = {
  1573. // Video
  1574. diff --git a/src/gba/memory.c b/src/gba/memory.c
  1575. index d2ba5a419..d2a8e8280 100644
  1576. --- a/src/gba/memory.c
  1577. +++ b/src/gba/memory.c
  1578. @@ -19,7 +19,7 @@
  1579. #define IDLE_LOOP_THRESHOLD 10000
  1580. -mLOG_DEFINE_CATEGORY(GBA_MEM, "GBA Memory", "gba.memory");
  1581. +mLOG_DEFINE_CATEGORY(GBA_MEM, "GBA Memory", "gba.memory")
  1582. static void _pristineCow(struct GBA* gba);
  1583. static void _agbPrintStore(struct GBA* gba, uint32_t address, int16_t value);
  1584. diff --git a/src/gba/savedata.c b/src/gba/savedata.c
  1585. index 39a805725..70b18d93a 100644
  1586. --- a/src/gba/savedata.c
  1587. +++ b/src/gba/savedata.c
  1588. @@ -26,7 +26,7 @@
  1589. #define EEPROM_SETTLE_CYCLES 115000
  1590. #define CLEANUP_THRESHOLD 15
  1591. -mLOG_DEFINE_CATEGORY(GBA_SAVE, "GBA Savedata", "gba.savedata");
  1592. +mLOG_DEFINE_CATEGORY(GBA_SAVE, "GBA Savedata", "gba.savedata")
  1593. static void _flashSwitchBank(struct GBASavedata* savedata, int bank);
  1594. static void _flashErase(struct GBASavedata* savedata);
  1595. diff --git a/src/gba/serialize.c b/src/gba/serialize.c
  1596. index 6f09e3005..8741d40e8 100644
  1597. --- a/src/gba/serialize.c
  1598. +++ b/src/gba/serialize.c
  1599. @@ -18,7 +18,7 @@
  1600. const uint32_t GBA_SAVESTATE_MAGIC = 0x01000000;
  1601. const uint32_t GBA_SAVESTATE_VERSION = 0x00000003;
  1602. -mLOG_DEFINE_CATEGORY(GBA_STATE, "GBA Savestate", "gba.serialize");
  1603. +mLOG_DEFINE_CATEGORY(GBA_STATE, "GBA Savestate", "gba.serialize")
  1604. struct GBABundledState {
  1605. struct GBASerializedState* state;
  1606. diff --git a/src/gba/sio.c b/src/gba/sio.c
  1607. index a153cb1fa..e5cbf97ba 100644
  1608. --- a/src/gba/sio.c
  1609. +++ b/src/gba/sio.c
  1610. @@ -8,7 +8,7 @@
  1611. #include <mgba/internal/gba/gba.h>
  1612. #include <mgba/internal/gba/io.h>
  1613. -mLOG_DEFINE_CATEGORY(GBA_SIO, "GBA Serial I/O", "gba.sio");
  1614. +mLOG_DEFINE_CATEGORY(GBA_SIO, "GBA Serial I/O", "gba.sio")
  1615. const int GBASIOCyclesPerTransfer[4][MAX_GBAS] = {
  1616. { 38326, 73003, 107680, 142356 },
  1617. diff --git a/src/gba/video.c b/src/gba/video.c
  1618. index a05d6a7f0..f3dc99db4 100644
  1619. --- a/src/gba/video.c
  1620. +++ b/src/gba/video.c
  1621. @@ -16,7 +16,7 @@
  1622. #include <mgba-util/memory.h>
  1623. -mLOG_DEFINE_CATEGORY(GBA_VIDEO, "GBA Video", "gba.video");
  1624. +mLOG_DEFINE_CATEGORY(GBA_VIDEO, "GBA Video", "gba.video")
  1625. static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer);
  1626. static void GBAVideoDummyRendererReset(struct GBAVideoRenderer* renderer);
  1627. diff --git a/src/platform/opengl/gles2.c b/src/platform/opengl/gles2.c
  1628. index fbb0fa601..af959d410 100644
  1629. --- a/src/platform/opengl/gles2.c
  1630. +++ b/src/platform/opengl/gles2.c
  1631. @@ -12,8 +12,8 @@
  1632. #include <mgba-util/vector.h>
  1633. #include <mgba-util/vfs.h>
  1634. -mLOG_DECLARE_CATEGORY(OPENGL);
  1635. -mLOG_DEFINE_CATEGORY(OPENGL, "OpenGL", "video.ogl");
  1636. +mLOG_DECLARE_CATEGORY(OPENGL)
  1637. +mLOG_DEFINE_CATEGORY(OPENGL, "OpenGL", "video.ogl")
  1638. #define MAX_PASSES 8
  1639. @@ -626,8 +626,8 @@ static bool _lookupBoolValue(const struct Configuration* config, const char* sec
  1640. return true;
  1641. }
  1642. -DECLARE_VECTOR(mGLES2UniformList, struct mGLES2Uniform);
  1643. -DEFINE_VECTOR(mGLES2UniformList, struct mGLES2Uniform);
  1644. +DECLARE_VECTOR(mGLES2UniformList, struct mGLES2Uniform)
  1645. +DEFINE_VECTOR(mGLES2UniformList, struct mGLES2Uniform)
  1646. static void _uniformHandler(const char* sectionName, void* user) {
  1647. struct mGLES2UniformList* uniforms = user;
  1648. diff --git a/src/platform/sdl/sdl-audio.c b/src/platform/sdl/sdl-audio.c
  1649. index f1666aa4e..85f9d761a 100644
  1650. --- a/src/platform/sdl/sdl-audio.c
  1651. +++ b/src/platform/sdl/sdl-audio.c
  1652. @@ -14,7 +14,7 @@
  1653. #define BUFFER_SIZE (GBA_AUDIO_SAMPLES >> 2)
  1654. -mLOG_DEFINE_CATEGORY(SDL_AUDIO, "SDL Audio", "platform.sdl.audio");
  1655. +mLOG_DEFINE_CATEGORY(SDL_AUDIO, "SDL Audio", "platform.sdl.audio")
  1656. static void _mSDLAudioCallback(void* context, Uint8* data, int len);
  1657. diff --git a/src/platform/sdl/sdl-audio.h b/src/platform/sdl/sdl-audio.h
  1658. index 2ae920af4..b131c7d2f 100644
  1659. --- a/src/platform/sdl/sdl-audio.h
  1660. +++ b/src/platform/sdl/sdl-audio.h
  1661. @@ -22,7 +22,7 @@ CXX_GUARD_START
  1662. #define bool _Bool
  1663. #endif
  1664. -mLOG_DECLARE_CATEGORY(SDL_AUDIO);
  1665. +mLOG_DECLARE_CATEGORY(SDL_AUDIO)
  1666. struct mSDLAudio {
  1667. // Input
  1668. diff --git a/src/platform/sdl/sdl-events.c b/src/platform/sdl/sdl-events.c
  1669. index c7291ff32..0a4a26310 100644
  1670. --- a/src/platform/sdl/sdl-events.c
  1671. +++ b/src/platform/sdl/sdl-events.c
  1672. @@ -25,9 +25,9 @@
  1673. #define RUMBLE_PWM 16
  1674. #define RUMBLE_STEPS 2
  1675. -mLOG_DEFINE_CATEGORY(SDL_EVENTS, "SDL Events", "platform.sdl.events");
  1676. +mLOG_DEFINE_CATEGORY(SDL_EVENTS, "SDL Events", "platform.sdl.events")
  1677. -DEFINE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo);
  1678. +DEFINE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo)
  1679. #if SDL_VERSION_ATLEAST(2, 0, 0)
  1680. static void _mSDLSetRumble(struct mRumble* rumble, int enable);
  1681. diff --git a/src/platform/sdl/sdl-events.h b/src/platform/sdl/sdl-events.h
  1682. index 8cb1aede2..8998449a2 100644
  1683. --- a/src/platform/sdl/sdl-events.h
  1684. +++ b/src/platform/sdl/sdl-events.h
  1685. @@ -25,7 +25,7 @@ CXX_GUARD_START
  1686. #define bool _Bool
  1687. #endif
  1688. -mLOG_DECLARE_CATEGORY(SDL_EVENTS);
  1689. +mLOG_DECLARE_CATEGORY(SDL_EVENTS)
  1690. #define SDL_BINDING_KEY 0x53444C4BU
  1691. #define SDL_BINDING_BUTTON 0x53444C42U
  1692. @@ -45,7 +45,7 @@ struct SDL_JoystickCombo {
  1693. #endif
  1694. };
  1695. -DECLARE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo);
  1696. +DECLARE_VECTOR(SDL_JoystickList, struct SDL_JoystickCombo)
  1697. struct mSDLPlayer;
  1698. struct mSDLEvents {
  1699. diff --git a/src/sm83/decoder.c b/src/sm83/decoder.c
  1700. index 949a8119a..7d9ae040f 100644
  1701. --- a/src/sm83/decoder.c
  1702. +++ b/src/sm83/decoder.c
  1703. @@ -75,20 +75,20 @@ DEFINE_DECODER_SM83(NOP, info->mnemonic = SM83_MN_NOP;)
  1704. info->op1.reg = SM83_REG_ ## NAME; \
  1705. return 2;)
  1706. -DEFINE_LD_DECODER_SM83(B);
  1707. -DEFINE_LD_DECODER_SM83(C);
  1708. -DEFINE_LD_DECODER_SM83(D);
  1709. -DEFINE_LD_DECODER_SM83(E);
  1710. -DEFINE_LD_DECODER_SM83(H);
  1711. -DEFINE_LD_DECODER_SM83(L);
  1712. -DEFINE_LD_DECODER_SM83(A);
  1713. -DEFINE_LD_DECODER_SM83_MEM(A, BC);
  1714. -DEFINE_LD_DECODER_SM83_MEM(A, DE);
  1715. -
  1716. -DEFINE_LD_2_DECODER_SM83(BC);
  1717. -DEFINE_LD_2_DECODER_SM83(DE);
  1718. -DEFINE_LD_2_DECODER_SM83(HL);
  1719. -DEFINE_LD_2_DECODER_SM83(SP);
  1720. +DEFINE_LD_DECODER_SM83(B)
  1721. +DEFINE_LD_DECODER_SM83(C)
  1722. +DEFINE_LD_DECODER_SM83(D)
  1723. +DEFINE_LD_DECODER_SM83(E)
  1724. +DEFINE_LD_DECODER_SM83(H)
  1725. +DEFINE_LD_DECODER_SM83(L)
  1726. +DEFINE_LD_DECODER_SM83(A)
  1727. +DEFINE_LD_DECODER_SM83_MEM(A, BC)
  1728. +DEFINE_LD_DECODER_SM83_MEM(A, DE)
  1729. +
  1730. +DEFINE_LD_2_DECODER_SM83(BC)
  1731. +DEFINE_LD_2_DECODER_SM83(DE)
  1732. +DEFINE_LD_2_DECODER_SM83(HL)
  1733. +DEFINE_LD_2_DECODER_SM83(SP)
  1734. DEFINE_DECODER_SM83(LDHL_, \
  1735. info->mnemonic = SM83_MN_LD; \
  1736. @@ -157,16 +157,16 @@ DEFINE_DECODER_SM83(LDIOA, \
  1737. return 1;) \
  1738. DEFINE_ALU_DECODER_SM83_NOHL(NAME)
  1739. -DEFINE_ALU_DECODER_SM83_NOHL(INC);
  1740. -DEFINE_ALU_DECODER_SM83_NOHL(DEC);
  1741. -DEFINE_ALU_DECODER_SM83(AND);
  1742. -DEFINE_ALU_DECODER_SM83(XOR);
  1743. -DEFINE_ALU_DECODER_SM83(OR);
  1744. -DEFINE_ALU_DECODER_SM83(CP);
  1745. -DEFINE_ALU_DECODER_SM83(ADD);
  1746. -DEFINE_ALU_DECODER_SM83(ADC);
  1747. -DEFINE_ALU_DECODER_SM83(SUB);
  1748. -DEFINE_ALU_DECODER_SM83(SBC);
  1749. +DEFINE_ALU_DECODER_SM83_NOHL(INC)
  1750. +DEFINE_ALU_DECODER_SM83_NOHL(DEC)
  1751. +DEFINE_ALU_DECODER_SM83(AND)
  1752. +DEFINE_ALU_DECODER_SM83(XOR)
  1753. +DEFINE_ALU_DECODER_SM83(OR)
  1754. +DEFINE_ALU_DECODER_SM83(CP)
  1755. +DEFINE_ALU_DECODER_SM83(ADD)
  1756. +DEFINE_ALU_DECODER_SM83(ADC)
  1757. +DEFINE_ALU_DECODER_SM83(SUB)
  1758. +DEFINE_ALU_DECODER_SM83(SBC)
  1759. #define DEFINE_ALU_DECODER_SM83_ADD_HL(REG) \
  1760. DEFINE_DECODER_SM83(ADDHL_ ## REG, info->mnemonic = SM83_MN_ADD; \
  1761. @@ -213,10 +213,10 @@ DEFINE_DECODER_SM83(ADDSP, info->mnemonic = SM83_MN_ADD; \
  1762. info->mnemonic = SM83_MN_RET; \
  1763. info->condition = CONDITION;)
  1764. -DEFINE_CONDITIONAL_DECODER_SM83(JP);
  1765. -DEFINE_CONDITIONAL_DECODER_SM83(JR);
  1766. -DEFINE_CONDITIONAL_DECODER_SM83(CALL);
  1767. -DEFINE_CONDITIONAL_DECODER_SM83(RET);
  1768. +DEFINE_CONDITIONAL_DECODER_SM83(JP)
  1769. +DEFINE_CONDITIONAL_DECODER_SM83(JR)
  1770. +DEFINE_CONDITIONAL_DECODER_SM83(CALL)
  1771. +DEFINE_CONDITIONAL_DECODER_SM83(RET)
  1772. DEFINE_DECODER_SM83(JPHL, \
  1773. info->mnemonic = SM83_MN_JP; \
  1774. @@ -282,10 +282,10 @@ DEFINE_DECODER_SM83(LDA_DHL, \
  1775. DEFINE_DECODER_SM83(INC ## REG, info->mnemonic = SM83_MN_INC; info->op1.reg = SM83_REG_ ## REG) \
  1776. DEFINE_DECODER_SM83(DEC ## REG, info->mnemonic = SM83_MN_DEC; info->op1.reg = SM83_REG_ ## REG)
  1777. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(BC);
  1778. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(DE);
  1779. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(HL);
  1780. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(SP);
  1781. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(BC)
  1782. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(DE)
  1783. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(HL)
  1784. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(SP)
  1785. DEFINE_DECODER_SM83(INC_HL,
  1786. info->mnemonic = SM83_MN_INC;
  1787. @@ -310,10 +310,10 @@ DEFINE_DECODER_SM83(DAA, info->mnemonic = SM83_MN_DAA)
  1788. info->mnemonic = SM83_MN_PUSH; \
  1789. info->op1.reg = SM83_REG_ ## REG;) \
  1790. -DEFINE_POPPUSH_DECODER_SM83(BC);
  1791. -DEFINE_POPPUSH_DECODER_SM83(DE);
  1792. -DEFINE_POPPUSH_DECODER_SM83(HL);
  1793. -DEFINE_POPPUSH_DECODER_SM83(AF);
  1794. +DEFINE_POPPUSH_DECODER_SM83(BC)
  1795. +DEFINE_POPPUSH_DECODER_SM83(DE)
  1796. +DEFINE_POPPUSH_DECODER_SM83(HL)
  1797. +DEFINE_POPPUSH_DECODER_SM83(AF)
  1798. #define DEFINE_CB_OP_DECODER_SM83(NAME, BODY, OP) \
  1799. DEFINE_DECODER_SM83(NAME ## B, info->OP.reg = SM83_REG_B; BODY) \
  1800. @@ -369,14 +369,14 @@ DEFINE_DECODER_SM83(STOP, info->mnemonic = SM83_MN_STOP; return 1)
  1801. #define DEFINE_RST_DECODER_SM83(VEC) \
  1802. DEFINE_DECODER_SM83(RST ## VEC, info->op1.immediate = 0x ## VEC;)
  1803. -DEFINE_RST_DECODER_SM83(00);
  1804. -DEFINE_RST_DECODER_SM83(08);
  1805. -DEFINE_RST_DECODER_SM83(10);
  1806. -DEFINE_RST_DECODER_SM83(18);
  1807. -DEFINE_RST_DECODER_SM83(20);
  1808. -DEFINE_RST_DECODER_SM83(28);
  1809. -DEFINE_RST_DECODER_SM83(30);
  1810. -DEFINE_RST_DECODER_SM83(38);
  1811. +DEFINE_RST_DECODER_SM83(00)
  1812. +DEFINE_RST_DECODER_SM83(08)
  1813. +DEFINE_RST_DECODER_SM83(10)
  1814. +DEFINE_RST_DECODER_SM83(18)
  1815. +DEFINE_RST_DECODER_SM83(20)
  1816. +DEFINE_RST_DECODER_SM83(28)
  1817. +DEFINE_RST_DECODER_SM83(30)
  1818. +DEFINE_RST_DECODER_SM83(38)
  1819. DEFINE_DECODER_SM83(CB, return 1)
  1820. diff --git a/src/sm83/isa-sm83.c b/src/sm83/isa-sm83.c
  1821. index 8599d2af2..4085b3553 100644
  1822. --- a/src/sm83/isa-sm83.c
  1823. +++ b/src/sm83/isa-sm83.c
  1824. @@ -44,7 +44,7 @@ static inline void SM83WriteDE(struct SM83Core* cpu, uint16_t de) {
  1825. BODY; \
  1826. }
  1827. -DEFINE_INSTRUCTION_SM83(NOP,);
  1828. +DEFINE_INSTRUCTION_SM83(NOP,)
  1829. #define DEFINE_CONDITIONAL_ONLY_INSTRUCTION_SM83(NAME) \
  1830. DEFINE_ ## NAME ## _INSTRUCTION_SM83(C, cpu->f.c) \
  1831. @@ -74,7 +74,7 @@ DEFINE_INSTRUCTION_SM83(JPDelay,
  1832. cpu->instruction = _SM83InstructionJPDelay; \
  1833. cpu->condition = CONDITION;)
  1834. -DEFINE_CONDITIONAL_INSTRUCTION_SM83(JP);
  1835. +DEFINE_CONDITIONAL_INSTRUCTION_SM83(JP)
  1836. DEFINE_INSTRUCTION_SM83(JPHL,
  1837. cpu->pc = SM83ReadHL(cpu);
  1838. @@ -93,7 +93,7 @@ DEFINE_INSTRUCTION_SM83(JRFinish,
  1839. cpu->instruction = _SM83InstructionJRFinish; \
  1840. cpu->condition = CONDITION;)
  1841. -DEFINE_CONDITIONAL_INSTRUCTION_SM83(JR);
  1842. +DEFINE_CONDITIONAL_INSTRUCTION_SM83(JR)
  1843. DEFINE_INSTRUCTION_SM83(CALLUpdateSPL,
  1844. --cpu->index;
  1845. @@ -235,13 +235,13 @@ DEFINE_CONDITIONAL_ONLY_INSTRUCTION_SM83(RET)
  1846. cpu->a = OPERAND;)
  1847. #define DEFINE_ALU_INSTRUCTION_SM83_NOHL(NAME) \
  1848. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(A, cpu->a); \
  1849. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(B, cpu->b); \
  1850. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(C, cpu->c); \
  1851. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(D, cpu->d); \
  1852. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(E, cpu->e); \
  1853. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(H, cpu->h); \
  1854. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(L, cpu->l);
  1855. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(A, cpu->a) \
  1856. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(B, cpu->b) \
  1857. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(C, cpu->c) \
  1858. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(D, cpu->d) \
  1859. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(E, cpu->e) \
  1860. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(H, cpu->h) \
  1861. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(L, cpu->l)
  1862. DEFINE_INSTRUCTION_SM83(LDHL_Bus, \
  1863. cpu->index = SM83ReadHL(cpu); \
  1864. @@ -277,17 +277,17 @@ DEFINE_INSTRUCTION_SM83(LDSP_HL,
  1865. cpu->instruction = _SM83Instruction ## NAME ## Bus;)
  1866. #define DEFINE_ALU_INSTRUCTION_SM83(NAME) \
  1867. - DEFINE_ ## NAME ## _INSTRUCTION_SM83(Bus, cpu->bus); \
  1868. + DEFINE_ ## NAME ## _INSTRUCTION_SM83(Bus, cpu->bus) \
  1869. DEFINE_ALU_INSTRUCTION_SM83_MEM(NAME, HL) \
  1870. DEFINE_INSTRUCTION_SM83(NAME, \
  1871. cpu->executionState = SM83_CORE_READ_PC; \
  1872. cpu->instruction = _SM83Instruction ## NAME ## Bus;) \
  1873. DEFINE_ALU_INSTRUCTION_SM83_NOHL(NAME)
  1874. -DEFINE_ALU_INSTRUCTION_SM83(AND);
  1875. -DEFINE_ALU_INSTRUCTION_SM83(XOR);
  1876. -DEFINE_ALU_INSTRUCTION_SM83(OR);
  1877. -DEFINE_ALU_INSTRUCTION_SM83(CP);
  1878. +DEFINE_ALU_INSTRUCTION_SM83(AND)
  1879. +DEFINE_ALU_INSTRUCTION_SM83(XOR)
  1880. +DEFINE_ALU_INSTRUCTION_SM83(OR)
  1881. +DEFINE_ALU_INSTRUCTION_SM83(CP)
  1882. static void _SM83InstructionLDB_Bus(struct SM83Core*);
  1883. static void _SM83InstructionLDC_Bus(struct SM83Core*);
  1884. @@ -334,20 +334,20 @@ static void _SM83InstructionLDA_Bus(struct SM83Core*);
  1885. cpu->a = diff; \
  1886. cpu->f.z = !cpu->a;)
  1887. -DEFINE_ALU_INSTRUCTION_SM83(LDB_);
  1888. -DEFINE_ALU_INSTRUCTION_SM83(LDC_);
  1889. -DEFINE_ALU_INSTRUCTION_SM83(LDD_);
  1890. -DEFINE_ALU_INSTRUCTION_SM83(LDE_);
  1891. -DEFINE_ALU_INSTRUCTION_SM83(LDH_);
  1892. -DEFINE_ALU_INSTRUCTION_SM83(LDL_);
  1893. -DEFINE_ALU_INSTRUCTION_SM83_NOHL(LDHL_);
  1894. -DEFINE_ALU_INSTRUCTION_SM83(LDA_);
  1895. -DEFINE_ALU_INSTRUCTION_SM83_MEM(LDA_, BC);
  1896. -DEFINE_ALU_INSTRUCTION_SM83_MEM(LDA_, DE);
  1897. -DEFINE_ALU_INSTRUCTION_SM83(ADD);
  1898. -DEFINE_ALU_INSTRUCTION_SM83(ADC);
  1899. -DEFINE_ALU_INSTRUCTION_SM83(SUB);
  1900. -DEFINE_ALU_INSTRUCTION_SM83(SBC);
  1901. +DEFINE_ALU_INSTRUCTION_SM83(LDB_)
  1902. +DEFINE_ALU_INSTRUCTION_SM83(LDC_)
  1903. +DEFINE_ALU_INSTRUCTION_SM83(LDD_)
  1904. +DEFINE_ALU_INSTRUCTION_SM83(LDE_)
  1905. +DEFINE_ALU_INSTRUCTION_SM83(LDH_)
  1906. +DEFINE_ALU_INSTRUCTION_SM83(LDL_)
  1907. +DEFINE_ALU_INSTRUCTION_SM83_NOHL(LDHL_)
  1908. +DEFINE_ALU_INSTRUCTION_SM83(LDA_)
  1909. +DEFINE_ALU_INSTRUCTION_SM83_MEM(LDA_, BC)
  1910. +DEFINE_ALU_INSTRUCTION_SM83_MEM(LDA_, DE)
  1911. +DEFINE_ALU_INSTRUCTION_SM83(ADD)
  1912. +DEFINE_ALU_INSTRUCTION_SM83(ADC)
  1913. +DEFINE_ALU_INSTRUCTION_SM83(SUB)
  1914. +DEFINE_ALU_INSTRUCTION_SM83(SBC)
  1915. DEFINE_INSTRUCTION_SM83(ADDSPFinish,
  1916. cpu->sp = cpu->index;
  1917. @@ -534,9 +534,9 @@ DEFINE_INSTRUCTION_SM83(LDISP,
  1918. SM83Write ## REG (cpu, reg - 1); \
  1919. cpu->executionState = SM83_CORE_STALL;)
  1920. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(BC);
  1921. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(DE);
  1922. -DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(HL);
  1923. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(BC)
  1924. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(DE)
  1925. +DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(HL)
  1926. #define DEFINE_ADD_HL_INSTRUCTION_SM83(REG, L, H) \
  1927. DEFINE_INSTRUCTION_SM83(ADDHL_ ## REG ## Finish, \
  1928. @@ -552,10 +552,10 @@ DEFINE_INCDEC_WIDE_INSTRUCTION_SM83(HL);
  1929. cpu->executionState = SM83_CORE_OP2; \
  1930. cpu->instruction = _SM83InstructionADDHL_ ## REG ## Finish;)
  1931. -DEFINE_ADD_HL_INSTRUCTION_SM83(BC, cpu->c, cpu->b);
  1932. -DEFINE_ADD_HL_INSTRUCTION_SM83(DE, cpu->e, cpu->d);
  1933. -DEFINE_ADD_HL_INSTRUCTION_SM83(HL, cpu->l, cpu->h);
  1934. -DEFINE_ADD_HL_INSTRUCTION_SM83(SP, (cpu->sp & 0xFF), (cpu->sp >> 8));
  1935. +DEFINE_ADD_HL_INSTRUCTION_SM83(BC, cpu->c, cpu->b)
  1936. +DEFINE_ADD_HL_INSTRUCTION_SM83(DE, cpu->e, cpu->d)
  1937. +DEFINE_ADD_HL_INSTRUCTION_SM83(HL, cpu->l, cpu->h)
  1938. +DEFINE_ADD_HL_INSTRUCTION_SM83(SP, (cpu->sp & 0xFF), (cpu->sp >> 8))
  1939. #define DEFINE_INC_INSTRUCTION_SM83(NAME, OPERAND) \
  1940. @@ -574,8 +574,8 @@ DEFINE_ADD_HL_INSTRUCTION_SM83(SP, (cpu->sp & 0xFF), (cpu->sp >> 8));
  1941. cpu->f.n = 1; \
  1942. cpu->f.z = !OPERAND;)
  1943. -DEFINE_ALU_INSTRUCTION_SM83_NOHL(INC);
  1944. -DEFINE_ALU_INSTRUCTION_SM83_NOHL(DEC);
  1945. +DEFINE_ALU_INSTRUCTION_SM83_NOHL(INC)
  1946. +DEFINE_ALU_INSTRUCTION_SM83_NOHL(DEC)
  1947. DEFINE_INSTRUCTION_SM83(INC_HLDelay,
  1948. int diff = cpu->bus + 1;
  1949. @@ -680,10 +680,10 @@ DEFINE_INSTRUCTION_SM83(DAA,
  1950. cpu->instruction = _SM83InstructionPUSH ## REG ## Delay; \
  1951. cpu->executionState = SM83_CORE_MEMORY_STORE;)
  1952. -DEFINE_POPPUSH_INSTRUCTION_SM83(BC, B, b, c);
  1953. -DEFINE_POPPUSH_INSTRUCTION_SM83(DE, D, d, e);
  1954. -DEFINE_POPPUSH_INSTRUCTION_SM83(HL, H, h, l);
  1955. -DEFINE_POPPUSH_INSTRUCTION_SM83(AF, A, a, f.packed);
  1956. +DEFINE_POPPUSH_INSTRUCTION_SM83(BC, B, b, c)
  1957. +DEFINE_POPPUSH_INSTRUCTION_SM83(DE, D, d, e)
  1958. +DEFINE_POPPUSH_INSTRUCTION_SM83(HL, H, h, l)
  1959. +DEFINE_POPPUSH_INSTRUCTION_SM83(AF, A, a, f.packed)
  1960. #define DEFINE_CB_2_INSTRUCTION_SM83(NAME, WB, BODY) \
  1961. DEFINE_INSTRUCTION_SM83(NAME ## B, uint8_t reg = cpu->b; BODY; cpu->b = reg) \
  1962. @@ -765,9 +765,9 @@ DEFINE_INSTRUCTION_SM83(RRCA_,
  1963. cpu->f.n = 0;
  1964. cpu->f.c = low;)
  1965. -DEFINE_INSTRUCTION_SM83(DI, cpu->irqh.setInterrupts(cpu, false));
  1966. -DEFINE_INSTRUCTION_SM83(EI, cpu->irqh.setInterrupts(cpu, true));
  1967. -DEFINE_INSTRUCTION_SM83(HALT, cpu->irqh.halt(cpu));
  1968. +DEFINE_INSTRUCTION_SM83(DI, cpu->irqh.setInterrupts(cpu, false))
  1969. +DEFINE_INSTRUCTION_SM83(EI, cpu->irqh.setInterrupts(cpu, true))
  1970. +DEFINE_INSTRUCTION_SM83(HALT, cpu->irqh.halt(cpu))
  1971. #define DEFINE_RST_INSTRUCTION_SM83(VEC) \
  1972. DEFINE_INSTRUCTION_SM83(RST ## VEC ## UpdateSPL, \
  1973. @@ -788,18 +788,18 @@ DEFINE_INSTRUCTION_SM83(HALT, cpu->irqh.halt(cpu));
  1974. cpu->executionState = SM83_CORE_OP2; \
  1975. cpu->instruction = _SM83InstructionRST ## VEC ## UpdateSPH;)
  1976. -DEFINE_RST_INSTRUCTION_SM83(00);
  1977. -DEFINE_RST_INSTRUCTION_SM83(08);
  1978. -DEFINE_RST_INSTRUCTION_SM83(10);
  1979. -DEFINE_RST_INSTRUCTION_SM83(18);
  1980. -DEFINE_RST_INSTRUCTION_SM83(20);
  1981. -DEFINE_RST_INSTRUCTION_SM83(28);
  1982. -DEFINE_RST_INSTRUCTION_SM83(30);
  1983. -DEFINE_RST_INSTRUCTION_SM83(38);
  1984. +DEFINE_RST_INSTRUCTION_SM83(00)
  1985. +DEFINE_RST_INSTRUCTION_SM83(08)
  1986. +DEFINE_RST_INSTRUCTION_SM83(10)
  1987. +DEFINE_RST_INSTRUCTION_SM83(18)
  1988. +DEFINE_RST_INSTRUCTION_SM83(20)
  1989. +DEFINE_RST_INSTRUCTION_SM83(28)
  1990. +DEFINE_RST_INSTRUCTION_SM83(30)
  1991. +DEFINE_RST_INSTRUCTION_SM83(38)
  1992. -DEFINE_INSTRUCTION_SM83(ILL, cpu->irqh.hitIllegal(cpu));
  1993. +DEFINE_INSTRUCTION_SM83(ILL, cpu->irqh.hitIllegal(cpu))
  1994. -DEFINE_INSTRUCTION_SM83(STOP2, cpu->irqh.stop(cpu));
  1995. +DEFINE_INSTRUCTION_SM83(STOP2, cpu->irqh.stop(cpu))
  1996. DEFINE_INSTRUCTION_SM83(STOP, \
  1997. cpu->executionState = SM83_CORE_READ_PC; \
  1998. diff --git a/src/util/elf-read.c b/src/util/elf-read.c
  1999. index 520c01ca3..138290eee 100644
  2000. --- a/src/util/elf-read.c
  2001. +++ b/src/util/elf-read.c
  2002. @@ -9,8 +9,8 @@
  2003. #include <mgba-util/vfs.h>
  2004. -DEFINE_VECTOR(ELFProgramHeaders, Elf32_Phdr);
  2005. -DEFINE_VECTOR(ELFSectionHeaders, Elf32_Shdr);
  2006. +DEFINE_VECTOR(ELFProgramHeaders, Elf32_Phdr)
  2007. +DEFINE_VECTOR(ELFSectionHeaders, Elf32_Shdr)
  2008. static bool _elfInit = false;
  2009. diff --git a/src/util/patch-fast.c b/src/util/patch-fast.c
  2010. index 81b3aa45a..8fcd87436 100644
  2011. --- a/src/util/patch-fast.c
  2012. +++ b/src/util/patch-fast.c
  2013. @@ -5,7 +5,7 @@
  2014. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  2015. #include <mgba-util/patch/fast.h>
  2016. -DEFINE_VECTOR(PatchFastExtents, struct PatchFastExtent);
  2017. +DEFINE_VECTOR(PatchFastExtents, struct PatchFastExtent)
  2018. size_t _fastOutputSize(struct Patch* patch, size_t inSize);
  2019. bool _fastApplyPatch(struct Patch* patch, const void* in, size_t inSize, void* out, size_t outSize);
  2020. diff --git a/src/util/string.c b/src/util/string.c
  2021. index 46e52fba7..69112a0cd 100644
  2022. --- a/src/util/string.c
  2023. +++ b/src/util/string.c
  2024. @@ -9,7 +9,7 @@
  2025. #include <string.h>
  2026. -DEFINE_VECTOR(StringList, char*);
  2027. +DEFINE_VECTOR(StringList, char*)
  2028. #ifndef HAVE_STRNDUP
  2029. char* strndup(const char* start, size_t len) {
  2030. --
  2031. 2.29.2