Writing NES Games! With Assembly!!

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 753

  • @misterhat5823
    @misterhat5823 6 ปีที่แล้ว +632

    Never saw a Ruby developer before. They're like unicorns.

    • @ryahpalma
      @ryahpalma 5 ปีที่แล้ว +7

      LOOOOL

    • @sabin97
      @sabin97 5 ปีที่แล้ว +26

      i use ruby at home, and have used it professionally....
      but i see it as just another tool in the box.
      my true loves are c, perl and php.
      but i use other tools for different things. it doesnt make sense to try to use perl for writing an operating system....or php for anything other than web development....
      ruby has some interesting libraries for dealing with midi.
      the ruby community is mostly overexcited hipsters....i wouldnt wanna be one of them....

    • @pauldavis5665
      @pauldavis5665 5 ปีที่แล้ว +25

      I didn't even know they existed. Thought they were a myth.

    • @shadowagent3
      @shadowagent3 4 ปีที่แล้ว +2

      @@sabin97 how well do you know C. I only ever learned data scructures with C++ and am interested to try to master C on my own.

    • @sabin97
      @sabin97 4 ปีที่แล้ว +3

      @@shadowagent3
      i can work with multiple levels of indirection, in my mind....so i'd say i'm pretty good with c.
      the beauty of c is its raw power. no other language comes even remotely close.
      c++ is more of a federation of languages instead of a single language.....most of your c code will compile and run as expected in c++.
      if your project doesnt need the performance of c, and your design can be simplified by using objects, then c++ might be a better choice. the performance of c++ is actually quite excellent....second only to c.

  • @PetikG
    @PetikG 9 หลายเดือนก่อน +3

    Oh my god! The moment he said the controller button layout can be stored as a single byte, I finally got how those videos of arbitrary code execution on NES work!

  • @benjaminramsey4695
    @benjaminramsey4695 6 ปีที่แล้ว +118

    I love the enthusiasm and almost childlike wonder of "discovering" the tech of the NES, good stuff.

  • @toddmiller5322
    @toddmiller5322 6 ปีที่แล้ว +290

    As a guy who grew up with 8-bit PCs and who learned to program in assembler because basic was so painfully slow, watching your excitement at discovering the basics was both entertaining and nostalgic. Enjoy your journey at finding out what we had to do before the era of high level languages and the processing capability to make them usable.

    • @verdoemme
      @verdoemme 6 ปีที่แล้ว +25

      Same here, I had a mpf-II, an Apple ][ compatible thing with a 6502 processor. Because AppleBasic was too slow I learned assembly to write screen routines. Problem was I didn't have a compiler so I wrote my code on paper and translated it to hexadecimal myself. You really learn stuff that way :)

    • @nosouponhead
      @nosouponhead 5 ปีที่แล้ว +4

      Do you work at Google now?

    • @pauljessup2647
      @pauljessup2647 5 ปีที่แล้ว +1

      SAME. I started on Tandy TRS-80, learning Tandy Color Basic, and then went into ASM because after awhile, with all the peeking and poking into memory addresses, you might as well writing to ASM anyway

    • @pauljessup2647
      @pauljessup2647 5 ปีที่แล้ว +4

      @@verdoemme OMG I remember doing that. Also, drawing graph paper sprites, and then using that to create the hexcode for each block line of sprite to poke into the right memory addresses

    • @verdoemme
      @verdoemme 5 ปีที่แล้ว +4

      Paul Jessup Now that’s hardcore! Modern day programmers who call themselves developers yet only know one high level language just make me laugh 😂

  • @AmriteshGaniger
    @AmriteshGaniger 5 ปีที่แล้ว +478

    She : He might be thinking about me.
    He: *How the heck this Nintendo works?*

    • @chrisakaschulbus4903
      @chrisakaschulbus4903 5 ปีที่แล้ว +11

      he is a nerd, his right hand won't be thinking much ;)

  • @CESkootchy
    @CESkootchy 6 ปีที่แล้ว +343

    "It's not a blank screen; it's a *black* screen!"

    • @marioisawesome8218
      @marioisawesome8218 5 ปีที่แล้ว +4

      yeah bro

    • @vasili1207
      @vasili1207 5 ปีที่แล้ว +11

      Racist

    • @Megacooltommydee
      @Megacooltommydee 5 ปีที่แล้ว +29

      It's the most powerful screen of them all, since it can say the N-word.

    • @uselessmedia858
      @uselessmedia858 4 ปีที่แล้ว +3

      Your pfp is frightening

    • @ASgfjyhgyi
      @ASgfjyhgyi 4 ปีที่แล้ว +1

      @@vasili1207 Sorry. Correct is - It's a afro-american screen.

  • @nensondubois
    @nensondubois 7 ปีที่แล้ว +16

    I have been rewriting NES games (among other things) for several years. Never stops getting old.

    • @nensondubois
      @nensondubois 3 ปีที่แล้ว +1

      @Podcast - SørenCast Z That is a very long-winded question. I was bored one day and i started learning.

    • @henrikdahl4943
      @henrikdahl4943 3 ปีที่แล้ว

      @SørenCast Z Did you see the video? :D

  • @dermihai
    @dermihai 6 ปีที่แล้ว +73

    This is the kind of enthusiasm that gets wiped away when you study computer science :))

    • @lukealadeen7836
      @lukealadeen7836 3 ปีที่แล้ว +3

      3 years later but what did you mean?

    • @Dik_Otur
      @Dik_Otur 3 ปีที่แล้ว +11

      @@lukealadeen7836 when you learn for passing the course with worry of review ws. for the sake of pure curiosity, enjoyment I guess

    • @spht9ng
      @spht9ng 3 ปีที่แล้ว +14

      @@Dik_Otur Strangely, i find myself much more enthralled in computer science ever since trying to learn stuff myself after having dropped out of school years ago.

    • @toastedjoe1013
      @toastedjoe1013 2 ปีที่แล้ว

      Nothing like an entire course on Discreet Math, aka Venn Diagrams to bore you to death.

  • @dmitrykim3096
    @dmitrykim3096 6 ปีที่แล้ว +47

    This magic of creating something with your own hands that other people can enjoy - is the what makes programming so exciting.

  • @clarissamcpigeon7857
    @clarissamcpigeon7857 6 ปีที่แล้ว +41

    It just amazes me that all these classic 8 and 16 bit games were coded, by hand, in raw assembly. Those games were awesome and they worked great.
    I'd love to hear some "war stories" from old school game programmers just to get an insight into what it was really like to code games for the likes of the Master System and SNES.

    • @obvfw
      @obvfw 5 ปีที่แล้ว +2

      Check out GameHut. He's a TH-camr who was(or still is?) a programmer at Traveler's Tales. He worked on a whole bunch of Genesis games like Sonic 3D Blast and Mickey Mania, Sonic R on the Saturn, and I think some Lego games for the PS2.

  • @joaovitordutra9365
    @joaovitordutra9365 5 ปีที่แล้ว +215

    I want a friend that get this excited about my projects 😂

    • @geghamayvazyan5637
      @geghamayvazyan5637 5 ปีที่แล้ว +3

      yeahh, me too

    • @rccola6779
      @rccola6779 4 ปีที่แล้ว +2

      Same here (-----

    • @CosmicNyan
      @CosmicNyan 4 ปีที่แล้ว +7

      IT'S A BLACK SCREEN
      WHOA

    • @pagenotfound_code_404
      @pagenotfound_code_404 3 ปีที่แล้ว +3

      i want a creature that acknowledges my existance

    • @JoBot__
      @JoBot__ 2 ปีที่แล้ว +2

      @@pagenotfound_code_404 I was gonna post a generic "relatable" reply, but then I saw yours and decided to go out of my way to express how much I relate to your experiences. The most fame I've ever experienced was when some random Roblox player recognized me on Natural Disaster Survival over my own games.

  • @karasira2696
    @karasira2696 7 ปีที่แล้ว +336

    Very humble guy, wish you luck!

    • @justinsalazar4952
      @justinsalazar4952 7 ปีที่แล้ว

      Only in relation to his apparent capability.

    • @TurboGoth
      @TurboGoth 6 ปีที่แล้ว +4

      But he still seems cool regardless.

  • @unusualpost6953
    @unusualpost6953 4 ปีที่แล้ว +2

    Lot of respect for what so many developers had to go through and work around to get a game out for what sometimes may not been considered by many to be a good game.

  • @jonathancauldwell9822
    @jonathancauldwell9822 5 ปีที่แล้ว +10

    Love this video, the guy's enthusiasm is infectious. We're always looking for volunteers to convert Multi-Platform Arcade Game Designer to other 8-bit machines and would love to see a NES version if anyone out there is up for a challenge!

  • @petersuvara
    @petersuvara 5 ปีที่แล้ว +6

    This guys is an inspiration. Humble and enthusiastic! Well done!

  • @srichard7291
    @srichard7291 7 ปีที่แล้ว +2

    Love the reaction at 5:42,the first time I coded a single sprite with user controller input and it worked,that was my reaction also.Look forward to seeing his progress.

  • @eduardoalvarez2497
    @eduardoalvarez2497 6 ปีที่แล้ว +4

    Thank you for explaining so well how the interrupt works in assembly and the part of the controller input. Cheers!

  • @swedishmichaell7369
    @swedishmichaell7369 3 ปีที่แล้ว +2

    Best presentation ever! Watch it 3 times and enjoyed it every time! Great work!

  • @ChrisWoodBandit
    @ChrisWoodBandit 6 ปีที่แล้ว +12

    This is awesome man!!!! What a great talk. I wonder how those things work too. Man, I completely get what you mean when you are proud of getting that blank screen. sometimes the hardest part is getting your tools set up. The first time i installed postgres and psycopg2 on my work laptop i had days of issues with something caused by a stupid virtual machine problem i created, and when i finally got that local postgres install running, and created an empty database, it was like i had created fire or sliced bread :D i am excited about following your progress on this project!

  • @fishface6247
    @fishface6247 3 ปีที่แล้ว +1

    I recently got a nes and an everdrive and now I'm obsessed and want to make a nes game

  • @jamessheridan539
    @jamessheridan539 6 ปีที่แล้ว +4

    This is an excellent video. He does a great job of explaining this. His excitement is awesome, you can tell he is passionate about the subject .

  • @OmegaPhlare
    @OmegaPhlare 7 ปีที่แล้ว +1

    Very cool video. I like how you presented it in way that makes the audience feel like they were exploring the subject with you. In the past, I have read articles on websites which teach the reader how to write home-brew NES or Gameboy games, but your talk was fantastic for introducing the subject to an audience who didn't necessarily go out of their way to search for it, but now that they've heard from you, they may become interested in reading up on it and trying it themselves.

  • @TheNew8bitHeroes
    @TheNew8bitHeroes 7 ปีที่แล้ว +331

    Hey all - this is Joe from The New 8-bit Heroes / NESmaker. Just wanted to say to all who are curious...YES! Learning 6502 ASM is still super important in creating amazing games. Understanding how the language works with the hardware really will help one do incredible things. This is a great video on creating games from scratch, the way we built OUR engine, too. This is what's going on under the hood! And while we've created a front end that helps you do a lot of things without having to know ASM, knowing ASM will absolutely help with doing even more advanced things with it (the same way all WYSIWYG tools for development work).
    Just wanted to say thanks, Coding Tech, for this video and keeping the thing alive! If you're ever interested in knowing more about NESmaker, let me know, and I can show how it interfaces with the ASM. :-)

    • @CusPedro
      @CusPedro 6 ปีที่แล้ว +10

      So where do I start learning this?

    • @FengXingFengXing
      @FengXingFengXing 6 ปีที่แล้ว +3

      One good book for 6502 ASM is「HOW TO PROGRAM THE APPLE II USING 6502 ASSEMBLY LANGUAGE」, for Apple II computer but good for begin programers (no assembly experience), explain much about assembly programming. Another book「Apple Graphics & Arcade Game Design」. Graphics, sound and I/O map is different but algorithms should work for both machine.

    • @Macross0688
      @Macross0688 6 ปีที่แล้ว

      The New 8-bit Heroes a

    • @DanielHebell
      @DanielHebell 6 ปีที่แล้ว

      @@CusPedro Google

    • @richardikin
      @richardikin 5 ปีที่แล้ว +1

      6502 I know, alongside 6809, Z80, 68000. How do I get coding NES games?

  • @ftpm8890
    @ftpm8890 4 ปีที่แล้ว +1

    Currently studying for my exams (one of the core subjects is assembly). Next semester we are writing a big project in assembly. Seeing you excited about the process makes me excited as well. Nice video!

  • @dacracking5768
    @dacracking5768 5 ปีที่แล้ว +6

    God bless this guy. He is so passionate it's amazing

  • @alucard0712
    @alucard0712 2 ปีที่แล้ว +1

    I wanted to do programming just for fun and have a big trouble with high-level languages (they are far too advanced for me) but at same time I was instantly hooked into assambly because I found it simple and understandable somehow. and today I discovered 6502 and NES homebrew and I just love it! It's pure magic to see that you can control the console you enjoyed so much in your childhood!
    what's wrong with me?

  • @teskio999
    @teskio999 5 ปีที่แล้ว +4

    Awesome! It really helped me get my head around it! Thank you!!

  • @AschKris
    @AschKris 5 ปีที่แล้ว +2

    I like this guy, he seems super positive and willing to learn new stuff

  • @davidcbeaudoin
    @davidcbeaudoin 2 ปีที่แล้ว +1

    Seeing this video years after it was posted, but I totally feel the guy about celebrating the most mundane milestones. I thought I was the smartest man alive the first time I got a window opening with a static bitmap on it; and that was using high-level coding. Mad respect for him doing it with Assembly!

  • @zuhail339
    @zuhail339 4 ปีที่แล้ว +8

    Wow what an amazing dev . He reflects the struggle of a self taught programmer

  • @davestomper3428
    @davestomper3428 6 ปีที่แล้ว +4

    LOL this guys is so funny to watch how excited he got while sharing his experiance

  • @MoTheBlackCat
    @MoTheBlackCat ปีที่แล้ว

    Short, sweet and inspiring! Time to jump into the rabbit hole!

  • @slowjamsliver7006
    @slowjamsliver7006 3 ปีที่แล้ว +1

    I finished a class in assembly, and I can say that I was equally as impressed as his friend that he manged any of that.

  • @muteqx
    @muteqx 7 ปีที่แล้ว +86

    Loved it, and your enthusiasm shines through. Thanks!

  • @hugodsa89
    @hugodsa89 6 ปีที่แล้ว +1

    Best quality slides I have seen in a very very very long time!

  • @45llc97
    @45llc97 6 ปีที่แล้ว +3

    Great video. I've been looking at NES gaming myself. I have been interested in getting back to programming. Thanks!

  • @anaphorsdomain
    @anaphorsdomain 5 ปีที่แล้ว

    This was a fantastic talk! I'm new to NES programming (and 8bit hardware in general) so I found it a really accessible intro and he linked NES concepts I'm still grasping in a really intuitive sequence.

  • @キラキラくりくり頭
    @キラキラくりくり頭 6 ปีที่แล้ว +17

    I love how obvious it was that he's Canadian from that first "about", then goes on to say "I'm Canadian"
    Very interesting talk though.

  • @Zaramoth98
    @Zaramoth98 5 ปีที่แล้ว

    You seem like a good guy good luck mate. Also I would like to thank you because I started a course about game development in LUA about a year ago and had to stop for whatever reason and after seeing this video I embarked on the course again.

  • @tiramisu8359
    @tiramisu8359 6 ปีที่แล้ว +1

    how did someone could come up with such persistence and brain power.
    i cant even pass through newbie level of programming, my brain is just stuck.

  • @dream_emulator
    @dream_emulator 5 ปีที่แล้ว +2

    Being excited about what your building is he best feeling 🤓

  • @jesseshakarji9241
    @jesseshakarji9241 7 ปีที่แล้ว +2

    Really cool! In the past month I have been coding a game for the original Gameboy. I would do gameboy color, but the palletes confused me a lot. One day I will figure it out.

  • @BrotherSean
    @BrotherSean 7 ปีที่แล้ว +42

    I can't wait to see this guys TH-cam channel!

    • @JohnFrancisShade
      @JohnFrancisShade 6 ปีที่แล้ว +1

      Yeah, what's the status on that?

    • @papayacatproductions
      @papayacatproductions 6 ปีที่แล้ว

      He tweeted that it would start soon, and to follow @nescasts to find out when. We’ll see...

  • @molonation
    @molonation 7 ปีที่แล้ว +60

    well presented!

    • @rallokkcaz
      @rallokkcaz 4 ปีที่แล้ว +2

      Barely, this is absolutely useless trying to actually write 6502 code asm

    • @simon7788
      @simon7788 3 ปีที่แล้ว +3

      @@rallokkcaz I do't think it was meant to teach you anything, it's just a showcase of the old code and hardware, and it's really interesting

  • @spongebobmx
    @spongebobmx 6 ปีที่แล้ว

    assembly is a super incredibly useful and profitable skill to have

  • @JoeyHahn
    @JoeyHahn หลายเดือนก่อน

    I learned ASM for the SNES, which just uses a 16-bit version of the 6502- lemme tell you I felt all those little victories just the same! But now I know what a stack overflow does to the machine.

  • @pmurph1
    @pmurph1 3 ปีที่แล้ว +2

    I'm trying to write my first emulator right now and I've never related so much to anything as "No, not a blank screen... That is a BLACK screen. I am so proud of that black screen! *audience laughter* " 😂
    It also reminds me of a story I tell friends quite often who aren't as into computer stuff, I first learned 3D modelling using a-point-by-point modelling program called Milkshape 3D. People used it for Half-life models as well as Thief 1/2 and CS 1.6 models sometimes but Half-life was how I came across it(I was 9 or 10). Point-by-point meant that you were working with single points individually instead of box modelling and if I recall correctly, you started with a single vertex.
    After 2 weeks of struggling, I had a single human leg and I was so, so proud of it. My Mums reaction? My best friend of also about 9 years old?
    "Where's the rest of him?"
    😂😂😂

  • @clmk4267
    @clmk4267 7 ปีที่แล้ว +36

    Did he start a youtube channel already ?

    • @franksmith7271
      @franksmith7271 3 ปีที่แล้ว

      You have to taste the color brown to know for sure.

  • @namco003
    @namco003 7 ปีที่แล้ว +1

    Great presentation. I subscribed to watch your future progress. I know nothing about coding, but for some odd reason, I can't stop watching people talk about it. I love the fact that you used the term 'I figured it out". It's one of my favorite phrases. I think my kids and I will work on figuring it out this summer. There's another channel, I think it's retro gaming breakdown, that dives deep into nes code with a pretty awesome visuals. Spent 20 minutes getting an algebra lesson lol.

  • @SimmeringPotpourri
    @SimmeringPotpourri 7 ปีที่แล้ว

    For ol' skool devs, this is well known but what is cool is his enthusiasm around learning how the past actually worked. Very cool.

  • @dandan7884
    @dandan7884 7 ปีที่แล้ว +523

    it seems like ruby devs use some kind of drug that gets them super excited about aesthetics all the time. not to offend though

    • @ZLau13
      @ZLau13 7 ปีที่แล้ว +27

      lol. I personally always wanna have the aesthetics in order, no matter what kind of programming I do. Of course I don't always have it that way, but it's way nicer to work when I do. Motivating. And BTW I code mostly in sepples.

    • @DissociatedWomenIncorporated
      @DissociatedWomenIncorporated 7 ปีที่แล้ว +22

      Don't _all_ the best coders? 0x1A4 😄

    • @DissociatedWomenIncorporated
      @DissociatedWomenIncorporated 6 ปีที่แล้ว +5

      KeinSkill LP, I'm so glad at least some people figured that out 😄

    • @ganmakurel2
      @ganmakurel2 6 ปีที่แล้ว +3

      i want that drug

    • @ylluminarious151
      @ylluminarious151 6 ปีที่แล้ว +18

      As a Ruby developer, I can confirm that we take such drugs.

  • @renakunisaki
    @renakunisaki 6 ปีที่แล้ว +5

    Using Lua as a unit test is friggin' clever.

  • @DrGonzoChronic
    @DrGonzoChronic 7 ปีที่แล้ว +90

    6 years?!!! I have 30 year old NES games that still have good batteries.

    • @agonleed3841
      @agonleed3841 7 ปีที่แล้ว +12

      Gonzo Duke 6yrs as in 6yrs of use.

    • @Cesargermanico1980
      @Cesargermanico1980 7 ปีที่แล้ว +33

      The battery is in use all the time, since the ram is powered by the NES when on. So it is actually the other way around.....years of "not use"

    • @agonleed3841
      @agonleed3841 7 ปีที่แล้ว +2

      César G. Rodríguez yeah. But like anything, actually using it, giving it more to remember, makes it work harder. Just how it is with batteries.
      I didn't Make the rules lol

    • @emerold_rd
      @emerold_rd 6 ปีที่แล้ว +14

      little funfact: transistors need much more power when they change a state compared to when they need to hold a state. So yeah, i guess they did their calculation on inhuman "input and usage" scales of all bits changing most of the time. So 6 "years of usage" are a pretty solid statement in my opinion :D

    • @ijusterik5384
      @ijusterik5384 6 ปีที่แล้ว +1

      @@emerold_rd agree

  • @wildatom669
    @wildatom669 7 ปีที่แล้ว

    Use to write atari 2600 games in assembly, glad to see your generation is enjoying your awesome childhood

  • @davidsotomayor8713
    @davidsotomayor8713 2 ปีที่แล้ว

    My Electronics 2 professor used to make us create the cover page for our lab reports in x86 assembly. Granted, the only ones that were actually required to do it were those of us that also had him for intro to microprocessor.

  • @rickhoyt6331
    @rickhoyt6331 6 ปีที่แล้ว

    Good job.. That looks like a fun journey.

  • @TheFiddleFaddle
    @TheFiddleFaddle 6 หลายเดือนก่อน

    Getting excited about the ball reminds me of my HS friend and I joking around about making a game called Blinky. It would be a single pixel that blinks. Then we could release Blinky 2.0, where now it blinks in color. And then in a surprise twist, in Blinky 3.0, Blinky would _move!_

  • @kirb8225
    @kirb8225 6 ปีที่แล้ว +2

    when I was writing basic on my 3DS (program called smile basic) I didn't know how to use sprites so I always used text for my games my code was more than 1000 lines long and it was a game you can play within 2 min but it was fun to make and that is what matters

  • @ExecutionerGamer
    @ExecutionerGamer 7 ปีที่แล้ว +267

    The constant buzzing really hurts :c

    • @thezipcreator
      @thezipcreator 6 ปีที่แล้ว +12

      I think your headphones are broken

    • @isaaccool3183
      @isaaccool3183 6 ปีที่แล้ว +45

      I hear it too

    • @TerjeNesthus
      @TerjeNesthus 6 ปีที่แล้ว +32

      Yes the audio has problems.

    • @jondbarrow
      @jondbarrow 6 ปีที่แล้ว +9

      Executioner Gaming I hear it too, really annoying

    • @Nightcaat
      @Nightcaat 6 ปีที่แล้ว +5

      I can hear it as well.

  • @rafalkowalczyk5027
    @rafalkowalczyk5027 2 ปีที่แล้ว

    true passion, NES gamedev looks amazing!

  • @wtfdoiputhere
    @wtfdoiputhere 2 ปีที่แล้ว

    this was seriously fun and interesting i want more of his talks

  • @youngzombie6342
    @youngzombie6342 3 ปีที่แล้ว

    That kind of joy, it's hard to find, and sad... hard to understand nowadays. The kind of knowledge he is getting from this process it will give to him better ideas on the future. And the best, he is enjoying like a kid having his first toy.
    Nice Job!

  • @tinnetju
    @tinnetju 6 ปีที่แล้ว +5

    That was pretty great to watch

  • @henrikdahl4943
    @henrikdahl4943 3 ปีที่แล้ว +1

    I've always (since I was a kid in the 90's) wanted to learn how to make real NES-games. Sees this just now, and realize it's using the same processor and Assembly language that we learned in school 16 years ago. Whee! I'll have to refresh those skills quite a bit, though. :p

  • @stoojinator
    @stoojinator 6 ปีที่แล้ว +8

    I can't like this enough! Fantastic talk and really interesting!

  • @spidermcgavenport
    @spidermcgavenport 6 ปีที่แล้ว

    Love NES in assembly the games code, makes sense. If your looking for codes in assembly I have so many I needed to start a channel based on codes.

    • @spidermcgavenport
      @spidermcgavenport 6 ปีที่แล้ว

      I love writing hex code it calms me down.

  • @CliffBiq
    @CliffBiq 6 ปีที่แล้ว +1

    One read at $4016 doesn't give you the 8 button presses in a single byte, only bit 0 indicates a button state, and you have to read 8 times.
    You'd have to do something like this before the code shown at 8:25 :
    controller1State=$50 //Let's say you choose some address to keep your button states on a single byte
    ldx #1
    stx $4016 //Initiate strobe, part 1
    dex
    stx $4016 //Initiate strobe, part 2
    stx controller1State //Button state byte initialised to 0
    lda #%10000000 //Injection bit starts out left (since A buttons state was bit 7 in your example)
    readButtons:
    lda $4016 //Read controller 1
    and #1 //Flush out superfluous status bits
    beq readButtons10 //Don't inject bit in your precious controller state byte if button isn't pressed
    ora controller1State //Inject the bit in you state byte if button is pressed
    sta controlle1State
    readButtons10:
    lsr a //Move the injection bit right
    bcc readButtons //if the bit isn't flushed out to the carry, read the next button state
    Then, your code would work, assuming you use "controller1state" the same way you used "controller1".
    The NES doesn't neatly give you all the button states in one byte because the joypad produces a serial signal, with each read shifting which button state you get. The other bits are used by the other devices, like the zapper, and the strobe sequence can be different if you actually want to use the NES expansion port. The upper bits are open bus, which means that the last state of the bus will show up there (thus garbage data).
    Since you ran your code in FCEUX, which simulates persistent bus states, you would've encountered this problem in some form...

  • @fikrisoleh
    @fikrisoleh 6 ปีที่แล้ว

    a very good presentation, clearly shows the workflow.

  • @niespeludo
    @niespeludo 6 ปีที่แล้ว

    This was a very interesting watch. I'm starting to go deep in this rabbit hole.

  • @BADC0FFEE
    @BADC0FFEE 6 ปีที่แล้ว +6

    this video should be titled "ruby developer discovers how software actually work" :P but good for him, it's great to see more high level programmers getting their hands dirty once in a while, be it programming on the nes or just doing some c++, helps a lot with optimizations at any level. kudos

    • @sabin97
      @sabin97 5 ปีที่แล้ว

      c++ is a high level language.....

  • @rickrude7916
    @rickrude7916 2 ปีที่แล้ว

    The most underrated part of this talk is the friend, what a f@#king friend.

  • @rooneye
    @rooneye 5 ปีที่แล้ว +2

    "Turns out" this video was good!

  • @pfh777
    @pfh777 6 ปีที่แล้ว +4

    The way I learned to code -an assembler and linker while diving into the details of the chip, motherboard, and IO devices. It was a lot of fun in a time when memory was at a premium. It’s inefficient to learn but was an adventure and fun. Different from today.

  • @leiliu83
    @leiliu83 2 ปีที่แล้ว

    This is so much encouraging, and so much fun

  • @braydenb1581
    @braydenb1581 4 ปีที่แล้ว

    it really makes you appreciate just what they could do back in the 80s

  • @JamesLewis2
    @JamesLewis2 6 ปีที่แล้ว +1

    I realize this isn't the original upload, but I should note that FCEUX is a combination of several forks of FCEU (FCE Ultra, itself a fork of FCE, Family Computer Emulator) that had been created since FCEU development ceased, up to 2006; I don't know what the X stands for, but I do know that until the BizHawk project (which is Windows-only but also has debugging functionality), this was the primary NES emulator at TASVideos (initially the site used Famtasia, VirtuaNES, and FCEU).

  • @brucegoatly
    @brucegoatly 6 ปีที่แล้ว

    Ah, that brought back happy memories of programming in 6502 assembler on my BBC Micro, bought in 1983. Acorn, where are you now?

  • @Devdojo
    @Devdojo 6 ปีที่แล้ว +4

    Very cool! When I have more time I need to go down that rabbit hole :D

  • @2Cerealbox
    @2Cerealbox 6 ปีที่แล้ว +1

    @9:00 so you need a Windows emulator to run an NES emulator on your Mac?

    • @c0ntag10n
      @c0ntag10n 5 ปีที่แล้ว

      Wine Is Not an Emulator (WINE)

  • @thekidsacademy3820
    @thekidsacademy3820 7 ปีที่แล้ว +3

    Enjoyed the talk! Thanks for sharing

  • @marscaleb
    @marscaleb 6 ปีที่แล้ว

    I already knew almost everything he's talking about, but I am so mad jealous because he's actually programming it and actually doing it.
    Still though, I don't really get why you couldn't use a high-level language to write a NES game. It all comes down to the compiler. Whatever code you write gets compiled into machine code anyway. Granted you'd need a new custom compiler since it's doubtful someone made one already, but it's not "impossible" it's just "arguably easier to just learn Assembly." Especially since you'd also need to be creating new libraries that would either have to be built for a specific game or else become needlessly complicated to match the power of directly calling things at arbitrary moments. (To really get the most out of an NES, you need mad skills with timing IRQs in the middle of drawing a frame.)
    Correct me if I'm wrong, but that's my understanding of how programs actually work.

  • @thisisnotagoodyear1013
    @thisisnotagoodyear1013 6 ปีที่แล้ว

    i am learning javascript now... i dont know how i reached here... but it looked and sounded beautiful and encouraging....

  • @bknesheim
    @bknesheim 7 ปีที่แล้ว +10

    65xx assembly was my first 4 years of programming, then i went to 68xxx. I get an absurd feeling when it is presented like this. Nothing wrong, it just show that I'm from another age. :-)

    • @mikebell2112
      @mikebell2112 7 ปีที่แล้ว

      Yeah, the miracles of doing what I could do when I was 13 in the 80's...

    • @bknesheim
      @bknesheim 7 ปีที่แล้ว +3

      I made a set of database function in 68K assembly on the Amiga and an invoice/in store program on top of that. It generated several 100'ed invoices in a few seconds in stead of hours. The last user retaired a few years back and had then used it for more then 25 years on the same stock Amiga 500 with an external HD. :-)
      In all that time it needed support 3 times, so strictly it was really not a good for business pogram. :-)

  • @JohnCookNet
    @JohnCookNet 6 ปีที่แล้ว

    Good and entertaining presentation to watch. Thanks for posting.

  • @PedroOliveira-sl6nw
    @PedroOliveira-sl6nw 7 ปีที่แล้ว

    Amazing video! I love the humbleness.

  • @MonkeyJmpr
    @MonkeyJmpr 7 ปีที่แล้ว

    You sir are a gentleman and a scholar.

  • @leandrolambardi9712
    @leandrolambardi9712 4 ปีที่แล้ว

    This is a gem

  • @peterpanther8627
    @peterpanther8627 4 ปีที่แล้ว +1

    Bruh, in the last three months, all I've accomplished is to watch two months of youtube.

  • @simonmaracine4721
    @simonmaracine4721 6 ปีที่แล้ว +1

    That was really inspiring. Thank you!

  • @MartinFracker
    @MartinFracker 6 ปีที่แล้ว +1

    Awesome. Though you don't need to program directly in 6502 assembly, as there exists a C compiler for 6502 based systems (which includes NES).

  • @Sponska
    @Sponska 3 ปีที่แล้ว

    That was incredibly fascinating

  • @christianmonturanoii6539
    @christianmonturanoii6539 2 ปีที่แล้ว

    6 years my dad got it when it came out and still works have a game saved from 2004 I think it's still on there I think it's was my sister's game

  • @chrisstone-streetlightinte5629
    @chrisstone-streetlightinte5629 7 ปีที่แล้ว +1

    Burning carts is super easy...just make sure you research the nes database for equivalent ROM and RAM chips and head over to Muramasa's site to get a brand new board. I burned a Dragon Warrior 3 and Mega Man 2 cart in the matter of a weekend. Both work great.

  • @sandman9601
    @sandman9601 7 ปีที่แล้ว +146

    The inability to use high-level languages has nothing to do with CPU speed, it has to do with memory capacity. Back then, memory was so scarce that you needed hand-tuned code to produce a game good enough to sell.

    • @moiquiregardevideo
      @moiquiregardevideo 7 ปีที่แล้ว +21

      The memory limit of 64K is not the reason. The 6502 processor miss the most fundamental instructions for accessing the stack pointer. It can not generate local variables or pass parameters on a stack for any function call.
      However, despite this kind of limitation, there is many C compiler for the intel microcontroller 8051 wghich is as primitive as the 6502.

    • @sandman9601
      @sandman9601 7 ปีที่แล้ว +12

      There are ways to pass parameters beyond the stack. For example, load a pointer to them in a register before the function call. On the 6502 you can easily manipulate the stack pointer, either by pushing/pulling an accumulator or, for complex operations, transferring a copy to the X register via the TSX instruction. Local variables are no sweat. When comparing to the 8051, keep in mind the 6502 is 5 years older, and the 8051 has 2x address space (thanks to its separate program and data memory areas). You probably could compile for the 6502 for basic stuff, but 64k is so small that hand coding is a must for anything worthwhile.

    • @TaiFerret
      @TaiFerret 7 ปีที่แล้ว +13

      The NES didn't even have 64K of RAM. It only came with 2K internal and another 2K for the name tables and 256 bytes of volatile RAM for sprites. The rest could be provided by the game cartridge.
      32K ROM for program memory and 8K ROM for pattern tables were the limits before memory mappers, which could extend the ROM capacity almost endlessly. The game cartridge could also provide additional RAM, usually 8K, either for providing more space for game variables like in Super Mario Bros 2 and 3 which use them for storing bigger levels and stuff, or for storing save data like in Zelda.
      Some games also had 8K RAM instead of ROM for pattern tables, which also had some interesting advantages.

    • @SerBallister
      @SerBallister 6 ปีที่แล้ว +5

      Writing C for bank switched ROMs wasn't exactly straight forward either, you would have to hand-arrange functions to manually assigned banks because no linker at the time could automatically lay this stuff out, and of course no C compiler understood that some functions needed the correct ROM bank selected before calling, so you had to do that by hand too.

    • @moiquiregardevideo
      @moiquiregardevideo 6 ปีที่แล้ว

      I admit to never reverse engineer any NES game and forgot the detail of the 6502 which could explain why nobody made a C compiler for it.
      I can add my own anecdotal example of great engineering on limited hardware: OS9 was allowing the processor 6809 to use up to 512K RAM. The 64K memory directly accessible was divided in 8 scrolling memory windows of 8K each. Each task had to select ow to use these 8 windows : let's pick 4 contiguous for a linear 32K, let's give 2 for interrupts code and some operating system function. One for access to the video buffer and lot's of modulo 8192 operations to manage everything.
      The engineers working on 8086,8088, 80186 and 80286 were doing similar gymnastic playing with segments to use 1 Meg (20 bits) RAM with a 16 bit processor.

  • @m_5373
    @m_5373 3 ปีที่แล้ว

    Awesome!!, It inspires me to learn assembly to do the same!!!

    • @patolol3091
      @patolol3091 3 ปีที่แล้ว

      lua! brasil 🇧🇷

    • @PalestrasTraduzidas
      @PalestrasTraduzidas 3 ปีที่แล้ว +1

      This talk is available in Portuguese (Brazil): th-cam.com/video/FdRGMW83Wfc/w-d-xo.html

  • @NYCHeavyHitz212
    @NYCHeavyHitz212 7 ปีที่แล้ว

    This was a suggestion. Definitely saving this.

  • @malikon6953
    @malikon6953 4 ปีที่แล้ว

    this is neat stuff. Also the pronunciation of Mario as "Mary-O" was amusing.

  • @raisulislam4628
    @raisulislam4628 7 ปีที่แล้ว

    Ever see how in some movies the young protege goes on a voyage to learn ancient text/art? Learning this stuff will be just like that in a few years.

  • @leonardoflorencio1198
    @leonardoflorencio1198 2 ปีที่แล้ว

    Congrats!!! Nice job!

  • @KanishkaDilshan
    @KanishkaDilshan 6 ปีที่แล้ว

    Very nice presentation! really intersting.