GithubHelp home page GithubHelp logo

bisqwit / nescom Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 7.0 498 KB

NES assembler and particularly clever disassembler

License: GNU General Public License v2.0

Makefile 2.29% C++ 92.60% PHP 5.11%

nescom's People

Contributors

bisqwit 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nescom's Issues

Very minor typo

I didn't want to create a PR for such a minor thing. A comment in clever.cc reads:
// $A0 y A0 x CA D0 FD 88 D0 FA XY-delay = opposite
... it should be:
// $A0 y A2 x CA D0 FD 88 D0 FA XY-delay = opposite

nescom/clever.cc

Line 1487 in 70e6549

// $A0 y A0 x CA D0 FD 88 D0 FA XY-delay = opposite

The delay loop templates are indeed clever.

Clever Disassembler mapping ROM region to Work RAM addresses

Great tool! One feature that might be great to add in the clever disassembler is an INI option to allow mapping a ROM address region to a location in work RAM (anything below 0x8000). This would be very helpful in games which copy ROM code/data sections to work RAM on the cartridge allowing for code/data analysis to extended into that region.

Build Fails on Ubuntu

I run "make" but after compiling a couple things, it outputs some errors.
Output:

(xenial)spongbap@localhost:/var/host/media/removable/UNTITLED/nescom-1.2.0$ make
Checking dependencies...
g++ -std=c++1z -Ofast -Wall -Wundef -Wcast-qual -Wpointer-arith -Wconversion -Wwrite-strings -Wsign-compare -Wredundant-decls -Winit-self -Wextra -Wcast-align -Wformat -Woverloaded-virtual -Wno-conversion -DVERSION="1.2.0" -g -pipe -I. -c -o assemble.o assemble.cc
g++ -std=c++1z -Ofast -Wall -Wundef -Wcast-qual -Wpointer-arith -Wconversion -Wwrite-strings -Wsign-compare -Wredundant-decls -Winit-self -Wextra -Wcast-align -Wformat -Woverloaded-virtual -Wno-conversion -DVERSION="1.2.0" -g -pipe -I. -c -o insdata.o insdata.cc
g++ -std=c++1z -Ofast -Wall -Wundef -Wcast-qual -Wpointer-arith -Wconversion -Wwrite-strings -Wsign-compare -Wredundant-decls -Winit-self -Wextra -Wcast-align -Wformat -Woverloaded-virtual -Wno-conversion -DVERSION="1.2.0" -g -pipe -I. -c -o object.o object.cc
object.cc: In member function 'void Object::WriteO65(FILE*)':
object.cc:1343:14: error: expected unqualified-id before '[' token
for(auto [segtype,segptr]: std::initializer_list<std::pair<SegmentSelection,Segment*>>
^
object.cc:1343:14: error: expected ';' before '[' token
object.cc:1343:15: error: 'segtype' was not declared in this scope
for(auto [segtype,segptr]: std::initializer_list<std::pair<SegmentSelection,Segment*>>
^
object.cc:1343:23: error: 'segptr' was not declared in this scope
for(auto [segtype,segptr]: std::initializer_list<std::pair<SegmentSelection,Segment*>>
^
object.cc: In lambda function:
object.cc:1343:30: error: expected '{' before ':' token
for(auto [segtype,segptr]: std::initializer_list<std::pair<SegmentSelection,Segment*>>
^
object.cc: In member function 'void Object::WriteO65(FILE*)':
object.cc:1343:30: error: expected ';' before ':' token
object.cc:1343:30: error: expected primary-expression before ':' token
object.cc:1343:30: error: expected ')' before ':' token
object.cc:1343:30: error: expected primary-expression before ':' token
object.cc:1344:79: error: expected primary-expression before ')' token
{{CODE,code},{DATA,data},{BSS,bss},{ZERO,zero}})
^
object.cc: In member function 'void Object::WriteRAW(FILE*, unsigned int, unsigned int)':
object.cc:1422:40: warning: ignoring return value of 'int ftruncate(int, __off_t)', declared with attribute warn_unused_result [-Wunused-result]
ftruncate(fileno(fp), size);
^
object.cc: At global scope:
object.cc:819:10: warning: 'void {anonymous}::PutCustomHeader(FILE*, int, int, int)' defined but not used [-Wunused-function]
void PutCustomHeader(std::FILE* fp, int type, int param1, int param2)
^
: recipe for target 'object.o' failed
make: *** [object.o] Error 1

No feature-inclusion macro defined (trivial; causes FTB on Cygwin)

Hello. I'm sure Cygwin isn't exactly a priority support-wise, but the fix is trivial and it does actually represent a deficiency, though apparently one most standard GNUish programming environments are willing to forgive (else there'd already be an issue for this).

The issue is that no _GNU_SOURCE or similar macro is defined before including standard headers; this results in failures to build, because although various functions like ftruncate and fileno get used, they are not declared if the suitable feature macro has not been defined. I imagine setting _POSIX_C_SOURCE to something suitable would also get the job done.

However, since the Makefile assumes gcc, the simplest way to fix the issue (did the trick for me) was to change the Makefile to set CXX += -std=gnu++1z instead of CXX += -std=c++1z.

As to why I encountered this issue in the first place: AFAICT GNU libc is presumably happy enough to supply these optional symbols anyway without a suitable feature-test macro #defined, but Cygwin apparently uses something called "The Red Hat newlib C Library" (or that's what info libc gives me when I've installed the cygwin-doc package).

Thanks for writing this handy resource! I've been using clever-disasm to explore Trog for the NES, as I wish to modify it to allow playing with two players on the Famicom (the game assumes 2P has a start button).

Build Fails on CentOS 7

Is there a way to compile this code on CentOS 7? Running make results in an error as follows.

g++: error: unrecognized command line option โ€˜-std=c++14โ€™

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.