This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| auto LZ77UnCompReadNormalWrite(Gba& gba, auto fetch_and_write, auto calc_offset) -> bool | |
| { | |
| auto src = arm7tdmi::get_reg(gba, 0); | |
| auto dst = arm7tdmi::get_reg(gba, 1); | |
| const auto header = mem::read32(gba, src); | |
| auto len = bit::get_range<8, 31>(header); | |
| src += 4; // skip over header | |
| if (!IsValidRange(gba, len, src)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "native_helper.hpp" | |
| #include <android_native_app_glue.h> | |
| #include <android/log.h> | |
| #include <string> | |
| namespace { | |
| struct JniHelper | |
| { | |
| JniHelper(struct android_app* app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct JniHelper | |
| { | |
| JniHelper() | |
| { | |
| vm = g_App->activity->vm; | |
| if (vm->GetEnv((void**)&env, JNI_VERSION_1_6)) | |
| { | |
| if (!vm->AttachCurrentThread(&env, NULL)) | |
| { | |
| __android_log_print(ANDROID_LOG_INFO, "JNI-TEST", "attaching thread\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct GlFormat | |
| { | |
| GLint sized_format; // eg, RGBA8 | |
| GLenum format; // eg, RGBA | |
| GLenum packing; // eg, GL_UNSIGNED_INT_8_8_8_8_REV or GL_UNSIGNED_SHORT_1_5_5_5_REV | |
| }; | |
| struct Format | |
| { | |
| SDL_PixelFormatEnum sdl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <cstdint> | |
| #include <cstring> | |
| #include <vector> | |
| template<typename T> | |
| struct WavWriter | |
| { | |
| void init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdbool.h> | |
| #include <stddef.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <string.h> | |
| static FILE* file; | |
| static size_t number_of_samples; | |
| static uint32_t sample_rate; | |
| static uint8_t channels; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "apu.h" | |
| uint8_t envelope_get_volume(const struct Nes_ApuEnvelope* envelope) | |
| { | |
| return envelope->constant_volume_flag ? envelope->volume : envelope->counter; | |
| } | |
| void envelope_reload(struct Nes_ApuEnvelope* envelope) | |
| { | |
| envelope->start_flag = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <gba_console.h> | |
| #include <gba_video.h> | |
| #include <gba_interrupt.h> | |
| #include <gba_systemcalls.h> | |
| #include <gba.h> | |
| #include <stdio.h> | |
| enum NorS71InfoOffset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "scheduler.hpp" | |
| #include <algorithm> | |
| namespace scheduler { | |
| namespace { | |
| // s32 overflows at 0x7FFFFFFF, just over 100 million gap | |
| constexpr s32 TIMEOUT_VALUE = 0x70000000; | |
| void reset_event(void* user, [[maybe_unused]] s32 _) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef MGBA_LOG_H | |
| #define MGBA_LOG_H | |
| #include <stdio.h> /* needed for snprintf */ | |
| #define MGBA_LOG_ON 0xC0DE | |
| #define MGBA_LOG_OFF 0x0000 | |
| #define MGBA_LOG_ON_RESULT 0x1DEA | |
| #define MGBA_LOG_STDOUT ((char*)0x4FFF600) |