git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 8068ff41fb3ce24829e44925c59fb32d597b4094
parent 1050a7a533df63c1f118417b2bad455610cf3b0e
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Wed, 29 Sep 2021 21:57:39 +0300

Fix potential future compatibility issue, update workflow environments

Diffstat:
M.github/workflows/sanity.yml5++---
MCore/save_state.c9+++++++++
MCore/save_state.h2+-
3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml @@ -6,7 +6,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest, ubuntu-16.04] + os: [macos-latest, ubuntu-latest, ubuntu-18.04] cc: [gcc, clang] include: - os: macos-latest @@ -33,4 +33,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: sameboy-canary-${{ matrix.os }}-${{ matrix.cc }} - path: build/bin - + path: build/bin diff --git a/Core/save_state.c b/Core/save_state.c @@ -9,6 +9,15 @@ #define BESS_NAME "SameBoy v" GB_VERSION #endif +_Static_assert((GB_SECTION_OFFSET(core_state) & 7) == 0, "Section core_state is not aligned"); +_Static_assert((GB_SECTION_OFFSET(dma) & 7) == 0, "Section dma is not aligned"); +_Static_assert((GB_SECTION_OFFSET(mbc) & 7) == 0, "Section mbc is not aligned"); +_Static_assert((GB_SECTION_OFFSET(hram) & 7) == 0, "Section hram is not aligned"); +_Static_assert((GB_SECTION_OFFSET(timing) & 7) == 0, "Section timing is not aligned"); +_Static_assert((GB_SECTION_OFFSET(apu) & 7) == 0, "Section apu is not aligned"); +_Static_assert((GB_SECTION_OFFSET(rtc) & 7) == 0, "Section rtc is not aligned"); +_Static_assert((GB_SECTION_OFFSET(video) & 7) == 0, "Section video is not aligned"); + typedef struct __attribute__((packed)) { uint32_t magic; uint32_t size; diff --git a/Core/save_state.h b/Core/save_state.h @@ -10,7 +10,7 @@ as anonymous enums inside unions */ #define GB_SECTION(name, ...) __attribute__ ((aligned (8))) __VA_ARGS__ #else -#define GB_SECTION(name, ...) __attribute__ ((aligned (8))) union {uint8_t name##_section_start; struct {__VA_ARGS__};}; uint8_t name##_section_end[0] +#define GB_SECTION(name, ...) union __attribute__ ((aligned (8))) {uint8_t name##_section_start; struct {__VA_ARGS__};}; uint8_t name##_section_end[0] #define GB_SECTION_OFFSET(name) (offsetof(GB_gameboy_t, name##_section_start)) #define GB_SECTION_SIZE(name) (offsetof(GB_gameboy_t, name##_section_end) - offsetof(GB_gameboy_t, name##_section_start)) #define GB_GET_SECTION(gb, name) ((void*)&((gb)->name##_section_start))

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.