housekeeping for GfxContext and Room logging
This commit is contained in:
@@ -129,10 +129,7 @@ void SetTabBarTab(ImGuiTabBar* tab_bar, ImGuiID tab_id) {
|
|||||||
if (tab_bar == NULL) return;
|
if (tab_bar == NULL) return;
|
||||||
|
|
||||||
// Find the tab item with the specified tab_id
|
// Find the tab item with the specified tab_id
|
||||||
// for (int i = 0; i < tab_bar->Tabs.Size; i++) {
|
|
||||||
ImGuiTabItem* tab_item = &tab_bar->Tabs[tab_id];
|
ImGuiTabItem* tab_item = &tab_bar->Tabs[tab_id];
|
||||||
// if (tab_item->ID == tab_id) {
|
|
||||||
// Set the tab item as active
|
|
||||||
tab_item->LastFrameVisible = -1;
|
tab_item->LastFrameVisible = -1;
|
||||||
tab_item->LastFrameSelected = -1;
|
tab_item->LastFrameSelected = -1;
|
||||||
tab_bar->VisibleTabId = tab_id;
|
tab_bar->VisibleTabId = tab_id;
|
||||||
@@ -141,10 +138,6 @@ void SetTabBarTab(ImGuiTabBar* tab_bar, ImGuiID tab_id) {
|
|||||||
tab_bar->NextSelectedTabId = tab_id;
|
tab_bar->NextSelectedTabId = tab_id;
|
||||||
tab_bar->ReorderRequestTabId = tab_id;
|
tab_bar->ReorderRequestTabId = tab_id;
|
||||||
tab_bar->CurrFrameVisible = -1;
|
tab_bar->CurrFrameVisible = -1;
|
||||||
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,9 @@ void Room::LoadHeader() {
|
|||||||
// Existing room size address calculation...
|
// Existing room size address calculation...
|
||||||
auto room_size_address = 0xF8000 + (room_id_ * 3);
|
auto room_size_address = 0xF8000 + (room_id_ * 3);
|
||||||
|
|
||||||
std::cout << "Room #" << room_id_ << " Address: " << std::hex
|
if (flags()->kLogToConsole)
|
||||||
<< room_size_address << std::endl;
|
std::cout << "Room #" << room_id_ << " Address: " << std::hex
|
||||||
|
<< room_size_address << std::endl;
|
||||||
|
|
||||||
// Reading bytes for long address construction
|
// Reading bytes for long address construction
|
||||||
uint8_t low = rom()->data()[room_size_address];
|
uint8_t low = rom()->data()[room_size_address];
|
||||||
@@ -82,13 +83,15 @@ void Room::LoadHeader() {
|
|||||||
|
|
||||||
// Constructing the long address
|
// Constructing the long address
|
||||||
int long_address = (bank << 16) | (high << 8) | low;
|
int long_address = (bank << 16) | (high << 8) | low;
|
||||||
std::cout << std::hex << std::setfill('0') << std::setw(6) << long_address
|
if (flags()->kLogToConsole)
|
||||||
<< std::endl;
|
std::cout << std::hex << std::setfill('0') << std::setw(6) << long_address
|
||||||
|
<< std::endl;
|
||||||
room_size_pointer_ = long_address;
|
room_size_pointer_ = long_address;
|
||||||
|
|
||||||
if (long_address == 0x0A8000) {
|
if (long_address == 0x0A8000) {
|
||||||
// Blank room disregard in size calculation
|
// Blank room disregard in size calculation
|
||||||
std::cout << "Size of Room #" << room_id_ << ": 0 bytes" << std::endl;
|
if (flags()->kLogToConsole)
|
||||||
|
std::cout << "Size of Room #" << room_id_ << ": 0 bytes" << std::endl;
|
||||||
room_size_ = 0;
|
room_size_ = 0;
|
||||||
} else {
|
} else {
|
||||||
// use the long address to calculate the size of the room
|
// use the long address to calculate the size of the room
|
||||||
@@ -97,8 +100,9 @@ void Room::LoadHeader() {
|
|||||||
|
|
||||||
int next_room_address = 0xF8000 + ((room_id_ + 1) * 3);
|
int next_room_address = 0xF8000 + ((room_id_ + 1) * 3);
|
||||||
|
|
||||||
std::cout << "Next Room Address: " << std::hex << next_room_address
|
if (flags()->kLogToConsole)
|
||||||
<< std::endl;
|
std::cout << "Next Room Address: " << std::hex << next_room_address
|
||||||
|
<< std::endl;
|
||||||
|
|
||||||
// Reading bytes for long address construction
|
// Reading bytes for long address construction
|
||||||
uint8_t next_low = rom()->data()[next_room_address];
|
uint8_t next_low = rom()->data()[next_room_address];
|
||||||
@@ -108,17 +112,19 @@ void Room::LoadHeader() {
|
|||||||
// Constructing the long address
|
// Constructing the long address
|
||||||
int next_long_address = (next_bank << 16) | (next_high << 8) | next_low;
|
int next_long_address = (next_bank << 16) | (next_high << 8) | next_low;
|
||||||
|
|
||||||
std::cout << std::hex << std::setfill('0') << std::setw(6)
|
if (flags()->kLogToConsole)
|
||||||
<< next_long_address << std::endl;
|
std::cout << std::hex << std::setfill('0') << std::setw(6)
|
||||||
|
<< next_long_address << std::endl;
|
||||||
|
|
||||||
// Calculate the size of the room
|
// Calculate the size of the room
|
||||||
int room_size = next_long_address - long_address;
|
int room_size = next_long_address - long_address;
|
||||||
std::cout << "Size of Room #" << room_id_ << ": " << std::dec << room_size
|
|
||||||
<< " bytes" << std::endl;
|
|
||||||
room_size_ = room_size;
|
room_size_ = room_size;
|
||||||
|
if (flags()->kLogToConsole)
|
||||||
|
std::cout << "Size of Room #" << room_id_ << ": " << std::dec
|
||||||
|
<< room_size << " bytes" << std::endl;
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
std::cout << "Error: " << e.what() << std::endl;
|
if (flags()->kLogToConsole) std::cout << "Error: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ struct ChestData {
|
|||||||
|
|
||||||
struct StaircaseRooms {};
|
struct StaircaseRooms {};
|
||||||
|
|
||||||
class Room : public SharedROM {
|
class Room : public SharedROM, public core::ExperimentFlags {
|
||||||
public:
|
public:
|
||||||
Room() = default;
|
Room() = default;
|
||||||
Room(int room_id) : room_id_(room_id) {}
|
Room(int room_id) : room_id_(room_id) {}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ add_executable(
|
|||||||
app/core/common.cc
|
app/core/common.cc
|
||||||
app/core/labeling.cc
|
app/core/labeling.cc
|
||||||
app/gui/pipeline.cc
|
app/gui/pipeline.cc
|
||||||
|
app/editor/context/gfx_context.cc
|
||||||
${YAZE_APP_EMU_SRC}
|
${YAZE_APP_EMU_SRC}
|
||||||
${YAZE_APP_GFX_SRC}
|
${YAZE_APP_GFX_SRC}
|
||||||
${YAZE_APP_ZELDA3_SRC}
|
${YAZE_APP_ZELDA3_SRC}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ add_executable(
|
|||||||
../src/app/emu/video/ppu.cc
|
../src/app/emu/video/ppu.cc
|
||||||
../src/app/emu/audio/dsp.cc
|
../src/app/emu/audio/dsp.cc
|
||||||
../src/app/emu/audio/spc700.cc
|
../src/app/emu/audio/spc700.cc
|
||||||
|
../src/app/editor/context/gfx_context.cc
|
||||||
../src/app/gfx/bitmap.cc
|
../src/app/gfx/bitmap.cc
|
||||||
../src/app/gfx/snes_tile.cc
|
../src/app/gfx/snes_tile.cc
|
||||||
../src/app/gfx/snes_palette.cc
|
../src/app/gfx/snes_palette.cc
|
||||||
|
|||||||
Reference in New Issue
Block a user