bisqwit / nescom Goto Github PK
View Code? Open in Web Editor NEWNES assembler and particularly clever disassembler
License: GNU General Public License v2.0
NES assembler and particularly clever disassembler
License: GNU General Public License v2.0
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
Line 1487 in 70e6549
The delay loop templates are indeed clever.
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.
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
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 #define
d, 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).
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โ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.