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