Core: Fix some minor warnings, fix channel labels
@@ -22,7 +22,7 @@ #ifndef MINIMAL_CORE
#include <mgba/feature/video-logger.h> #endif -const static struct mCoreFilter { +static const struct mCoreFilter { bool (*filter)(struct VFile*); struct mCore* (*open)(void); enum mPlatform platform;
@@ -26,7 +26,7 @@ #define MAX_BLOCK_SIZE 0x800000
const char mVL_MAGIC[] = "mVL\0"; -const static struct mVLDescriptor { +static const struct mVLDescriptor { enum mPlatform platform; struct mCore* (*open)(void); } _descriptors[] = {
@@ -24,26 +24,26 @@ #include <mgba-util/memory.h>
#include <mgba-util/patch.h> #include <mgba-util/vfs.h> -const static struct mCoreChannelInfo _GBVideoLayers[] = { +static const struct mCoreChannelInfo _GBVideoLayers[] = { { 0, "bg", "Background", NULL }, { 1, "obj", "Objects", NULL }, { 2, "win", "Window", NULL }, }; -const static struct mCoreChannelInfo _GBAudioChannels[] = { - { 0, "ch0", "Channel 0", "Square/Sweep" }, - { 1, "ch1", "Channel 1", "Square" }, - { 2, "ch2", "Channel 2", "PCM" }, - { 3, "ch3", "Channel 3", "Noise" }, +static const struct mCoreChannelInfo _GBAudioChannels[] = { + { 0, "ch1", "Channel 1", "Square/Sweep" }, + { 1, "ch2", "Channel 2", "Square" }, + { 2, "ch3", "Channel 3", "PCM" }, + { 3, "ch4", "Channel 4", "Noise" }, }; -const static struct LR35902Segment _GBSegments[] = { +static const struct LR35902Segment _GBSegments[] = { { .name = "ROM", .start = GB_BASE_CART_BANK1, .end = GB_BASE_VRAM }, { .name = "RAM", .start = GB_BASE_EXTERNAL_RAM, .end = GB_BASE_WORKING_RAM_BANK0 }, { 0 } }; -const static struct LR35902Segment _GBCSegments[] = { +static const struct LR35902Segment _GBCSegments[] = { { .name = "ROM", .start = GB_BASE_CART_BANK1, .end = GB_BASE_VRAM }, { .name = "RAM", .start = GB_BASE_EXTERNAL_RAM, .end = GB_BASE_WORKING_RAM_BANK0 }, { .name = "WRAM", .start = GB_BASE_WORKING_RAM_BANK1, .end = 0xE000 },@@ -51,7 +51,7 @@ { .name = "VRAM", .start = GB_BASE_VRAM, .end = GB_BASE_EXTERNAL_RAM },
{ 0 } }; -const static struct mCoreMemoryBlock _GBMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000, 0x10000, mCORE_MEMORY_VIRTUAL }, { GB_REGION_CART_BANK0, "cart0", "ROM Bank", "Game Pak (32kiB)", GB_BASE_CART_BANK0, GB_SIZE_CART_BANK0 * 2, 0x800000, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED, 511 }, { GB_REGION_VRAM, "vram", "VRAM", "Video RAM (8kiB)", GB_BASE_VRAM, GB_BASE_VRAM + GB_SIZE_VRAM, GB_SIZE_VRAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },@@ -62,7 +62,7 @@ { GB_BASE_IO, "io", "MMIO", "Memory-Mapped I/O", GB_BASE_IO, GB_BASE_IO + GB_SIZE_IO, GB_SIZE_IO, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },
{ GB_BASE_HRAM, "hram", "HRAM", "High RAM", GB_BASE_HRAM, GB_BASE_HRAM + GB_SIZE_HRAM, GB_SIZE_HRAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBCMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBCMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000, 0x10000, mCORE_MEMORY_VIRTUAL }, { GB_REGION_CART_BANK0, "cart0", "ROM Bank", "Game Pak (32kiB)", GB_BASE_CART_BANK0, GB_SIZE_CART_BANK0 * 2, 0x800000, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED, 511 }, { GB_REGION_VRAM, "vram", "VRAM", "Video RAM (8kiB)", GB_BASE_VRAM, GB_BASE_VRAM + GB_SIZE_VRAM, GB_SIZE_VRAM * 2, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED, 1 },
@@ -24,7 +24,7 @@ #include <mgba-util/memory.h>
#include <mgba-util/patch.h> #include <mgba-util/vfs.h> -const static struct mCoreChannelInfo _GBAVideoLayers[] = { +static const struct mCoreChannelInfo _GBAVideoLayers[] = { { 0, "bg0", "Background 0", NULL }, { 1, "bg1", "Background 1", NULL }, { 2, "bg2", "Background 2", NULL },@@ -32,16 +32,16 @@ { 3, "bg3", "Background 3", NULL },
{ 4, "obj", "Objects", NULL }, }; -const static struct mCoreChannelInfo _GBAAudioChannels[] = { - { 0, "ch0", "PSG Channel 0", "Square/Sweep" }, - { 1, "ch1", "PSG Channel 1", "Square" }, - { 2, "ch2", "PSG Channel 2", "PCM" }, - { 3, "ch3", "PSG Channel 3", "Noise" }, +static const struct mCoreChannelInfo _GBAAudioChannels[] = { + { 0, "ch1", "PSG Channel 1", "Square/Sweep" }, + { 1, "ch2", "PSG Channel 2", "Square" }, + { 2, "ch3", "PSG Channel 3", "PCM" }, + { 3, "ch4", "PSG Channel 4", "Noise" }, { 4, "chA", "FIFO Channel A", NULL }, { 5, "chB", "FIFO Channel B", NULL }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocks[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocks[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },@@ -55,7 +55,7 @@ { REGION_CART1, "cart1", "ROM WS1", "Game Pak (Waitstate 1)", BASE_CART1, BASE_CART1 + SIZE_CART1, SIZE_CART1, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED },
{ REGION_CART2, "cart2", "ROM WS2", "Game Pak (Waitstate 2)", BASE_CART2, BASE_CART2 + SIZE_CART2, SIZE_CART2, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksSRAM[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksSRAM[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },@@ -70,7 +70,7 @@ { REGION_CART2, "cart2", "ROM WS2", "Game Pak (Waitstate 2)", BASE_CART2, BASE_CART2 + SIZE_CART2, SIZE_CART2, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED },
{ REGION_CART_SRAM, "sram", "SRAM", "Static RAM (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_SRAM, SIZE_CART_SRAM, true }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash512[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksFlash512[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },@@ -85,7 +85,7 @@ { REGION_CART2, "cart2", "ROM WS2", "Game Pak (Waitstate 2)", BASE_CART2, BASE_CART2 + SIZE_CART2, SIZE_CART2, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED },
{ REGION_CART_SRAM, "sram", "Flash", "Flash Memory (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_FLASH512, SIZE_CART_FLASH512, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksFlash1M[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksFlash1M[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },@@ -100,7 +100,7 @@ { REGION_CART2, "cart2", "ROM WS2", "Game Pak (Waitstate 2)", BASE_CART2, BASE_CART2 + SIZE_CART2, SIZE_CART2, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED },
{ REGION_CART_SRAM, "sram", "Flash", "Flash Memory (64kiB)", BASE_CART_SRAM, BASE_CART_SRAM + SIZE_CART_FLASH512, SIZE_CART_FLASH1M, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED, 1 }, }; -const static struct mCoreMemoryBlock _GBAMemoryBlocksEEPROM[] = { +static const struct mCoreMemoryBlock _GBAMemoryBlocksEEPROM[] = { { -1, "mem", "All", "All", 0, 0x10000000, 0x10000000, mCORE_MEMORY_VIRTUAL }, { REGION_BIOS, "bios", "BIOS", "BIOS (16kiB)", BASE_BIOS, SIZE_BIOS, SIZE_BIOS, mCORE_MEMORY_READ | mCORE_MEMORY_MAPPED }, { REGION_WORKING_RAM, "wram", "EWRAM", "Working RAM (256kiB)", BASE_WORKING_RAM, BASE_WORKING_RAM + SIZE_WORKING_RAM, SIZE_WORKING_RAM, mCORE_MEMORY_RW | mCORE_MEMORY_MAPPED },