Skip to content

Commit

Permalink
Now compiles without errors on all intended targets
Browse files Browse the repository at this point in the history
  • Loading branch information
SolraBizna committed Sep 19, 2017
1 parent bb02962 commit a5a678d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/ars-emu.hh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace ARS {
// $0228-$022F are complex on write
uint8_t bankMap[8];
};
constexpr Regs& Regs() { return *reinterpret_cast<struct Regs*>(dram+0x0200); }
static inline Regs& Regs() { return *reinterpret_cast<struct Regs*>(dram+0x0200); }
extern class MessageImp {
std::ostringstream stream;
void outputLine(std::string line, int lifespan_value);
Expand Down
1 change: 1 addition & 0 deletions include/fxinternal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "fx.hh"

#include <ctime>
#include <cmath>

#define restrict __restrict__

Expand Down
2 changes: 1 addition & 1 deletion include/optimize-this-file.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
debugging. This is only really necessary in FX implementations.
*/

#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC optimize("3","fast-math")
#endif
10 changes: 5 additions & 5 deletions include/ppu.hh
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ namespace ARS {
static constexpr uint8_t FOREGROUND_MASK = 4;
uint8_t TileAddr, TilePage;
} ssm[NUM_SPRITES];
constexpr uint8_t* ssmBytes() {return reinterpret_cast<uint8_t*>(ssm);}
static inline uint8_t* ssmBytes() {return reinterpret_cast<uint8_t*>(ssm);}
static_assert(sizeof(SpriteState) == 4, "Sprite size has slipped");
// HHHHHPPP
// H = tile height-1, range 1..32 (8..128)
typedef uint8_t SpriteAttr;
extern SpriteAttr sam[NUM_SPRITES];
constexpr uint8_t* samBytes() {return sam;}
static inline uint8_t* samBytes() {return sam;}
constexpr uint8_t SA_HEIGHT_SHIFT = 3;
constexpr uint8_t SA_HEIGHT_MASK = 0x1F;
constexpr uint8_t SA_PALETTE_SHIFT = 0;
Expand All @@ -88,13 +88,13 @@ namespace ARS {
* MODE1_BACKGROUND_TILES_HIGH / 16];
uint8_t padding[4];
};
constexpr struct Background_Mode1* backgrounds_mode1() {
static inline struct Background_Mode1* backgrounds_mode1() {
return reinterpret_cast<struct Background_Mode1*>(vram);
}
struct Background_Mode2 {
uint8_t Tiles[MODE2_BACKGROUND_TILES_WIDE * MODE2_BACKGROUND_TILES_HIGH];
};
constexpr struct Background_Mode2* backgrounds_mode2() {
static inline struct Background_Mode2* backgrounds_mode2() {
return reinterpret_cast<struct Background_Mode2*>(vram);
}
static_assert(sizeof(Background_Mode1)==0x400, "Background size slipped");
Expand All @@ -104,7 +104,7 @@ namespace ARS {
uint8_t Attributes[OVERLAY_TILES_WIDE*OVERLAY_TILES_HIGH/8];
uint8_t padding[16];
};
constexpr struct Overlay& overlay() {
static inline struct Overlay& overlay() {
return *reinterpret_cast<struct Overlay*>(ARS::dram+sizeof(ARS::dram)
-sizeof(struct Overlay));
}
Expand Down
8 changes: 4 additions & 4 deletions src/upscale.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ Upscaler::~Upscaler() {
}

const SN::ConstKey Upscaler::SIGNAL_TYPE_SELECTOR = "VIDEO_SIGNAL_TYPE"_Key;
const std::array<SN::ConstKey, MAX_SIGNAL_TYPE+1> Upscaler::SIGNAL_TYPE_KEYS{
const std::array<SN::ConstKey, MAX_SIGNAL_TYPE+1> Upscaler::SIGNAL_TYPE_KEYS{{
"VIDEO_SIGNAL_TYPE_COMPONENT"_Key,
"VIDEO_SIGNAL_TYPE_SVIDEO"_Key,
"VIDEO_SIGNAL_TYPE_COMPOSITE"_Key,
};
}};

const SN::ConstKey Upscaler::UPSCALE_TYPE_SELECTOR = "VIDEO_UPSCALE_TYPE"_Key;
const std::array<SN::ConstKey, MAX_UPSCALE_TYPE+1> Upscaler::UPSCALE_TYPE_KEYS{
const std::array<SN::ConstKey, MAX_UPSCALE_TYPE+1>Upscaler::UPSCALE_TYPE_KEYS{{
"VIDEO_UPSCALE_TYPE_NONE"_Key,
"VIDEO_UPSCALE_TYPE_SMOOTH"_Key,
"VIDEO_UPSCALE_TYPE_SCANLINES_CRISP"_Key,
"VIDEO_UPSCALE_TYPE_SCANLINES_BRIGHT"_Key,
};
}};

0 comments on commit a5a678d

Please sign in to comment.