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

Поділитися
Вставка
  • Опубліковано 28 гру 2024

КОМЕНТАРІ •

  • @vspecky6681
    @vspecky6681 5 років тому +1770

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

    • @javidx9
      @javidx9  5 років тому +296

      Thanks! Or any of my videos as it happens 😊

    • @cecilectomy
      @cecilectomy 5 років тому +91

      Never has, and doesn't intend to, iirc. Doesn't care about monetizing the channel, only cares about the community, code, and knowledge.

    • @CB3ROB-CyberBunker
      @CB3ROB-CyberBunker 5 років тому +3

      don't even think you can monetize videos when the account is registered on most parts of the world other than the usa. can't find it anywhere in my account for one thing. lol. youtube never understood much of the 'open one office in pakistan and just send everyone bitcoin' thing and think they have to open 'local offices' with 'local payment bullshit' everywhere. lol. for all i care they just pop the cash in an envelope. works anywhere where there is a mailman ;)

    • @ObnovaDomu
      @ObnovaDomu 5 років тому +7

      can i be your patron? :>

    • @javidx9
      @javidx9  5 років тому +19

      @@ObnovaDomu you certainly can!

  • @waseinmalwar1854
    @waseinmalwar1854 5 років тому +530

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

    • @javidx9
      @javidx9  5 років тому +122

      Not only do you learn about code, but its an awesome insomnia remedy too!

    • @hadis93
      @hadis93 5 років тому +6

      west Virginia

    • @lupinedreamexpress
      @lupinedreamexpress 5 років тому +11

      machine code is great for those cold winter nights.

    • @aphexon.
      @aphexon. 5 років тому

      Defeated swordsman pretty sure it's hell

    • @fdelduquenobre
      @fdelduquenobre 5 років тому +2

      No. Just mean you are crazy, like the rest of us!

  • @emiljaszczuk1
    @emiljaszczuk1 5 років тому +331

    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.

    • @javidx9
      @javidx9  5 років тому +12

      Thanks remique!

    • @proxy1035
      @proxy1035 4 роки тому +12

      which is not only rare but also really awesome as you can follow along while programming in another language!

    • @slickmashable
      @slickmashable 3 роки тому +2

      Man we don’t deserve this!!!! Holy shit

  • @74LS_NE555
    @74LS_NE555 5 років тому +810

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

    • @user-cz9ss4yq4x
      @user-cz9ss4yq4x 4 роки тому +35

      "men only want one thing and it's disgusting"

    • @user-cz9ss4yq4x
      @user-cz9ss4yq4x 3 роки тому +16

      @Serena Williams No, having a wife that can double check your opcodes

    • @baileyharrison1030
      @baileyharrison1030 3 роки тому

      @Serena Williams Wants ≠ responsibilities

    • @tinker7722
      @tinker7722 3 роки тому

      😅👍

  • @victornpb
    @victornpb 5 років тому +79

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

  • @PflanzenChirurg
    @PflanzenChirurg 5 років тому +251

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

    • @javidx9
      @javidx9  5 років тому +40

      Thanks Great Bullet! I just want to show that fun applications are possible and far better to learn from than text books XD

    • @josemaria2094
      @josemaria2094 5 років тому +7

      TheChernoProject, Universo Programado and Bisqwit are too, :)

    • @PflanzenChirurg
      @PflanzenChirurg 5 років тому

      @@javidx9 thats my speech, books are outdated crap for the biggest part.

    • @PflanzenChirurg
      @PflanzenChirurg 5 років тому

      @jj zun i have experience yes but understanding the whole background of a system is another level of expertise you have to gather, and im thankful for every useful plate someone is able to serve.

    • @Xd4LEM4ObX
      @Xd4LEM4ObX 4 роки тому +1

      @@josemaria2094 All the channels that i like... You're brazilian right?

  • @InfiniteQuest86
    @InfiniteQuest86 5 років тому +74

    Wow, you have a very patient and understanding wife.

  • @lallenlowe
    @lallenlowe 5 років тому +51

    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.

    • @skilz8098
      @skilz8098 5 років тому +2

      Already Watched it; and if you want the math background check out 3Blue1Brown and for In Depth C++; check out Jason Turner!

    • @deathscreton
      @deathscreton 4 роки тому +6

      @@skilz8098 I wanna throw out "The Cherno" as well, his tutorials into C++ are succinct and to the point.

    • @skilz8098
      @skilz8098 4 роки тому

      @@deathscreton Yeah, he's good too!

    • @asandax6
      @asandax6 3 роки тому +1

      Interesting I am subscribed to all the people named here.

  • @code-dredd
    @code-dredd 5 років тому +189

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

    • @skilz8098
      @skilz8098 5 років тому +10

      Hardware Engineers have the Truth Tables, State Tables, Transition Tables, Implication Tables, and K-Maps of your Basic Logic Gates and the combinations of them!

    • @loernius
      @loernius 5 років тому +3

      Of each processor

    • @bpark10001
      @bpark10001 4 роки тому +1

      ...but there is only one "machine" in chemistry, with a universal set of codes, versus many for the software guys! Can we compile C++ to chemistry?

    • @VanillaMidgetSSBM
      @VanillaMidgetSSBM 3 роки тому

      @@bpark10001 I mean Silicone is a chemical compound sooooo 🤔🤔🤔

  • @VirtuelleWeltenMitKhan
    @VirtuelleWeltenMitKhan 5 років тому +47

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

  • @zlatkovnik
    @zlatkovnik 5 років тому +41

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

  • @Simple_Simon_UK
    @Simple_Simon_UK 5 років тому +30

    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.

    • @kkeanie
      @kkeanie 5 років тому +3

      jesus! Do you still have the code!

    • @Simple_Simon_UK
      @Simple_Simon_UK 5 років тому +1

      @@kkeanie Sadly no. My wife's de-cluttering got rid of my history many years ago.

    • @skilz8098
      @skilz8098 5 років тому +1

      @@Simple_Simon_UK Bad wife; bad wife!

    • @Simple_Simon_UK
      @Simple_Simon_UK 5 років тому +1

      @@skilz8098 Nah. She's a fantastic Wife. She has put up with my s#it for over 37 years. She just likes to de-clutter once in a while.

  • @code-dredd
    @code-dredd 5 років тому +22

    @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

  • @vtomasr5
    @vtomasr5 5 років тому +33

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

  • @saraweber312
    @saraweber312 5 років тому +27

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

  • @w3ll1ngt0nd14s
    @w3ll1ngt0nd14s 5 років тому +49

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

    • @whatamievendoing
      @whatamievendoing 5 років тому +1

      Same! I'm totally satisfied with this episode too, all the juicy details I wanted are included in a way which makes more sense than it ever did before!

  • @boredfish80
    @boredfish80 8 місяців тому +2

    It takes some skill to create something that a curious layman can follow and yet someone more tech-minded can actually use without being condescending. Hats off to you, sir. There’s something for everyone here!

    • @javidx9
      @javidx9  8 місяців тому +2

      Thanks boredfish, I appreciate that, as it's what I aim for in my videos.

  • @WagnerSchmitt
    @WagnerSchmitt 5 років тому +8

    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.

  • @quincy1048
    @quincy1048 5 років тому

    In 1985 I was in computer science school and we did a course where you did a simulation of a assigned processor archeture and proceeded to write an assembler to feed the first program you wrote. So I fired up my new ibm clone with 256ram and two 360k drives and i put turbo pascal 3 in it with a tsr to give me source level debugging and off I went. Our processor was limited so you got the idea of address modes and instruction variants without the repeated details of even a 6502. But yes this was a awesome walk down memory lane watching this video. I was yes, Yes, and YES the whole way through. Nice for you to say this was not your first effort on this but a refined result. Because it looked VERY refined...awesome.

  • @amisner2k
    @amisner2k 5 років тому +12

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

  • @theronster345
    @theronster345 5 років тому +1

    System Designers back in the day were geniuses. I had to design a Single Cycle CPU that performed all the bit wise operations and arithmetic operations for my computer organization class. It fried my brain by the end of the semester. Thanks for the vid it improved my knowledge of system design but also C++.

  • @manuellehmann267
    @manuellehmann267 5 років тому +11

    Uhhhh... I was so looking forward for this!
    I just wanted to say: Thx for your awesome work here! I'm learning so much from every single video you are posting. So much detail, so much passion. Again: Thx for sharing this stuff with us.

    • @javidx9
      @javidx9  5 років тому +3

      Hey my pleasure donnerbrenn!

  • @yousiftareq8694
    @yousiftareq8694 2 роки тому +1

    The amount of effort you are putting.... not even a paid professor in a University would do the same thing...
    Hats off to you good sir!

  • @funposting8912
    @funposting8912 5 років тому +1

    It’s beautiful seeing a deep-dive into the 6502 like this in video form. Even the simplest of microprocessor trainers don’t get this absolutely simple, I love it!
    Can’t wait to see you go through the rest of the NES’s hardware like this, this series is taking my knowledge from a rough, “good enough but never great” understanding to something much more refined and even simplified. Thank you very much for everything you’ve done so far, and I can’t wait for the rest of this series!

  • @Heisenberg2097
    @Heisenberg2097 5 років тому +8

    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.

  • @StuBonham
    @StuBonham 5 років тому +11

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

  • @rfdave3980
    @rfdave3980 3 роки тому

    I spit my coffee out when you said your wife checked the lookup table. Wow you are a lucky guy. I have so much information to watch with your channel. Thanks Dr. David.

  • @kb3khs
    @kb3khs 4 роки тому

    Got a Sir David Frederick Attenborough vibe at 1:05:35
    Your inflection was good. And the resolution inflection made me feel like I was watching David on the BBC nature channel. LOL.
    I admire your work, and your choice to not put ads in your videos.

  • @ContractCAD
    @ContractCAD 5 років тому +2

    I taught myself 6502 30-odd years ago as a 15 yr old and guessed at what your emu code would look like (which in fact was my assumption as to how I’d write one). This tho has been a masterclass. I can’t wait for the rest. Thank you sir!

    • @javidx9
      @javidx9  5 років тому +1

      Thanks Matt, I'm approaching the series with broad strokes, and the devices get more complicated as we progress so it will need a bit of "filling in the gaps" later.

  • @hellbenthorse
    @hellbenthorse 4 роки тому +1

    I could listen to this top bloke talk about CPU architecture all day..

  • @skilz8098
    @skilz8098 5 років тому

    I've tried to do something similar on my own before from reading the documentation from nesdev, and from listening to others but the one thing I kept struggling with was the different addressing modes. After following your source and typing it by hand in my own IDE, as I was reading through the mnemonics or functions and seeing how you implemented them in C++ then I started to understand the actual internal hardware of the CPU. I've worked in Logisim to create simple 4 bit single phase single address CPUs which are quite easy to build from basic gates, but now I think I finally got the full grasp of the different addressing modes of the 6502. I really appreciate videos like this; they help to fill in the gaps! After you complete this series I think building the 6502 - NES in Logisim as a step by step set of tutorial videos would be another exemplary set of worthwhile videos! I was hoping that Ben Eater would take his 8-bit Bread Board CPU and do the same in Logisim! Who know's maybe one day!

  • @delnarlt
    @delnarlt 5 років тому +5

    Amazing Video. I'm having fun cause I'm converting the code to C#. I've always wanted to write a NES emulator and I'm a C# guy so your video is a perfect match. You're helping me understand how they wrote a NES emulator in Javascript and other languages.

  • @maniacZesci
    @maniacZesci 4 роки тому +2

    It's one of those videos that gets you tempted to make several youtube accounts just so you can like it more than once.

  • @BackyardFilms2
    @BackyardFilms2 5 років тому +5

    Finnaly to the end. took me a few sessions. This was an amazing video thank you!

  • @jdragyn
    @jdragyn 5 років тому

    Hobbyist programmer here, but I haven't had the opportunity to write any software in years. Watching you write this NES Emulator is both so incredibly satisfying (your presentation, voice, style and knowledge is amazing) and inspiring (I wanna write something like this now - you make this large project seem do-able!). Thank you for sharing your obvious passion!

  • @bitchain
    @bitchain 5 років тому +1

    Totally hooked on this series having both played NES as a kid and later gone into _higher_ level programming; this brings back CompSci memories but if only those lectures were taught in this way.

  • @Damaniel3
    @Damaniel3 5 років тому

    I actually tried my hand at writing a 6502 emulator many years ago (I wanted to try making an NES emulator too), and I've got the code open while looking at what you're doing. Unsurprisingly, your implementation is *much* nicer - I used giant switch statements to process opcodes instead of function pointers, for example, and I never implemented a proper bus, choosing to just create a single 64K block of RAM, which meant I would have had to refactor things to get the other devices hooked up once I got past the mere CPU emulation stage. I doubt I'll revisit the project again, but I really enjoy watching someone that knows what they're doing go through the same steps that then-20-year old me did so many years ago.

  • @imrank340
    @imrank340 2 роки тому +1

    A classic Englishman subtle, firm, and with evidence of code, presented by David or Javidx9.

  • @dtg5790
    @dtg5790 5 років тому +1

    This is amazing work. I've been trying to get a 6502 emulator going in Common Lisp for the last few months and it has been slow... Your work is extremely useful! You've inspired me to revisit my own implementation.

  • @jszoja
    @jszoja 3 роки тому

    Usually I'm watching videos like this with x1.75 speed to get quickly what I need to know, but there is no need to do that with your videos. Very good work. Much appreciated. God bless.

  • @angulo_
    @angulo_ 5 років тому +4

    Wow. Thank you! I'm studying computer science and I was having a bad time understanding assembly code and instructions. This project helped me a lot! Just finished writing my implementation in dotnet:)) looking forward for the next episode!!

  • @cameronball3998
    @cameronball3998 4 роки тому +1

    I didn't expect to watch the entire hour+, but here I am. This was awesome

  • @MK73DS
    @MK73DS 5 років тому +28

    51:47 Shouldn't it be A = A - M - 1 + C ?

    • @javidx9
      @javidx9  5 років тому +10

      Yes, nice catch, so the +1 cancels out the -1

  • @DDD-vs2pe
    @DDD-vs2pe 5 років тому +1

    Dude you have explained everything and implemented everything so abstractly and succinctly that I watched the whole last one, saw this one come out and watched it straight away.. Thanks for a great video, and I really hope you make this a great series! It's absolutely fascinating!

  • @danorjestad4605
    @danorjestad4605 5 років тому +1

    The video was wonderful, interesting, educational,easy to understand and decently paced. I also greatly appreciate the little things to do in your code for clarity, such as "x + 0" when getting the low byte of an adress so you don't think x is one greater than it actually is.

    • @javidx9
      @javidx9  5 років тому

      Its interesting Dan, people than "can" code already tend to give me grief about doing things like that, but I firmly stand by it as a way of enforcing mental clarity. Glad to see others appreciating its value!

    • @danorjestad4605
      @danorjestad4605 5 років тому

      @@javidx9 I really dislike is the, maybe subconscious, "elitism" you sometimes see. Code which is undocumented just because it's a cool trick trick that only "proper" coders would understand, etc. I say keep doing what you're doing! The videos are properly educational and exciting to watch, clearly made by someone who knows their stuff.

  • @lozD83
    @lozD83 5 років тому

    Only 5 minutes in and I can already tell this video is a great resource for anyone interested in 6502 and probably any processor/microcomputer understanding. Thanks for taking the time to explain things so well 😁

  • @Ali-io9lw
    @Ali-io9lw 4 роки тому

    Hi Javidx9! I just want to thank you for making this available!!! In my early teens I wanted to program my own emulator but never knew where to start. I was around the time when NeoRage (first neogeo emulator) was being developed purely in assembly in the 90s and was fascinated by the coders accomplishments. Forward 20 odd years later here I am trying to learn how to make a Nes emulator in C++. I don't have a strong programming background so I have had to watch this several times. I now understand most of your code in this video. I look forward to watching the rest of the series and seeing Nes emulating on my screen. Thank you for making this happen!

  • @minmaijd
    @minmaijd 5 років тому

    Rarely in life have I made a decision so obviously right and immediately rewarding as subscribing to this channel.

  • @shampavmancg
    @shampavmancg 2 роки тому

    Very very well articulated. Having written device drivers for the early part of my life, I know how difficult it was to visualize things.. this is very well done

  • @johnhammer8668
    @johnhammer8668 4 роки тому

    Wow. This channel has very unique and rare content. I did not knew i lacked so much basic knowledge until i watched David's videos.

  • @tecnoplayer
    @tecnoplayer 5 років тому +1

    I'm very glad you're making this series. The acronyms and abbreviations of the code make it fast to read and write (r/w) but is far from being intuitive to grasp at first.

  • @mannhansen9337
    @mannhansen9337 4 роки тому

    Excellent video. You are a great teacher with very good presentation skills. I'm a self-taught 6502 programmer on a KIM-1 back in 1980-81.Some years later when I got an IBM PC and developed a 6502 table driven assembler in Quick Basic,later Turbo Pascal.

  • @renarsdilevka6573
    @renarsdilevka6573 5 років тому +1

    David, you are great, just so easy to understand and watch. Every your video inspires me. Thank you!

  • @taik0
    @taik0 Рік тому

    Such an amazing video. Perfect explanation. 10/10 quality. There's a game called Turing Complete that helped me a lot to understand a lot of concepts about CPUs addressed in this video.

  • @xotmatrix
    @xotmatrix 5 років тому +1

    Really good. Easy to understand structure and excellent explanation of ADC/SBC and Overflow. Extra good for introducing your olcPixelGameEngine engine and the handy mass:werk assembler.

  • @keigezellig
    @keigezellig Рік тому

    I just found this series and it inspired me to build a Z80 emulator. It has a lot more instructions than 6502 but i use the ideas presented in this video/series during development. Thank you!

  • @samljer
    @samljer 5 років тому +6

    Ive been refreshing your channel since part 1... this is SO GUD.

  • @Oingoboingo710
    @Oingoboingo710 5 років тому +2

    This is so nice, this series is going to be really awesome!

    • @javidx9
      @javidx9  5 років тому +2

      I hope so Mah Moud, thanks!

  • @psyience3213
    @psyience3213 Рік тому

    I stole your function definitions and filled the rest in myself. It was a lot of fun. Thank you for taking the time to write them it was a perfect template for me to get right into actually making it. I ended up doing it a bit differently but also similar. I don't really know where to start with the graphics so i look forward to that part.
    I also made a disassemble function and just finished inserting labels in. Yours looks a bit shorter

  • @nadiequintero9981
    @nadiequintero9981 5 років тому

    We do not deserve this amount of quality content and amount of educational resources from your part. Thank you very much!
    Greetings from Mexico.

  • @chrismcovell
    @chrismcovell 5 років тому

    What a great instructional video! You tell potential emulator writers first to choose the level of detail at which the emulation will take place, then consistently explain coding choices for staying at that level. I wish I could explain things just as well.

  • @FinnT730
    @FinnT730 5 років тому +31

    There need to be more people like you in the world!
    This is some top notch sh*t, and a very few people explain things this good, and let alone make this good of docs + source available for everyone to use (with credits of course :P )
    Keep it up, and don't stop teaching!

  • @thecakeredux
    @thecakeredux 5 років тому +1

    I stumbled over this when I was writing an emulator for Redcode (the assembly language for Core Wars, a Programming Game). It's fun watching you solve very similar problems than I faced and I kind of wish I could have used C++ as well, but it had to be JS.

    • @javidx9
      @javidx9  5 років тому

      lol you use the word "solve" very optimistically, thanks Felix!

  • @sherifhussein9707
    @sherifhussein9707 2 роки тому

    You should receive the equivalent of noble prize for content creation. Thank you for making this world a better place!

  • @TheBeanhacker
    @TheBeanhacker 5 років тому

    Incredible! Been eagerly awaiting this video all week. There's a crater in my office floor where I've been nervously tapping my foot! Awesome video, it paints processor emulation in a simple and elegant light, and makes it appear very achievable.

  • @JeremiahKellogg
    @JeremiahKellogg 5 років тому +1

    This is amazing! I know it's a labor of love, but thanks so much for sharing. It really removes some of the more mysterious aspects behind how CPUs work. I'm really looking forward to the rest of the series.

  • @jeanjcl
    @jeanjcl 5 років тому +1

    Amazing content. This is pure gold to someone who is learning systems programming and low level stuff in general. Thank you!

  • @frankkubrick865
    @frankkubrick865 4 роки тому +1

    You make complex programing so easy to understand, you sir are a legend!

    • @javidx9
      @javidx9  4 роки тому +1

      Thanks Frank!

  • @LittleRainGames
    @LittleRainGames 5 років тому +2

    Much respect! Especially when you explained how video editing makes it look much easier, i know alot of people dont realize that and it makes them feel dumb.
    Suprisingly enough, ive always wondered how to write an emulator, and i was actually pretty close!
    I dont give many videos a like, but this one is well deserved, by far.

    • @javidx9
      @javidx9  5 років тому

      Thanks and much appreciated LittleRainGames, with most of my videos Im always concerned that it makes things look easier than it really is, and I dont want people just jumping into emulation expecting to have mastered it in no time at all. Im pleased this was a good call.

  • @GeneralVanRyberg
    @GeneralVanRyberg 4 роки тому +1

    This is a super-duper-awesome video. I can't imagine this video being much better... Thank you so much!

  • @NesrocksGamingVideos
    @NesrocksGamingVideos 5 років тому

    20 seconds in, and this is one of those 1 hour long videos where I KNOW I'm going to watch through everything and I KNOW I'm gonna like it, so there you go, liked it already. Now I watch it.

  • @joedempseysr.3376
    @joedempseysr.3376 5 років тому

    Congratulations on your 100th video, David! Thoroughly enjoyed it and am looking forward to more. Thanks!

  • @tomkirbygreen
    @tomkirbygreen 5 років тому +3

    Fab video David! :-) I learned lots and as ever the process was entirely enjoyable!

  • @fabuloss77
    @fabuloss77 5 років тому

    What a gold mine.. you have one of the best youtube channel ive came across. I can feel how passionate your are about this subject through your explanations and it shows in the overall quality of the content. Amazing work.

  • @josephholten5088
    @josephholten5088 4 роки тому

    wow, this is just amazing! i have only taken a short course on c++ at uni but understood most of what you were talking about, it was all very clear and super interesting. i would have never thought i'd get that much involved into c++

  • @bruno-zl9qn
    @bruno-zl9qn 2 роки тому

    Brilliant. I'm writing a Z80 emulator in Rust, and I am using your video for that purpose. Thanks a lot for the hard work put in those videos.

  • @sakealex
    @sakealex 5 років тому +1

    Thanks for your work sir, I binged on your vids the past week, I was off from work. I wish you the best of luck in all your endeavors.

  • @NeilRoy
    @NeilRoy 5 років тому

    This takes me way back. The first assembly language programming I ever learned was the C64 assembly, which has a 6510 (which is basically a 6502). It was the easiest and most fun I had programming assembly I think. I also watched another video where a guy built a simple computer. That is, he built a CPU using off the shelf electronics, wiring it all up and explaining how the CPU works electrically. It was a great education. Each clock cycle you have electronic "switches" (logic gates etc) which does one thing, like, it gets the instruction, clock cycle, then it maybe read LDA, so the next cycle it transfers the contents of memory into the accumulator. For addition, those four cycles may be that cycle 1 it loads one value into the accumulator, then it loads another into say Y for the next cycle, then it adds the two, and finally, perhaps transfers the result to the accumulator, or maybe sets/clears a flag. The faster the clock, the faster things get done, but it was quite educational. There really isn't any other "programming code" inside the CPU, just a set of electrical switches that are changed around for each cycle of an instruction to complete what it needs to do. Fascinating anyhow, this just adds to that knowledge for me. If you're interested in the series where he builds a CPU, check out his videos, they're amazing in how he explains how exactly a CPU operates, and he explains it like you explain things. Easy to understand.
    ua-cam.com/video/HyznrdDSSGM/v-deo.html

  • @RetroWK
    @RetroWK 5 років тому +1

    Excellent Video! Congrats on 100 videos and thanks for your work & time!

  • @christianbuendia5794
    @christianbuendia5794 5 років тому +1

    how much i learn with this 2 videos thanks a lot! P.D. supporting ur channel is the only way can i say thanks.

  • @michaelburns8073
    @michaelburns8073 5 років тому

    I had no problems at all understanding this video, since when I was in High School I was programming 6502 assembler on an Apple ][+. This brought back many memories for me. One cool thing about the zero-page memory, I used it to *hack* many games into giving me unlimited lives. My homebrew Apple (I still have it!) had a switch that I could use to switch between AppleSoft and Integer Basic. So I would run a game, and keep note of how many lives it started off with. I would then play the game and get killed, then immediately put the switch to Integer Basic and hit reset (This needed to be done because most games would reboot on reset in AppleSoft), which would put you into the Apple Monitor, where you could examine the memory of the Apple, including the zero page. I would look through all the entries of the zero page, and see if it the count went down one, and keep it's location. Most game programmers put this kind of stuff in the zero-page area. I would start the game again and get killed a few more times, and see if there were zero-page memories that went down at the same time. Then, it was just a matter of loading up the code, using the monitor to look through the game code for something like "DEC $10" and NOP'ing (I still know it as the $EA opcode!) the code out. Then restarting the game, with now unlimited lives! Also, used to freak out schoolmates by putting their name in the game.
    Anyway, congrats on your 0x64 video. Will also sub as well.

  • @schnert0
    @schnert0 5 років тому

    Funny that you happened to be writing an NES emulator at the same as me! Maybe I’ll be able to learn what I’ve been doing wrong when I run into emulation errors. Thanks for your awesome vids, can’t wait for part 3

  • @schweizerd6303
    @schweizerd6303 4 роки тому +1

    Excellent content, very easy to understand and follow. Love how you break everything down and the object oriented nature of C++ makes everything so much easier to visualise. I am trying to emulate IA64 architecture and hopefully get it to run Linux and Windows

  • @Stabby666
    @Stabby666 4 роки тому +2

    I'd just like to say thanks for this video! I've recently written a 6502 emulator for a pet project, and it's randomly weirdly similar in design to yours (aside from the PGE)! I'm going to be revising it though as some of your decisions are definitely improvements on my initial code! I'm mostly a hardware guy, but wanted to emulate a 6502 based retro computer I'm working on, which will have pretty advanced graphics, sound and even networking, so should be cool to learn to code on, and play games 😁 I'll also be trying out your PGE as the emulation interface, so thanks again!

    • @javidx9
      @javidx9  4 роки тому +1

      Hey no problem Stabby! Your neoretro computer project sounds fun 😄

  • @that_funny_guy496
    @that_funny_guy496 5 років тому +1

    Big Thanks to you and your wife for providing completely accurate lookup table .. :)

  • @icupiii
    @icupiii 5 років тому +1

    This is one of the best series on YT. Thanks!

  • @pietrasagh
    @pietrasagh 5 років тому

    Few weeks before I watched this video I got through Ben Eater "Building an 8-bit breadboard computer!" playlist. It helped a lot to understand this topic for not-electronic, not-IT guy like me. For long time I knew some basics how computers work by Ben video series cleared up many confusions and misunderstandings of this topic. The series is bit long (44 of 1-20 min. videos) but it's worth to watch.

  • @Kadaj0666
    @Kadaj0666 3 роки тому

    I miss probably something, but why we need to add 1 to the address at 35:11 ?
    Apart of my misunderstanding, you are a god !!! Thank you very much for your videos !!! Words cannot describe the quality of your content !

  • @OptimusNiaa
    @OptimusNiaa 4 місяці тому

    That was excellent and easy to follow. I hobby code a little in C Sharp (Unity) and LUA (Pico-8 and Pictotron), and as it relates to the 6502 I watch channels like Displaced Gamers. But the assembly-language world has always felt inscrutable black box-y. And yet now, after watching this, I feel like a have a much more clear understanding of the 6502. Thanks!

  • @victorjosegonzalez1829
    @victorjosegonzalez1829 5 років тому +2

    this man is incredible, your content is amazing

  • @cheaterman49
    @cheaterman49 5 років тому

    I honestly expected no less after seeing part #1, but this really shows how great of a complement it can be (for those interested) to Ben Eater's "8-bit computer on a breadboard" series! Love it! I honestly thought of implementing one in software after seeing his video, but didn't even think of pushing it to the extreme and emulate a console! Very inspirational! :-D

  • @greje656
    @greje656 2 роки тому

    just getting into this serie, so far its soooo good

  • @bripbrap
    @bripbrap 3 роки тому

    I'd just like to take a moment to really appreciate your implementation of the LUT for the instructions. Using the OPCODE as an array index is just genius. My naive approach was just a huge switch statement.

    • @whukriede
      @whukriede Рік тому

      Well, anyone exposed to the bit fiddling in those days would do it even if half unconscious.

  • @walterdiaz2003
    @walterdiaz2003 Рік тому

    I really enjoy learning from this channel. Excellent and high quality content and free.
    Reminds me of the channel "Self Sufficient Me", similar accent :)
    Thanks for sharing.

  • @Seftdelmer
    @Seftdelmer 5 років тому

    Wow, these videos are excellent, with clear and concise explanations. You can tell a lot of time and effort went into making these videos by their quality. Thank you for making them and keep up the good work.

  • @hazzit1
    @hazzit1 5 років тому +6

    @1:03:09 BNE $FA jumps back 4 Bytes to $8010, the disassembly shows $8110 instead. Very interesting to see how you approach writing an emulator, and quite different to how I would have imagined doing it myself. Thanks for this walkthrough.

    • @javidx9
      @javidx9  5 років тому +2

      Yeah its a little bug in how i visualise the assembly in the output of my hacked together disassembler XD

    • @hazzit1
      @hazzit1 5 років тому +2

      @@javidx9 if you want to know how addition of signed integers work, there is this one guy on the youtubes named javidx9, who explains it at about @42:40 of this hour-long video ;-)

    • @michaelburns8073
      @michaelburns8073 5 років тому

      Yeah, I noticed this too. Was going to mention it.

    • @frisnitfrisnit
      @frisnitfrisnit 5 років тому

      I was the same, looking ahead to see what was at 8110, before realising it must be a numeric error. Glad it wasn’t just me not understanding 😜

    • @ContractCAD
      @ContractCAD 5 років тому +1

      Haha I spotted this too! What an attentive audience - spotting hex errors 1hr 3 mins in 😀

  • @LucasAlfare
    @LucasAlfare 4 роки тому

    Need to watch this several times to understand the meaning of each structure is. But this is a good place to start!

  • @jimmea6317
    @jimmea6317 4 місяці тому

    you are a true master and teacher to me and to others, you are who we strive to become as students

  • @zgolkar
    @zgolkar 5 років тому

    Outstanding. Simply outstanding. 10/10. Great explanations, great approach of showing the code incrementally, engaging at all times. Thanks a lot, I will be looking forward to the rest of the series!

  • @podborski
    @podborski 5 років тому +1

    Wow. What a great content!!! I'm waiting for the next part! Thank you, javidx9