Giter Club home page Giter Club logo

nfs's People

Contributors

lagmeester4000 avatar nielsbishere avatar velddev 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

Watchers

 avatar  avatar  avatar  avatar

Forkers

chengstone

nfs's Issues

Qt disallows me to build the editor.

NFSU creates a runtime error which disallows me to run it. Please try removing your own PATH variables and check if you're missing something.

How to use this?

Hello, i want to make a romhacking tool using this to handle read a writes to the rom file.

I was thinking this is library so i tried to run your example as:

#include "NFS-master/NFS/FileSystem.h"
#include <iostream>

int main()
{
	std::cout << "name: ";
	std::string filename;
	std::cin >> filename;

	Buffer buf = readFile(filename);
	try
	{
		nfs::NDS nds = nfs::NType::readNDS(buf);
	}
	catch (std::exception e)
	{
		printf("%s\n", e.what());
	}
	deleteBuffer(&buf);

	std::cin.clear();
	std::cin.ignore(32767, '\n');
	std::cin.get();
}

using: g++ -o test.exe main.cpp -I C:\Users\***\Desktop\nitrotest\NFS-master\NFS

but got about 72 compile errors, all from "Iterators.h", "TypeStruc.h", "NTypes2.h".

Seeing the source files with qt and all makes me thing this is a tool but you present this repo as a lib, i am so confused, i don't even sure what files i should #include in my code to work with this or if this works with GCC.

note: I don't have Visual Studio installed.

Improve tile editor UI

  • Show palette next to picture.
  • Move toolbar based on aspect ratio and widget size.
  • Refine self made icons by removing white background.
  • Indicator for brush color.
  • Indicator for brush size.
  • Selection tool.
  • Fill tool should be accessible.
  • Square tool should be accessible.
  • Circle/Ellipse tool should be made.
  • Pipette tool should be made accessible.
  • Copy paste.
  • Brush mask.

Adding decompression

  • Huffman
  • LZ40
  • LZ11
  • LZ77
  • RLE
  • None encoding
  • Automatically decompressing if needed
  • Show a compression icon next to a resource
  • Add an option for exporting uncompressed/compressed data

History

To be able to revert things that were added or removed by accident.
I think it could be cool if you can see a tree of changes so if you wanna go back to a certain revision you can.
Maybe you can also add a 'stable release' button that removes branches from the tree to avoid cluttering the project file.

VS2015 version 14 compile error

Hi,
i'm using visual studio 2015 version 14 to complie the code,got 8 errors

error messages :

Severity Code Description Project File Line Suppression State
Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFS c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFS c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

Error C2244 'lag::TypeStruct<Front,Back...>::size': unable to match function definition to an existing declaration NFSU c:\users\cheng.sd\downloads\nfs-master\nfs\api\lm4000_typelist\typestruct.h 162

But, when i comment out below code in the file ‘TypeStruct.h’ line 158~162, then solve the issue:

template<typename Front, typename ...Back>
inline constexpr unsigned int TypeStruct<Front, Back...>::size()
{
	return SizeTypes<Front, Back...>;
}

its strange

File search feature

The following would be great:

  • Find String in file (case sensitive on/off, compression on/off)
  • Find WString in file (case sensitive on/off, compression on/off)
  • Find file in file (Provide hash or file, compression on/off)
  • Find hex values in file (compression on/off)
  • Find int in file (bytes, little endian on/off, compression on/off)
  • Find offset in file
  • Find instruction in file (thumb on/off, compression on/off)

Runtime error: Archive BTAF didn't match format

This is the code:

#include "filesystem.h"

int main()
{
	Buffer buf = Buffer::read("test.nds");
	nfs::NDS *nds = (nfs::NDS*) buf.ptr;
	nfs::FileSystem fs(nds);

	nfs::NARC &narc = fs.get<nfs::NARC>(*fs["fielddata/eventdata/zone_event.narc"]);

	nfs::Archive arc(narc);  //error here
}

For some reason i can't step into nfs::Archive arc(narc); to see what exactly happens, but looks like btafb.size != btaf.files * 8 in archive.cpp evaluates to true and throws EXCEPTION("Archive BTAF didn't match format");.

I checked for these values in the main function:
screenshot_20180621_212315

Looks like you want to check if the FAT size correspond to the number of files but buffer.size only holds the properties of the FAT, not the FAT itself.

Archive::Archive(NARC &narc) {

	BTAF &btaf = narc.at<0>();
	Buffer btafb = narc.get<0>();

	if (btafb.size != btaf.files * 8)
		EXCEPTION("Archive BTAF didn't match format");
	...

Apply compression

The commit function should actually recompress it and check using the aligned file size instead of file size as well as update the real file size (in the ROM) when it did change it.

  • RLE
  • Huffman
  • LZ77
  • LZ11
  • LZ40
  • Show when a file can't be compressed

[NFS_Reloaded] Use bitflags

Apparently bitflags are a thing in C; which also work in C++17. This means that instead of doing template magic, the compiler can handle it for us. The ux and u1 types can be removed.

u32 bits2 : 2;
u32 bits1 : 1;
u32 bits3 : 3;
u32 bits : 26;

This means the problem with structs that have different sizes can easily be fixed. It also means that the CPSR for ARM emulation could be perfectly emulated without a hassle:

u32 negative : 1;
u32 zero : 1;
u32 carry : 1;
u32 overflow : 1;
u32 saturation : 1;
u32 thumbIT0 : 2;
u32 jazelle : 1;
u32 pad0 : 4;
u32 condition: 4;
u32 thumbIT1 : 6;
u32 useBigEndian : 1;
u32 asyncAbort : 1;
u32 disableIRQ : 1;
u32 disableFIRQ : 1;
u32 thumbMode : 1;
u32 one : 1;
u32 systemMode : 4; //USR, FIQ, IRQ, SVC, MON, ABT, HYP, UND, SYS

Separate file viewer with resource combinations

For example; 0.NCLR and 1.NCGR should be bundled into 1 resource. You should be able to press a button to bundle them and move them into a virtual file system that can be saved alongside the project file. This can then be transferred to other people to make reverse engineering easy.

Compilation error, no matching function for call to std::exception::exception(const char [53])

This line:

nfs::NARC &narc = fs.get<nfs::NARC>(*fs["fielddata/eventdata/zone_event.narc"]);

Causes this compile error:

In file included from include/filesystem.h:2,
                 from src/main.cpp:3:
include/archive.h: In instantiation of 'T& nfs::Archive::get(nfs::ArchiveObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]':
include/filesystem.h:107:28:   required from 'T& nfs::FileSystem::get(nfs::ArchiveObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]'
include/filesystem.h:102:33:   required from 'T& nfs::FileSystem::get(nfs::FileSystemObject&) [with T = nfs::GenericResource<1129464142, nfs::BTAF, nfs::BTNF, nfs::GMIF>]'
src/main.cpp:13:80:   required from here
include/archive.h:67:15: error: no matching function for call to 'std::exception::exception(const char [53])'
    throw std::exception("Archive Couldn't cast; variables aren't of same type");
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8.1.1/exception:38,
                 from /usr/include/c++/8.1.1/stdexcept:38,
                 from /usr/include/c++/8.1.1/array:39,
                 from include/generic.h:2,
                 from include/templatemagic.h:2,
                 from include/genericresource.h:2,
                 from include/ntypes.h:2,
                 from include/resourcehelper.h:2,
                 from include/archive.h:2,
                 from include/filesystem.h:2,
                 from src/main.cpp:3:
/usr/include/c++/8.1.1/bits/exception.h:63:5: note: candidate: 'std::exception::exception()'
     exception() _GLIBCXX_USE_NOEXCEPT { }
     ^~~~~~~~~
/usr/include/c++/8.1.1/bits/exception.h:63:5: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/8.1.1/bits/exception.h:60:9: note: candidate: 'constexpr std::exception::exception(const std::exception&)'
   class exception
         ^~~~~~~~~
/usr/include/c++/8.1.1/bits/exception.h:60:9: note:   no known conversion for argument 1 from 'const char [53]' to 'const std::exception&'

changing std::exception for std::runtime_error by example, fixes the error.
i am in linux and using gcc 8.1.1

On reload

Make sure that all textures that are bound to renderers are cleaned out before reloading a new rom.

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.