Overworld housekeeping

This commit is contained in:
Justin Scofield
2022-07-19 20:21:52 -04:00
parent 7a795fd75d
commit 31bf3b7881
4 changed files with 7 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ namespace zelda3 {
void Overworld::Load(ROM &rom) {
rom_ = rom;
mapblockset16.Create(128, 8192, 8, 1048576);
//mapblockset16.Create(128, 8192, 8, 1048576);
AssembleMap32Tiles();
AssembleMap16Tiles();
@@ -98,13 +98,13 @@ void Overworld::DecompressAllMapTiles() {
int p1 = (rom_.data()[(map_high_ptr) + 2 + (3 * i)] << 16) +
(rom_.data()[(map_high_ptr) + 1 + (3 * i)] << 8) +
(rom_.data()[(map_high_ptr + (3 * i))]);
p1 = SnesToPc(p1);
p1 = core::SnesToPc(p1);
int map_low_ptr = core::compressedAllMap32PointersLow;
int p2 = (rom_.data()[(map_low_ptr) + 2 + (3 * i)] << 16) +
(rom_.data()[(map_low_ptr) + 1 + (3 * i)] << 8) +
(rom_.data()[(map_low_ptr + (3 * i))]);
p2 = SnesToPc(p2);
p2 = core::SnesToPc(p2);
int ttpos = 0;

View File

@@ -22,8 +22,6 @@ class Overworld {
public:
void Load(ROM &rom);
auto GetTiles16() const { return tiles16; }
auto GetCurrentGfxSetPtr() { return currentOWgfx16.GetData(); }
auto GetMapBlockset16Ptr() { return mapblockset16.GetData(); }
private:
const int map32address[4] = {core::map32TilesTL, core::map32TilesTR,

View File

@@ -18,7 +18,7 @@ namespace zelda3 {
OverworldMap::OverworldMap(int index, ROM& rom,
const std::vector<gfx::Tile16>& tiles16)
: parent_(index_), index(index_), rom_(rom), tiles16_(tiles16) {
: parent_(index), index_(index), rom_(rom), tiles16_(tiles16) {
if (index_ != 0x80 && index_ <= 150 &&
rom_.data()[core::overworldMapSize + (index_ & 0x3F)] != 0) {
large_map_ = true;
@@ -26,7 +26,7 @@ OverworldMap::OverworldMap(int index, ROM& rom,
LoadAreaInfo();
}
void Overworld::LoadAreaInfo() {
void OverworldMap::LoadAreaInfo() {
auto z3data = rom_.data();
if (index_ < 64) {

View File

@@ -14,7 +14,7 @@ namespace yaze {
namespace app {
namespace zelda3 {
static constexpr int kTileOffsets = {0, 8, 4096, 4104};
static constexpr int kTileOffsets[] = {0, 8, 4096, 4104};
class OverworldMap {
public:
@@ -35,8 +35,7 @@ class OverworldMap {
gfx::TileInfo tile, uchar* gfx16Pointer,
uchar* gfx8Pointer);
void CopyTile8bpp16(int x, int y, int tile, uchar* destbmpPtr);
void CopyTile8bpp16From8(int xP, int yP, int tileID, uchar* destbmpPtr,
uchar* sourcebmpPtr);
void CopyTile8bpp16From8(int xP, int yP, int tileID, uchar* destbmpPtr);
int parent_ = 0;
int index_ = 0;