mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-27 16:21:53 +00:00
adding a define for fallthrough abstraction
This commit is contained in:
@@ -138,7 +138,7 @@ namespace ComSquare::PPU
|
||||
secondLowByte = this->_vram->read((tileAddress + 17) % VRAMSIZE);
|
||||
result = ((secondHighByte & (1U << shift)) | ((secondLowByte & (1U << shift)) << 1U));
|
||||
result = (shift - 2 >= 0) ? result >> (shift - 2) : result << ((shift - 2) * -1);
|
||||
__attribute__((fallthrough));
|
||||
FALLTHROUGH
|
||||
case 2:
|
||||
result += ((highByte & (1U << shift)) | ((lowByte & (1U << shift)) << 1U)) >> shift;
|
||||
default:
|
||||
|
||||
+3
-3
@@ -300,7 +300,7 @@ namespace ComSquare::PPU
|
||||
case PpuRegisters::bg1hofs:
|
||||
// TODO need of special var for prev value for Mode 7
|
||||
this->_registers._m7ofs[addr - PpuRegisters::bg1hofs].raw = data;
|
||||
__attribute__((fallthrough));
|
||||
FALLTHROUGH
|
||||
case PpuRegisters::bg2hofs:
|
||||
case PpuRegisters::bg3hofs:
|
||||
case PpuRegisters::bg4hofs:
|
||||
@@ -311,7 +311,7 @@ namespace ComSquare::PPU
|
||||
case PpuRegisters::bg1vofs:
|
||||
// TODO need of special var for prev value for Mode 7
|
||||
this->_registers._bgnba[addr - PpuRegisters::bg12nba].raw = data;
|
||||
__attribute__((fallthrough));
|
||||
FALLTHROUGH
|
||||
case PpuRegisters::bg2vofs:
|
||||
case PpuRegisters::bg3vofs:
|
||||
case PpuRegisters::bg4vofs:
|
||||
@@ -665,7 +665,7 @@ namespace ComSquare::PPU
|
||||
return 8;
|
||||
return 7;
|
||||
default:
|
||||
return -1;
|
||||
throw std::runtime_error("Invalid Background number");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -14,10 +14,9 @@
|
||||
#include "Background.hpp"
|
||||
#include "PPUUtils.hpp"
|
||||
|
||||
//#define max2BitTiles 4096
|
||||
//#define max4BitTiles 2048
|
||||
//#define max8BitTiles 1024
|
||||
#define FALLTHROUGH __attribute__((fallthrough));
|
||||
|
||||
// TODO check if it usefull to have defines instead of constepxr
|
||||
#define VRAMSIZE 65536
|
||||
#define CGRAMSIZE 512
|
||||
#define OAMRAMSIZE 544
|
||||
|
||||
Reference in New Issue
Block a user