amhndu / simplenes Goto Github PK
View Code? Open in Web Editor NEWAn NES emulator in C++
License: GNU General Public License v3.0
An NES emulator in C++
License: GNU General Public License v3.0
/mnt/hgfs/sjt/SimpleNES/src/PPU.cpp:181:93: error: no matching function for call to ‘sf::Color::Color(const Uint32&)’
m_pictureBuffer[x][y] = sf::Color(colors[m_bus.readPalette(paletteAddr)]);
when i use cmake,it says ,"CMake Generate step failed. Build files cannot be regenerated correctly",and have a error :
CMake Error at CMakeLists.txt:74 (add_executable):
No SOURCES given to target: SimpleNES
i don't know why it say that,how can i solve it?
by the way,because i am a beginner,how can i compiled .nes ?and where can i compiled ?
hope somebody can relply my question.thank u o_o
Hi,
In CPUOpcodes.h, I found there are opcodes and respective hex number in enum OperationImplied, but other enums like Operation1, Operation2..., there are only opcodes defined, no hex number at all. So I am wondering why we can still use opcodes(should be a hex number) in 'Switch-Case' to match the codes in these enum?
Say enum Operation1
{
ORA, /* there's no hex like ORA = E9 defined ?*/
AND,
EOR,
ADC,
STA,
LDA,
CMP,
SBC,
};
In CPU.cc:
switch (op){
case ORA:
// do some stuff
break;
}
When configure it in cmake, it shows the Error:
CMake Error at cmake/Modules/FindSFML.cmake:358 (message): Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY) Call Stack (most recent call first): CMakeLists.txt:63 (find_package)
It seems that FindSFML.cmake has been removed when use SFML 2.5.0 or higher version.
我用cmakegui编译了,但是不知道怎么用这个玩意,因为我看不懂
Hello. I've built the emulator from source by following the instructions in README.md page. I'm running macOS Mojave. The "Up" and "Down" actions don't seem to work. I've tried it out on the Super Mario Bros ROM, which has been downloaded from this site. I even tried remapping the keys from the keybindings.conf
file by swapping the controls for Player 1 and Player 2. While the left/right actions were successfully swapped, the "Up" and "Down" were still unresponsive, even after the swapping.
[Cartridge.cpp:50] Reading ROM from path: Tetris (USA).nes [Cartridge.cpp:68] Reading header, it dictates: [Cartridge.cpp:71] 16KB PRG-ROM Banks: 2 [Cartridge.cpp:79] 8KB CHR-ROM Banks: 2 [Cartridge.cpp:82] Name Table Mirroring: 0 [Cartridge.cpp:85] Mapper #: 1 [Cartridge.cpp:88] Extended (CPU) RAM: false [Cartridge.cpp:102] ROM is NTSC compatible. [MapperSxROM.cpp:29] Using CHR-ROM [PictureBus.cpp:94] Unsupported Name Table mirroring : 1162765676 [CPU.cpp:138] Unrecognized opcode: 2 [CPU.cpp:138] Unrecognized opcode: 2 [CPU.cpp:138] Unrecognized opcode: 42 [CPU.cpp:138] Unrecognized opcode: b2 [CPU.cpp:138] Unrecognized opcode: 5a [CPU.cpp:138] Unrecognized opcode: 42
There is a gray screen in the main window.
Shunkang@XiaomiPro14:~/Konrad/code/SimpleNES/build$ ./SimpleNES ~/Games/SuperMarioBros.nes
[Cartridge.cpp:45] Could not open ROM file from path: /home/Shunkang/Games/SuperMarioBros.nes
i run it in windows system ,but i got a error about:
CMake Error at cmake/Modules/FindSFML.cmake:358 (message):
Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY
SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY)
i don't how to solve it,can someboby get me help(cry),
I imported the source into a visual studio 2022 solution and fixed any compiler errors. Now I can compile the program in debug and release mode, but debug mode either barely runs or throws runtime errors. However, everything works in release mode. Any suggestions where the problem could be?
os: win10
display: 4k
window size too small...
when make -j4 error,why?
I built this on Mac with apple silicon. I install sfml using Homebrew and successeed building it. When I try to run it, it shows:
dyld: Library not loaded: @rpath/libsfml-system.2.5.dylib
Referenced from: /opt/homebrew/opt/sfml/lib/libsfml-audio.2.5.dylib
Reason: image not found
[1] 39889 abort ./SimpleNES -w 1920 -H1080 ~/Downloads/Super\ Mario\ Bros\ (E).nes
I add the the following environment:
export DYLD_LIBRARY_PATH=/opt/homebrew/opt/sfml/lib/
and it start to work. But there are no sound. Any idea of where the problem is.
According to Opcode matrix from http://www.oxyron.de/html/opcodes02.html:
"*" : add 1 cycle if page boundary is crossed.
add 1 cycle on branches if taken.
From cpu.cpp line 349:
if (branch) { int8_t offset = m_bus.read(r_PC++); ++m_skipCycles; auto newPC = static_cast<Address>(r_PC + offset); setPageCrossed(r_PC, newPC, 2); r_PC = newPC; }
If the branch is taken, and page is crossed, m_skipCycles
will increase by 3. But according to the document, only 2 cycles should be added.
Is there any mistake, or did I misunderstand the document?
Thank you.
how much it stretches depends on the other tiles you have up, the first picture I had the terminal opened to run SimpleNES then moved it to the second workspace, the second picture I ran the command using dmenu so no terminal was open, going to fullscreen keeps the stretching the same and keeps the black space
Why does "could not open ROM file from path bueryt/Games/SuperMarioBros.nes" appear when executing the title, thanks.
My building of this project scceeds, but run to crash when the game picture starts. is it a problem because of x64 building?
Not load existing ROM. Thanks
it should be as follows:
if (line.empty() || line[0] == '#' )
the original is:
if (line[0] == '#' || line.empty())
if line has nothing, operator || will deal with the fr operand which may be out-of-range
I find the file FindSFML.cmke
, it seems not contains windows?
Should [src/CPU.cpp:408] be like:
f_V = (r_A ^ sum) & (operand ^ sum) & 0x40;
instead of
f_V = (r_A ^ sum) & (operand ^ sum) & 0x80;
?
Because of:
p 7 6 5 3 2 1 0
r N V B D I Z C
Thanks
Make use of https://github.com/pinam45/dynamic_bitset and it's optional dependency: https://github.com/kimwalisch/libpopcnt
Also make use of https://github.com/fmtlib/fmt, which is part of the C++ 20 standard but available for earlier versions.
Potentially make use of https://github.com/martinus/robin-hood-hashing for maps.
Add into the build step to use https://github.com/microsoft/mimalloc to greatly improve performance of allocations.
Threre are build logs as following:
CMake Error at cmake/Modules/FindSFML.cmake:358 (message):
Could NOT find SFML (missing: SFML_AUDIO_LIBRARY SFML_GRAPHICS_LIBRARY
SFML_WINDOW_LIBRARY SFML_SYSTEM_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:63 (find_package)
-- Configuring incomplete, errors occurred!
I am so excited that I build your project successfully!
But, why the game no sound?
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.