Comments (1)
Hi! I'm also following this wonderful series and I'm trying to a step further, to have a more complete emulator.
I also encountered the same bug as you, and from my understanding it comes to the IRQ signal.
Those games (like Kirby and SMB3) are using IRQ to know at which scanlines the PPU is currently at to change the rendering behavior. For Kirby/SMB3 it's the status bar, but in SMB3 there is also the Spade game, where you need to match 3 lines.
After diving a bit deeper on the internals of the CPU, I noticed that when the IRQ is requested by the Mapper, the I
flag in the the status register in the CPU was always 1, and therefore IRQ were ignored.
In Kirby, it seems the PPU will trigger an NMI, and in the NMI function, it will clear the I
flag.
But in the olc implementation, there is something not right done. And rightfully it seems someone noticed:
#33
By moving the set flag after writing to the stack is solving the problem.
I'll open a Pull request to fix this :)
PS: Didn't see it was from 2020, sorry if I chimed in too late :D
PS2: It's here: #42
from olcnes.
Related Issues (20)
- Interrupts (NMI, BRK, IRQ) set I flag before pushing to stack
- B Flag doesn't actually exist (so don't save it in register) HOT 1
- Identifier lookup is undefinied HOT 1
- Fix: Cartridge.h error: 'shared_ptr' in namespace 'std' does not name a template type
- olc2C02.cpp error: use of deleted function 'olc::Sprite::Sprite(const olc::Sprite&)' HOT 2
- A slight correction to ASL to more clearly represent the opcode definition
- Incorrect ROL and ROR implementations
- Compile the game and load a room but don't have proper sound
- Part #3: segfault after compilation HOT 1
- CPU.cpp a little mistake in comment
- Disassemble logging "error" on REL addressing mode HOT 2
- Don't stay at home, and don't protect the UK's stupid & moron & donkey "national" clown "service". HOT 3
- ExampleProgram in Part 3 open then shut immediately when ran HOT 1
- Inspiration
- Stardust
- error C2280: 'olc::Sprite::Sprite(const olc::Sprite &)': attempting to reference a deleted function HOT 7
- missing olcPGEX_Sound.h HOT 1
- Part #2: possibly incorrect return value for uint8_t CMP() HOT 1
- Jump and coin sounds are distorted in Super Mario Bros.
- Part #7 - Emulator no sound on Macos Ventura v13.6.6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from olcnes.