diff --git a/CHANGES b/CHANGES index 7a6a551ce..d148f39df 100644 --- a/CHANGES +++ b/CHANGES @@ -35,6 +35,7 @@ Features: - Ability to select GB/GBC/SGB BIOS on console ports - Optional automatic state saving/loading - Access to ur0 and uma0 partitions on the Vita + - Partial support for MBC6, MMM01, TAMA and HuC-1 GB mappers Bugfixes: - GB Audio: Make audio unsigned with bias (fixes mgba.io/i/749) - GB Serialize: Fix audio state loading @@ -62,6 +63,7 @@ Bugfixes: - GB I/O: DMA register is R/W - GB Video: Fix SCX timing - GBA Video: Improve sprite cycle counting (fixes mgba.io/i/1126) + - GB, GBA Savedata: Fix savestate loading overwriting saves on reset Misc: - GBA Timer: Use global cycles for timers - GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722) diff --git a/README.md b/README.md index ae1a9f312..e3c6860ee 100644 --- a/README.md +++ b/README.md @@ -53,15 +53,12 @@ The following mappers are fully supported: The following mappers are partially supported: +- MBC6 +- MMM01 - Pocket Cam - TAMA5 -- HuC-3 - -The following mappers are not currently supported: - -- MBC6 - HuC-1 -- MMM01 +- HuC-3 ### Planned features diff --git a/cinema/gb/mooneye-gb/misc/boot_regs-A/baseline_0000.png b/cinema/gb/mooneye-gb/misc/boot_regs-A/baseline_0000.png index e29254b10..b27f84b7a 100644 Binary files a/cinema/gb/mooneye-gb/misc/boot_regs-A/baseline_0000.png and b/cinema/gb/mooneye-gb/misc/boot_regs-A/baseline_0000.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0000.png b/cinema/gb/window/wmm-hud/baseline_0000.png index 15207ebdc..73af7e9c5 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0000.png and b/cinema/gb/window/wmm-hud/baseline_0000.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0001.png b/cinema/gb/window/wmm-hud/baseline_0001.png index 15207ebdc..73af7e9c5 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0001.png and b/cinema/gb/window/wmm-hud/baseline_0001.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0002.png b/cinema/gb/window/wmm-hud/baseline_0002.png index 15207ebdc..73af7e9c5 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0002.png and b/cinema/gb/window/wmm-hud/baseline_0002.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0003.png b/cinema/gb/window/wmm-hud/baseline_0003.png index 7c0d4bc3b..497008dbb 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0003.png and b/cinema/gb/window/wmm-hud/baseline_0003.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0004.png b/cinema/gb/window/wmm-hud/baseline_0004.png index 7c0d4bc3b..497008dbb 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0004.png and b/cinema/gb/window/wmm-hud/baseline_0004.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0005.png b/cinema/gb/window/wmm-hud/baseline_0005.png index 7c0d4bc3b..497008dbb 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0005.png and b/cinema/gb/window/wmm-hud/baseline_0005.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0006.png b/cinema/gb/window/wmm-hud/baseline_0006.png index 7c0d4bc3b..497008dbb 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0006.png and b/cinema/gb/window/wmm-hud/baseline_0006.png differ diff --git a/cinema/gb/window/wmm-hud/baseline_0007.png b/cinema/gb/window/wmm-hud/baseline_0007.png index 7c0d4bc3b..497008dbb 100644 Binary files a/cinema/gb/window/wmm-hud/baseline_0007.png and b/cinema/gb/window/wmm-hud/baseline_0007.png differ diff --git a/include/mgba/internal/gb/memory.h b/include/mgba/internal/gb/memory.h index 4c4020df8..7d834080c 100644 --- a/include/mgba/internal/gb/memory.h +++ b/include/mgba/internal/gb/memory.h @@ -129,6 +129,11 @@ struct GBMBC7State { GBMBC7Field eeprom; }; +struct GBMMM01State { + bool locked; + int currentBank0; +}; + struct GBPocketCamState { bool registersActive; uint8_t registers[0x36]; @@ -143,6 +148,7 @@ union GBMBCState { struct GBMBC1State mbc1; struct GBMBC6State mbc6; struct GBMBC7State mbc7; + struct GBMMM01State mmm01; struct GBPocketCamState pocketCam; struct GBTAMA5State tama5; }; diff --git a/include/mgba/internal/gb/serialize.h b/include/mgba/internal/gb/serialize.h index 7628faa0b..f4f36c640 100644 --- a/include/mgba/internal/gb/serialize.h +++ b/include/mgba/internal/gb/serialize.h @@ -373,6 +373,10 @@ struct GBSerializedState { uint16_t sr; uint32_t writable; } mbc7; + struct { + uint8_t locked; + uint8_t bank0; + } mmm01; struct { uint8_t reserved[16]; } padding; diff --git a/src/gb/audio.c b/src/gb/audio.c index a84aad3a8..daf479a26 100644 --- a/src/gb/audio.c +++ b/src/gb/audio.c @@ -562,7 +562,7 @@ void GBAudioUpdateFrame(struct GBAudio* audio, struct mTiming* timing) { if (audio->playingCh4 && !audio->ch4.envelope.dead) { --audio->ch4.envelope.nextStep; if (audio->ch4.envelope.nextStep == 0) { - int8_t sample = (audio->ch4.sample > 0) * 0x8; + int8_t sample = audio->ch4.sample > 0; _updateEnvelope(&audio->ch4.envelope); if (audio->ch4.envelope.dead == 2) { mTimingDeschedule(timing, &audio->ch4Event); @@ -575,52 +575,55 @@ void GBAudioUpdateFrame(struct GBAudio* audio, struct mTiming* timing) { } void GBAudioSamplePSG(struct GBAudio* audio, int16_t* left, int16_t* right) { - int sampleLeft = 0; - int sampleRight = 0; + int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x8; + int sampleLeft = dcOffset; + int sampleRight = dcOffset; if (audio->playingCh1 && !audio->forceDisableCh[0]) { if (audio->ch1Left) { - sampleLeft += audio->ch1.sample; + sampleLeft -= audio->ch1.sample; } if (audio->ch1Right) { - sampleRight += audio->ch1.sample; + sampleRight -= audio->ch1.sample; } } if (audio->playingCh2 && !audio->forceDisableCh[1]) { if (audio->ch2Left) { - sampleLeft += audio->ch2.sample; + sampleLeft -= audio->ch2.sample; } if (audio->ch2Right) { - sampleRight += audio->ch2.sample; + sampleRight -= audio->ch2.sample; } } if (audio->playingCh3 && !audio->forceDisableCh[2]) { if (audio->ch3Left) { - sampleLeft += audio->ch3.sample; + sampleLeft -= audio->ch3.sample; } if (audio->ch3Right) { - sampleRight += audio->ch3.sample; + sampleRight -= audio->ch3.sample; } } if (audio->playingCh4 && !audio->forceDisableCh[3]) { if (audio->ch4Left) { - sampleLeft += audio->ch4.sample; + sampleLeft -= audio->ch4.sample; } if (audio->ch4Right) { - sampleRight += audio->ch4.sample; + sampleRight -= audio->ch4.sample; } } - int dcOffset = audio->style == GB_AUDIO_GBA ? 0 : 0x20A; - *left = (sampleLeft - dcOffset) * (1 + audio->volumeLeft); - *right = (sampleRight - dcOffset) * (1 + audio->volumeRight); + sampleLeft <<= 3; + sampleRight <<= 3; + + *left = sampleLeft * (1 + audio->volumeLeft); + *right = sampleRight * (1 + audio->volumeRight); } static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) { @@ -644,6 +647,8 @@ static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) { if ((size_t) blip_samples_avail(audio->left) < audio->samples) { blip_add_delta(audio->left, audio->clock, sampleLeft - audio->lastLeft); blip_add_delta(audio->right, audio->clock, sampleRight - audio->lastRight); + audio->lastLeft = sampleLeft; + audio->lastRight = sampleRight; audio->clock += audio->sampleInterval; if (audio->clock >= CLOCKS_PER_BLIP_FRAME) { blip_end_frame(audio->left, CLOCKS_PER_BLIP_FRAME); @@ -651,8 +656,6 @@ static void _sample(struct mTiming* timing, void* user, uint32_t cyclesLate) { audio->clock -= CLOCKS_PER_BLIP_FRAME; } } - audio->lastLeft = sampleLeft; - audio->lastRight = sampleRight; produced = blip_samples_avail(audio->left); if (audio->p->stream && audio->p->stream->postAudioFrame) { audio->p->stream->postAudioFrame(audio->p->stream, sampleLeft, sampleRight); @@ -719,7 +722,7 @@ bool _writeEnvelope(struct GBAudioEnvelope* envelope, uint8_t value, enum GBAudi } static void _updateSquareSample(struct GBAudioSquareChannel* ch) { - ch->sample = ch->control.hi * ch->envelope.currentVolume * 0x8; + ch->sample = ch->control.hi * ch->envelope.currentVolume; } static int32_t _updateSquareChannel(struct GBAudioSquareChannel* ch) { @@ -820,19 +823,17 @@ static void _updateChannel3(struct mTiming* timing, void* user, uint32_t cyclesL int volume; switch (ch->volume) { case 0: - volume = 0; - break; - case 1: volume = 4; break; - case 2: - volume = 2; + case 1: + volume = 0; break; - case 3: + case 2: volume = 1; break; default: - volume = 3; + case 3: + volume = 2; break; } int start; @@ -870,7 +871,10 @@ static void _updateChannel3(struct mTiming* timing, void* user, uint32_t cyclesL ch->sample = bitsCarry >> 4; break; } - ch->sample *= volume * 2; + if (ch->volume > 3) { + ch->sample += ch->sample << 1; + } + ch->sample >>= volume; audio->ch3.readable = true; if (audio->style == GB_AUDIO_DMG) { mTimingDeschedule(audio->timing, &audio->ch3Fade); @@ -897,8 +901,7 @@ static void _updateChannel4(struct mTiming* timing, void* user, uint32_t cyclesL do { int lsb = ch->lfsr & 1; - ch->sample = lsb * 0x8; - ch->sample *= ch->envelope.currentVolume; + ch->sample = lsb * ch->envelope.currentVolume; ch->lfsr >>= 1; ch->lfsr ^= (lsb * 0x60) << (ch->power ? 0 : 8); cycles += baseCycles; diff --git a/src/gb/gb.c b/src/gb/gb.c index cce40b5ce..d5f809fb2 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -295,7 +295,6 @@ void GBUnloadROM(struct GB* gb) { gb->isPristine = false; gb->sramMaskWriteback = false; - GBSavedataUnmask(gb); GBSramDeinit(gb); if (gb->sramRealVf) { gb->sramRealVf->close(gb->sramRealVf); @@ -468,6 +467,7 @@ void GBReset(struct LR35902Core* cpu) { cpu->memory.setActiveRegion(cpu, cpu->pc); + gb->sramMaskWriteback = false; GBSavedataUnmask(gb); } diff --git a/src/gb/mbc.c b/src/gb/mbc.c index fee944c03..05160d876 100644 --- a/src/gb/mbc.c +++ b/src/gb/mbc.c @@ -9,8 +9,11 @@ #include #include #include +#include #include +const uint32_t GB_LOGO_HASH = 0x46195417; + mLOG_DEFINE_CATEGORY(GB_MBC, "GB MBC", "gb.mbc"); static void _GBMBCNone(struct GB* gb, uint16_t address, uint8_t value) { @@ -27,6 +30,8 @@ static void _GBMBC3(struct GB*, uint16_t address, uint8_t value); static void _GBMBC5(struct GB*, uint16_t address, uint8_t value); static void _GBMBC6(struct GB*, uint16_t address, uint8_t value); static void _GBMBC7(struct GB*, uint16_t address, uint8_t value); +static void _GBMMM01(struct GB*, uint16_t address, uint8_t value); +static void _GBHuC1(struct GB*, uint16_t address, uint8_t value); static void _GBHuC3(struct GB*, uint16_t address, uint8_t value); static void _GBPocketCam(struct GB* gb, uint16_t address, uint8_t value); static void _GBTAMA5(struct GB* gb, uint16_t address, uint8_t value); @@ -56,7 +61,7 @@ void GBMBCSwitchBank(struct GB* gb, int bank) { } void GBMBCSwitchBank0(struct GB* gb, int bank) { - size_t bankStart = bank * GB_SIZE_CART_BANK0 << gb->memory.mbcState.mbc1.multicartStride; + size_t bankStart = bank * GB_SIZE_CART_BANK0; if (bankStart + GB_SIZE_CART_BANK0 > gb->memory.romSize) { mLOG(GB_MBC, GAME_ERROR, "Attempting to switch to an invalid ROM bank: %0X", bank); bankStart &= (gb->memory.romSize - 1); @@ -134,6 +139,12 @@ void GBMBCSwitchSramHalfBank(struct GB* gb, int half, int bank) { void GBMBCInit(struct GB* gb) { const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; if (gb->memory.rom) { + if (gb->memory.romSize >= 0x8000) { + const struct GBCartridge* cartFooter = (const struct GBCartridge*) &gb->memory.rom[gb->memory.romSize - 0x7F00]; + if (doCrc32(cartFooter->logo, sizeof(cartFooter->logo)) == GB_LOGO_HASH) { + cart = cartFooter; + } + } switch (cart->ramSize) { case 0: gb->sramSize = 0; @@ -177,6 +188,11 @@ void GBMBCInit(struct GB* gb) { case 6: gb->memory.mbcType = GB_MBC2; break; + case 0x0B: + case 0x0C: + case 0x0D: + gb->memory.mbcType = GB_MMM01; + break; case 0x0F: case 0x10: gb->memory.mbcType = GB_MBC3_RTC; @@ -255,12 +271,10 @@ void GBMBCInit(struct GB* gb) { gb->sramSize = 0x100; break; case GB_MMM01: - mLOG(GB_MBC, WARN, "unimplemented MBC: MMM01"); - gb->memory.mbcWrite = _GBMBC1; + gb->memory.mbcWrite = _GBMMM01; break; case GB_HuC1: - mLOG(GB_MBC, WARN, "unimplemented MBC: HuC-1"); - gb->memory.mbcWrite = _GBMBC1; + gb->memory.mbcWrite = _GBHuC1; break; case GB_HuC3: gb->memory.mbcWrite = _GBHuC3; @@ -393,7 +407,7 @@ void _GBMBC1(struct GB* gb, uint16_t address, uint8_t value) { case 0x2: bank &= 3; if (memory->mbcState.mbc1.mode) { - GBMBCSwitchBank0(gb, bank); + GBMBCSwitchBank0(gb, bank << gb->memory.mbcState.mbc1.multicartStride); GBMBCSwitchSramBank(gb, bank); } GBMBCSwitchBank(gb, (bank << memory->mbcState.mbc1.multicartStride) | (memory->currentBank & (stride - 1))); @@ -401,7 +415,7 @@ void _GBMBC1(struct GB* gb, uint16_t address, uint8_t value) { case 0x3: memory->mbcState.mbc1.mode = value & 1; if (memory->mbcState.mbc1.mode) { - GBMBCSwitchBank0(gb, memory->currentBank >> memory->mbcState.mbc1.multicartStride); + GBMBCSwitchBank0(gb, memory->currentBank & ~((1 << memory->mbcState.mbc1.multicartStride) - 1)); } else { GBMBCSwitchBank0(gb, 0); GBMBCSwitchSramBank(gb, 0); @@ -821,6 +835,82 @@ static void _GBMBC7Write(struct GBMemory* memory, uint16_t address, uint8_t valu mbc7->eeprom = value; } +void _GBMMM01(struct GB* gb, uint16_t address, uint8_t value) { + struct GBMemory* memory = &gb->memory; + if (!memory->mbcState.mmm01.locked) { + switch (address >> 13) { + case 0x0: + memory->mbcState.mmm01.locked = true; + GBMBCSwitchBank0(gb, memory->mbcState.mmm01.currentBank0); + break; + case 0x1: + memory->mbcState.mmm01.currentBank0 &= ~0x7F; + memory->mbcState.mmm01.currentBank0 |= value & 0x7F; + break; + case 0x2: + memory->mbcState.mmm01.currentBank0 &= ~0x180; + memory->mbcState.mmm01.currentBank0 |= (value & 0x30) << 3; + break; + default: + // TODO + mLOG(GB_MBC, STUB, "MMM01 unknown address: %04X:%02X", address, value); + break; + } + return; + } + switch (address >> 13) { + case 0x0: + switch (value) { + case 0xA: + memory->sramAccess = true; + GBMBCSwitchSramBank(gb, memory->sramCurrentBank); + break; + default: + memory->sramAccess = false; + break; + } + break; + case 0x1: + GBMBCSwitchBank(gb, value + memory->mbcState.mmm01.currentBank0); + break; + case 0x2: + GBMBCSwitchSramBank(gb, value); + break; + default: + // TODO + mLOG(GB_MBC, STUB, "MMM01 unknown address: %04X:%02X", address, value); + break; + } +} + +void _GBHuC1(struct GB* gb, uint16_t address, uint8_t value) { + struct GBMemory* memory = &gb->memory; + int bank = value & 0x3F; + switch (address >> 13) { + case 0x0: + switch (value) { + case 0xE: + memory->sramAccess = false; + break; + default: + memory->sramAccess = true; + GBMBCSwitchSramBank(gb, memory->sramCurrentBank); + break; + } + break; + case 0x1: + GBMBCSwitchBank(gb, bank); + break; + case 0x2: + GBMBCSwitchSramBank(gb, value); + break; + default: + // TODO + mLOG(GB_MBC, STUB, "HuC-1 unknown address: %04X:%02X", address, value); + break; + } +} + void _GBHuC3(struct GB* gb, uint16_t address, uint8_t value) { struct GBMemory* memory = &gb->memory; int bank = value & 0x3F; diff --git a/src/gb/memory.c b/src/gb/memory.c index 229366078..688d43676 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -176,6 +176,8 @@ void GBMemoryReset(struct GB* gb) { gb->memory.hdmaEvent.priority = 0x41; memset(&gb->memory.hram, 0, sizeof(gb->memory.hram)); + + GBMBCInit(gb); switch (gb->memory.mbcType) { case GB_MBC1: gb->memory.mbcState.mbc1.mode = 0; @@ -187,11 +189,12 @@ void GBMemoryReset(struct GB* gb) { GBMBCSwitchSramHalfBank(gb, 0, 0); GBMBCSwitchSramHalfBank(gb, 0, 1); break; + case GB_MMM01: + GBMBCSwitchBank0(gb, gb->memory.romSize / GB_SIZE_CART_BANK0 - 2); + GBMBCSwitchBank(gb, gb->memory.romSize / GB_SIZE_CART_BANK0 - 1); default: memset(&gb->memory.mbcState, 0, sizeof(gb->memory.mbcState)); } - - GBMBCInit(gb); gb->memory.sramBank = gb->memory.sram; if (!gb->memory.wram) { @@ -688,6 +691,10 @@ void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state) { STORE_16LE(memory->mbcState.mbc7.sr, 0, &state->memory.mbc7.sr); STORE_32LE(memory->mbcState.mbc7.writable, 0, &state->memory.mbc7.writable); break; + case GB_MMM01: + state->memory.mmm01.locked = memory->mbcState.mmm01.locked; + state->memory.mmm01.bank0 = memory->mbcState.mmm01.currentBank0; + break; default: break; } @@ -755,6 +762,15 @@ void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state) { LOAD_16LE(memory->mbcState.mbc7.sr, 0, &state->memory.mbc7.sr); LOAD_32LE(memory->mbcState.mbc7.writable, 0, &state->memory.mbc7.writable); break; + case GB_MMM01: + memory->mbcState.mmm01.locked = state->memory.mmm01.locked; + memory->mbcState.mmm01.currentBank0 = state->memory.mmm01.bank0; + if (memory->mbcState.mmm01.locked) { + GBMBCSwitchBank0(gb, memory->mbcState.mmm01.currentBank0); + } else { + GBMBCSwitchBank0(gb, gb->memory.romSize / GB_SIZE_CART_BANK0 - 2); + } + break; default: break; } diff --git a/src/gba/gba.c b/src/gba/gba.c index 70f2a3f98..6692a17e3 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -185,6 +185,7 @@ void GBAReset(struct ARMCore* cpu) { struct GBA* gba = (struct GBA*) cpu->master; if (!gba->rr || (!gba->rr->isPlaying(gba->rr) && !gba->rr->isRecording(gba->rr))) { + gba->memory.savedata.maskWriteback = false; GBASavedataUnmask(&gba->memory.savedata); } diff --git a/src/platform/qt/MapView.cpp b/src/platform/qt/MapView.cpp index 2481bd9a3..e4d970e5f 100644 --- a/src/platform/qt/MapView.cpp +++ b/src/platform/qt/MapView.cpp @@ -10,6 +10,7 @@ #include "LogController.h" #include +#include #ifdef M_CORE_GBA #include #endif @@ -184,5 +185,6 @@ void MapView::exportMap() { QImage map = m_rawMap.rgbSwapped(); PNGWritePixelsA(png, map.width(), map.height(), map.bytesPerLine() / 4, static_cast(map.constBits())); PNGWriteClose(png, info); + vf->close(vf); } #endif diff --git a/src/platform/qt/ObjView.cpp b/src/platform/qt/ObjView.cpp index 99220b543..b4c0ae5ac 100644 --- a/src/platform/qt/ObjView.cpp +++ b/src/platform/qt/ObjView.cpp @@ -22,6 +22,7 @@ #include #endif #include +#include using namespace QGBA; @@ -283,6 +284,7 @@ void ObjView::exportObj() { PNGWritePixels8(png, m_objInfo.width * 8, m_objInfo.height * 8, m_objInfo.width * 8, static_cast(buffer)); PNGWriteClose(png, info); delete[] buffer; + vf->close(vf); } #endif diff --git a/src/platform/qt/TileView.cpp b/src/platform/qt/TileView.cpp index 2f7a3e4b4..38c2610f7 100644 --- a/src/platform/qt/TileView.cpp +++ b/src/platform/qt/TileView.cpp @@ -25,7 +25,7 @@ TileView::TileView(std::shared_ptr controller, QWidget* parent) m_ui.tile->setController(controller); connect(m_ui.tiles, &TilePainter::indexPressed, m_ui.tile, &AssetTile::selectIndex); - connect(m_ui.paletteId, &QAbstractSlider::valueChanged, this, &TileView::updatePalette); + connect(m_ui.paletteId, static_cast(&QSpinBox::valueChanged), this, &TileView::updatePalette); switch (m_controller->platform()) { #ifdef M_CORE_GBA diff --git a/src/platform/qt/TileView.ui b/src/platform/qt/TileView.ui index 1c61bd869..608e1d2d0 100644 --- a/src/platform/qt/TileView.ui +++ b/src/platform/qt/TileView.ui @@ -6,7 +6,7 @@ 0 0 - 498 + 501 335 @@ -14,49 +14,10 @@ Tiles - - - - 256 colors - - - - - - - - 170 - 16777215 - - - - 15 - - - 1 - - - Qt::Horizontal - - - QSlider::TicksBelow - - - - - - - Qt::Vertical - - - - 0 - 0 - - - - + + + @@ -105,7 +66,7 @@ 0 0 - 286 + 256 768 @@ -151,8 +112,36 @@ - - + + + + Qt::Vertical + + + + 0 + 0 + + + + + + + + + + 15 + + + + + + + 256 colors + + + + @@ -175,22 +164,6 @@ - - palette256 - toggled(bool) - paletteId - setDisabled(bool) - - - 100 - 54 - - - 96 - 22 - - - magnification valueChanged(int) @@ -207,5 +180,21 @@ + + palette256 + toggled(bool) + paletteId + setDisabled(bool) + + + 158 + 29 + + + 44 + 29 + + + diff --git a/src/platform/wii/CMakeLists.txt b/src/platform/wii/CMakeLists.txt index b72ac2d5c..165dba60b 100644 --- a/src/platform/wii/CMakeLists.txt +++ b/src/platform/wii/CMakeLists.txt @@ -3,7 +3,7 @@ find_program(GXTEXCONV gxtexconv) find_program(RAW2C raw2c) find_program(WIILOAD wiiload) -set(OS_DEFINES COLOR_16_BIT COLOR_5_6_5 USE_VFS_FILE IOAPI_NO_64) +set(OS_DEFINES COLOR_16_BIT COLOR_5_6_5 USE_VFS_FILE IOAPI_NO_64 FIXED_ROM_BUFFER) list(APPEND CORE_VFS_SRC ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-file.c ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-dirent.c ${CMAKE_SOURCE_DIR}/src/util/vfs/vfs-devlist.c) include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/platform/wii/main.c b/src/platform/wii/main.c index 6a359a637..ef0c3f84c 100644 --- a/src/platform/wii/main.c +++ b/src/platform/wii/main.c @@ -253,7 +253,8 @@ int main(int argc, char* argv[]) { memset(audioBuffer, 0, sizeof(audioBuffer)); #ifdef FIXED_ROM_BUFFER romBufferSize = SIZE_CART0; - romBuffer = anonymousMemoryMap(romBufferSize); + romBuffer = SYS_GetArena2Lo(); + SYS_SetArena2Lo((void*)((intptr_t) romBuffer + SIZE_CART0)); #endif #if !defined(COLOR_16_BIT) && !defined(COLOR_5_6_5) @@ -530,10 +531,6 @@ int main(int argc, char* argv[]) { VIDEO_WaitVSync(); mGUIDeinit(&runner); -#ifdef FIXED_ROM_BUFFER - mappedMemoryFree(romBuffer, romBufferSize); -#endif - free(fifo); free(texmem); free(rescaleTexmem);