NES Emulator Part #2: The CPU (6502 Implementation)

preview_player
Показать описание
In this video I build a 6502 emulation in C++. I pay close attention to the instructions that can cause problems, ADC and SBC. Then I build a lightweight application to analyze running 6502 programs.

Рекомендации по теме
Комментарии
Автор

Can we just take a moment and appreciate the fact that this guy didn't put a single ad on an hour long video?

vspecky
Автор

1 hour of David speaking about opcodes? Is this heaven?

waseinmalwar
Автор

Life goals, having a wife that can double check my opcodes

LS_NE
Автор

Dude, your content is pure gold. I love the fact that you thoroughly explain every concept and not only show the code, while still being concise.

remique
Автор

Chemists have The Periodic Table of Elements.
We Software Engineers have The Mnemonic Table of Opcodes.

code-dredd
Автор

I’m on YouTube since 2005, I never been so excited to see a part 2 video in my entire life!

victornpb
Автор

You are the personification for actual, usefull qualitycontent about c++. Be proud!

SolusPrimus
Автор

Wow, you have a very patient and understanding wife.

InfiniteQuest
Автор

Why are you much more interesting than my college professor when talking about the same subject? Good work!

zlatkovnik
Автор

The test ROMs are a super nice thing to have.
A wife which is willing to check your code is even better.

VirtuelleWeltenMitKhan
Автор

@53:43:

This is an attempt to clarify a potential point of confusion for others who may not be too familiar with the stack. Normally, the stack pointer (i.e. `stkp`) should be pointing to the element at the top of the stack. However, in the code as shown, the `stkp` isn't really pointing directly to the top element. Rather, it's pointing to the (logically) "empty" location where the next element should go when pushed, which is why the `write(0x0100 + stkp, a)` call is made first in `PHA` before decrementing the pointer with `stkp--`. Consistent with this, in `PLA`, you can see that the `stkp` is first incremented before reading, so that it moves from the (logically) "empty" stack position down to the actual top element in the stack.

I mention this because "normally", you'd expect the `stkp` to be pointing to the top element directly at all times, which would mean that on push, you'd be `stkp--` and then `write(...)`, and on pop you'd be doing `read(...)` and then `stkp++`, in that order.

BTW, if you're wondering why `stkp` is decremented in value when the stack itself is supposed to be growing in size (and vice-versa), the reason is that stacks grow from high memory addresses down to lower memory addresses.

GG

code-dredd
Автор

Oh man, this series is coming at the best time. I love you. May I recommend Ben Eater's 8 bit computer on bread boards series for anyone wanting to understand the electrical underpinnings of a CPU.

lallenlowe
Автор

YES! I was looking forward to second part of this new series.

wllngtnds
Автор

I can't stop giggling. You have taken me right back in time.
I wrote a 6800 Emulator (Dissassembler) in Pascal, during my second year at University in 1984!
The Ureka moment for this most daunting of tasks was when I devised the table of Instructions and Addressing Modes. Once I'd created the table, the implementation of the CPU was a doddle.
I love the elegance of your C++.
You are a very clever cookie.

Simple_Simon_UK
Автор

I think I'm more exited about the well organized and educational content rather than the NES emulator itself ;)

vtomasr
Автор

This is honestly amazing! This is basically a college course that's free. Keep up the good work man!

saraweber
Автор

You did your whole presentation, outside, in the heat and didn't take one sip of your soda.




You absolute legend. XD

amisnerk
Автор

Incredible stuff - I programmed 6502 back in the day, and this brought back a lot of memories.

StuBonham
Автор

Fills so many gaps I never cared about to fill back in the days though it was all in front of me... had to care about so many other things. Great video.

Heisenberg
Автор

Since your first video I already started building my own Emulator. You were right, it is such a wonderful project to work on.
It was something I also wanted to do a long time ago, and your videos gave me the motivation to start.
Thank you for that, and for making the videos so didactic.

WagnerSchmitt
join shbcf.ru