From dd76846cf2a6525b89d06e5bf011365f90b317f0 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Mon, 23 Jan 2017 08:04:26 +1100 Subject: [PATCH] Update to v102r02 release. byuu says: Changelog: - I caved on the `samples[] = {0.0}` thing, but I'm very unhappy about it - if it's really invalid C++, then GCC needs to stop accepting it in strict `-std=c++14` mode - Emulator::Interface::Information::resettable is gone - Emulator::Interface::reset() is gone - FC, SFC, MD cores updated to remove soft reset behavior - split GameBoy::Interface into GameBoyInterface, GameBoyColorInterface - split WonderSwan::Interface into WonderSwanInterface, WonderSwanColorInterface - PCE: fixed off-by-one scanline error [hex_usr] - PCE: temporary hack to prevent crashing when VDS is set to < 2 - hiro: Cocoa: removed (u)int(#) constants; converted (u)int(#) types to (u)int_(#)t types - icarus: replaced usage of unique with strip instead (so we don't mess up frameworks on macOS) - libco: added macOS-specific section marker [Ryphecha] So ... the major news this time is the removal of the soft reset behavior. This is a major!! change that results in a 100KiB diff file, and it's very prone to accidental mistakes!! If anyone is up for testing, or even better -- looking over the code changes between v102r01 and v102r02 and looking for any issues, please do so. Ideally we'll want to test every NES mapper type and every SNES coprocessor type by loading said games and power cycling to make sure the games are all cleanly resetting. It's too big of a change for me to cover there not being any issues on my own, but this is truly critical code, so yeah ... please help if you can. We technically lose a bit of hardware documentation here. The soft reset events do all kinds of interesting things in all kinds of different chips -- or at least they do on the SNES. This is obviously not ideal. But in the process of removing these portions of code, I found a few mistakes I had made previously. It simplifies resetting the system state a lot when not trying to have all the power() functions call the reset() functions to share partial functionality. In the future, the goal will be to come up with a way to add back in the soft reset behavior via keyboard binding as with the Master System core. What's going to have to happen is that the key binding will have to send a "reset pulse" to every emulated chip, and those chips are going to have to act independently to power() instead of reusing functionality. We'll get there eventually, but there's many things of vastly greater importance to work on right now, so it'll be a while. The information isn't lost ... we'll just have to pull it out of v102 when we are ready. Note that I left the SNES reset vector simulation code in, even though it's not possible to trigger, for the time being. Also ... the Super Game Boy core is still disconnected. To be honest, it totally slipped my mind when I released v102 that it wasn't connected again yet. This one's going to be pretty tricky to be honest. I'm thinking about making a third GameBoy::Interface class just for SGB, and coming up with some way of bypassing platform-> calls when in this mode. --- libco.h | 2 +- settings.h | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libco.h b/libco.h index 792df0bd..0ea47789 100644 --- a/libco.h +++ b/libco.h @@ -1,5 +1,5 @@ /* - libco v18 (2016-09-14) + libco v18.01 (2017-01-22) author: byuu license: public domain */ diff --git a/settings.h b/settings.h index b419683a..d8037bc4 100644 --- a/settings.h +++ b/settings.h @@ -1,4 +1,4 @@ -#ifdef LIBCO_C +#if defined(LIBCO_C) /*[amd64, arm, ppc, x86]: by default, co_swap_function is marked as a text (code) section @@ -10,8 +10,8 @@ do not use this unless you are certain your application won't use SSE */ /* #define LIBCO_NO_SSE */ -#ifdef LIBCO_C - #ifdef LIBCO_MP +#if defined(LIBCO_C) + #if defined(LIBCO_MP) #define thread_local __thread #else #define thread_local @@ -19,18 +19,20 @@ #endif #if __STDC_VERSION__ >= 201112L - #ifndef _MSC_VER + #if !defined(_MSC_VER) #include #endif #else #define alignas(bytes) #endif -#ifndef _MSC_VER - #define section(name) __attribute__((section("." #name "#"))) -#else +#if defined(_MSC_VER) #define section(name) __declspec(allocate("." #name)) +#elif defined(__APPLE__) + #define section(name) __attribute__((section("__TEXT,__" #name))) +#else + #define section(name) __attribute__((section("." #name "#"))) #endif -/* ifdef LIBCO_C */ +/* if defined(LIBCO_C) */ #endif