Inside the Famicom | 02: The 6502 CPU

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • Welcome to the second video in my multi-part series on the Famicom. In this video, we’re going to take a closer look under the hood, as we dive into the Famicom’s central processor and learn what makes it tick… literally! We’ll talk about some of the interesting background associated with Nintendo’s use of the 6502 and start exploring the mechanics of Ricoh’s 2A03/2A07 chip.
    Links Referenced in this Video:
    - Visual 2A03 - floooh.github....
    - Commodore’s BCD Circuit Patent - worldwide.espa...
    - List of 2A03/2A07 Clones - www.nesdev.org...
    - Commodore The Amiga Years - www.amazon.com...

Komentáře • 49

  • @play_history
    @play_history Před 2 měsíci +8

    Okay so on the BCD removal thing: To my understanding this was a redesign that Rockwell did first. MOS second-sourced production of the 6502 and variants to Synertek and Rockwell (a common practice in the industry at the time). Rockwell made modifications to the chip and Rockwell sub-licensed the rights of their design to Ricoh.
    MOS engineers have claimed that Nintendo stole the 6502 because they weren't getting direct payments, but anything they would have gotten would have gone through a long chain through Rockwell. Such are the salad days of early microprocessors.

    • @whatskenmaking
      @whatskenmaking  Před 2 měsíci +2

      Yeah, the re-licensing of the tech makes it really difficult to pin down what exactly happened. I read through a couple of accounts and Bagnall’s seems to at least summarize the reaction from Commodore employees with a firsthand account

  • @AlexanderEmashev
    @AlexanderEmashev Před 2 měsíci +5

    Wow, such a thorough and clean explanation of how the CPU works. Animation really helps to understand what happens and why. Thank you! Looking forward to watching the next part.

    • @whatskenmaking
      @whatskenmaking  Před 2 měsíci +1

      The animations take a lot of time, so I’m glad they’re useful!

  • @rudy5360
    @rudy5360 Před 2 měsíci +1

    Loving this series! Watching along as I plan to AV mod my newly acquired Famicom!

  • @ZipplyZane
    @ZipplyZane Před 3 měsíci +3

    What I love is that the lack of hardware BCD is why Tetris eventually crashes. It's the software BCD that winds up eventually taking too long to calculate and results in corruption.
    So that whole Tetris crash thing made something this old relevant again.
    Also, I love that it's the same chip with that line cut, and that was enough back then to say it was a different chip. That's the only reason it was left out. It allowed the copy to be legal.

  • @scotchnichols
    @scotchnichols Před 3 měsíci +5

    I've really enjoyed your deep dives into the Famicom so far. Looking forward to the next one.

  • @SplitHouse
    @SplitHouse Před 3 měsíci +3

    This is a great video to watch while I'm working on my NES emulator project! Thanks!

  • @HSTVizle
    @HSTVizle Před 3 měsíci +2

    These videos are awesome! My favourite lecture was Microprocessors in college, we've studied similar 8-bit CPU desings. Keep going Ken!

  • @willllbert1
    @willllbert1 Před měsícem

    Fantastic series! Looking forward to learn more 😊

  • @omarhossam9199
    @omarhossam9199 Před měsícem

    This is so goated omg. What a great video

  • @kauegoncalves9532
    @kauegoncalves9532 Před 3 měsíci +4

    fantastic video !

  • @user-hw2vu4fu5p
    @user-hw2vu4fu5p Před 3 měsíci

    Really enjoyed this! Not a huge fan of the games on these consoles but I have a huge soft spot for the 6502

  • @arnauddemarais9104
    @arnauddemarais9104 Před 3 měsíci

    Great great great video. Thanks !!!

  • @TheMikeyb86
    @TheMikeyb86 Před 3 měsíci +1

    Love this. Keep 'em coming. Thank you.

  • @Twenty_Six_Hundred
    @Twenty_Six_Hundred Před 3 měsíci +1

    Great stuff!

  • @chansonjoy
    @chansonjoy Před 2 měsíci +1

    Interesting, in fact it's very close to modern MCU architecture, except very limited IRQ resource and probably doesn't support nested IRQ at all.
    Modern MCU usually also come with NMI IRQ, but I found it hardly being used, because there are many other high priority IRQ available. I wonder what's the scenario of NMI in 6502.

    • @whatskenmaking
      @whatskenmaking  Před 2 měsíci +1

      You can nest IRQs if you reset the interrupt flag in your IRQ processing. For the FC and NES, NMIs are used by the PPU for Vblank signaling. I’ll talk about that when I cover the display subsystem

  • @iwanttocomplain
    @iwanttocomplain Před 3 měsíci +2

    There's something I've been trying to remember about 6502 bus requests for a while and not into all the resarch and it's really the key issue I have with the 6502. The SNES has 128KB of working ram. People think it's all available. But it's not.
    I'm also quite proud of myself for predicting two 8KB buffers in the NES by counting the numbers and not figuring out how it could have 2K of work and video and also 8K, but slower.

    • @whatskenmaking
      @whatskenmaking  Před 3 měsíci +2

      I'm going to walk through how the address decoding works in the next video - that will explain why there's an 8K chunk of memory with only a single 2KB RAM chip in it 😉

    • @iwanttocomplain
      @iwanttocomplain Před 3 měsíci

      @@whatskenmaking I'm speaking of the 6502 bus access system

    • @whatskenmaking
      @whatskenmaking  Před 3 měsíci +4

      Yeah - the address decoder logic is why the bus behaves that way. In short, chip select is enabled on work RAM through a higher order bit, but some of the lower order address pins aren't connected. I'll have some visuals that walk through it

    • @iwanttocomplain
      @iwanttocomplain Před 3 měsíci

      @@whatskenmaking yes that's it. I really want to understand why the snes has 128KB ram.

    • @skilz8098
      @skilz8098 Před 26 dny

      If I remember correctly, don't they use a Zero Paging Scheme? Something on the lines like when the system writes information to Page 0 based on the chunk or page size, it also writes to all other sections as well. It's been quite a while since I've done this type of research and read into, so please feel free to correct me if I'm wrong. But I think I remember learning something about this with their memory mapping scheme. This is kind of what tripped me up the most within the 6502 Assembly for the NES where I've been more familiar with and accustomed to x86 ASM (Intel Syntax).

  • @docwhogr
    @docwhogr Před 3 měsíci +2

    the nes inner working was explained by many, i think someone should give love to the other consoles. you did an excellent job though
    when you said go make something cool i went and fill the icecube tray in my fridge. does it count?

    • @whatskenmaking
      @whatskenmaking  Před 3 měsíci +2

      Thanks! I do plan on doing a series like this with other consoles and computers, as well. I started with the Famicom series for a couple of reasons, but mostly because the NES was my first childhood game console.
      Putting your ice cube tray in the fridge won't do much - you might try the freezer next time; that would be cooler 😆

  • @cosmefulanito5933
    @cosmefulanito5933 Před 3 měsíci +3

    Since the Z-80 was and still is today the most used processor in the world (enbedded today), I don't understand why people in the USA are so fixated on the 6502.
    Good video.

    • @whatskenmaking
      @whatskenmaking  Před 3 měsíci +2

      I don't know - maybe because of the popularity of Commodore or the Apple II here in the US? Variants of it were used by Atari as well. Personally, I've always been more of an Intel guy

    • @ScottDuensing
      @ScottDuensing Před 3 měsíci +1

      Simple! It was cheaper!

    • @skilz8098
      @skilz8098 Před 26 dny +1

      One of the things I think is driving it isn't just due to the various devices that used it throughout the 70s and 80s almost up into the early 90s, but also the fact that it does have a huge part in the History of Computer Science - Electonics Engineering. On top of that, there's a lot of information on it, it is well researched and well documented. There's also the sense of nostalgia that comes from it. Finally, one of the most intriguing aspects is that the original 6502 was physically designed by hand. Every single transistor and wire were laid out by hand. They didn't use a sophisticated piece of software to automate this process. I think this is why it is so intriguing. Sure, the Z80 is just as intriguing but so is the 8080 by Intel. They are all feats of Engineering! They are all worth learning about.

    • @bloepje
      @bloepje Před 23 dny

      As a programmer I would chose a 6502 above a z80 anytime. And I did a lot of z80/8085 and 6502 reversed engineering.
      I thought the 8052 was one of the most used cpus for embedded applications. I mean that stuff is embedded in switches as either the controller of a dumb switch or the interface between the switch and the cpu of a managed switch.

    • @bloepje
      @bloepje Před 23 dny +1

      To be clear, I did RE on 8052 too... that was a deep dive in a controller where banking is embedded in the ISA

  • @mwk1
    @mwk1 Před 3 měsíci +2

    So... if the Famicom 2A03 chip has 16 bits wide address bus does it mean that it really is a 16-bit CPU? (hello Atari Jaguar!) 😎

    • @whatskenmaking
      @whatskenmaking  Před 2 měsíci +2

      The data bus is what makes it an 8-bit system. The 16-bit address bus just means it can address 64K of memory… but it only does it 8 bits at a time.

    • @eitantal726
      @eitantal726 Před měsícem +1

      @@whatskenmaking I thought it was register size

    • @bloepje
      @bloepje Před 23 dny

      The jaguar was 68k based I think and that is a 16/32 bit cpu. It had a 16 bits data bus but was mostly 32 bits in calculating.
      Somewhere in history the definition changed from the size of the external databus to the size of the common alu size. The size of the external databus became much bigger than the alu size on amd64 ISA. Yet we don't call the 128 bits or larger.
      The 8088 had an 8 but databus but was internally an 8086, so a full 16 bit cpu. At that time we were not sure if we should call it 8 bits or 16 bits. We called it 8 bits if you don't like the ISA and we called it a cheap 16 if you liked it.
      Yes there were actual camps of this cpu is better.
      Intel made 4 interesting cpus: the 8089, the 80860, maybe the 8096 and the 80960.
      The 8088/8086 was so riddled with z80 shit it wasn't fun.
      There were a lot of interesting ISA's and the worst became popular.
      I know that back in the late 80's, early 90's we tried to get access to the T800 transputer. Or actually any. Even by today's standards, they were very innovative.

  • @stempek121
    @stempek121 Před 3 měsíci

    What's the software shown at 2:26 mark?

    • @whatskenmaking
      @whatskenmaking  Před 2 měsíci +1

      That’s Visual2A03 - there’s a link in the description. You can give it a set of instructions and it will show you what’s happening on the chip as they’re being executed.

  • @ssl3546
    @ssl3546 Před měsícem +1

    Chip masks are only protected for 10 years and the Famicom came out before the mask law was even passed. It would be foolish not to use the masks or to pay a license for something in the public domain. Do you send CZcams money for the free music in your videos?

  • @truectl
    @truectl Před 3 měsíci +1

    This isn't "begging the question."

    • @whatskenmaking
      @whatskenmaking  Před 3 měsíci +1

      Perhaps 😊

    • @jeff.fredrickson
      @jeff.fredrickson Před 3 měsíci +2

      Current vernacular uses “begging the question” to mean “raises the question” even if that meaning has nothing to do with the original meaning. Languages evolve even if the evolution was based on improper usage.

    • @TheMysteryDriver
      @TheMysteryDriver Před 3 měsíci

      To beg the question and begging the question are now two separate things.