GithubHelp home page GithubHelp logo

yaze's Introduction

Yet Another Zelda3 Editor

  • Platform: Windows, macOS, GNU/Linux
  • Dependencies: SDL2, ImGui

Description

General purpose editor for The Legend of Zelda: A Link to the Past for the Super Nintendo.

Takes heavy inspiration from ALTTP community efforts such as Hyrule Magic and ZScream

Building and installation

CMake is required to build yaze

  1. Clone the repository
  git clone --recurse-submodules https://github.com/scawful/yaze.git 
  1. Create the build directory and configuration
  cmake -S . -B build
  1. Build and run.
  cmake --build build

Documentation

  • For users, please refer to getting_started.md for instructions on how to use yaze.
  • For developers, please refer to the documentation for information on the project's infrastructure.

License

YAZE is distributed under the GNU GPLv3 license.

SDL2, ImGui and Abseil are subject to respective licenses.

Screenshots

image

image

image

yaze's People

Contributors

operaismo avatar scawful avatar sohamg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yaze's Issues

CGX Viewer Format

Objective

Create a CGX Viewer component using the internal header data which associates the correct colors to the graphics.

Background

File header is at end of the file rather than the beginning and encompasses the NAKA1989 metastamps.

Oganization of a CGX file is [pixel data][header][attribute (i.e. color palette selector) data]

Can open CGX files in SCad and immediately save them in their SCad equivalent format.

Workspace Formats and SCad equivalents after saving

  • CGX -> SCH
  • COL -> SCL
  • SCR -> SSC

Used to check your work for palette data applied to a CGX
Documentation on file formats included with SCad zip.

QoL features

  • Copy and paste the full file path of the assets
  • Support backup file extensions .bak
  • Displaying the 'NAK1989 S-CG-CADVer1.21 900611' metastamp from the header
  • Automatically detect if the file is 8bpp or 4bpp and default to that for it

Test Dummy Candidates

NEWS\テープリストア\NEWS_04.\home\arimoto\zelda\smap.col.bak
NEWS\テープリストア\NEWS_04.\home\arimoto\zelda\smap.cgx.bak

arimoto/delda/m/osr.cgx
arimoto/delda/soto/hyama-1.col.bak

LC_LZ2 Compression

The format LC_LZ2 is a lossless compression technique used by Super Mario World and The Legend of Zelda: A Link to the Past for the Super Nintendo to compress graphics into a (sometimes) smaller format. The LC_LZ2 decompression routine is setup at SNES $00:B888. The decompression routine itself is located at SNES $00:B8DE. During the decompression, the decompressed chunks are outputted into a buffer which is either RAM or SRAM.

In the ROM class I've implemented a version of the format based on @Skarsnik sneshacking as well as @Zarby89 ZScreamDungeon which both implement the format in C and C# respectively.

ROM::Decompress has unit tests and visual tests for decompressing the graphics in The Legend of Zelda: A Link to the Past.

ROM::Compress needs unit testing completed and further live testing.

Further reading on LC_LZ2:

Code Review comment 8

This is how ZS did it, but in 3.0.4 I changed it to just check for 03, 05, 07, and the DW ones as that's how it would appear in-game if you were to make area 03 not a large area anymore for example, so you might want to do the same.

if ((parent_ >= 0x03 && parent_ <= 0x07) ||
(parent_ >= 0x0B && parent_ <= 0x0E)) {
static_graphics_[7] = 89;
} else if ((parent_ >= 0x43 && parent_ <= 0x47) ||
(parent_ >= 0x4B && parent_ <= 0x4E)) {
static_graphics_[7] = 89;
} else {
static_graphics_[7] = 91;
}

Code Review comment 7

using both decimal and hex smh.

if (index_ == 0x94) {
parent_ = 128;
} else if (index_ == 0x95) {
parent_ = 03;
} else if (index_ == 0x96) {
parent_ = 0x5B; // pyramid bg use 0x5B map
} else if (index_ == 0x97) {
parent_ = 0x00; // pyramid bg use 0x5B map
} else if (index_ == 156) {
parent_ = 67;
} else if (index_ == 157) {
parent_ = 0;
} else if (index_ == 158) {
parent_ = 0;
} else if (index_ == 159) {
parent_ = 44;
} else if (index_ == 136) {
parent_ = 136;
}

load dummy_rom.sfc on ubuntu18.04 crash

Hello, yaze is a very good project. but when I test i met a problem.
load dummy_rom.sfc crashed.

  • steps:
    1, run yaze ,
    2, open file chooser ,
    3, select 'dummy_rom.sfc' from lib asar

  • logs

ALSA lib pcm.c:8306:(snd_pcm_recover) underrun occurred
*** SIGSEGV received at time=1697774380 on cpu 10 ***
PC: @     0x561d2d00d2bf  (unknown)  std::vector<>::~vector()
    @     0x7f31afb2ba47         64  absl::lts_20220623::WriteFailureInfo()
    @     0x7f31afb2bc3e         96  absl::lts_20220623::AbslFailureSignalHandler()
    @     0x7f31ae80c980  (unknown)  (unknown)
    @     0x561d2d00c5ce         32  std::filesystem::__cxx11::path::~path()
    @     0x561d2d0150dc         32  std::filesystem::__cxx11::path::_Cmpt::~_Cmpt()
    @     0x561d2d0150f7         32  std::_Destroy<>()
    @     0x561d2d013c28         32  std::_Destroy_aux<>::__destroy<>()
    @     0x561d2d0115f3         32  std::_Destroy<>()
    @     0x561d2d00ed75         48  std::_Destroy<>()
    @     0x561d2d00d2d5         32  std::vector<>::~vector()
    @     0x561d2d00c5ce         32  std::filesystem::__cxx11::path::~path()
    @     0x561d2d0150dc         32  std::filesystem::__cxx11::path::_Cmpt::~_Cmpt()
    @     0x561d2d0150f7         32  std::_Destroy<>()
    @     0x561d2d013c28         32  std::_Destroy_aux<>::__destroy<>()
    @     0x561d2d0115f3         32  std::_Destroy<>()
    @     0x561d2d00ed75         48  std::_Destroy<>()
    @     0x561d2d00d2d5         32  std::vector<>::~vector()
    @     0x561d2d00c5ce         32  std::filesystem::__cxx11::path::~path()
    @     0x561d2d0096fe        800  yaze::app::ROM::LoadFromFile()
    @     0x561d2d04cd85        128  yaze::app::editor::MasterEditor::DrawFileDialog()::{lambda()#1}::operator()()
    @     0x561d2d04e400         32  std::_Function_handler<>::_M_invoke()
    @     0x561d2d00eb46         32  std::function<>::operator()()
    @     0x561d2d03bc12        224  yaze::app::core::FileDialogPipeline()
    @     0x561d2d04ce99        192  yaze::app::editor::MasterEditor::DrawFileDialog()
    @     0x561d2d04cc6f         32  yaze::app::editor::MasterEditor::UpdateScreen()
    @     0x561d2d02d16c         32  yaze::app::core::Controller::OnLoad()
    @     0x561d2cfea70a      92880  main
    @     0x7f31ad547c87  (unknown)  __libc_start_main
    @ 0x4446258d4c544155  (unknown)  (unknown)
11:59:40: The program has unexpectedly finished.

Code Review comment 2

Same thing as comment 1 but all i figured out how to put it in the same issue lol.

uchar extendedcmd_i[4] = {0b11100100, 0x8F, 42, 0xFF};

uchar extendedcmd_i[4] = {0b11100101, 0x8F, 42, 0xFF};

uchar single_set_expected[3] = {BUILD_HEADER(1, 5), 42, 0xFF};

uchar single_word_expected[4] = {BUILD_HEADER(2, 6), 42, 1, 0xFF};

uchar single_inc_expected[3] = {BUILD_HEADER(3, 3), 1, 0xFF};

uchar single_copy_expected[6] = {BUILD_HEADER(0, 4), 3, 10, 7, 20, 0xFF};

BUILD_HEADER(4, 4), 0, 0, 0xFF};

yaze/test/rom_test.cc

Lines 188 to 194 in 465b3fc

uchar repeat_and_inc_copy_expected[7] = {BUILD_HEADER(1, 4),
5,
BUILD_HEADER(3, 6),
6,
BUILD_HEADER(0, 1),
5,
0xFF};

yaze/test/rom_test.cc

Lines 206 to 212 in 465b3fc

uchar repeat_and_inc_copy_expected[] = {BUILD_HEADER(1, 4),
5,
BUILD_HEADER(3, 6),
6,
BUILD_HEADER(0, 1),
5,
0xFF};

yaze/test/rom_test.cc

Lines 219 to 227 in 465b3fc

// char inc_word_intra_copy_expected[] = {BUILD_HEADER(3, 7),
// 5,
// BUILD_HEADER(2, 6),
// 5,
// 2,
// BUILD_HEADER(4, 8),
// 5,
// 0,
// 0xFF};

yaze/test/rom_test.cc

Lines 231 to 246 in 465b3fc

// char all_expected[] = {BUILD_HEADER(1, 4),
// 5,
// BUILD_HEADER(3, 6),
// 6,
// BUILD_HEADER(2, 6),
// 5,
// 2,
// BUILD_HEADER(4, 8),
// 8,
// 0,
// BUILD_HEADER(0, 4),
// 8,
// 10,
// 0,
// 5,
// 0xFF};

yaze/test/rom_test.cc

Lines 257 to 262 in 465b3fc

char extended_lenght_expected_42[] = {0b11100100, 41, 5, 0xFF};
char extended_lenght_expected_400[] = {0b11100101, 0x8F, 5, 0xFF};
char extended_lenght_expected_1050[] = {0b11100111, 0xFF, 5,
BUILD_HEADER(1, 26), 5, 0xFF};
char extended_lenght_expected_2050[] = {
0b11100111, 0xFF, 5, 0b11100111, 0xFF, 5, BUILD_HEADER(1, 2), 5, 0xFF};

yaze/test/rom_test.cc

Lines 282 to 283 in 465b3fc

char hightlenght_word_1050[] = {0b11101011, 0xFF, 5, 6,
BUILD_HEADER(2, 26), 5, 6, 0xFF};

Code Review comment 3

Are you checking for the starting line twice here?

if (i == 0 || i % 8 == 0) {
to_add += " db ";
}
// set byte
to_add += "$00";
if (mosaic_tiles[i] > 0) {
if (i == 0 || i % 8 == 0) {
to_add = " db $01";
} else {

Code Review comment 6

I'm not 100% sure but I'm assuming this is checking to see if the tab of the certain name is open? if so i would put the names in a constant here and anywhere else you use them that way if you or someone else changes the names of the tabs this will still work.

if (ImGui::BeginTabBar("##TabBar", ImGuiTabBarFlags_FittingPolicyScroll)) {
if (ImGui::BeginTabItem("Tile8")) {
ImGuiID child_id = ImGui::GetID((void *)(intptr_t)1);
if (ImGui::BeginChild(child_id, ImGui::GetContentRegionAvail(), true,
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
DrawTile8Selector();
}
ImGui::EndChild();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Tile16")) {
if (ImGui::BeginChild("#Tile16Child", ImGui::GetContentRegionAvail(),
true, ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
DrawTile16Selector();
}
ImGui::EndChild();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Area Graphics")) {
if (ImGui::BeginChild("#Tile16Child", ImGui::GetContentRegionAvail(),

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.