mirror of https://github.com/mgba-emu/mgba.git
Merge branch 'master' into medusa
This commit is contained in:
commit
87caf0a6ac
|
@ -2,3 +2,4 @@
|
||||||
*.user*
|
*.user*
|
||||||
*~
|
*~
|
||||||
*.swp
|
*.swp
|
||||||
|
*.pyc
|
||||||
|
|
85
CHANGES
85
CHANGES
|
@ -7,43 +7,12 @@ Features:
|
||||||
- Debugging console
|
- Debugging console
|
||||||
- Improved memory viewer
|
- Improved memory viewer
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- Libretro: Fix unterminated SET_INPUT_DESCRIPTORS
|
|
||||||
- LR35902: Fix core never exiting with certain event patterns
|
- LR35902: Fix core never exiting with certain event patterns
|
||||||
- GB Timer: Improve DIV reset behavior
|
- GB Timer: Improve DIV reset behavior
|
||||||
- GBA Memory: Fix misaligned BIOS reads
|
|
||||||
- GBA BIOS: Fix MidiKey2Freq BIOS reads
|
|
||||||
- GBA BIOS: Fix invalid CpuSet not setting BIOS prefetch
|
|
||||||
- GB MBC: Fix SRAM dangling pointer with RTC games
|
|
||||||
- Windows: Fix Unicode directory handling
|
|
||||||
- Qt: Fix changing resolution of software renderer
|
|
||||||
- Qt: Fix setting overrides
|
|
||||||
- GBA Cheats: Fix GameShark ROM patches
|
|
||||||
- Qt: Fix cut off tiles and alignment issues in tile viewer
|
|
||||||
- GB MBC: Fix initializing MBC when no ROM is loaded
|
|
||||||
- VFS: Fix resizing memory chunks when not needed
|
|
||||||
- GB Memory: Fix patching ROM bank 0
|
|
||||||
- GB: Fix audio not being deinitialized
|
|
||||||
- GBA Memory: Fix VCOUNT being writable
|
|
||||||
- GBA Memory: Improve initial skipped BIOS state
|
- GBA Memory: Improve initial skipped BIOS state
|
||||||
- Qt: Only reset window dimensions when first shown
|
|
||||||
- GB Memory: Fix starting HDMAs during mode 0
|
|
||||||
- Qt: Fix Qt Multimedia audio driver on big endian
|
|
||||||
- GBA: Fix IRQs firing after already being cleared
|
|
||||||
- All: Fix fullscreen config option being ignored
|
|
||||||
- GBA BIOS: Implement BitUnPack
|
- GBA BIOS: Implement BitUnPack
|
||||||
- GBA: Add savegame override for Crash Bandicoot 2
|
- ARM7: Fix MLA/*MULL/*MLAL timing
|
||||||
- ARM7: PSR mode bits should not get sign extended
|
- GBA: Fix multiboot ROM loading
|
||||||
- GBA: Only unhalt CPU if appropriate bit is set in IE
|
|
||||||
- GBA Video: Fix out of bounds sprite transforms
|
|
||||||
- GB: Fix crash when masking savedata
|
|
||||||
- GB Audio: Fix serialization of channel 3 and NR52 properties
|
|
||||||
- GB: Properly initialize sramRealVf variable
|
|
||||||
- Qt: Fix Apply button for key and controller configurations
|
|
||||||
- GB Video: Initialize LCDC in renderer
|
|
||||||
- GBA I/O: Mask off WAITCNT bits that cannot be written
|
|
||||||
- GB Memory: Fix HDMA5 value after DMA completes
|
|
||||||
- GB Video: Hblank IRQs should mask LYC=LY IRQs
|
|
||||||
- GB Audio: Reset envelope timer when reseting sound channel
|
|
||||||
- SDL: Prevent crash on cores with no audio
|
- SDL: Prevent crash on cores with no audio
|
||||||
- ARM7: Decode MCR/MRC
|
- ARM7: Decode MCR/MRC
|
||||||
- ARM7: Clean up instruction decoding for future expandability
|
- ARM7: Clean up instruction decoding for future expandability
|
||||||
|
@ -54,8 +23,6 @@ Misc:
|
||||||
- GBA Video: Allow multiple handles into the same tile cache
|
- GBA Video: Allow multiple handles into the same tile cache
|
||||||
- VFS: Call msync when syncing mapped data
|
- VFS: Call msync when syncing mapped data
|
||||||
- GBA Video, GB Video: Colors are now fully scaled
|
- GBA Video, GB Video: Colors are now fully scaled
|
||||||
- PSP2: Improved controller rumble
|
|
||||||
- GB, GBA: Prevent loading null ROMs
|
|
||||||
- VFS: Allow truncating memory chunk VFiles
|
- VFS: Allow truncating memory chunk VFiles
|
||||||
- Debugger: Modularize CLI debugger
|
- Debugger: Modularize CLI debugger
|
||||||
- Core: Clean up some thread state checks
|
- Core: Clean up some thread state checks
|
||||||
|
@ -67,11 +34,55 @@ Misc:
|
||||||
- 3DS, PSP2, Wii: Last directory loaded is saved
|
- 3DS, PSP2, Wii: Last directory loaded is saved
|
||||||
- GB Audio: Simplify envelope code
|
- GB Audio: Simplify envelope code
|
||||||
- GB Audio: Improve initial envelope samples
|
- GB Audio: Improve initial envelope samples
|
||||||
- GB Audio: Initialize wave RAM to GBC values
|
|
||||||
- Debugger: Add functions for read- or write-only watchpoints
|
- Debugger: Add functions for read- or write-only watchpoints
|
||||||
- GB Memory: Reset ROM bank when loading a ROM
|
|
||||||
- GBA DMA: Refactor DMA out of memory.c
|
- GBA DMA: Refactor DMA out of memory.c
|
||||||
- GBA DMA: Move DMAs to using absolute timing
|
- GBA DMA: Move DMAs to using absolute timing
|
||||||
|
- All: Add C++ header guards
|
||||||
|
- GBA I/O: Clear JOYSTAT RECV flag when reading JOY_RECV registers
|
||||||
|
- GBA I/O: Set JOYSTAT TRANS flag when writing JOY_TRANS registers
|
||||||
|
|
||||||
|
0.5.2: (2016-12-31)
|
||||||
|
Bugfixes:
|
||||||
|
- All: Fix fullscreen config option being ignored
|
||||||
|
- ARM7: PSR mode bits should not get sign extended
|
||||||
|
- GB: Fix audio not being deinitialized
|
||||||
|
- GB: Fix crash when masking savedata
|
||||||
|
- GB: Properly initialize sramRealVf variable
|
||||||
|
- GB Audio: Fix serialization of channel 3 and NR52 properties
|
||||||
|
- GB Audio: Reset envelope timer when reseting sound channel
|
||||||
|
- GB MBC: Fix SRAM dangling pointer with RTC games
|
||||||
|
- GB MBC: Fix initializing MBC when no ROM is loaded
|
||||||
|
- GB Memory: Fix patching ROM bank 0
|
||||||
|
- GB Memory: Fix starting HDMAs during mode 0
|
||||||
|
- GB Memory: Fix HDMA5 value after DMA completes
|
||||||
|
- GB Video: Initialize LCDC in renderer
|
||||||
|
- GB Video: Hblank IRQs should mask LYC=LY IRQs
|
||||||
|
- GBA: Fix IRQs firing after already being cleared
|
||||||
|
- GBA: Only unhalt CPU if appropriate bit is set in IE
|
||||||
|
- GBA: Add savegame override for Crash Bandicoot 2
|
||||||
|
- GBA BIOS: Fix MidiKey2Freq BIOS reads
|
||||||
|
- GBA BIOS: Fix invalid CpuSet not setting BIOS prefetch
|
||||||
|
- GBA Cheats: Fix GameShark ROM patches
|
||||||
|
- GBA I/O: Mask off WAITCNT bits that cannot be written
|
||||||
|
- GBA Memory: Fix misaligned BIOS reads
|
||||||
|
- GBA Memory: Fix VCOUNT being writable
|
||||||
|
- GBA Video: Fix out of bounds sprite transforms
|
||||||
|
- Libretro: Fix unterminated SET_INPUT_DESCRIPTORS
|
||||||
|
- Libretro: Fix disabling BIOS
|
||||||
|
- Libretro: Fix Game Boy savestates and audio
|
||||||
|
- Qt: Fix changing resolution of software renderer
|
||||||
|
- Qt: Fix setting overrides
|
||||||
|
- Qt: Fix cut off tiles and alignment issues in tile viewer
|
||||||
|
- Qt: Only reset window dimensions when first shown
|
||||||
|
- Qt: Fix Qt Multimedia audio driver on big endian
|
||||||
|
- Qt: Fix Apply button for key and controller configurations
|
||||||
|
- VFS: Fix resizing memory chunks when not needed
|
||||||
|
- Windows: Fix Unicode directory handling
|
||||||
|
Misc:
|
||||||
|
- GB, GBA: Prevent loading null ROMs
|
||||||
|
- GB Audio: Initialize wave RAM to GBC values
|
||||||
|
- GB Memory: Reset ROM bank when loading a ROM
|
||||||
|
- PSP2: Improved controller rumble
|
||||||
|
|
||||||
0.5.1: (2016-10-05)
|
0.5.1: (2016-10-05)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -29,6 +29,7 @@ set(BUILD_PERF OFF CACHE BOOL "Build performance profiling tool")
|
||||||
set(BUILD_TEST OFF CACHE BOOL "Build testing harness")
|
set(BUILD_TEST OFF CACHE BOOL "Build testing harness")
|
||||||
set(BUILD_SUITE OFF CACHE BOOL "Build test suite")
|
set(BUILD_SUITE OFF CACHE BOOL "Build test suite")
|
||||||
set(BUILD_EXAMPLE OFF CACHE BOOL "Build example frontends")
|
set(BUILD_EXAMPLE OFF CACHE BOOL "Build example frontends")
|
||||||
|
set(BUILD_PYTHON OFF CACHE BOOL "Build Python bindings")
|
||||||
set(BUILD_STATIC OFF CACHE BOOL "Build a static library")
|
set(BUILD_STATIC OFF CACHE BOOL "Build a static library")
|
||||||
set(BUILD_SHARED ON CACHE BOOL "Build a shared library")
|
set(BUILD_SHARED ON CACHE BOOL "Build a shared library")
|
||||||
set(SKIP_LIBRARY OFF CACHE BOOL "Skip building the library (useful for only building libretro or OpenEmu cores)")
|
set(SKIP_LIBRARY OFF CACHE BOOL "Skip building the library (useful for only building libretro or OpenEmu cores)")
|
||||||
|
@ -53,7 +54,8 @@ file(GLOB UTIL_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/*.[cSs])
|
||||||
file(GLOB UTIL_TEST_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/test/*.c)
|
file(GLOB UTIL_TEST_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/test/*.c)
|
||||||
file(GLOB GUI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/gui/*.c ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/gui/*.c)
|
file(GLOB GUI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/gui/*.c ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/gui/*.c)
|
||||||
file(GLOB GBA_RENDERER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gba/renderers/*.c)
|
file(GLOB GBA_RENDERER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gba/renderers/*.c)
|
||||||
file(GLOB SIO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gba/sio/lockstep.c)
|
file(GLOB GBA_SIO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gba/sio/lockstep.c)
|
||||||
|
file(GLOB GB_SIO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gb/sio/lockstep.c)
|
||||||
file(GLOB GB_RENDERER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gb/renderers/*.c)
|
file(GLOB GB_RENDERER_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/gb/renderers/*.c)
|
||||||
file(GLOB THIRD_PARTY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/inih/*.c)
|
file(GLOB THIRD_PARTY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/third-party/inih/*.c)
|
||||||
set(CLI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/commandline.c)
|
set(CLI_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/feature/commandline.c)
|
||||||
|
@ -61,12 +63,12 @@ set(CORE_VFS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-mem.c)
|
||||||
set(VFS_SRC)
|
set(VFS_SRC)
|
||||||
source_group("ARM core" FILES ${ARM_SRC})
|
source_group("ARM core" FILES ${ARM_SRC})
|
||||||
source_group("LR35902 core" FILES ${LR35902_SRC})
|
source_group("LR35902 core" FILES ${LR35902_SRC})
|
||||||
source_group("GBA board" FILES ${GBA_SRC} ${GBA_RENDERER_SRC} ${SIO_SRC})
|
source_group("GBA board" FILES ${GBA_SRC} ${GBA_RENDERER_SRC} ${GBA_SIO_SRC})
|
||||||
source_group("GBA extra" FILES ${GBA_CHEATS_SRC} ${GBA_RR_SRC})
|
source_group("GBA extra" FILES ${GBA_CHEATS_SRC} ${GBA_RR_SRC})
|
||||||
source_group("GB board" FILES ${GB_SRC})
|
source_group("GB board" FILES ${GB_SRC} ${GB_SIO_SRC})
|
||||||
source_group("DS board" FILES ${DS_SRC})
|
source_group("DS board" FILES ${DS_SRC})
|
||||||
source_group("Utilities" FILES ${UTIL_SRC})
|
source_group("Utilities" FILES ${UTIL_SRC})
|
||||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (e.g. Release or Debug)" FORCE)
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type (e.g. Release or Debug)" FORCE)
|
||||||
|
@ -153,6 +155,9 @@ add_custom_target(version-info ALL
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/version.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/version.cmake)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/core/flags.h.in ${CMAKE_CURRENT_BINARY_DIR}/flags.h)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/flags.h DESTINATION include/mgba COMPONENT lib${BINARY_NAME})
|
||||||
|
|
||||||
list(APPEND UTIL_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
list(APPEND UTIL_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
||||||
source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
source_group("Generated sources" FILES ${CMAKE_CURRENT_BINARY_DIR}/version.c)
|
||||||
|
|
||||||
|
@ -643,7 +648,11 @@ if(NOT MINIMAL_CORE)
|
||||||
list(APPEND SRC
|
list(APPEND SRC
|
||||||
${GBA_RR_SRC}
|
${GBA_RR_SRC}
|
||||||
${GBA_EXTRA_SRC}
|
${GBA_EXTRA_SRC}
|
||||||
${SIO_SRC})
|
${GBA_SIO_SRC})
|
||||||
|
endif()
|
||||||
|
if(M_CORE_GB)
|
||||||
|
list(APPEND SRC
|
||||||
|
${GB_SIO_SRC})
|
||||||
endif()
|
endif()
|
||||||
list(APPEND SRC
|
list(APPEND SRC
|
||||||
${FEATURE_SRC}
|
${FEATURE_SRC}
|
||||||
|
@ -777,6 +786,11 @@ if(BUILD_SUITE)
|
||||||
add_test(${BINARY_NAME}-suite ${BINARY_NAME}-suite)
|
add_test(${BINARY_NAME}-suite ${BINARY_NAME}-suite)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_PYTHON)
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/python ${CMAKE_CURRENT_BINARY_DIR}/python)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(BUILD_EXAMPLE)
|
if(BUILD_EXAMPLE)
|
||||||
add_executable(${BINARY_NAME}-example-server ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/example/client-server/server.c)
|
add_executable(${BINARY_NAME}-example-server ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/example/client-server/server.c)
|
||||||
target_link_libraries(${BINARY_NAME}-example-server ${BINARY_NAME})
|
target_link_libraries(${BINARY_NAME}-example-server ${BINARY_NAME})
|
||||||
|
@ -787,7 +801,7 @@ if(BUILD_EXAMPLE)
|
||||||
target_link_libraries(${BINARY_NAME}-example-client ${BINARY_NAME} ${SDL_LIBRARY} ${SDLMAIN_LIBRARY} ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY})
|
target_link_libraries(${BINARY_NAME}-example-client ${BINARY_NAME} ${SDL_LIBRARY} ${SDLMAIN_LIBRARY} ${OPENGL_LIBRARY} ${OPENGLES2_LIBRARY})
|
||||||
set_target_properties(${BINARY_NAME}-example-client PROPERTIES
|
set_target_properties(${BINARY_NAME}-example-client PROPERTIES
|
||||||
COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}"
|
COMPILE_DEFINITIONS "${OS_DEFINES};${FEATURE_DEFINES};${FUNCTION_DEFINES}"
|
||||||
INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/src")
|
INCLUDE_DIRECTORIES "${SDL_INCLUDE_DIR};${CMAKE_CURRENT_SOURCE_DIR}/src;${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -861,6 +875,7 @@ if(NOT QUIET)
|
||||||
message(STATUS " Profiling: ${BUILD_PERF}")
|
message(STATUS " Profiling: ${BUILD_PERF}")
|
||||||
message(STATUS " Test harness: ${BUILD_TEST}")
|
message(STATUS " Test harness: ${BUILD_TEST}")
|
||||||
message(STATUS " Test suite: ${BUILD_SUITE}")
|
message(STATUS " Test suite: ${BUILD_SUITE}")
|
||||||
|
message(STATUS " Python bindings: ${BUILD_PYTHON}")
|
||||||
message(STATUS " Examples: ${BUILD_EXAMPLE}")
|
message(STATUS " Examples: ${BUILD_EXAMPLE}")
|
||||||
message(STATUS "Cores:")
|
message(STATUS "Cores:")
|
||||||
message(STATUS " Libretro core: ${BUILD_LIBRETRO}")
|
message(STATUS " Libretro core: ${BUILD_LIBRETRO}")
|
||||||
|
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef CIRCLE_BUFFER_H
|
#ifndef CIRCLE_BUFFER_H
|
||||||
#define CIRCLE_BUFFER_H
|
#define CIRCLE_BUFFER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct CircleBuffer {
|
struct CircleBuffer {
|
||||||
void* data;
|
void* data;
|
||||||
|
@ -30,4 +32,6 @@ int CircleBufferRead32(struct CircleBuffer* buffer, int32_t* value);
|
||||||
size_t CircleBufferRead(struct CircleBuffer* buffer, void* output, size_t length);
|
size_t CircleBufferRead(struct CircleBuffer* buffer, void* output, size_t length);
|
||||||
size_t CircleBufferDump(const struct CircleBuffer* buffer, void* output, size_t length);
|
size_t CircleBufferDump(const struct CircleBuffer* buffer, void* output, size_t length);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,6 +6,16 @@
|
||||||
#ifndef COMMON_H
|
#ifndef COMMON_H
|
||||||
#define COMMON_H
|
#define COMMON_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define CXX_GUARD_START extern "C" {
|
||||||
|
#define CXX_GUARD_END }
|
||||||
|
#else
|
||||||
|
#define CXX_GUARD_START
|
||||||
|
#define CXX_GUARD_END
|
||||||
|
#endif
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
@ -46,7 +56,9 @@ typedef intptr_t ssize_t;
|
||||||
#define SSIZE_MAX ((ssize_t) (SIZE_MAX >> 1))
|
#define SSIZE_MAX ((ssize_t) (SIZE_MAX >> 1))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef UNUSED
|
||||||
#define UNUSED(V) (void)(V)
|
#define UNUSED(V) (void)(V)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.141592654f
|
#define M_PI 3.141592654f
|
||||||
|
@ -177,4 +189,6 @@ typedef intptr_t ssize_t;
|
||||||
|
|
||||||
#define ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((uint32_t) (I) << ((-ROTATE) & 31)))
|
#define ROR(I, ROTATE) ((((uint32_t) (I)) >> ROTATE) | ((uint32_t) (I) << ((-ROTATE) & 31)))
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,11 @@
|
||||||
#ifndef CONFIGURATION_H
|
#ifndef CONFIGURATION_H
|
||||||
#define CONFIGURATION_H
|
#define CONFIGURATION_H
|
||||||
|
|
||||||
#include "util/table.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/table.h>
|
||||||
|
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
||||||
|
@ -35,4 +39,6 @@ bool ConfigurationWriteSection(const struct Configuration*, const char* path, co
|
||||||
|
|
||||||
void ConfigurationEnumerateSections(const struct Configuration* configuration, void (*handler)(const char* sectionName, void* user), void* user);
|
void ConfigurationEnumerateSections(const struct Configuration* configuration, void (*handler)(const char* sectionName, void* user), void* user);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef CRC32_H
|
#ifndef CRC32_H
|
||||||
#define CRC32_H
|
#define CRC32_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
||||||
|
@ -14,4 +16,6 @@ uint32_t doCrc32(const void* buf, size_t size);
|
||||||
uint32_t updateCrc32(uint32_t crc, const void* buf, size_t size);
|
uint32_t updateCrc32(uint32_t crc, const void* buf, size_t size);
|
||||||
uint32_t fileCrc32(struct VFile* file, size_t endOffset);
|
uint32_t fileCrc32(struct VFile* file, size_t endOffset);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,15 @@
|
||||||
#ifndef EXPORT_H
|
#ifndef EXPORT_H
|
||||||
#define EXPORT_H
|
#define EXPORT_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
||||||
bool exportPaletteRIFF(struct VFile* vf, size_t entries, const uint16_t* colors);
|
bool exportPaletteRIFF(struct VFile* vf, size_t entries, const uint16_t* colors);
|
||||||
bool exportPaletteACT(struct VFile* vf, size_t entries, const uint16_t* colors);
|
bool exportPaletteACT(struct VFile* vf, size_t entries, const uint16_t* colors);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef FORMATTING_H
|
#ifndef FORMATTING_H
|
||||||
#define FORMATTING_H
|
#define FORMATTING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#include "locale.h"
|
#include "locale.h"
|
||||||
|
|
||||||
|
@ -29,4 +31,6 @@ float strtof_u(const char* restrict str, char** restrict end);
|
||||||
struct tm* localtime_r(const time_t* timep, struct tm* result);
|
struct tm* localtime_r(const time_t* timep, struct tm* result);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,13 @@
|
||||||
#ifndef GUI_H
|
#ifndef GUI_H
|
||||||
#define GUI_H
|
#define GUI_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/input.h"
|
CXX_GUARD_START
|
||||||
#include "util/vector.h"
|
|
||||||
|
// TODO: Fix layering violation
|
||||||
|
#include <mgba/core/input.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
struct GUIFont;
|
struct GUIFont;
|
||||||
|
|
||||||
|
@ -81,4 +84,6 @@ void GUIPollInput(struct GUIParams* params, uint32_t* newInput, uint32_t* heldIn
|
||||||
enum GUICursorState GUIPollCursor(struct GUIParams* params, unsigned* x, unsigned* y);
|
enum GUICursorState GUIPollCursor(struct GUIParams* params, unsigned* x, unsigned* y);
|
||||||
void GUIInvalidateKeys(struct GUIParams* params);
|
void GUIInvalidateKeys(struct GUIParams* params);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,16 @@
|
||||||
#ifndef GUI_FILE_CHOOSER_H
|
#ifndef GUI_FILE_CHOOSER_H
|
||||||
#define GUI_FILE_CHOOSER_H
|
#define GUI_FILE_CHOOSER_H
|
||||||
|
|
||||||
#include "util/gui.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/gui.h>
|
||||||
|
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
||||||
bool GUISelectFile(struct GUIParams*, char* outPath, size_t outLen, bool (*filter)(struct VFile*));
|
bool GUISelectFile(struct GUIParams*, char* outPath, size_t outLen, bool (*filter)(struct VFile*));
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef DEFAULT_FONT_METRICS_H
|
#ifndef DEFAULT_FONT_METRICS_H
|
||||||
#define DEFAULT_FONT_METRICS_H
|
#define DEFAULT_FONT_METRICS_H
|
||||||
|
|
||||||
#include "util/gui/font.h"
|
#include <mgba-util/gui/font.h>
|
||||||
|
|
||||||
extern struct GUIFontGlyphMetric defaultFontMetrics[];
|
extern struct GUIFontGlyphMetric defaultFontMetrics[];
|
||||||
extern struct GUIIconMetric defaultIconMetrics[];
|
extern struct GUIIconMetric defaultIconMetrics[];
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef GUI_FONT_H
|
#ifndef GUI_FONT_H
|
||||||
#define GUI_FONT_H
|
#define GUI_FONT_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct GUIFont;
|
struct GUIFont;
|
||||||
struct GUIFont* GUIFontCreate(void);
|
struct GUIFont* GUIFontCreate(void);
|
||||||
|
@ -84,4 +86,6 @@ void GUIFontDrawGlyph(const struct GUIFont*, int x, int y, uint32_t color, uint3
|
||||||
void GUIFontDrawIcon(const struct GUIFont*, int x, int y, enum GUIAlignment, enum GUIOrientation, uint32_t color, enum GUIIcon);
|
void GUIFontDrawIcon(const struct GUIFont*, int x, int y, enum GUIAlignment, enum GUIOrientation, uint32_t color, enum GUIIcon);
|
||||||
void GUIFontDrawIconSize(const struct GUIFont* font, int x, int y, int w, int h, uint32_t color, enum GUIIcon icon);
|
void GUIFontDrawIconSize(const struct GUIFont* font, int x, int y, int w, int h, uint32_t color, enum GUIIcon icon);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,11 @@
|
||||||
#ifndef GUI_MENU_H
|
#ifndef GUI_MENU_H
|
||||||
#define GUI_MENU_H
|
#define GUI_MENU_H
|
||||||
|
|
||||||
#include "util/vector.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
struct GUIMenu;
|
struct GUIMenu;
|
||||||
struct GUIMenuItem {
|
struct GUIMenuItem {
|
||||||
|
@ -49,4 +53,6 @@ enum GUIMenuExitReason GUIShowMessageBox(struct GUIParams* params, int buttons,
|
||||||
void GUIDrawBattery(struct GUIParams* params);
|
void GUIDrawBattery(struct GUIParams* params);
|
||||||
void GUIDrawClock(struct GUIParams* params);
|
void GUIDrawClock(struct GUIParams* params);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,8 +6,12 @@
|
||||||
#ifndef HASH_H
|
#ifndef HASH_H
|
||||||
#define HASH_H
|
#define HASH_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
uint32_t hash32(const void* key, int len, uint32_t seed);
|
uint32_t hash32(const void* key, int len, uint32_t seed);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef UTIL_MATH_H
|
#ifndef UTIL_MATH_H
|
||||||
#define UTIL_MATH_H
|
#define UTIL_MATH_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
static inline uint32_t popcount32(unsigned bits) {
|
static inline uint32_t popcount32(unsigned bits) {
|
||||||
bits = bits - ((bits >> 1) & 0x55555555);
|
bits = bits - ((bits >> 1) & 0x55555555);
|
||||||
|
@ -59,4 +61,6 @@ static inline uint32_t toPow2(uint32_t bits) {
|
||||||
return 1 << (32 - lz);
|
return 1 << (32 - lz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,13 @@
|
||||||
#ifndef MEMORY_H
|
#ifndef MEMORY_H
|
||||||
#define MEMORY_H
|
#define MEMORY_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
void* anonymousMemoryMap(size_t size);
|
void* anonymousMemoryMap(size_t size);
|
||||||
void mappedMemoryFree(void* memory, size_t size);
|
void mappedMemoryFree(void* memory, size_t size);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef NOINTRO_H
|
#ifndef NOINTRO_H
|
||||||
#define NOINTRO_H
|
#define NOINTRO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct NoIntroGame {
|
struct NoIntroGame {
|
||||||
const char* name;
|
const char* name;
|
||||||
|
@ -26,4 +28,6 @@ struct NoIntroDB* NoIntroDBLoad(struct VFile* vf);
|
||||||
void NoIntroDBDestroy(struct NoIntroDB* db);
|
void NoIntroDBDestroy(struct NoIntroDB* db);
|
||||||
bool NoIntroDBLookupGameByCRC(const struct NoIntroDB* db, uint32_t crc32, struct NoIntroGame* game);
|
bool NoIntroDBLookupGameByCRC(const struct NoIntroDB* db, uint32_t crc32, struct NoIntroGame* game);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef PATCH_H
|
#ifndef PATCH_H
|
||||||
#define PATCH_H
|
#define PATCH_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct VFile;
|
struct VFile;
|
||||||
|
|
||||||
|
@ -19,4 +21,6 @@ struct Patch {
|
||||||
|
|
||||||
bool loadPatch(struct VFile* vf, struct Patch* patch);
|
bool loadPatch(struct VFile* vf, struct Patch* patch);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,12 @@
|
||||||
#ifndef PATCH_FAST_H
|
#ifndef PATCH_FAST_H
|
||||||
#define PATCH_FAST_H
|
#define PATCH_FAST_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "util/patch.h"
|
CXX_GUARD_START
|
||||||
#include "util/vector.h"
|
|
||||||
|
#include <mgba-util/patch.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
#define PATCH_FAST_EXTENT 256
|
#define PATCH_FAST_EXTENT 256
|
||||||
|
|
||||||
|
@ -31,4 +33,6 @@ void initPatchFast(struct PatchFast*);
|
||||||
void deinitPatchFast(struct PatchFast*);
|
void deinitPatchFast(struct PatchFast*);
|
||||||
bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size);
|
bool diffPatchFast(struct PatchFast* patch, const void* restrict in, const void* restrict out, size_t size);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,14 @@
|
||||||
#ifndef PATCH_IPS_H
|
#ifndef PATCH_IPS_H
|
||||||
#define PATCH_IPS_H
|
#define PATCH_IPS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct Patch;
|
struct Patch;
|
||||||
|
|
||||||
bool loadPatchIPS(struct Patch* patch);
|
bool loadPatchIPS(struct Patch* patch);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,14 @@
|
||||||
#ifndef PATCH_UPS_H
|
#ifndef PATCH_UPS_H
|
||||||
#define PATCH_UPS_H
|
#define PATCH_UPS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct Patch;
|
struct Patch;
|
||||||
|
|
||||||
bool loadPatchUPS(struct Patch* patch);
|
bool loadPatchUPS(struct Patch* patch);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef N3DS_VFS_H
|
#ifndef N3DS_VFS_H
|
||||||
#define N3DS_VFS_H
|
#define N3DS_VFS_H
|
||||||
|
|
||||||
#include "util/vfs.h"
|
#include <mgba-util/vfs.h>
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef N3DS_THREADING_H
|
#ifndef N3DS_THREADING_H
|
||||||
#define N3DS_THREADING_H
|
#define N3DS_THREADING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include <3ds.h>
|
#include <3ds.h>
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef POSIX_THREADING_H
|
#ifndef POSIX_THREADING_H
|
||||||
#define POSIX_THREADING_H
|
#define POSIX_THREADING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -94,4 +96,6 @@ static inline int ThreadSetName(const char* name) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef WINDOWS_THREADING_H
|
#ifndef WINDOWS_THREADING_H
|
||||||
#define WINDOWS_THREADING_H
|
#define WINDOWS_THREADING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#define _WIN32_WINNT 0x0600
|
#define _WIN32_WINNT 0x0600
|
||||||
#include <windows.h>
|
#include <windows.h>
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef PNG_IO_H
|
#ifndef PNG_IO_H
|
||||||
#define PNG_IO_H
|
#define PNG_IO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#ifdef USE_PNG
|
#ifdef USE_PNG
|
||||||
|
|
||||||
|
@ -37,4 +39,6 @@ void PNGReadClose(png_structp png, png_infop info, png_infop end);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef RING_FIFO_H
|
#ifndef RING_FIFO_H
|
||||||
#define RING_FIFO_H
|
#define RING_FIFO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct RingFIFO {
|
struct RingFIFO {
|
||||||
void* data;
|
void* data;
|
||||||
|
@ -22,4 +24,6 @@ void RingFIFOClear(struct RingFIFO* buffer);
|
||||||
size_t RingFIFOWrite(struct RingFIFO* buffer, const void* value, size_t length);
|
size_t RingFIFOWrite(struct RingFIFO* buffer, const void* value, size_t length);
|
||||||
size_t RingFIFORead(struct RingFIFO* buffer, void* output, size_t length);
|
size_t RingFIFORead(struct RingFIFO* buffer, void* output, size_t length);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef SOCKET_H
|
#ifndef SOCKET_H
|
||||||
#define SOCKET_H
|
#define SOCKET_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#if defined(__cplusplus) && !defined(restrict)
|
#if defined(__cplusplus) && !defined(restrict)
|
||||||
#define restrict __restrict__
|
#define restrict __restrict__
|
||||||
|
@ -316,4 +318,6 @@ static inline int SocketPoll(size_t nSockets, Socket* reads, Socket* writes, Soc
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef UTIL_STRING_H
|
#ifndef UTIL_STRING_H
|
||||||
#define UTIL_STRING_H
|
#define UTIL_STRING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#ifndef HAVE_STRNDUP
|
#ifndef HAVE_STRNDUP
|
||||||
// This is sometimes a macro
|
// This is sometimes a macro
|
||||||
|
@ -36,4 +38,6 @@ const char* hex4(const char* line, uint8_t* out);
|
||||||
|
|
||||||
void rtrim(char* string);
|
void rtrim(char* string);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef TABLE_H
|
#ifndef TABLE_H
|
||||||
#define TABLE_H
|
#define TABLE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct TableList;
|
struct TableList;
|
||||||
|
|
||||||
|
@ -29,13 +31,8 @@ void TableClear(struct Table*);
|
||||||
void TableEnumerate(const struct Table*, void (handler(uint32_t key, void* value, void* user)), void* user);
|
void TableEnumerate(const struct Table*, void (handler(uint32_t key, void* value, void* user)), void* user);
|
||||||
size_t TableSize(const struct Table*);
|
size_t TableSize(const struct Table*);
|
||||||
|
|
||||||
static inline void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*))) {
|
void HashTableInit(struct Table* table, size_t initialSize, void (deinitializer(void*)));
|
||||||
TableInit(table, initialSize, deinitializer);
|
void HashTableDeinit(struct Table* table);
|
||||||
}
|
|
||||||
|
|
||||||
static inline void HashTableDeinit(struct Table* table) {
|
|
||||||
TableDeinit(table);
|
|
||||||
}
|
|
||||||
|
|
||||||
void* HashTableLookup(const struct Table*, const char* key);
|
void* HashTableLookup(const struct Table*, const char* key);
|
||||||
void HashTableInsert(struct Table*, const char* key, void* value);
|
void HashTableInsert(struct Table*, const char* key, void* value);
|
||||||
|
@ -46,4 +43,6 @@ void HashTableClear(struct Table*);
|
||||||
void HashTableEnumerate(const struct Table*, void (handler(const char* key, void* value, void* user)), void* user);
|
void HashTableEnumerate(const struct Table*, void (handler(const char* key, void* value, void* user)), void* user);
|
||||||
size_t HashTableSize(const struct Table*);
|
size_t HashTableSize(const struct Table*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef TEXT_CODEC_H
|
#ifndef TEXT_CODEC_H
|
||||||
#define TEXT_CODEC_H
|
#define TEXT_CODEC_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct TextCodecNode;
|
struct TextCodecNode;
|
||||||
struct TextCodec {
|
struct TextCodec {
|
||||||
|
@ -29,4 +31,6 @@ void TextCodecStartEncode(struct TextCodec*, struct TextCodecIterator*);
|
||||||
ssize_t TextCodecAdvance(struct TextCodecIterator*, uint8_t byte, uint8_t* output, size_t outputLength);
|
ssize_t TextCodecAdvance(struct TextCodecIterator*, uint8_t byte, uint8_t* output, size_t outputLength);
|
||||||
ssize_t TextCodecFinish(struct TextCodecIterator*, uint8_t* output, size_t outputLength);
|
ssize_t TextCodecFinish(struct TextCodecIterator*, uint8_t* output, size_t outputLength);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,17 +6,19 @@
|
||||||
#ifndef THREADING_H
|
#ifndef THREADING_H
|
||||||
#define THREADING_H
|
#define THREADING_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#ifndef DISABLE_THREADING
|
#ifndef DISABLE_THREADING
|
||||||
#ifdef USE_PTHREADS
|
#ifdef USE_PTHREADS
|
||||||
#include "platform/posix/threading.h"
|
#include <mgba-util/platform/posix/threading.h>
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
#include "platform/windows/threading.h"
|
#include <mgba-util/platform/windows/threading.h>
|
||||||
#elif PSP2
|
#elif PSP2
|
||||||
#include "platform/psp2/threading.h"
|
#include <mgba-util/platform/psp2/threading.h>
|
||||||
#elif _3DS
|
#elif _3DS
|
||||||
#include "platform/3ds/threading.h"
|
#include <mgba-util/platform/3ds/threading.h>
|
||||||
#else
|
#else
|
||||||
#define DISABLE_THREADING
|
#define DISABLE_THREADING
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,4 +87,6 @@ static inline int ConditionWake(Condition* cond) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef VECTOR_H
|
#ifndef VECTOR_H
|
||||||
#define VECTOR_H
|
#define VECTOR_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#define DECLARE_VECTOR(NAME, TYPE) \
|
#define DECLARE_VECTOR(NAME, TYPE) \
|
||||||
struct NAME { \
|
struct NAME { \
|
||||||
|
@ -84,4 +86,6 @@
|
||||||
return member - (const TYPE*) vector->vector; \
|
return member - (const TYPE*) vector->vector; \
|
||||||
} \
|
} \
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef VFS_H
|
#ifndef VFS_H
|
||||||
#define VFS_H
|
#define VFS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
@ -65,12 +67,11 @@ struct VDir {
|
||||||
struct VFile* VFileOpen(const char* path, int flags);
|
struct VFile* VFileOpen(const char* path, int flags);
|
||||||
|
|
||||||
struct VFile* VFileOpenFD(const char* path, int flags);
|
struct VFile* VFileOpenFD(const char* path, int flags);
|
||||||
struct VFile* VFileFOpen(const char* path, const char* mode);
|
|
||||||
struct VFile* VFileFromFD(int fd);
|
struct VFile* VFileFromFD(int fd);
|
||||||
|
|
||||||
struct VFile* VFileFromMemory(void* mem, size_t size);
|
struct VFile* VFileFromMemory(void* mem, size_t size);
|
||||||
struct VFile* VFileFromConstMemory(const void* mem, size_t size);
|
struct VFile* VFileFromConstMemory(const void* mem, size_t size);
|
||||||
struct VFile* VFileMemChunk(const void* mem, size_t size);
|
struct VFile* VFileMemChunk(const void* mem, size_t size);
|
||||||
struct VFile* VFileFromFILE(FILE* file);
|
|
||||||
|
|
||||||
struct VDir* VDirOpen(const char* path);
|
struct VDir* VDirOpen(const char* path);
|
||||||
struct VDir* VDirOpenArchive(const char* path);
|
struct VDir* VDirOpenArchive(const char* path);
|
||||||
|
@ -83,7 +84,11 @@ struct VDir* VDirOpenZip(const char* path, int flags);
|
||||||
struct VDir* VDirOpen7z(const char* path, int flags);
|
struct VDir* VDirOpen7z(const char* path, int flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__wii__) || defined(_3DS)
|
||||||
|
struct VFile* VFileFOpen(const char* path, const char* mode);
|
||||||
|
struct VFile* VFileFromFILE(FILE* file);
|
||||||
struct VDir* VDeviceList(void);
|
struct VDir* VDeviceList(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
void separatePath(const char* path, char* dirname, char* basename, char* extension);
|
void separatePath(const char* path, char* dirname, char* basename, char* extension);
|
||||||
|
|
||||||
|
@ -97,4 +102,6 @@ ssize_t VFileWrite16LE(struct VFile* vf, int16_t hword);
|
||||||
ssize_t VFileRead32LE(struct VFile* vf, void* word);
|
ssize_t VFileRead32LE(struct VFile* vf, void* word);
|
||||||
ssize_t VFileRead16LE(struct VFile* vf, void* hword);
|
ssize_t VFileRead16LE(struct VFile* vf, void* hword);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -24,7 +24,7 @@ void blip_set_rates( blip_t*, double clock_rate, double sample_rate );
|
||||||
|
|
||||||
enum { /** Maximum clock_rate/sample_rate ratio. For a given sample_rate,
|
enum { /** Maximum clock_rate/sample_rate ratio. For a given sample_rate,
|
||||||
clock_rate must not be greater than sample_rate*blip_max_ratio. */
|
clock_rate must not be greater than sample_rate*blip_max_ratio. */
|
||||||
blip_max_ratio = 1 << 20 };
|
blip_max_ratio = 0x100000 };
|
||||||
|
|
||||||
/** Clears entire buffer. Afterwards, blip_samples_avail() == 0. */
|
/** Clears entire buffer. Afterwards, blip_samples_avail() == 0. */
|
||||||
void blip_clear( blip_t* );
|
void blip_clear( blip_t* );
|
|
@ -6,11 +6,13 @@
|
||||||
#ifndef CHEATS_H
|
#ifndef CHEATS_H
|
||||||
#define CHEATS_H
|
#define CHEATS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/cpu.h"
|
CXX_GUARD_START
|
||||||
#include "core/log.h"
|
|
||||||
#include "util/vector.h"
|
#include <mgba/core/cpu.h>
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
#define MAX_ROM_PATCHES 4
|
#define MAX_ROM_PATCHES 4
|
||||||
|
|
||||||
|
@ -100,4 +102,6 @@ bool mCheatSaveFile(struct mCheatDevice*, struct VFile*);
|
||||||
|
|
||||||
void mCheatRefresh(struct mCheatDevice*, struct mCheatSet*);
|
void mCheatRefresh(struct mCheatDevice*, struct mCheatSet*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef M_CORE_CONFIG_H
|
#ifndef M_CORE_CONFIG_H
|
||||||
#define M_CORE_CONFIG_H
|
#define M_CORE_CONFIG_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "util/configuration.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/configuration.h>
|
||||||
|
|
||||||
struct mCoreConfig {
|
struct mCoreConfig {
|
||||||
struct Configuration configTable;
|
struct Configuration configTable;
|
||||||
|
@ -91,4 +93,6 @@ const struct Configuration* mCoreConfigGetOverridesConst(const struct mCoreConfi
|
||||||
|
|
||||||
void mCoreConfigFreeOpts(struct mCoreOptions* opts);
|
void mCoreConfigFreeOpts(struct mCoreOptions* opts);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,18 +6,21 @@
|
||||||
#ifndef M_CORE_H
|
#ifndef M_CORE_H
|
||||||
#define M_CORE_H
|
#define M_CORE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/config.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/config.h>
|
||||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||||
#include "core/directories.h"
|
#include <mgba/core/directories.h>
|
||||||
#endif
|
#endif
|
||||||
#ifndef MINIMAL_CORE
|
#ifndef MINIMAL_CORE
|
||||||
#include "core/input.h"
|
#include <mgba/core/input.h>
|
||||||
#endif
|
#endif
|
||||||
#include "core/interface.h"
|
#include <mgba/core/interface.h>
|
||||||
#ifdef USE_DEBUGGERS
|
#ifdef USE_DEBUGGERS
|
||||||
#include "debugger/debugger.h"
|
// TODO: Fix layering violation
|
||||||
|
#include <mgba/internal/debugger/debugger.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum mPlatform {
|
enum mPlatform {
|
||||||
|
@ -162,4 +165,6 @@ void mCoreInitConfig(struct mCore* core, const char* port);
|
||||||
void mCoreLoadConfig(struct mCore* core);
|
void mCoreLoadConfig(struct mCore* core);
|
||||||
void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config);
|
void mCoreLoadForeignConfig(struct mCore* core, const struct mCoreConfig* config);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_CPU_H
|
#ifndef M_CPU_H
|
||||||
#define M_CPU_H
|
#define M_CPU_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
enum mCPUComponentType {
|
enum mCPUComponentType {
|
||||||
CPU_COMPONENT_DEBUGGER,
|
CPU_COMPONENT_DEBUGGER,
|
||||||
|
@ -20,4 +22,6 @@ struct mCPUComponent {
|
||||||
void (*deinit)(struct mCPUComponent* component);
|
void (*deinit)(struct mCPUComponent* component);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef DIRECTORIES_H
|
#ifndef DIRECTORIES_H
|
||||||
#define DIRECTORIES_H
|
#define DIRECTORIES_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
#if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
|
||||||
struct VDir;
|
struct VDir;
|
||||||
|
@ -34,4 +36,6 @@ struct mCoreOptions;
|
||||||
void mDirectorySetMapOptions(struct mDirectorySet* dirs, const struct mCoreOptions* opts);
|
void mDirectorySetMapOptions(struct mDirectorySet* dirs, const struct mCoreOptions* opts);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_INPUT_H
|
#ifndef M_INPUT_H
|
||||||
#define M_INPUT_H
|
#define M_INPUT_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct Configuration;
|
struct Configuration;
|
||||||
|
|
||||||
|
@ -60,4 +62,6 @@ const char* mInputGetCustomValue(const struct Configuration* config, const char*
|
||||||
void mInputSetCustomValue(struct Configuration* config, const char* platformName, uint32_t type, const char* key, const char* value,
|
void mInputSetCustomValue(struct Configuration* config, const char* platformName, uint32_t type, const char* key, const char* value,
|
||||||
const char* profile);
|
const char* profile);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef CORE_INTERFACE_H
|
#ifndef CORE_INTERFACE_H
|
||||||
#define CORE_INTERFACE_H
|
#define CORE_INTERFACE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct mCore;
|
struct mCore;
|
||||||
|
|
||||||
|
@ -84,4 +86,6 @@ struct mRumble {
|
||||||
void (*setRumble)(struct mRumble*, int enable);
|
void (*setRumble)(struct mRumble*, int enable);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,12 @@
|
||||||
#ifndef M_LIBRARY_H
|
#ifndef M_LIBRARY_H
|
||||||
#define M_LIBRARY_H
|
#define M_LIBRARY_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/core.h"
|
CXX_GUARD_START
|
||||||
#include "util/vector.h"
|
|
||||||
|
#include <mgba/core/core.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
struct mLibraryEntry {
|
struct mLibraryEntry {
|
||||||
char* filename;
|
char* filename;
|
||||||
|
@ -34,4 +36,6 @@ struct VFile;
|
||||||
void mLibraryLoadDirectory(struct mLibrary* library, struct VDir* dir);
|
void mLibraryLoadDirectory(struct mLibrary* library, struct VDir* dir);
|
||||||
void mLibraryAddEntry(struct mLibrary* library, const char* filename, struct VFile* vf);
|
void mLibraryAddEntry(struct mLibrary* library, const char* filename, struct VFile* vf);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -0,0 +1,41 @@
|
||||||
|
/* Copyright (c) 2013-2016 Jeffrey Pfau
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
#ifndef SIO_LOCKSTEP_H
|
||||||
|
#define SIO_LOCKSTEP_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
enum mLockstepPhase {
|
||||||
|
TRANSFER_IDLE = 0,
|
||||||
|
TRANSFER_STARTING,
|
||||||
|
TRANSFER_STARTED,
|
||||||
|
TRANSFER_FINISHING,
|
||||||
|
TRANSFER_FINISHED
|
||||||
|
};
|
||||||
|
|
||||||
|
struct mLockstep {
|
||||||
|
int attached;
|
||||||
|
enum mLockstepPhase transferActive;
|
||||||
|
int32_t transferCycles;
|
||||||
|
|
||||||
|
bool (*signal)(struct mLockstep*, unsigned mask);
|
||||||
|
bool (*wait)(struct mLockstep*, unsigned mask);
|
||||||
|
void (*addCycles)(struct mLockstep*, int id, int32_t cycles);
|
||||||
|
int32_t (*useCycles)(struct mLockstep*, int id, int32_t cycles);
|
||||||
|
void (*unload)(struct mLockstep*, int id);
|
||||||
|
void* context;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
int transferId;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
void mLockstepInit(struct mLockstep*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_LOG_H
|
#ifndef M_LOG_H
|
||||||
#define M_LOG_H
|
#define M_LOG_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
enum mLogLevel {
|
enum mLogLevel {
|
||||||
mLOG_FATAL = 0x01,
|
mLOG_FATAL = 0x01,
|
||||||
|
@ -30,19 +32,7 @@ int mLogGenerateCategory(const char*);
|
||||||
const char* mLogCategoryName(int);
|
const char* mLogCategoryName(int);
|
||||||
|
|
||||||
ATTRIBUTE_FORMAT(printf, 3, 4)
|
ATTRIBUTE_FORMAT(printf, 3, 4)
|
||||||
static inline void mLog(int category, enum mLogLevel level, const char* format, ...) {
|
void mLog(int category, enum mLogLevel level, const char* format, ...);
|
||||||
struct mLogger* context = mLogGetContext();
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
if (context) {
|
|
||||||
context->log(context, category, level, format, args);
|
|
||||||
} else {
|
|
||||||
printf("%s: ", mLogCategoryName(category));
|
|
||||||
vprintf(format, args);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define mLOG(CATEGORY, LEVEL, ...) mLog(_mLOG_CAT_ ## CATEGORY (), mLOG_ ## LEVEL, __VA_ARGS__)
|
#define mLOG(CATEGORY, LEVEL, ...) mLog(_mLOG_CAT_ ## CATEGORY (), mLOG_ ## LEVEL, __VA_ARGS__)
|
||||||
|
|
||||||
|
@ -58,4 +48,6 @@ static inline void mLog(int category, enum mLogLevel level, const char* format,
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(STATUS)
|
mLOG_DECLARE_CATEGORY(STATUS)
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef M_CORE_REWIND_H
|
#ifndef M_CORE_REWIND_H
|
||||||
#define M_CORE_REWIND_H
|
#define M_CORE_REWIND_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "util/vector.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast);
|
DECLARE_VECTOR(mCoreRewindPatches, struct PatchFast);
|
||||||
|
|
||||||
|
@ -28,4 +30,6 @@ struct mCore;
|
||||||
void mCoreRewindAppend(struct mCoreRewindContext*, struct mCore*);
|
void mCoreRewindAppend(struct mCoreRewindContext*, struct mCore*);
|
||||||
bool mCoreRewindRestore(struct mCoreRewindContext*, struct mCore*);
|
bool mCoreRewindRestore(struct mCoreRewindContext*, struct mCore*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_SERIALIZE_H
|
#ifndef M_SERIALIZE_H
|
||||||
#define M_SERIALIZE_H
|
#define M_SERIALIZE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
enum mStateExtdataTag {
|
enum mStateExtdataTag {
|
||||||
EXTDATA_NONE = 0,
|
EXTDATA_NONE = 0,
|
||||||
|
@ -44,4 +46,6 @@ bool mCoreSaveStateNamed(struct mCore* core, struct VFile* vf, int flags);
|
||||||
bool mCoreLoadStateNamed(struct mCore* core, struct VFile* vf, int flags);
|
bool mCoreLoadStateNamed(struct mCore* core, struct VFile* vf, int flags);
|
||||||
void* mCoreExtractState(struct mCore* core, struct VFile* vf, struct mStateExtdata* extdata);
|
void* mCoreExtractState(struct mCore* core, struct VFile* vf, struct mStateExtdata* extdata);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef M_CORE_SYNC_H
|
#ifndef M_CORE_SYNC_H
|
||||||
#define M_CORE_SYNC_H
|
#define M_CORE_SYNC_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "util/threading.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba-util/threading.h>
|
||||||
|
|
||||||
struct mCoreSync {
|
struct mCoreSync {
|
||||||
int videoFramePending;
|
int videoFramePending;
|
||||||
|
@ -36,4 +38,6 @@ void mCoreSyncLockAudio(struct mCoreSync* sync);
|
||||||
void mCoreSyncUnlockAudio(struct mCoreSync* sync);
|
void mCoreSyncUnlockAudio(struct mCoreSync* sync);
|
||||||
void mCoreSyncConsumeAudio(struct mCoreSync* sync);
|
void mCoreSyncConsumeAudio(struct mCoreSync* sync);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,12 +6,14 @@
|
||||||
#ifndef M_CORE_THREAD_H
|
#ifndef M_CORE_THREAD_H
|
||||||
#define M_CORE_THREAD_H
|
#define M_CORE_THREAD_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
#include "core/rewind.h"
|
|
||||||
#include "core/sync.h"
|
#include <mgba/core/log.h>
|
||||||
#include "util/threading.h"
|
#include <mgba/core/rewind.h>
|
||||||
|
#include <mgba/core/sync.h>
|
||||||
|
#include <mgba-util/threading.h>
|
||||||
|
|
||||||
struct mCoreThread;
|
struct mCoreThread;
|
||||||
struct mCore;
|
struct mCore;
|
||||||
|
@ -97,4 +99,6 @@ void mCoreThreadSetRewinding(struct mCoreThread* threadContext, bool);
|
||||||
struct mCoreThread* mCoreThreadGet(void);
|
struct mCoreThread* mCoreThreadGet(void);
|
||||||
struct mLogger* mCoreThreadLogger(void);
|
struct mLogger* mCoreThreadLogger(void);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_TILE_CACHE_H
|
#ifndef M_TILE_CACHE_H
|
||||||
#define M_TILE_CACHE_H
|
#define M_TILE_CACHE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
DECL_BITFIELD(mTileCacheConfiguration, uint32_t);
|
DECL_BITFIELD(mTileCacheConfiguration, uint32_t);
|
||||||
DECL_BIT(mTileCacheConfiguration, ShouldStore, 0);
|
DECL_BIT(mTileCacheConfiguration, ShouldStore, 0);
|
||||||
|
@ -57,4 +59,6 @@ void mTileCacheSetPalette(struct mTileCache* cache, int palette);
|
||||||
const uint16_t* mTileCacheGetTile(struct mTileCache* cache, unsigned tileId, unsigned paletteId);
|
const uint16_t* mTileCacheGetTile(struct mTileCache* cache, unsigned tileId, unsigned paletteId);
|
||||||
const uint16_t* mTileCacheGetTileIfDirty(struct mTileCache* cache, struct mTileCacheEntry* entry, unsigned tileId, unsigned paletteId);
|
const uint16_t* mTileCacheGetTileIfDirty(struct mTileCache* cache, struct mTileCacheEntry* entry, unsigned tileId, unsigned paletteId);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef M_CORE_TIMING
|
#ifndef M_CORE_TIMING
|
||||||
#define M_CORE_TIMING
|
#define M_CORE_TIMING
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct mTiming;
|
struct mTiming;
|
||||||
struct mTimingEvent {
|
struct mTimingEvent {
|
||||||
|
@ -37,4 +39,6 @@ int32_t mTimingTick(struct mTiming* timing, int32_t cycles);
|
||||||
int32_t mTimingCurrentTime(const struct mTiming* timing);
|
int32_t mTimingCurrentTime(const struct mTiming* timing);
|
||||||
int32_t mTimingNextEvent(struct mTiming* timing);
|
int32_t mTimingNextEvent(struct mTiming* timing);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,13 @@
|
||||||
#ifndef DS_CORE_H
|
#ifndef DS_CORE_H
|
||||||
#define DS_CORE_H
|
#define DS_CORE_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct mCore;
|
struct mCore;
|
||||||
struct mCore* DSCoreCreate(void);
|
struct mCore* DSCoreCreate(void);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,13 @@
|
||||||
#ifndef GB_CORE_H
|
#ifndef GB_CORE_H
|
||||||
#define GB_CORE_H
|
#define GB_CORE_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct mCore;
|
struct mCore;
|
||||||
struct mCore* GBCoreCreate(void);
|
struct mCore* GBCoreCreate(void);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef GB_INTERFACE_H
|
#ifndef GB_INTERFACE_H
|
||||||
#define GB_INTERFACE_H
|
#define GB_INTERFACE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
enum GBModel {
|
enum GBModel {
|
||||||
GB_MODEL_AUTODETECT = 0xFF,
|
GB_MODEL_AUTODETECT = 0xFF,
|
||||||
|
@ -32,4 +34,6 @@ enum GBMemoryBankControllerType {
|
||||||
GB_MBC5_RUMBLE = 0x105
|
GB_MBC5_RUMBLE = 0x105
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,13 @@
|
||||||
#ifndef GBA_CORE_H
|
#ifndef GBA_CORE_H
|
||||||
#define GBA_CORE_H
|
#define GBA_CORE_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct mCore;
|
struct mCore;
|
||||||
struct mCore* GBACoreCreate(void);
|
struct mCore* GBACoreCreate(void);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef GBA_INTERFACE_H
|
#ifndef GBA_INTERFACE_H
|
||||||
#define GBA_INTERFACE_H
|
#define GBA_INTERFACE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/interface.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/interface.h>
|
||||||
|
|
||||||
enum GBASIOMode {
|
enum GBASIOMode {
|
||||||
SIO_NORMAL_8 = 0,
|
SIO_NORMAL_8 = 0,
|
||||||
|
@ -42,4 +44,6 @@ struct GBASIODriver {
|
||||||
uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
|
uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef ARM_H
|
#ifndef ARM_H
|
||||||
#define ARM_H
|
#define ARM_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/cpu.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/cpu.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
ARM_SP = 13,
|
ARM_SP = 13,
|
||||||
|
@ -73,7 +75,7 @@ union PSR {
|
||||||
unsigned z : 1;
|
unsigned z : 1;
|
||||||
unsigned c : 1;
|
unsigned c : 1;
|
||||||
unsigned v : 1;
|
unsigned v : 1;
|
||||||
unsigned : 20;
|
unsigned unused : 20;
|
||||||
unsigned i : 1;
|
unsigned i : 1;
|
||||||
unsigned f : 1;
|
unsigned f : 1;
|
||||||
unsigned t : 1;
|
unsigned t : 1;
|
||||||
|
@ -83,7 +85,7 @@ union PSR {
|
||||||
unsigned t : 1;
|
unsigned t : 1;
|
||||||
unsigned f : 1;
|
unsigned f : 1;
|
||||||
unsigned i : 1;
|
unsigned i : 1;
|
||||||
unsigned : 20;
|
unsigned unused : 20;
|
||||||
unsigned v : 1;
|
unsigned v : 1;
|
||||||
unsigned c : 1;
|
unsigned c : 1;
|
||||||
unsigned z : 1;
|
unsigned z : 1;
|
||||||
|
@ -261,4 +263,6 @@ void ARMv5RunLoop(struct ARMCore* cpu);
|
||||||
int32_t ARMv5RunCycles(struct ARMCore* cpu, int32_t cycles);
|
int32_t ARMv5RunCycles(struct ARMCore* cpu, int32_t cycles);
|
||||||
void ARMRunFake(struct ARMCore* cpu, uint32_t opcode);
|
void ARMRunFake(struct ARMCore* cpu, uint32_t opcode);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,13 @@
|
||||||
#ifndef ARM_CLI_DEBUGGER_H
|
#ifndef ARM_CLI_DEBUGGER_H
|
||||||
#define ARM_CLI_DEBUGGER_H
|
#define ARM_CLI_DEBUGGER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct CLIDebuggerSystem;
|
struct CLIDebuggerSystem;
|
||||||
void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger);
|
void ARMCLIDebuggerCreate(struct CLIDebuggerSystem* debugger);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -3,7 +3,16 @@
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
#include "debugger/debugger.h"
|
#ifndef ARM_DEBUGGER_H
|
||||||
|
#define ARM_DEBUGGER_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/debugger/debugger.h>
|
||||||
|
|
||||||
|
#include <mgba/internal/arm/arm.h>
|
||||||
|
|
||||||
struct ARMDebugBreakpoint {
|
struct ARMDebugBreakpoint {
|
||||||
uint32_t address;
|
uint32_t address;
|
||||||
|
@ -40,3 +49,7 @@ struct ARMDebugger {
|
||||||
struct mDebuggerPlatform* ARMDebuggerPlatformCreate(void);
|
struct mDebuggerPlatform* ARMDebuggerPlatformCreate(void);
|
||||||
bool ARMDebuggerSetSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address, enum ExecutionMode mode);
|
bool ARMDebuggerSetSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address, enum ExecutionMode mode);
|
||||||
void ARMDebuggerClearSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address);
|
void ARMDebuggerClearSoftwareBreakpoint(struct mDebuggerPlatform* debugger, uint32_t address);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
|
#endif
|
|
@ -6,11 +6,15 @@
|
||||||
#ifndef MEMORY_DEBUGGER_H
|
#ifndef MEMORY_DEBUGGER_H
|
||||||
#define MEMORY_DEBUGGER_H
|
#define MEMORY_DEBUGGER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct ARMDebugger;
|
struct ARMDebugger;
|
||||||
|
|
||||||
void ARMDebuggerInstallMemoryShim(struct ARMDebugger* debugger);
|
void ARMDebuggerInstallMemoryShim(struct ARMDebugger* debugger);
|
||||||
void ARMDebuggerRemoveMemoryShim(struct ARMDebugger* debugger);
|
void ARMDebuggerRemoveMemoryShim(struct ARMDebugger* debugger);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,11 @@
|
||||||
#ifndef ARM_DECODER_H
|
#ifndef ARM_DECODER_H
|
||||||
#define ARM_DECODER_H
|
#define ARM_DECODER_H
|
||||||
|
|
||||||
#include "arm.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/arm/arm.h>
|
||||||
|
|
||||||
// Bit 0: a register is involved with this operand
|
// Bit 0: a register is involved with this operand
|
||||||
// Bit 1: an immediate is invovled with this operand
|
// Bit 1: an immediate is invovled with this operand
|
||||||
|
@ -234,4 +238,6 @@ bool ARMDecodeThumbCombine(struct ARMInstructionInfo* info1, struct ARMInstructi
|
||||||
struct ARMInstructionInfo* out);
|
struct ARMInstructionInfo* out);
|
||||||
int ARMDisassemble(struct ARMInstructionInfo* info, uint32_t pc, char* buffer, int blen);
|
int ARMDisassemble(struct ARMInstructionInfo* info, uint32_t pc, char* buffer, int blen);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef ISA_ARM_H
|
#ifndef ISA_ARM_H
|
||||||
#define ISA_ARM_H
|
#define ISA_ARM_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32)
|
#define ARM_PREFETCH_CYCLES (1 + cpu->memory.activeSeqCycles32)
|
||||||
|
|
||||||
|
@ -16,4 +18,6 @@ typedef void (*ARMInstruction)(struct ARMCore*, uint32_t opcode);
|
||||||
extern const ARMInstruction _armv4Table[0x1000];
|
extern const ARMInstruction _armv4Table[0x1000];
|
||||||
extern const ARMInstruction _armv5Table[0x1000];
|
extern const ARMInstruction _armv5Table[0x1000];
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,15 @@
|
||||||
#ifndef ISA_THUMB_H
|
#ifndef ISA_THUMB_H
|
||||||
#define ISA_THUMB_H
|
#define ISA_THUMB_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct ARMCore;
|
struct ARMCore;
|
||||||
|
|
||||||
typedef void (*ThumbInstruction)(struct ARMCore*, uint16_t opcode);
|
typedef void (*ThumbInstruction)(struct ARMCore*, uint16_t opcode);
|
||||||
extern const ThumbInstruction _thumbTable[0x400];
|
extern const ThumbInstruction _thumbTable[0x400];
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,7 @@
|
||||||
#ifndef MACROS_H
|
#ifndef MACROS_H
|
||||||
#define MACROS_H
|
#define MACROS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#define LOAD_64 LOAD_64LE
|
#define LOAD_64 LOAD_64LE
|
||||||
#define LOAD_32 LOAD_32LE
|
#define LOAD_32 LOAD_32LE
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef CLI_DEBUGGER_H
|
#ifndef CLI_DEBUGGER_H
|
||||||
#define CLI_DEBUGGER_H
|
#define CLI_DEBUGGER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "debugger.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/debugger/debugger.h>
|
||||||
|
|
||||||
struct CLIDebugger;
|
struct CLIDebugger;
|
||||||
|
|
||||||
|
@ -86,4 +88,6 @@ void CLIDebuggerAttachBackend(struct CLIDebugger*, struct CLIDebuggerBackend*);
|
||||||
|
|
||||||
bool CLIDebuggerTabComplete(struct CLIDebugger*, const char* token, bool initial, size_t len);
|
bool CLIDebuggerTabComplete(struct CLIDebugger*, const char* token, bool initial, size_t len);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,13 @@
|
||||||
#ifndef DEBUGGER_H
|
#ifndef DEBUGGER_H
|
||||||
#define DEBUGGER_H
|
#define DEBUGGER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "arm/arm.h"
|
CXX_GUARD_START
|
||||||
#include "core/log.h"
|
|
||||||
#include "util/vector.h"
|
#include <mgba/core/cpu.h>
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(DEBUGGER);
|
mLOG_DECLARE_CATEGORY(DEBUGGER);
|
||||||
|
|
||||||
|
@ -35,7 +37,7 @@ enum mDebuggerState {
|
||||||
enum mWatchpointType {
|
enum mWatchpointType {
|
||||||
WATCHPOINT_WRITE = 1,
|
WATCHPOINT_WRITE = 1,
|
||||||
WATCHPOINT_READ = 2,
|
WATCHPOINT_READ = 2,
|
||||||
WATCHPOINT_RW = WATCHPOINT_WRITE | WATCHPOINT_READ
|
WATCHPOINT_RW = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum mBreakpointType {
|
enum mBreakpointType {
|
||||||
|
@ -111,5 +113,6 @@ void mDebuggerAttach(struct mDebugger*, struct mCore*);
|
||||||
void mDebuggerRun(struct mDebugger*);
|
void mDebuggerRun(struct mDebugger*);
|
||||||
void mDebuggerEnter(struct mDebugger*, enum mDebuggerEntryReason, struct mDebuggerEntryInfo*);
|
void mDebuggerEnter(struct mDebugger*, enum mDebuggerEntryReason, struct mDebuggerEntryInfo*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,13 @@
|
||||||
#ifndef GDB_STUB_H
|
#ifndef GDB_STUB_H
|
||||||
#define GDB_STUB_H
|
#define GDB_STUB_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "debugger/debugger.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
#include "util/socket.h"
|
#include <mgba/internal/debugger/debugger.h>
|
||||||
|
|
||||||
|
#include <mgba-util/socket.h>
|
||||||
|
|
||||||
#define GDB_STUB_MAX_LINE 1200
|
#define GDB_STUB_MAX_LINE 1200
|
||||||
#define GDB_STUB_INTERVAL 32
|
#define GDB_STUB_INTERVAL 32
|
||||||
|
@ -47,4 +49,6 @@ void GDBStubShutdown(struct GDBStub*);
|
||||||
|
|
||||||
void GDBStubUpdate(struct GDBStub*);
|
void GDBStubUpdate(struct GDBStub*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,8 +6,11 @@
|
||||||
#ifndef PARSER_H
|
#ifndef PARSER_H
|
||||||
#define PARSER_H
|
#define PARSER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
#include "debugger.h"
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/debugger/debugger.h>
|
||||||
|
|
||||||
enum LexState {
|
enum LexState {
|
||||||
LEX_ERROR = -1,
|
LEX_ERROR = -1,
|
||||||
|
@ -62,4 +65,6 @@ void parseLexedExpression(struct ParseTree* tree, struct LexVector* lv);
|
||||||
void lexFree(struct LexVector* lv);
|
void lexFree(struct LexVector* lv);
|
||||||
void parseFree(struct ParseTree* tree);
|
void parseFree(struct ParseTree* tree);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef DS_BIOS_H
|
#ifndef DS_BIOS_H
|
||||||
#define DS_BIOS_H
|
#define DS_BIOS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(DS_BIOS);
|
mLOG_DECLARE_CATEGORY(DS_BIOS);
|
||||||
|
|
||||||
|
@ -21,4 +23,6 @@ void DS9Swi32(struct ARMCore* cpu, int immediate);
|
||||||
extern const uint32_t DS7_BIOS_CHECKSUM;
|
extern const uint32_t DS7_BIOS_CHECKSUM;
|
||||||
extern const uint32_t DS9_BIOS_CHECKSUM;
|
extern const uint32_t DS9_BIOS_CHECKSUM;
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,14 +6,16 @@
|
||||||
#ifndef DS_H
|
#ifndef DS_H
|
||||||
#define DS_H
|
#define DS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "arm/arm.h"
|
CXX_GUARD_START
|
||||||
#include "core/log.h"
|
|
||||||
|
|
||||||
#include "ds/memory.h"
|
#include <mgba/internal/arm/arm.h>
|
||||||
#include "ds/timer.h"
|
#include <mgba/core/log.h>
|
||||||
#include "ds/video.h"
|
|
||||||
|
#include <mgba/internal/ds/memory.h>
|
||||||
|
#include <mgba/internal/ds/timer.h>
|
||||||
|
#include <mgba/internal/ds/video.h>
|
||||||
|
|
||||||
extern const uint32_t DS_ARM946ES_FREQUENCY;
|
extern const uint32_t DS_ARM946ES_FREQUENCY;
|
||||||
extern const uint32_t DS_ARM7TDMI_FREQUENCY;
|
extern const uint32_t DS_ARM7TDMI_FREQUENCY;
|
||||||
|
@ -140,4 +142,6 @@ void DSWriteIME(struct ARMCore* cpu, uint16_t* io, uint16_t value);
|
||||||
void DSWriteIE(struct ARMCore* cpu, uint16_t* io, uint32_t value);
|
void DSWriteIE(struct ARMCore* cpu, uint16_t* io, uint32_t value);
|
||||||
void DSRaiseIRQ(struct ARMCore* cpu, uint16_t* io, enum DSIRQ irq);
|
void DSRaiseIRQ(struct ARMCore* cpu, uint16_t* io, enum DSIRQ irq);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,11 @@
|
||||||
#ifndef DS_CLI_H
|
#ifndef DS_CLI_H
|
||||||
#define DS_CLI_H
|
#define DS_CLI_H
|
||||||
|
|
||||||
#include "debugger/cli-debugger.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/debugger/cli-debugger.h>
|
||||||
|
|
||||||
struct mCore;
|
struct mCore;
|
||||||
|
|
||||||
|
@ -21,4 +25,6 @@ struct DSCLIDebugger {
|
||||||
|
|
||||||
struct DSCLIDebugger* DSCLIDebuggerCreate(struct mCore*);
|
struct DSCLIDebugger* DSCLIDebuggerCreate(struct mCore*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef DS_IO_H
|
#ifndef DS_IO_H
|
||||||
#define DS_IO_H
|
#define DS_IO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
|
||||||
enum DS7IORegisters {
|
enum DS7IORegisters {
|
||||||
// Video
|
// Video
|
||||||
|
@ -339,4 +341,7 @@ void DS9IOWrite(struct DS* ds, uint32_t address, uint16_t value);
|
||||||
void DS9IOWrite8(struct DS* ds, uint32_t address, uint8_t value);
|
void DS9IOWrite8(struct DS* ds, uint32_t address, uint8_t value);
|
||||||
void DS9IOWrite32(struct DS* ds, uint32_t address, uint32_t value);
|
void DS9IOWrite32(struct DS* ds, uint32_t address, uint32_t value);
|
||||||
uint16_t DS9IORead(struct DS* ds, uint32_t address);
|
uint16_t DS9IORead(struct DS* ds, uint32_t address);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,13 @@
|
||||||
#ifndef DS_MEMORY_H
|
#ifndef DS_MEMORY_H
|
||||||
#define DS_MEMORY_H
|
#define DS_MEMORY_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "arm/arm.h"
|
CXX_GUARD_START
|
||||||
#include "core/log.h"
|
|
||||||
#include "ds/io.h"
|
#include <mgba/internal/arm/arm.h>
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
#include <mgba/internal/ds/io.h>
|
||||||
|
|
||||||
enum DSMemoryRegion {
|
enum DSMemoryRegion {
|
||||||
DS7_REGION_BIOS = 0x0,
|
DS7_REGION_BIOS = 0x0,
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef DS_TIMER_H
|
#ifndef DS_TIMER_H
|
||||||
#define DS_TIMER_H
|
#define DS_TIMER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
DECL_BITFIELD(DSTimerFlags, uint32_t);
|
DECL_BITFIELD(DSTimerFlags, uint32_t);
|
||||||
DECL_BITS(DSTimerFlags, PrescaleBits, 0, 4);
|
DECL_BITS(DSTimerFlags, PrescaleBits, 0, 4);
|
||||||
|
@ -31,4 +33,7 @@ void DSTimerWriteTMCNT_HI(struct DSTimer* timer, struct ARMCore* cpu, uint16_t*
|
||||||
|
|
||||||
struct DS;
|
struct DS;
|
||||||
int32_t DSTimersProcessEvents(struct DS* ds, int32_t cycles);
|
int32_t DSTimersProcessEvents(struct DS* ds, int32_t cycles);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef DS_VIDEO_H
|
#ifndef DS_VIDEO_H
|
||||||
#define DS_VIDEO_H
|
#define DS_VIDEO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(DS_VIDEO);
|
mLOG_DECLARE_CATEGORY(DS_VIDEO);
|
||||||
|
|
||||||
|
@ -48,4 +50,6 @@ void DSVideoInit(struct DSVideo* video);
|
||||||
void DSVideoReset(struct DSVideo* video);
|
void DSVideoReset(struct DSVideo* video);
|
||||||
void DSVideoDeinit(struct DSVideo* video);
|
void DSVideoDeinit(struct DSVideo* video);
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,11 @@
|
||||||
#ifndef GB_AUDIO_H
|
#ifndef GB_AUDIO_H
|
||||||
#define GB_AUDIO_H
|
#define GB_AUDIO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/timing.h"
|
CXX_GUARD_START
|
||||||
#include "third-party/blip_buf/blip_buf.h"
|
|
||||||
|
#include <mgba/core/timing.h>
|
||||||
|
|
||||||
DECL_BITFIELD(GBAudioRegisterDuty, uint8_t);
|
DECL_BITFIELD(GBAudioRegisterDuty, uint8_t);
|
||||||
DECL_BITS(GBAudioRegisterDuty, Length, 0, 6);
|
DECL_BITS(GBAudioRegisterDuty, Length, 0, 6);
|
||||||
|
@ -155,8 +156,8 @@ struct GBAudio {
|
||||||
struct GBAudioWaveChannel ch3;
|
struct GBAudioWaveChannel ch3;
|
||||||
struct GBAudioNoiseChannel ch4;
|
struct GBAudioNoiseChannel ch4;
|
||||||
|
|
||||||
blip_t* left;
|
struct blip_t* left;
|
||||||
blip_t* right;
|
struct blip_t* right;
|
||||||
int16_t lastLeft;
|
int16_t lastLeft;
|
||||||
int16_t lastRight;
|
int16_t lastRight;
|
||||||
int clock;
|
int clock;
|
||||||
|
@ -240,4 +241,6 @@ struct GBSerializedState;
|
||||||
void GBAudioSerialize(const struct GBAudio* audio, struct GBSerializedState* state);
|
void GBAudioSerialize(const struct GBAudio* audio, struct GBSerializedState* state);
|
||||||
void GBAudioDeserialize(struct GBAudio* audio, const struct GBSerializedState* state);
|
void GBAudioDeserialize(struct GBAudio* audio, const struct GBSerializedState* state);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,12 @@
|
||||||
#ifndef GB_CHEATS_H
|
#ifndef GB_CHEATS_H
|
||||||
#define GB_CHEATS_H
|
#define GB_CHEATS_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/cheats.h"
|
CXX_GUARD_START
|
||||||
#include "util/vector.h"
|
|
||||||
|
#include <mgba/core/cheats.h>
|
||||||
|
#include <mgba-util/vector.h>
|
||||||
|
|
||||||
enum GBCheatType {
|
enum GBCheatType {
|
||||||
GB_CHEAT_AUTODETECT,
|
GB_CHEAT_AUTODETECT,
|
||||||
|
@ -36,4 +38,6 @@ struct GBCheatSet {
|
||||||
|
|
||||||
struct mCheatDevice* GBCheatDeviceCreate(void);
|
struct mCheatDevice* GBCheatDeviceCreate(void);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,11 @@
|
||||||
#ifndef GB_CLI_H
|
#ifndef GB_CLI_H
|
||||||
#define GB_CLI_H
|
#define GB_CLI_H
|
||||||
|
|
||||||
#include "debugger/cli-debugger.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/internal/debugger/cli-debugger.h>
|
||||||
|
|
||||||
struct GBCLIDebugger {
|
struct GBCLIDebugger {
|
||||||
struct CLIDebuggerSystem d;
|
struct CLIDebuggerSystem d;
|
||||||
|
@ -19,4 +23,6 @@ struct GBCLIDebugger {
|
||||||
|
|
||||||
struct CLIDebuggerSystem* GBCLIDebuggerCreate(struct mCore*);
|
struct CLIDebuggerSystem* GBCLIDebuggerCreate(struct mCore*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,19 +6,19 @@
|
||||||
#ifndef GB_H
|
#ifndef GB_H
|
||||||
#define GB_H
|
#define GB_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
#include "core/timing.h"
|
|
||||||
|
|
||||||
#include "lr35902/lr35902.h"
|
#include <mgba/core/cpu.h>
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
#include <mgba/core/timing.h>
|
||||||
|
|
||||||
#include "gb/audio.h"
|
#include <mgba/internal/gb/audio.h>
|
||||||
#include "gb/interface.h"
|
#include <mgba/internal/gb/memory.h>
|
||||||
#include "gb/memory.h"
|
#include <mgba/internal/gb/sio.h>
|
||||||
#include "gb/sio.h"
|
#include <mgba/internal/gb/timer.h>
|
||||||
#include "gb/timer.h"
|
#include <mgba/internal/gb/video.h>
|
||||||
#include "gb/video.h"
|
|
||||||
|
|
||||||
extern const uint32_t DMG_LR35902_FREQUENCY;
|
extern const uint32_t DMG_LR35902_FREQUENCY;
|
||||||
extern const uint32_t CGB_LR35902_FREQUENCY;
|
extern const uint32_t CGB_LR35902_FREQUENCY;
|
||||||
|
@ -43,6 +43,7 @@ enum GBIRQVector {
|
||||||
GB_VECTOR_KEYPAD = 0x60,
|
GB_VECTOR_KEYPAD = 0x60,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LR35902Core;
|
||||||
struct mCoreSync;
|
struct mCoreSync;
|
||||||
struct mAVStream;
|
struct mAVStream;
|
||||||
struct mCoreCallbacks;
|
struct mCoreCallbacks;
|
||||||
|
@ -79,6 +80,7 @@ struct GB {
|
||||||
struct mAVStream* stream;
|
struct mAVStream* stream;
|
||||||
|
|
||||||
bool cpuBlocked;
|
bool cpuBlocked;
|
||||||
|
bool earlyExit;
|
||||||
struct mTimingEvent eiPending;
|
struct mTimingEvent eiPending;
|
||||||
unsigned doubleSpeed;
|
unsigned doubleSpeed;
|
||||||
};
|
};
|
||||||
|
@ -119,7 +121,6 @@ void GBHalt(struct LR35902Core* cpu);
|
||||||
struct VFile;
|
struct VFile;
|
||||||
bool GBLoadROM(struct GB* gb, struct VFile* vf);
|
bool GBLoadROM(struct GB* gb, struct VFile* vf);
|
||||||
bool GBLoadSave(struct GB* gb, struct VFile* vf);
|
bool GBLoadSave(struct GB* gb, struct VFile* vf);
|
||||||
void GBYankROM(struct GB* gb);
|
|
||||||
void GBUnloadROM(struct GB* gb);
|
void GBUnloadROM(struct GB* gb);
|
||||||
void GBSynthesizeROM(struct VFile* vf);
|
void GBSynthesizeROM(struct VFile* vf);
|
||||||
|
|
||||||
|
@ -140,4 +141,6 @@ void GBGetGameCode(const struct GB* gba, char* out);
|
||||||
|
|
||||||
void GBFrameEnded(struct GB* gb);
|
void GBFrameEnded(struct GB* gb);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef GB_IO_H
|
#ifndef GB_IO_H
|
||||||
#define GB_IO_H
|
#define GB_IO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(GB_IO);
|
mLOG_DECLARE_CATEGORY(GB_IO);
|
||||||
|
|
||||||
|
@ -118,4 +120,6 @@ struct GBSerializedState;
|
||||||
void GBIOSerialize(const struct GB* gb, struct GBSerializedState* state);
|
void GBIOSerialize(const struct GB* gb, struct GBSerializedState* state);
|
||||||
void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state);
|
void GBIODeserialize(struct GB* gb, const struct GBSerializedState* state);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef GB_MBC_H
|
#ifndef GB_MBC_H
|
||||||
#define GB_MBC_H
|
#define GB_MBC_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
|
||||||
mLOG_DECLARE_CATEGORY(GB_MBC);
|
mLOG_DECLARE_CATEGORY(GB_MBC);
|
||||||
|
|
||||||
|
@ -37,4 +39,6 @@ void GBMBCRTCWrite(struct GB* gb);
|
||||||
uint8_t GBMBC7Read(struct GBMemory*, uint16_t address);
|
uint8_t GBMBC7Read(struct GBMemory*, uint16_t address);
|
||||||
void GBMBC7Write(struct GBMemory*, uint16_t address, uint8_t value);
|
void GBMBC7Write(struct GBMemory*, uint16_t address, uint8_t value);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,12 +6,13 @@
|
||||||
#ifndef GB_MEMORY_H
|
#ifndef GB_MEMORY_H
|
||||||
#define GB_MEMORY_H
|
#define GB_MEMORY_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/log.h"
|
CXX_GUARD_START
|
||||||
#include "core/timing.h"
|
|
||||||
#include "gb/interface.h"
|
#include <mgba/core/log.h>
|
||||||
#include "lr35902/lr35902.h"
|
#include <mgba/core/timing.h>
|
||||||
|
#include <mgba/gb/interface.h>
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
@ -152,6 +153,7 @@ struct GBMemory {
|
||||||
struct mRumble* rumble;
|
struct mRumble* rumble;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct LR35902Core;
|
||||||
void GBMemoryInit(struct GB* gb);
|
void GBMemoryInit(struct GB* gb);
|
||||||
void GBMemoryDeinit(struct GB* gb);
|
void GBMemoryDeinit(struct GB* gb);
|
||||||
|
|
||||||
|
@ -175,4 +177,6 @@ struct GBSerializedState;
|
||||||
void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state);
|
void GBMemorySerialize(const struct GB* gb, struct GBSerializedState* state);
|
||||||
void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state);
|
void GBMemoryDeserialize(struct GB* gb, const struct GBSerializedState* state);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef GB_OVERRIDES_H
|
#ifndef GB_OVERRIDES_H
|
||||||
#define GB_OVERRIDES_H
|
#define GB_OVERRIDES_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "gb/interface.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/gb/interface.h>
|
||||||
|
|
||||||
struct GBCartridgeOverride {
|
struct GBCartridgeOverride {
|
||||||
int headerCrc32;
|
int headerCrc32;
|
||||||
|
@ -24,4 +26,6 @@ struct GB;
|
||||||
void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*);
|
void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*);
|
||||||
void GBOverrideApplyDefaults(struct GB*);
|
void GBOverrideApplyDefaults(struct GB*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,11 +6,13 @@
|
||||||
#ifndef GB_RENDERER_SOFTWARE_H
|
#ifndef GB_RENDERER_SOFTWARE_H
|
||||||
#define GB_RENDERER_SOFTWARE_H
|
#define GB_RENDERER_SOFTWARE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/core.h"
|
CXX_GUARD_START
|
||||||
#include "gb/gb.h"
|
|
||||||
#include "gb/video.h"
|
#include <mgba/core/core.h>
|
||||||
|
#include <mgba/internal/gb/gb.h>
|
||||||
|
#include <mgba/internal/gb/video.h>
|
||||||
|
|
||||||
struct GBVideoSoftwareRenderer {
|
struct GBVideoSoftwareRenderer {
|
||||||
struct GBVideoRenderer d;
|
struct GBVideoRenderer d;
|
||||||
|
@ -36,4 +38,6 @@ struct GBVideoSoftwareRenderer {
|
||||||
|
|
||||||
void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*);
|
void GBVideoSoftwareRendererCreate(struct GBVideoSoftwareRenderer*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,7 +6,9 @@
|
||||||
#ifndef GB_TILE_CACHE_H
|
#ifndef GB_TILE_CACHE_H
|
||||||
#define GB_TILE_CACHE_H
|
#define GB_TILE_CACHE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
struct GBVideo;
|
struct GBVideo;
|
||||||
struct mTileCache;
|
struct mTileCache;
|
||||||
|
@ -14,4 +16,6 @@ struct mTileCache;
|
||||||
void GBVideoTileCacheInit(struct mTileCache* cache);
|
void GBVideoTileCacheInit(struct mTileCache* cache);
|
||||||
void GBVideoTileCacheAssociate(struct mTileCache* cache, struct GBVideo* video);
|
void GBVideoTileCacheAssociate(struct mTileCache* cache, struct GBVideo* video);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,10 +6,12 @@
|
||||||
#ifndef GB_SERIALIZE_H
|
#ifndef GB_SERIALIZE_H
|
||||||
#define GB_SERIALIZE_H
|
#define GB_SERIALIZE_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/core.h"
|
CXX_GUARD_START
|
||||||
#include "gb/gb.h"
|
|
||||||
|
#include <mgba/core/core.h>
|
||||||
|
#include <mgba/internal/gb/gb.h>
|
||||||
|
|
||||||
extern const uint32_t GB_SAVESTATE_MAGIC;
|
extern const uint32_t GB_SAVESTATE_MAGIC;
|
||||||
extern const uint32_t GB_SAVESTATE_VERSION;
|
extern const uint32_t GB_SAVESTATE_VERSION;
|
||||||
|
@ -370,4 +372,6 @@ struct GBSerializedState {
|
||||||
bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state);
|
bool GBDeserialize(struct GB* gb, const struct GBSerializedState* state);
|
||||||
void GBSerialize(struct GB* gb, struct GBSerializedState* state);
|
void GBSerialize(struct GB* gb, struct GBSerializedState* state);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -6,15 +6,26 @@
|
||||||
#ifndef GB_SIO_H
|
#ifndef GB_SIO_H
|
||||||
#define GB_SIO_H
|
#define GB_SIO_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/timing.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/log.h>
|
||||||
|
#include <mgba/core/timing.h>
|
||||||
|
|
||||||
|
#define MAX_GBS 2
|
||||||
|
|
||||||
|
extern const int GBSIOCyclesPerTransfer[2];
|
||||||
|
|
||||||
|
mLOG_DECLARE_CATEGORY(GB_SIO);
|
||||||
|
|
||||||
struct GB;
|
struct GB;
|
||||||
|
struct GBSIODriver;
|
||||||
struct GBSIO {
|
struct GBSIO {
|
||||||
struct GB* p;
|
struct GB* p;
|
||||||
|
|
||||||
struct mTimingEvent event;
|
struct mTimingEvent event;
|
||||||
|
struct GBSIODriver* driver;
|
||||||
|
|
||||||
int32_t nextEvent;
|
int32_t nextEvent;
|
||||||
int32_t period;
|
int32_t period;
|
||||||
|
@ -23,6 +34,15 @@ struct GBSIO {
|
||||||
uint8_t pendingSB;
|
uint8_t pendingSB;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct GBSIODriver {
|
||||||
|
struct GBSIO* p;
|
||||||
|
|
||||||
|
bool (*init)(struct GBSIODriver* driver);
|
||||||
|
void (*deinit)(struct GBSIODriver* driver);
|
||||||
|
void (*writeSB)(struct GBSIODriver* driver, uint8_t value);
|
||||||
|
uint8_t (*writeSC)(struct GBSIODriver* driver, uint8_t value);
|
||||||
|
};
|
||||||
|
|
||||||
DECL_BITFIELD(GBRegisterSC, uint8_t);
|
DECL_BITFIELD(GBRegisterSC, uint8_t);
|
||||||
DECL_BIT(GBRegisterSC, ShiftClock, 0);
|
DECL_BIT(GBRegisterSC, ShiftClock, 0);
|
||||||
DECL_BIT(GBRegisterSC, ClockSpeed, 1);
|
DECL_BIT(GBRegisterSC, ClockSpeed, 1);
|
||||||
|
@ -31,6 +51,10 @@ DECL_BIT(GBRegisterSC, Enable, 7);
|
||||||
void GBSIOInit(struct GBSIO* sio);
|
void GBSIOInit(struct GBSIO* sio);
|
||||||
void GBSIOReset(struct GBSIO* sio);
|
void GBSIOReset(struct GBSIO* sio);
|
||||||
void GBSIODeinit(struct GBSIO* sio);
|
void GBSIODeinit(struct GBSIO* sio);
|
||||||
|
void GBSIOSetDriver(struct GBSIO* sio, struct GBSIODriver* driver);
|
||||||
void GBSIOWriteSC(struct GBSIO* sio, uint8_t sc);
|
void GBSIOWriteSC(struct GBSIO* sio, uint8_t sc);
|
||||||
|
void GBSIOWriteSB(struct GBSIO* sio, uint8_t sb);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -0,0 +1,49 @@
|
||||||
|
/* Copyright (c) 2013-2016 Jeffrey Pfau
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
#ifndef GB_SIO_LOCKSTEP_H
|
||||||
|
#define GB_SIO_LOCKSTEP_H
|
||||||
|
|
||||||
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/lockstep.h>
|
||||||
|
#include <mgba/core/timing.h>
|
||||||
|
#include <mgba/internal/gb/sio.h>
|
||||||
|
|
||||||
|
struct GBSIOLockstep {
|
||||||
|
struct mLockstep d;
|
||||||
|
struct GBSIOLockstepNode* players[MAX_GBS];
|
||||||
|
|
||||||
|
uint8_t pendingSB[MAX_GBS];
|
||||||
|
bool masterClaimed;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct GBSIOLockstepNode {
|
||||||
|
struct GBSIODriver d;
|
||||||
|
struct GBSIOLockstep* p;
|
||||||
|
struct mTimingEvent event;
|
||||||
|
|
||||||
|
volatile int32_t nextEvent;
|
||||||
|
int32_t eventDiff;
|
||||||
|
int id;
|
||||||
|
bool transferFinished;
|
||||||
|
#ifndef NDEBUG
|
||||||
|
int transferId;
|
||||||
|
enum mLockstepPhase phase;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
void GBSIOLockstepInit(struct GBSIOLockstep*);
|
||||||
|
|
||||||
|
void GBSIOLockstepNodeCreate(struct GBSIOLockstepNode*);
|
||||||
|
|
||||||
|
bool GBSIOLockstepAttachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*);
|
||||||
|
void GBSIOLockstepDetachNode(struct GBSIOLockstep*, struct GBSIOLockstepNode*);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
|
#endif
|
|
@ -6,9 +6,11 @@
|
||||||
#ifndef GB_TIMER_H
|
#ifndef GB_TIMER_H
|
||||||
#define GB_TIMER_H
|
#define GB_TIMER_H
|
||||||
|
|
||||||
#include "util/common.h"
|
#include <mgba-util/common.h>
|
||||||
|
|
||||||
#include "core/timing.h"
|
CXX_GUARD_START
|
||||||
|
|
||||||
|
#include <mgba/core/timing.h>
|
||||||
|
|
||||||
DECL_BITFIELD(GBRegisterTAC, uint8_t);
|
DECL_BITFIELD(GBRegisterTAC, uint8_t);
|
||||||
DECL_BITS(GBRegisterTAC, Clock, 0, 2);
|
DECL_BITS(GBRegisterTAC, Clock, 0, 2);
|
||||||
|
@ -38,4 +40,6 @@ struct GBSerializedState;
|
||||||
void GBTimerSerialize(const struct GBTimer* timer, struct GBSerializedState* state);
|
void GBTimerSerialize(const struct GBTimer* timer, struct GBSerializedState* state);
|
||||||
void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* state);
|
void GBTimerDeserialize(struct GBTimer* timer, const struct GBSerializedState* state);
|
||||||
|
|
||||||
|
CXX_GUARD_END
|
||||||
|
|
||||||
#endif
|
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue