diff --git a/src/app/core/common.h b/src/app/core/common.h index bec1b7d7..60c1396c 100644 --- a/src/app/core/common.h +++ b/src/app/core/common.h @@ -12,6 +12,6 @@ int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3); } // namespace core } // namespace app -} // namespace premia +} // namespace yaze #endif \ No newline at end of file diff --git a/src/app/editor/editor.h b/src/app/editor/editor.h index 171964bb..3295c14a 100644 --- a/src/app/editor/editor.h +++ b/src/app/editor/editor.h @@ -47,7 +47,7 @@ class Editor { bool is_loaded_ = true; bool asm_is_loaded = false; - rom::ROM rom_; + ROM rom_; gui::Canvas canvas_; AssemblyEditor assembly_editor_; OverworldEditor overworld_editor_; diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index 91451de2..d394657e 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -29,7 +29,7 @@ namespace yaze { namespace app { namespace editor { -void OverworldEditor::SetupROM(rom::ROM &rom) { rom_ = rom; } +void OverworldEditor::SetupROM(ROM &rom) { rom_ = rom; } void OverworldEditor::Update() { if (rom_.isLoaded() && !all_gfx_loaded_) { diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld_editor.h index 6657479d..cb474f2c 100644 --- a/src/app/editor/overworld_editor.h +++ b/src/app/editor/overworld_editor.h @@ -17,7 +17,7 @@ static constexpr unsigned int k4BPP = 4; class OverworldEditor { public: - void SetupROM(app::rom::ROM &rom); + void SetupROM(ROM &rom); void Update(); private: @@ -31,7 +31,7 @@ class OverworldEditor { void LoadBlockset(); void LoadGraphics(); - rom::ROM rom_; + ROM rom_; zelda3::Overworld overworld_; gfx::SNESPalette palette_; diff --git a/src/app/rom.cc b/src/app/rom.cc index 4f9861f2..4f429bdb 100644 --- a/src/app/rom.cc +++ b/src/app/rom.cc @@ -17,7 +17,6 @@ namespace yaze { namespace app { -namespace rom { void ROM::Close() { if (is_loaded_) { @@ -76,8 +75,8 @@ char *ROM::Decompress(int pos, int size, bool reversed) { length = (ushort)(((current_rom_[pos] << 8) | current_rom_[pos + 1]) & 0x3FF); pos += 2; // Advance 2 bytes in ROM - - } else { // Normal Command + + } else { // Normal Command cmd = (uchar)((databyte >> 5) & 0x07); length = (uchar)(databyte & 0x1F); pos += 1; // Advance 1 byte in ROM @@ -235,8 +234,8 @@ int ROM::GetPCGfxAddress(uint8_t id) { uint8_t gfxGamePointer2 = current_rom_[gfxPtr2 + id]; uint8_t gfxGamePointer3 = current_rom_[gfxPtr3 + id]; - return core::SnesToPc( - core::AddressFromBytes(gfxGamePointer1, gfxGamePointer2, gfxGamePointer3)); + return core::SnesToPc(core::AddressFromBytes(gfxGamePointer1, gfxGamePointer2, + gfxGamePointer3)); } // 0-112 -> compressed 3bpp bgr -> (decompressed each) 0x600 chars @@ -281,6 +280,5 @@ char *ROM::CreateAllGfxDataRaw() { return buffer; } -} // namespace rom } // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/app/rom.h b/src/app/rom.h index 7873db50..5644539b 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -19,7 +19,6 @@ namespace yaze { namespace app { -namespace rom { class ROM { public: @@ -29,7 +28,8 @@ class ROM { void LoadFromFile(const std::string& path); char* Decompress(int pos, int size = 0x800, bool reversed = false); gfx::SNESPalette ExtractPalette(uint addr, int bpp); - uchar* SNES3bppTo8bppSheet(uchar* buffer_in, int sheet_id = 0, int size = 0x1000); + uchar* SNES3bppTo8bppSheet(uchar* buffer_in, int sheet_id = 0, + int size = 0x1000); SDL_Texture* DrawGraphicsSheet(int offset); int GetPCGfxAddress(uint8_t id); @@ -59,7 +59,6 @@ class ROM { std::shared_ptr sdl_renderer_; }; -} // namespace rom } // namespace app } // namespace yaze diff --git a/src/app/zelda3/overworld.cc b/src/app/zelda3/overworld.cc index cde00ef2..09d7f9bb 100644 --- a/src/app/zelda3/overworld.cc +++ b/src/app/zelda3/overworld.cc @@ -25,7 +25,7 @@ static TileInfo GetTilesInfo(ushort tile) { return TileInfo(tid, p, v, h, o); } -void Overworld::Load(app::rom::ROM& rom, uchar* allGfxPtr) { +void Overworld::Load(ROM& rom, uchar* allGfxPtr) { rom_ = rom; allGfx16Ptr = allGfxPtr; diff --git a/src/app/zelda3/overworld.h b/src/app/zelda3/overworld.h index 338a0bd4..ef3e0c66 100644 --- a/src/app/zelda3/overworld.h +++ b/src/app/zelda3/overworld.h @@ -19,7 +19,7 @@ namespace zelda3 { class Overworld { public: - void Load(app::rom::ROM& rom, uchar* allGfxPtr); + void Load(ROM& rom, uchar* allGfxPtr); auto GetTiles16() const { return tiles16; } auto GetCurrentGfxSetPtr() { return currentOWgfx16Ptr; } auto GetMapBlockset16Ptr() { return mapblockset16; } @@ -35,7 +35,7 @@ class Overworld { void FetchLargeMaps(); void LoadOverworldMap(); - app::rom::ROM rom_; + ROM rom_; int gameState = 1; bool isLoaded = false; uchar mapParent[160]; diff --git a/src/app/zelda3/overworld_map.cc b/src/app/zelda3/overworld_map.cc index 20553c4a..65460d0c 100644 --- a/src/app/zelda3/overworld_map.cc +++ b/src/app/zelda3/overworld_map.cc @@ -14,8 +14,8 @@ namespace zelda3 { using namespace core; using namespace gfx; -OverworldMap::OverworldMap(app::rom::ROM& rom, - const std::vector& tiles16, int index_) +OverworldMap::OverworldMap(ROM& rom, const std::vector& tiles16, + int index_) : parent_(index_), index_(index_), rom_(rom), tiles16_(tiles16) { if (index_ != 0x80 && index_ <= 150 && rom_.data()[constants::overworldMapSize + (index_ & 0x3F)] != 0) { diff --git a/src/app/zelda3/overworld_map.h b/src/app/zelda3/overworld_map.h index 86a52595..b645e671 100644 --- a/src/app/zelda3/overworld_map.h +++ b/src/app/zelda3/overworld_map.h @@ -30,14 +30,14 @@ class OverworldMap { uchar* currentOWgfx16Ptr_ = nullptr; uchar* allGfx16Ptr_ = nullptr; - app::rom::ROM rom_; + ROM rom_; gfx::Bitmap gfxBitmap; std::vector tiles16_; uchar* staticgfx = new uchar[16]; std::vector> tiles_used_; - OverworldMap(app::rom::ROM& rom, const std::vector& tiles16, + OverworldMap(ROM& rom, const std::vector& tiles16, int index); void BuildMap(uchar* mapParent, int count, int gameState, std::vector>& allmapsTilesLW,