yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_map.cc
Go to the documentation of this file.
1#include "overworld_map.h"
2
3#include <cstddef>
4#include <cstdint>
5#include <memory>
6#include <unordered_map>
7#include <vector>
8
10#include "app/gfx/bitmap.h"
11#include "app/gfx/snes_tile.h"
12#include "app/rom.h"
14#include "imgui/imgui.h"
15
16namespace yaze {
17namespace app {
18namespace zelda3 {
19namespace overworld {
20
21OverworldMap::OverworldMap(int index, Rom& rom, bool load_custom_data)
22 : index_(index), parent_(index), rom_(rom) {
24
25 if (load_custom_data) {
26 // If the custom overworld ASM has NOT already been applied, manually set
27 // the vanilla values.
28 uint8_t asm_version = rom_[OverworldCustomASMHasBeenApplied];
29 if (asm_version == 0x00) {
31 } else {
32 SetupCustomTileset(asm_version);
33 }
34 }
35}
36
37absl::Status OverworldMap::BuildMap(int count, int game_state, int world,
38 std::vector<gfx::Tile16>& tiles16,
39 OWBlockset& world_blockset) {
40 game_state_ = game_state;
41 world_ = world;
42 if (large_map_) {
43 if (parent_ != index_ && !initialized_) {
44 if (index_ >= 0x80 && index_ <= 0x8A && index_ != 0x88) {
47 } else if (index_ == 0x88) {
48 area_graphics_ = 0x51;
49 area_palette_ = 0x00;
50 } else {
53 }
54
55 initialized_ = true;
56 }
57 }
58
61 RETURN_IF_ERROR(BuildTiles16Gfx(tiles16, count))
63 RETURN_IF_ERROR(BuildBitmap(world_blockset))
64 built_ = true;
65 return absl::OkStatus();
66}
67
69 if (index_ != 0x80) {
70 if (index_ <= 128)
71 large_map_ = (rom_[overworldMapSize + (index_ & 0x3F)] != 0);
72 else {
74 index_ == 129 || index_ == 130 || index_ == 137 || index_ == 138;
75 }
76 }
77
79
80 if (index_ < 0x40) {
83
88
92
96 } else if (index_ < 0x80) {
100
104
108 } else {
109 if (index_ == 0x94) {
110 parent_ = 0x80;
111 } else if (index_ == 0x95) {
112 parent_ = 0x03;
113 } else if (index_ == 0x96) {
114 parent_ = 0x5B; // pyramid bg use 0x5B map
115 } else if (index_ == 0x97) {
116 parent_ = 0x00; // pyramid bg use 0x5B map
117 } else if (index_ == 0x9C) {
118 parent_ = 0x43;
119 } else if (index_ == 0x9D) {
120 parent_ = 0x00;
121 } else if (index_ == 0x9E) {
122 parent_ = 0x00;
123 } else if (index_ == 0x9F) {
124 parent_ = 0x2C;
125 } else if (index_ == 0x88) {
126 parent_ = 0x88;
127 } else if (index_ == 129 || index_ == 130 || index_ == 137 ||
128 index_ == 138) {
129 parent_ = 129;
130 }
131
133 if ((index_ >= 0x80 && index_ <= 0x8A && index_ != 0x88) ||
134 index_ == 0x94) {
137 } else if (index_ == 0x88) {
138 area_graphics_ = 0x51;
139 area_palette_ = 0x00;
140 } else {
141 // pyramid bg use 0x5B map
144 }
145
149
153 }
154}
155
157 // Set the main palette values.
158 if (index_ < 0x40) {
159 area_palette_ = 0;
160 } else if (index_ >= 0x40 && index_ < 0x80) {
161 area_palette_ = 1;
162 } else if (index_ >= 0x80 && index_ < 0xA0) {
163 area_palette_ = 0;
164 }
165
166 if (index_ == 0x03 || index_ == 0x05 || index_ == 0x07) {
167 area_palette_ = 2;
168 } else if (index_ == 0x43 || index_ == 0x45 || index_ == 0x47) {
169 area_palette_ = 3;
170 } else if (index_ == 0x88) {
171 area_palette_ = 4;
172 }
173
174 // Set the mosaic values.
175 mosaic_ = index_ == 0x00 || index_ == 0x40 || index_ == 0x80 ||
176 index_ == 0x81 || index_ == 0x88;
177
178 int indexWorld = 0x20;
179
180 if (parent_ >= 0x40 && parent_ < 0x80) // DW
181 {
182 indexWorld = 0x21;
183 } else if (parent_ == 0x88) // Triforce room
184 {
185 indexWorld = 0x24;
186 }
187
188 const auto overworld_gfx_groups2 =
190
191 // Main Blocksets
192
193 for (int i = 0; i < 8; i++) {
194 custom_gfx_ids_[i] =
195 (uint8_t)rom_[overworld_gfx_groups2 + (indexWorld * 8) + i];
196 }
197
198 const auto overworldgfxGroups = rom_.version_constants().kOverworldGfxGroups1;
199
200 // Replace the variable tiles with the variable ones.
201 uint8_t temp = rom_[overworldgfxGroups + (area_graphics_ * 4)];
202 if (temp != 0) {
203 custom_gfx_ids_[3] = temp;
204 } else {
205 custom_gfx_ids_[3] = 0xFF;
206 }
207
208 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 1];
209 if (temp != 0) {
210 custom_gfx_ids_[4] = temp;
211 } else {
212 custom_gfx_ids_[4] = 0xFF;
213 }
214
215 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 2];
216 if (temp != 0) {
217 custom_gfx_ids_[5] = temp;
218 } else {
219 custom_gfx_ids_[5] = 0xFF;
220 }
221
222 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 3];
223 if (temp != 0) {
224 custom_gfx_ids_[6] = temp;
225 } else {
226 custom_gfx_ids_[6] = 0xFF;
227 }
228
229 // Set the animated GFX values.
230 if (index_ == 0x03 || index_ == 0x05 || index_ == 0x07 || index_ == 0x43 ||
231 index_ == 0x45 || index_ == 0x47) {
232 animated_gfx_ = 0x59;
233 } else {
234 animated_gfx_ = 0x5B;
235 }
236
237 // Set the subscreen overlay values.
238 subscreen_overlay_ = 0x00FF;
239
240 if (index_ == 0x00 ||
241 index_ == 0x40) // Add fog 2 to the lost woods and skull woods.
242 {
243 subscreen_overlay_ = 0x009D;
244 } else if (index_ == 0x03 || index_ == 0x05 ||
245 index_ == 0x07) // Add the sky BG to LW death mountain.
246 {
247 subscreen_overlay_ = 0x0095;
248 } else if (index_ == 0x43 || index_ == 0x45 ||
249 index_ == 0x47) // Add the lava to DW death mountain.
250 {
251 subscreen_overlay_ = 0x009C;
252 } else if (index_ == 0x5B) // TODO: Might need this one too "index == 0x1B"
253 // but for now I don't think so.
254 {
255 subscreen_overlay_ = 0x0096;
256 } else if (index_ == 0x80) // Add fog 1 to the master sword area.
257 {
258 subscreen_overlay_ = 0x0097;
259 } else if (index_ ==
260 0x88) // Add the triforce room curtains to the triforce room.
261 {
262 subscreen_overlay_ = 0x0093;
263 }
264}
265
266void OverworldMap::SetupCustomTileset(uint8_t asm_version) {
269
270 // This is just to load the GFX groups for ROMs that have an older version
271 // of the Overworld ASM already applied.
272 if (asm_version >= 0x01 && asm_version != 0xFF) {
273 for (int i = 0; i < 8; i++) {
274 custom_gfx_ids_[i] =
276 }
277
279 } else {
280 int indexWorld = 0x20;
281
282 if (parent_ >= 0x40 && parent_ < 0x80) // DW
283 {
284 indexWorld = 0x21;
285 } else if (parent_ == 0x88) // Triforce room
286 {
287 indexWorld = 0x24;
288 }
289
290 // Main Blocksets
291
292 for (int i = 0; i < 8; i++) {
293 custom_gfx_ids_[i] =
295 (indexWorld * 8) + i];
296 }
297
298 const auto overworldgfxGroups =
300
301 // Replace the variable tiles with the variable ones.
302 // If the variable is 00 set it to 0xFF which is the new "don't load
303 // anything" value.
304 uint8_t temp = rom_[overworldgfxGroups + (area_graphics_ * 4)];
305 if (temp != 0x00) {
306 custom_gfx_ids_[3] = temp;
307 } else {
308 custom_gfx_ids_[3] = 0xFF;
309 }
310
311 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 1];
312 if (temp != 0x00) {
313 custom_gfx_ids_[4] = temp;
314 } else {
315 custom_gfx_ids_[4] = 0xFF;
316 }
317
318 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 2];
319 if (temp != 0x00) {
320 custom_gfx_ids_[5] = temp;
321 } else {
322 custom_gfx_ids_[5] = 0xFF;
323 }
324
325 temp = rom_[overworldgfxGroups + (area_graphics_ * 4) + 3];
326 if (temp != 0x00) {
327 custom_gfx_ids_[6] = temp;
328 } else {
329 custom_gfx_ids_[6] = 0xFF;
330 }
331
332 // Set the animated GFX values.
333 if (index_ == 0x03 || index_ == 0x05 || index_ == 0x07 || index_ == 0x43 ||
334 index_ == 0x45 || index_ == 0x47) {
335 animated_gfx_ = 0x59;
336 } else {
337 animated_gfx_ = 0x5B;
338 }
339 }
340
343}
344
345// ============================================================================
346
348 if (parent_ < 0x40) {
349 main_gfx_id_ = 0x20;
350 } else if (parent_ >= 0x40 && parent_ < 0x80) {
351 main_gfx_id_ = 0x21;
352 } else if (parent_ == 0x88) {
353 main_gfx_id_ = 0x24;
354 }
355}
356
358 int static_graphics_base = 0x73;
359 static_graphics_[8] = static_graphics_base + 0x00;
360 static_graphics_[9] = static_graphics_base + 0x01;
361 static_graphics_[10] = static_graphics_base + 0x06;
362 static_graphics_[11] = static_graphics_base + 0x07;
363
364 for (int i = 0; i < 4; i++) {
365 static_graphics_[12 + i] =
366 (rom_[rom_.version_constants().kSpriteBlocksetPointer +
367 (sprite_graphics_[game_state_] * 4) + i] +
368 static_graphics_base);
369 }
370}
371
373 for (int i = 0; i < 8; i++) {
375 (main_gfx_id_ * 8) + i];
376 }
377}
378
379// For animating water tiles on the overworld map.
380// We want to swap out static_graphics_[07] with the next sheet
381// Usually it is 5A, so we make it 5B instead.
382// There is a middle frame which contains tiles from the bottom half
383// of the 5A sheet, so this will need some special manipulation to make work
384// during the BuildBitmap step (or a new one specifically for animating).
386 std::cout << "static_graphics_[6] = "
387 << core::UppercaseHexByte(static_graphics_[6]) << std::endl;
388 std::cout << "static_graphics_[7] = "
389 << core::UppercaseHexByte(static_graphics_[7]) << std::endl;
390 std::cout << "static_graphics_[8] = "
391 << core::UppercaseHexByte(static_graphics_[8]) << std::endl;
392 if (static_graphics_[7] == 0x5B) {
393 static_graphics_[7] = 0x5A;
394 } else {
395 if (static_graphics_[7] == 0x59) {
396 static_graphics_[7] = 0x58;
397 }
398 static_graphics_[7] = 0x5B;
399 }
400}
401
403 for (int i = 0; i < 4; i++) {
405 (area_graphics_ * 4) + i];
406 if (value != 0) {
407 static_graphics_[3 + i] = value;
408 }
409 }
410}
411
412// TODO: Change the conditions for death mountain gfx
413// JaredBrian: This is how ZS did it, but in 3.0.4 I changed it to just check
414// for 03, 05, 07, and the DW ones as that's how it would appear in-game if
415// you were to make area 03 not a large area anymore for example, so you might
416// want to do the same.
418 static_graphics_[7] = (((parent_ >= 0x03 && parent_ <= 0x07) ||
419 (parent_ >= 0x0B && parent_ <= 0x0E)) ||
420 ((parent_ >= 0x43 && parent_ <= 0x47) ||
421 (parent_ >= 0x4B && parent_ <= 0x4E)))
422 ? 0x59
423 : 0x5B;
424}
425
433
434namespace palette_internal {
435
436absl::Status SetColorsPalette(Rom& rom, int index, gfx::SnesPalette& current,
439 gfx::SnesPalette hud, gfx::SnesColor bgrcolor,
441 // Palettes infos, color 0 of a palette is always transparent (the arrays
442 // contains 7 colors width wide) There is 16 color per line so 16*Y
443
444 // Left side of the palette - Main, Animated
445 std::vector<gfx::SnesColor> new_palette(256);
446
447 // Main Palette, Location 0,2 : 35 colors [7x5]
448 int k = 0;
449 for (int y = 2; y < 7; y++) {
450 for (int x = 1; x < 8; x++) {
451 new_palette[x + (16 * y)] = main[k];
452 k++;
453 }
454 }
455
456 // Animated Palette, Location 0,7 : 7colors
457 for (int x = 1; x < 8; x++) {
458 new_palette[(16 * 7) + (x)] = animated[(x - 1)];
459 }
460
461 // Right side of the palette - Aux1, Aux2
462
463 // Aux1 Palette, Location 8,2 : 21 colors [7x3]
464 k = 0;
465 for (int y = 2; y < 5; y++) {
466 for (int x = 9; x < 16; x++) {
467 new_palette[x + (16 * y)] = aux1[k];
468 k++;
469 }
470 }
471
472 // Aux2 Palette, Location 8,5 : 21 colors [7x3]
473 k = 0;
474 for (int y = 5; y < 8; y++) {
475 for (int x = 9; x < 16; x++) {
476 new_palette[x + (16 * y)] = aux2[k];
477 k++;
478 }
479 }
480
481 // Hud Palette, Location 0,0 : 32 colors [16x2]
482 for (int i = 0; i < 32; i++) {
483 new_palette[i] = hud[i];
484 }
485
486 // Hardcoded grass color (that might change to become invisible instead)
487 for (int i = 0; i < 8; i++) {
488 new_palette[(i * 16)] = bgrcolor;
489 new_palette[(i * 16) + 8] = bgrcolor;
490 }
491
492 // Sprite Palettes
493 k = 0;
494 for (int y = 8; y < 9; y++) {
495 for (int x = 1; x < 8; x++) {
496 auto pal_group = rom.palette_group().sprites_aux1;
497 new_palette[x + (16 * y)] = pal_group[1][k];
498 k++;
499 }
500 }
501
502 // Sprite Palettes
503 k = 0;
504 for (int y = 8; y < 9; y++) {
505 for (int x = 9; x < 16; x++) {
506 auto pal_group = rom.palette_group().sprites_aux3;
507 new_palette[x + (16 * y)] = pal_group[0][k];
508 k++;
509 }
510 }
511
512 // Sprite Palettes
513 k = 0;
514 for (int y = 9; y < 13; y++) {
515 for (int x = 1; x < 16; x++) {
516 auto pal_group = rom.palette_group().global_sprites;
517 new_palette[x + (16 * y)] = pal_group[0][k];
518 k++;
519 }
520 }
521
522 // Sprite Palettes
523 k = 0;
524 for (int y = 13; y < 14; y++) {
525 for (int x = 1; x < 8; x++) {
526 new_palette[x + (16 * y)] = spr[k];
527 k++;
528 }
529 }
530
531 // Sprite Palettes
532 k = 0;
533 for (int y = 14; y < 15; y++) {
534 for (int x = 1; x < 8; x++) {
535 new_palette[x + (16 * y)] = spr2[k];
536 k++;
537 }
538 }
539
540 // Sprite Palettes
541 k = 0;
542 for (int y = 15; y < 16; y++) {
543 for (int x = 1; x < 16; x++) {
544 auto pal_group = rom.palette_group().armors;
545 new_palette[x + (16 * y)] = pal_group[0][k];
546 k++;
547 }
548 }
549
550 current.Create(new_palette);
551 for (int i = 0; i < 256; i++) {
552 current[(i / 16) * 16].set_transparent(true);
553 }
554
555 return absl::OkStatus();
556}
557} // namespace palette_internal
558
559// New helper function to get a palette from the Rom.
560absl::StatusOr<gfx::SnesPalette> OverworldMap::GetPalette(
561 const gfx::PaletteGroup& palette_group, int index, int previous_index,
562 int limit) {
563 if (index == 255) {
565 (previous_index * 4)];
566 }
567 if (index >= limit) {
568 index = limit - 1;
569 }
570 return palette_group[index];
571}
572
574 int previousPalId = index_ > 0 ? rom_[kOverworldMapPaletteIds + parent_ - 1] : 0;
575 int previousSprPalId =
577
578 area_palette_ = std::min((int)area_palette_, 0xA3);
579
580 uchar pal0 = 0;
582 (area_palette_ * 4)];
584 (area_palette_ * 4) + 1];
586 (area_palette_ * 4) + 2];
587 uchar pal4 =
590 (sprite_palette_[game_state_] * 2) + 1];
591
592 auto grass_pal_group = rom_.palette_group().grass;
593 ASSIGN_OR_RETURN(gfx::SnesColor bgr, grass_pal_group[0].GetColor(0));
594
595 auto ow_aux_pal_group = rom_.palette_group().overworld_aux;
597 GetPalette(ow_aux_pal_group, pal1, previousPalId, 20));
599 GetPalette(ow_aux_pal_group, pal2, previousPalId, 20));
600
601 // Additional handling of `pal3` and `parent_`
602 if (pal3 == 255) {
604 (previousPalId * 4) + 2];
605 }
606
607 if (parent_ < 0x40) {
608 pal0 = parent_ == 0x03 || parent_ == 0x05 || parent_ == 0x07 ? 2 : 0;
609 ASSIGN_OR_RETURN(bgr, grass_pal_group[0].GetColor(0));
610 } else if (parent_ >= 0x40 && parent_ < 0x80) {
611 pal0 = parent_ == 0x43 || parent_ == 0x45 || parent_ == 0x47 ? 3 : 1;
612 ASSIGN_OR_RETURN(bgr, grass_pal_group[0].GetColor(1));
613 } else if (parent_ >= 128 && parent_ < kNumOverworldMaps) {
614 pal0 = 0;
615 ASSIGN_OR_RETURN(bgr, grass_pal_group[0].GetColor(2));
616 }
617
618 if (parent_ == 0x88) {
619 pal0 = 4;
620 }
621
622 auto ow_main_pal_group = rom_.palette_group().overworld_main;
624 GetPalette(ow_main_pal_group, pal0, previousPalId, 255));
625 auto ow_animated_pal_group = rom_.palette_group().overworld_animated;
627 GetPalette(ow_animated_pal_group, std::min((int)pal3, 13),
628 previousPalId, 14));
629
630 auto hud_pal_group = rom_.palette_group().hud;
631 gfx::SnesPalette hud = hud_pal_group[0];
632
634 GetPalette(rom_.palette_group().sprites_aux3, pal4,
635 previousSprPalId, 24));
637 GetPalette(rom_.palette_group().sprites_aux3, pal5,
638 previousSprPalId, 24));
639
641 rom_, parent_, current_palette_, main, animated, aux1, aux2, hud, bgr,
642 spr, spr2));
643
644 if (palettesets_.count(area_palette_) == 0) {
646 main, animated, aux1, aux2, bgr, hud, spr, spr2, current_palette_};
647 }
648
649 return absl::OkStatus();
650}
651
652// New helper function to process graphics buffer.
653void OverworldMap::ProcessGraphicsBuffer(int index, int static_graphics_offset,
654 int size) {
655 for (int i = 0; i < size; i++) {
656 auto byte = all_gfx_[i + (static_graphics_offset * size)];
657 switch (index) {
658 case 0:
659 case 3:
660 case 4:
661 case 5:
662 byte += 0x88;
663 break;
664 }
665 current_gfx_[(index * size) + i] = byte;
666 }
667}
668
671 if (current_gfx_.size() == 0) current_gfx_.resize(0x10000, 0x00);
672
673 for (int i = 0; i < 0x10; i++) {
675 }
676
677 return absl::OkStatus();
678}
679
680absl::Status OverworldMap::BuildTiles16Gfx(std::vector<gfx::Tile16>& tiles16,
681 int count) {
682 if (current_blockset_.size() == 0) current_blockset_.resize(0x100000, 0x00);
683
684 const int offsets[] = {0x00, 0x08, 0x400, 0x408};
685 auto yy = 0;
686 auto xx = 0;
687
688 for (auto i = 0; i < count; i++) {
689 for (auto tile = 0; tile < 0x04; tile++) {
690 gfx::TileInfo info = tiles16[i].tiles_info[tile];
691 int offset = offsets[tile];
692 for (auto y = 0; y < 0x08; ++y) {
693 for (auto x = 0; x < 0x08; ++x) {
694 int mx = x;
695 int my = y;
696
697 if (info.horizontal_mirror_ != 0) {
698 mx = 0x07 - x;
699 }
700
701 if (info.vertical_mirror_ != 0) {
702 my = 0x07 - y;
703 }
704
705 int xpos = ((info.id_ % 0x10) * 0x08);
706 int ypos = (((info.id_ / 0x10)) * 0x400);
707 int source = ypos + xpos + (x + (y * 0x80));
708
709 auto destination = xx + yy + offset + (mx + (my * 0x80));
710 current_blockset_[destination] =
711 (current_gfx_[source] & 0x0F) + (info.palette_ * 0x10);
712 }
713 }
714 }
715
716 xx += 0x10;
717 if (xx >= 0x80) {
718 yy += 0x800;
719 xx = 0;
720 }
721 }
722
723 return absl::OkStatus();
724}
725
726namespace {
727
728void CopyTile8bpp16(int x, int y, int tile, std::vector<uint8_t>& bitmap,
729 std::vector<uint8_t>& blockset) {
730 int src_pos =
731 ((tile - ((tile / 0x08) * 0x08)) * 0x10) + ((tile / 0x08) * 2048);
732 int dest_pos = (x + (y * 0x200));
733 for (int yy = 0; yy < 0x10; yy++) {
734 for (int xx = 0; xx < 0x10; xx++) {
735 bitmap[dest_pos + xx + (yy * 0x200)] =
736 blockset[src_pos + xx + (yy * 0x80)];
737 }
738 }
739}
740
741} // namespace
742
743absl::Status OverworldMap::BuildBitmap(OWBlockset& world_blockset) {
744 if (bitmap_data_.size() != 0) {
745 bitmap_data_.clear();
746 }
747 bitmap_data_.reserve(0x40000);
748 for (int i = 0; i < 0x40000; i++) {
749 bitmap_data_.push_back(0x00);
750 }
751
752 int superY = ((index_ - (world_ * 0x40)) / 0x08);
753 int superX = index_ - (world_ * 0x40) - (superY * 0x08);
754
755 for (int y = 0; y < 0x20; y++) {
756 for (int x = 0; x < 0x20; x++) {
757 auto xt = x + (superX * 0x20);
758 auto yt = y + (superY * 0x20);
759 CopyTile8bpp16((x * 0x10), (y * 0x10), world_blockset[xt][yt],
761 }
762 }
763 return absl::OkStatus();
764}
765
766} // namespace overworld
767} // namespace zelda3
768} // namespace app
769} // namespace yaze
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:145
auto palette_group()
Definition rom.h:481
VersionConstants version_constants() const
Definition rom.h:491
std::vector< uint8_t > graphics_buffer() const
Definition rom.h:464
uint16_t toint16(int offset)
Definition rom.h:273
static std::unordered_map< uint8_t, gfx::Paletteset > palettesets_
Definition gfx_context.h:28
SNES Color container.
Definition snes_color.h:38
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
void Create(const std::vector< SnesColor > &cols)
SNES 16-bit tile metadata container.
Definition snes_tile.h:52
absl::Status BuildTiles16Gfx(std::vector< gfx::Tile16 > &tiles16, int count)
void ProcessGraphicsBuffer(int index, int static_graphics_offset, int size)
void SetupCustomTileset(uint8_t asm_version)
absl::StatusOr< gfx::SnesPalette > GetPalette(const gfx::PaletteGroup &group, int index, int previous_index, int limit)
absl::Status BuildBitmap(OWBlockset &world_blockset)
absl::Status BuildMap(int count, int game_state, int world, std::vector< gfx::Tile16 > &tiles16, OWBlockset &world_blockset)
#define RETURN_IF_ERROR(expression)
Definition constants.h:69
#define ASSIGN_OR_RETURN(type_variable_name, expression)
Definition constants.h:77
unsigned char uchar
Definition constants.h:121
int main(int argc, char **argv)
Main entry point for the application.
Definition emu.cc:33
std::string UppercaseHexByte(uint8_t byte, bool leading)
Definition labeling.cc:21
void CopyTile8bpp16(int x, int y, int tile, std::vector< uint8_t > &bitmap, std::vector< uint8_t > &blockset)
absl::Status SetColorsPalette(Rom &rom, int index, gfx::SnesPalette &current, gfx::SnesPalette main, gfx::SnesPalette animated, gfx::SnesPalette aux1, gfx::SnesPalette aux2, gfx::SnesPalette hud, gfx::SnesColor bgrcolor, gfx::SnesPalette spr, gfx::SnesPalette spr2)
constexpr int overworldSpritePaletteGroup
Definition overworld.h:382
constexpr int overworldSpriteset
Definition overworld.h:383
constexpr int OverworldCustomAnimatedGFXArray
constexpr int OverworldCustomASMHasBeenApplied
constexpr int kOverworldMapPaletteIds
Definition overworld.h:379
constexpr int kNumOverworldMaps
Definition overworld.h:433
constexpr int overworldMapSize
Definition overworld.h:402
constexpr int overworldMusicDW
Definition overworld.h:397
constexpr int overworldMusicMasterSword
Definition overworld.h:395
constexpr int overworldMusicBegining
Definition overworld.h:393
constexpr int kOverworldSpritePaletteIds
Definition overworld.h:380
constexpr int overworldMusicZelda
Definition overworld.h:394
constexpr int overworldSpecialGFXGroup
Definition overworld.h:384
constexpr int OverworldCustomTileGFXGroupArray
constexpr int overworldMusicAgahim
Definition overworld.h:396
constexpr int overworldSpecialPALGroup
Definition overworld.h:385
constexpr int OverworldCustomMosaicArray
constexpr int OverworldCustomMainPaletteArray
constexpr int OverworldCustomSubscreenOverlayArray
constexpr int kOverworldMessageIds
Definition overworld.h:391
std::vector< std::vector< uint16_t > > OWBlockset
Represents tile32 data for the overworld.
Definition common.h:15
Definition common.cc:21
uint32_t kOverworldGfxGroups2
Definition rom.h:58
uint32_t kOverworldGfxGroups1
Definition rom.h:57
uint32_t overworldMapPaletteGroup
Definition rom.h:61
Represents a group of palettes.
Represents a set of palettes used in a SNES graphics system.