Merge branch 'master' (early part) into medusa
@@ -44,37 +44,11 @@ - ARM: Fix MSR when T bit is set
- GB Serialize: Fix game title check - GB: Revamp IRQ handling based on new information - GBA Video: Don't mask out high bits of BLDY (fixes mgba.io/i/899) - - GBA Video: Force align 256-color tiles - - GBA DMA: ROM reads are forced to increment - GB Video: Fix loading states while in mode 3 - - GB Video: Only trigger STAT write IRQs when screen is on (fixes mgba.io/i/912) - - GBA Cheats: Fix PARv3 slide codes (fixes mgba.io/i/919) - - GBA Video: OBJWIN can change blend params after OBJ is drawn (fixes mgba.io/i/921) - GBA DMA: Fix invalid DMA reads (fixes mgba.io/i/142) - - GBA Savedata: Fix crash when resizing flash - GBA Video: Add delay when enabling BGs (fixes mgba.io/i/744, mgba.io/i/752) - - GB Memory: HDMAs should not start when LCD is off (fixes mgba.io/i/310) - - GBA Cheats: Fix slide codes not initializing properly - - Qt: Fix locale being set to English on settings save (fixes mgba.io/i/906) - - LR35902: Fix watchpoints not reporting new value - - GBA Audio: Increase PSG volume (fixes mgba.io/i/932) - - 3DS: Fix opening files in directory names with trailing slashes - - GB MBC: Fix MBC2 saves (fixes mgba.io/i/954) - - GBA Memory: Fix copy-on-write memory leak - - Core: Fix ROM patches not being unloaded when disabled (fixes mgba.io/i/962) - - GBA I/O: Fix writing to DISPCNT CGB flag (fixes mgba.io/i/902) - - GBA Memory: Partially revert prefetch changes (fixes mgba.io/i/840) - - PSP2: Fix issues causing poor audio - - Wii: Fix screen tear when unpausing - - GBA: Fix some GBA ROM misdetection (fixes mgba.io/i/978) - - GBA Hardware: RTC accuracy improvements - GB Timer: Minor accuracy improvements - GB Audio: Clock frame events on DIV - - GBA: Fix SharkPort saves for EEPROM games - - Qt: Fix opening in fullscreen (fixes mgba.io/i/993) - - Python: Fix package directory - - GB Memory: Fix OAM DMA blocking regions (fixes mgba.io/i/1013) - - Wii: Fix various setup and teardown drawing issues (fixes mgba.io/i/988) - GBA Timer: Fix timers sometimes being late (fixes mgba.io/i/1012) Misc: - GBA Timer: Use global cycles for timers@@ -93,9 +67,43 @@ - GBA Cheats: Allow multiple ROM patches in the same slot
- GB: Skip BIOS option now works - Libretro: Add frameskip option - GBA Memory: 64 MiB GBA Video cartridge support - - 3DS: Scale font based on glyph heights (fixes mgba.io/i/961) - PSP2: Use system enter key by default - 3DS: Remove deprecated CSND interface + +0.6.2: (2017-04-03) +Bugfixes: + - Core: Fix ROM patches not being unloaded when disabled (fixes mgba.io/i/962) + - 3DS: Fix opening files in directory names with trailing slashes + - LR35902: Fix watchpoints not reporting new value + - GB MBC: Fix MBC2 saves (fixes mgba.io/i/954) + - GB Memory: HDMAs should not start when LCD is off (fixes mgba.io/i/310) + - GB Memory: Fix OAM DMA blocking regions (fixes mgba.io/i/1013) + - GB Video: Only trigger STAT write IRQs when screen is on (fixes mgba.io/i/912) + - GBA: Fix some GBA ROM misdetection (fixes mgba.io/i/978) + - GBA: Fix SharkPort saves for EEPROM games + - GBA Audio: Increase PSG volume (fixes mgba.io/i/932) + - GBA BIOS: Fix incorrect exit condition in LZ77 + - GBA Cheats: Fix PARv3 slide codes (fixes mgba.io/i/919) + - GBA Cheats: Fix slide codes not initializing properly + - GBA DMA: ROM reads are forced to increment + - GBA Hardware: RTC accuracy improvements + - GBA I/O: Fix writing to DISPCNT CGB flag (fixes mgba.io/i/902) + - GBA Memory: Fix copy-on-write memory leak + - GBA Memory: Partially revert prefetch changes (fixes mgba.io/i/840) + - GBA Savedata: Fix crash when resizing flash + - GBA Video: Force align 256-color tiles + - GBA Video: OBJWIN can change blend params after OBJ is drawn (fixes mgba.io/i/921) + - PSP2: Fix issues causing poor audio + - Python: Fix package directory + - Qt: Fix locale being set to English on settings save (fixes mgba.io/i/906) + - Qt: Fix opening in fullscreen (fixes mgba.io/i/993) + - Wii: Fix screen tear when unpausing + - Wii: Fix various setup and teardown drawing issues (fixes mgba.io/i/988) +Misc: + - 3DS: Scale font based on glyph heights (fixes mgba.io/i/961) + - GB MBC: Remove erroneous bank 0 wrapping + - GBA: Improve multiboot image detection + - PSP2: Use system enter key by default 0.6.1: (2017-10-01) Bugfixes:
@@ -1,4 +1,7 @@
cmake_minimum_required(VERSION 3.1) +if(POLICY CMP0025) + cmake_policy(SET CMP0025 NEW) +endif() project(medusa) set(BINARY_NAME medusa-emu CACHE INTERNAL "Name of output binaries") if(NOT MSVC)
@@ -1,9 +1,6 @@
Jaime J. Denizard Fog -Reilly Grant Philip Horton -mars -pr1ntf Rohit Nirmal Rhys Powell rootfather
@@ -555,6 +555,10 @@ if (gb->memory.romBase < gb->memory.rom || gb->memory.romBase > &gb->memory.rom[gb->memory.romSize - 1]) {
free(gb->memory.romBase); gb->memory.romBase = gb->memory.rom; } + // XXX: Force AGB registers for AGB-mode + if (gb->model == GB_MODEL_AGB && gb->cpu->pc == 0x100) { + gb->cpu->b = 1; + } } void GBDetectModel(struct GB* gb) {
@@ -106,7 +106,7 @@ };
static void _writeSGBBits(struct GB* gb, int bits) { if (!bits) { - gb->sgbBit = 0; + gb->sgbBit = -1; memset(gb->sgbPacket, 0, sizeof(gb->sgbPacket)); } if (bits == gb->currentSgbBits) {@@ -122,9 +122,12 @@ return;
} switch (bits) { case 1: + if (gb->sgbBit < 0) { + return; + } gb->sgbPacket[gb->sgbBit >> 3] |= 1 << (gb->sgbBit & 7); - // Fall through - case 2: + break; + case 3: ++gb->sgbBit; default: break;
@@ -209,7 +209,7 @@ renderer->currentWy -= renderer->lastY;
renderer->hasWindow = true; } else { if (!renderer->hasWindow) { - renderer->currentWy = renderer->lastY + 1 - renderer->wy; + renderer->currentWy = renderer->lastY - renderer->wy; } else { renderer->currentWy += renderer->lastY; }@@ -359,6 +359,9 @@
static void GBVideoSoftwareRendererWritePalette(struct GBVideoRenderer* renderer, int index, uint16_t value) { struct GBVideoSoftwareRenderer* softwareRenderer = (struct GBVideoSoftwareRenderer*) renderer; color_t color = mColorFrom555(value); + if (softwareRenderer->model == GB_MODEL_SGB && index < 0x10 && index && !(index & 3)) { + color = softwareRenderer->palette[0]; + } softwareRenderer->palette[index] = color; if (renderer->cache) { mCacheSetWritePalette(renderer->cache, index, color);
@@ -606,12 +606,12 @@ video->renderer->writePalette(video->renderer, 0, video->palette[0]);
video->renderer->writePalette(video->renderer, 1, video->palette[1]); video->renderer->writePalette(video->renderer, 2, video->palette[2]); video->renderer->writePalette(video->renderer, 3, video->palette[3]); - video->renderer->writePalette(video->renderer, 4, video->palette[0]); + video->renderer->writePalette(video->renderer, 4, video->palette[4]); video->renderer->writePalette(video->renderer, 5, video->palette[5]); video->renderer->writePalette(video->renderer, 6, video->palette[6]); video->renderer->writePalette(video->renderer, 7, video->palette[7]); - video->renderer->writePalette(video->renderer, 8, video->palette[0]); - video->renderer->writePalette(video->renderer, 12, video->palette[0]); + video->renderer->writePalette(video->renderer, 8, video->palette[8]); + video->renderer->writePalette(video->renderer, 12, video->palette[12]); break; case SGB_PAL23: video->palette[9] = data[3] | (data[4] << 8);@@ -645,9 +645,9 @@ video->renderer->writePalette(video->renderer, 0, video->palette[0]);
video->renderer->writePalette(video->renderer, 1, video->palette[1]); video->renderer->writePalette(video->renderer, 2, video->palette[2]); video->renderer->writePalette(video->renderer, 3, video->palette[3]); - video->renderer->writePalette(video->renderer, 4, video->palette[0]); - video->renderer->writePalette(video->renderer, 8, video->palette[0]); - video->renderer->writePalette(video->renderer, 12, video->palette[0]); + video->renderer->writePalette(video->renderer, 4, video->palette[4]); + video->renderer->writePalette(video->renderer, 8, video->palette[8]); + video->renderer->writePalette(video->renderer, 12, video->palette[12]); video->renderer->writePalette(video->renderer, 13, video->palette[13]); video->renderer->writePalette(video->renderer, 14, video->palette[14]); video->renderer->writePalette(video->renderer, 15, video->palette[15]);@@ -675,7 +675,7 @@ mLOG(GB, STUB, "Unimplemented SGB palette overflow: %03X", entry);
continue; } LOAD_16LE(video->palette[i * 4 + 0], entry * 8 + 0, video->renderer->sgbPalRam); - video->renderer->writePalette(video->renderer, i * 4 + 0, video->palette[0]); + video->renderer->writePalette(video->renderer, i * 4 + 0, video->palette[i * 4 + 0]); LOAD_16LE(video->palette[i * 4 + 1], entry * 8 + 2, video->renderer->sgbPalRam); video->renderer->writePalette(video->renderer, i * 4 + 1, video->palette[i * 4 + 1]); LOAD_16LE(video->palette[i * 4 + 2], entry * 8 + 4, video->renderer->sgbPalRam);
@@ -66,7 +66,7 @@ struct retro_variable var;
enum GBModel model; const char* modelName; - var.key = "mgba_model"; + var.key = "mgba_gb_model"; var.value = 0; if (environCallback(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { if (strcmp(var.value, "Game Boy") == 0) {@@ -75,6 +75,8 @@ } else if (strcmp(var.value, "Super Game Boy") == 0) {
model = GB_MODEL_SGB; } else if (strcmp(var.value, "Game Boy Color") == 0) { model = GB_MODEL_CGB; + } else if (strcmp(var.value, "Game Boy Advance") == 0) { + model = GB_MODEL_AGB; } else { model = GB_MODEL_AUTODETECT; }@@ -140,7 +142,7 @@
struct retro_variable vars[] = { { "mgba_solar_sensor_level", "Solar sensor level; 0|1|2|3|4|5|6|7|8|9|10" }, { "mgba_allow_opposing_directions", "Allow opposing directional input; OFF|ON" }, - { "mgba_model", "Game Boy model (requires restart); Autodetect|Game Boy|Super Game Boy|Game Boy Color" }, + { "mgba_gb_model", "Game Boy model (requires restart); Autodetect|Game Boy|Super Game Boy|Game Boy Color|Game Boy Advance" }, { "mgba_use_bios", "Use BIOS file if found (requires restart); ON|OFF" }, { "mgba_skip_bios", "Skip BIOS intro (requires restart); OFF|ON" }, { "mgba_sgb_borders", "Use Super Game Boy borders (requires restart); ON|OFF" },@@ -483,6 +485,7 @@ GBDetectModel(gb);
} switch (gb->model) { + case GB_MODEL_AGB: case GB_MODEL_CGB: biosName = "gbc_bios.bin"; break;
@@ -17,6 +17,10 @@ list(APPEND PLATFORM_SRC ${PLATFORM_SRC} ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-events.c ${CMAKE_SOURCE_DIR}/src/platform/sdl/sdl-audio.c)
include_directories(${SDL_INCLUDE_DIR} ${CMAKE_SOURCE_DIR}/src/platform/sdl) endif() +if(POLICY CMP0071) + cmake_policy(SET CMP0071 OLD) +endif() + set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/input)
@@ -89,8 +89,10 @@ server_command = list(self.command)
else: server_command = [os.path.join(os.getcwd(), PerfTest.EXECUTABLE)] server_command.extend(['--', '-PD', '0']) - if (hasattr(test, "frames")): - server_command.extend(['-F', str(test.frames)]) + if hasattr(test, "frames"): + server_command.extend(['-F', str(test.frames)]) + if test.renderer != "software": + server_command.append('-N') subprocess.check_call(server_command) time.sleep(4) self.socket = socket.create_connection(self.address, timeout=1000)