31 (
rom()->data()[(header_pointer + 1) + (
room_id_ * 2)] << 8) +
38 is_light_ = ((
rom()->data()[header_location]) & 0x01) == 1;
41 bg2_ = z3_dungeon_background2::DarkRoom;
44 palette = ((
rom()->data()[header_location + 1] & 0x3F));
75 auto room_size_address = 0xF8000 + (
room_id_ * 3);
77 std::cout <<
"Room #" <<
room_id_ <<
" Address: " << std::hex
78 << room_size_address << std::endl;
81 uint8_t low =
rom()->data()[room_size_address];
82 uint8_t high =
rom()->data()[room_size_address + 1];
83 uint8_t bank =
rom()->data()[room_size_address + 2];
86 int long_address = (bank << 16) | (high << 8) | low;
87 std::cout << std::hex << std::setfill(
'0') << std::setw(6) << long_address
91 if (long_address == 0x0A8000) {
93 std::cout <<
"Size of Room #" <<
room_id_ <<
": 0 bytes" << std::endl;
100 int next_room_address = 0xF8000 + ((
room_id_ + 1) * 3);
102 std::cout <<
"Next Room Address: " << std::hex << next_room_address
106 uint8_t next_low =
rom()->data()[next_room_address];
107 uint8_t next_high =
rom()->data()[next_room_address + 1];
108 uint8_t next_bank =
rom()->data()[next_room_address + 2];
111 int next_long_address = (next_bank << 16) | (next_high << 8) | next_low;
113 std::cout << std::hex << std::setfill(
'0') << std::setw(6)
114 << next_long_address << std::endl;
117 int room_size = next_long_address - long_address;
120 <<
" bytes" << std::endl;
122 }
catch (
const std::exception &e) {
123 std::cout <<
"Error: " << e.what() << std::endl;
280 auto rom_data =
rom()->vector();
285 int room_address = object_pointer + (
room_id_ * 3);
287 int tile_address = (rom_data[room_address + 2] << 16) +
288 (rom_data[room_address + 1] << 8) + rom_data[room_address];
292 if (objects_location == 0x52CA2) {
293 std::cout <<
"Room ID : " <<
room_id_ << std::endl;
299 static_cast<uint8_t
>((rom_data[objects_location] >> 4) & 0x0F);
302 layout =
static_cast<uint8_t
>((rom_data[objects_location + 1] >> 2) & 0x07);
307 int nbr_of_staircase = 0;
309 int pos = objects_location + 2;
321 bool end_read =
false;
324 b2 = rom_data[pos + 1];
326 if (b1 == 0xFF && b2 == 0xFF) {
336 if (b1 == 0xF0 && b2 == 0xFF) {
342 b3 = rom_data[pos + 2];
351 oid =
static_cast<short>((b3 << 4) |
352 0x80 + (((b2 & 0x03) << 2) + ((b1 & 0x03))));
353 posX =
static_cast<uint8_t
>((b1 & 0xFC) >> 2);
354 posY =
static_cast<uint8_t
>((b2 & 0xFC) >> 2);
355 sizeXY =
static_cast<uint8_t
>((((b1 & 0x03) << 2) + (b2 & 0x03)));
358 posX =
static_cast<uint8_t
>((b1 & 0xFC) >> 2);
359 posY =
static_cast<uint8_t
>((b2 & 0xFC) >> 2);
360 sizeX =
static_cast<uint8_t
>((b1 & 0x03));
361 sizeY =
static_cast<uint8_t
>((b2 & 0x03));
362 sizeXY =
static_cast<uint8_t
>(((sizeX << 2) + sizeY));
366 oid =
static_cast<short>((b3 & 0x3F) + 0x100);
367 posX =
static_cast<uint8_t
>(((b2 & 0xF0) >> 4) + ((b1 & 0x3) << 4));
368 posY =
static_cast<uint8_t
>(((b2 & 0x0F) << 2) + ((b3 & 0xC0) >> 6));
372 RoomObject r(oid, posX, posY, sizeXY,
static_cast<uint8_t
>(layer));
377 if (nbr_of_staircase < 4) {
401 }
else if (oid == 0xFB1) {
419 auto rom_data =
rom()->vector();
420 int sprite_pointer = (0x04 << 16) +
423 int sprite_address_snes =
424 (0x09 << 16) + (rom_data[sprite_pointer + (
room_id_ * 2) + 1] << 8) +
425 rom_data[sprite_pointer + (
room_id_ * 2)];
428 bool sortsprites = rom_data[sprite_address] == 1;
432 uint8_t b1 = rom_data[sprite_address];
433 uint8_t b2 = rom_data[sprite_address + 1];
434 uint8_t b3 = rom_data[sprite_address + 2];
440 sprites_.emplace_back(b3, (b2 & 0x1F), (b1 & 0x1F),
441 ((b2 & 0xE0) >> 5) + ((b1 & 0x60) >> 2),
448 if (spr.
id() == 0xE4 && spr.
x() == 0x00 && spr.
y() == 0x1E &&
454 if (spr.
id() == 0xE4 && spr.
x() == 0x00 && spr.
y() == 0x1D &&