Minor code cleanup and changes
This commit is contained in:
@@ -115,7 +115,7 @@ if(WIN32)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Package Config
|
# Package Config
|
||||||
set(CPACK_PACKAGE_NAME "SNES Emulator")
|
set(CPACK_PACKAGE_NAME "BreadedSNES")
|
||||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||||
set(CPACK_PACKAGE_DESCRIPTION "Cross-platform SNES Emulator")
|
set(CPACK_PACKAGE_DESCRIPTION "Cross-platform SNES Emulator")
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ uint8_t Bus::Read(uint32_t address) {
|
|||||||
return wram[address - 0x7E0000];
|
return wram[address - 0x7E0000];
|
||||||
} else if (address >= 0x800000 && cartridge) {
|
} else if (address >= 0x800000 && cartridge) {
|
||||||
// ROM access
|
// ROM access
|
||||||
uint32_t rom_addr = address & 0x7FFFFF;
|
if (const uint32_t rom_addr = address & 0x7FFFFF; rom_addr < cartridge->size()) {
|
||||||
if (rom_addr < cartridge->size()) {
|
|
||||||
return (*cartridge)[rom_addr];
|
return (*cartridge)[rom_addr];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class PPU;
|
|||||||
class APU;
|
class APU;
|
||||||
class Bus;
|
class Bus;
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(const int argc, char* argv[]) {
|
||||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
||||||
std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl;
|
std::cout << "SDL could not initialize! SDL_Error: " << SDL_GetError() << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -22,7 +22,7 @@ int main(int argc, char* argv[]) {
|
|||||||
"BreadedSNES",
|
"BreadedSNES",
|
||||||
SDL_WINDOWPOS_UNDEFINED,
|
SDL_WINDOWPOS_UNDEFINED,
|
||||||
SDL_WINDOWPOS_UNDEFINED,
|
SDL_WINDOWPOS_UNDEFINED,
|
||||||
256, 224, // SNES output resolution
|
256, 224, // SNES output res
|
||||||
SDL_WINDOW_SHOWN
|
SDL_WINDOW_SHOWN
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ bool System::LoadROM(const std::string& filename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
file.seekg(0, std::ios::end);
|
file.seekg(0, std::ios::end);
|
||||||
size_t size = file.tellg();
|
const size_t size = file.tellg();
|
||||||
file.seekg(0, std::ios::beg);
|
file.seekg(0, std::ios::beg);
|
||||||
|
|
||||||
cartridge_data.resize(size);
|
cartridge_data.resize(size);
|
||||||
|
|||||||
Reference in New Issue
Block a user