NES Assembly on an Apple II: 'Hello World' with Merlin

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

КОМЕНТАРІ • 103

  • @fernwood
    @fernwood 3 роки тому +38

    This is just the kind of insanity I need to watch instead of sleeping. So awesome.

  • @IEATCHEEZEYO
    @IEATCHEEZEYO Рік тому +1

    Dang. Its been 2 years already. I still watch this and still think its the coolest thing i have ever seen.

  • @askhowiknow5527
    @askhowiknow5527 2 роки тому +5

    Having all of that stuff sticking out of your Apple ][ is what makes it authentic. The Apple ][ was an immortal platform, mainly because it was on life support xD

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

      With functionality continuing to grow! Certainly as a result of it's active enthusiast community. Quite an enjoyable and rewarding machine for sure, to this day.

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

    haha, that pink hello kitty monitor is just awesome! This is exactly how real men used to program back in the days. ;)

  • @IEATCHEEZEYO
    @IEATCHEEZEYO 3 роки тому +20

    This is probably the coolest thing I’ve ever seen. I hope this isn’t the only video on this I would love to see more

    • @TrebleWing
      @TrebleWing  3 роки тому +9

      I will absolutely make more. I have the next video in mind but it is going to take more work to set up

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

      @@TrebleWing awesome!!! I can not wait!

  • @andydork
    @andydork 3 роки тому +6

    Thank you for sharing! I’ve been getting started on Apple //e assembly and never thought I’d find myself switching to NES assembly on an Apple 2! Fascinating. I always learn the most by watching others code! Thank you!

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

      You are learning 6502 assembly language in 2022? Are you familiar with the concept of 'opportunity cost' ? haha

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

      @@DerekDavis213 I never turn down an opportunity to learn something new. And I have no problems enjoying my cup of coffee while doing that. :-)
      There are a lot of problems a lot of old timers had to work through with limited resources and were equally as exciting (if not more) than developing the latest app with the latest technology.

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

      @@andydork Yes but you only have limited time, in this life. Does it make sense in 2022 to learn how to repair a Model T car?
      A 6502 is about 10,000 times slower than modern processors. Basically a Model T.

    • @andydork
      @andydork 2 роки тому +2

      @@DerekDavis213 Honey, the best things in life are to be enjoyed with whatever time you think you have left.. I’ve got plenty of time to enjoy my 6502. 🤣 and afterwards, I’ll expect to enjoy a nice walk on the beach with enough time to spare to come back and enjoy more tinkering with the 6502. LOL.

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

      @@andydork Tinkering with a 6502, in 2022, is much like trying to repair your great-grandfathers vacuum tube radio from 1930. Not a very good use of your time.
      I had an Apple IIgs when I was a kid, but today I would rather work on Raspberry Pi, or Adobe Premiere, or fly my drone around. 6502 cpu is from the Flintstones age of computing!
      When I look at software from the Apple II days I just cringe. So primitive, and I mean Neanderthal level of primitive.

  • @CaptainSouthbird
    @CaptainSouthbird 3 роки тому +10

    As the guy who reverse engineered Super Mario Bros. 3 and then built the 3Mix hack out of it... of course with all the modern amenities of emulators, debuggers and other nice software, it's pretty neat to imagine something more grounded in the reality of the time. Of course, this setup isn't necessarily accurate to exactly what developers had. The NES days were pretty "wild west" as I understand it. There were no Nintendo official devkits, although some third parties came up with contraptions to help out. For example, modifying a retail NES with a bank of RAM chips that were written to, to avoid at least initially needing to use EEPROMs and surely speeding up the code -> test cycle. Sometimes 6502 based computers were used to develop like you did here, but sometimes not. There's also a photograph from SMB3's timeline showing some kind of primitive art program running on a DOS-based computer to create sprite art. So really your setup is probably part of what a developer MAY have been using, but most likely there would have been more, if for no other reason than you've got it about as primitive as it could be. Not faulting you for it, I'm just sure at the time desperate devs would've been looking to improve that situation any way they could haha. In any case, this was very cool, and at least it helped me imagine traveling back to this time period of more primitive computer systems and development hardware to think about how it (at least sort of) used to be.

  • @clivejbarrett
    @clivejbarrett Рік тому +1

    Yep, this is how we created games back in the early '80's. Cross assembly.

  • @lean.drocalil
    @lean.drocalil 3 роки тому +7

    As a hobbyist NES developer used to modern assemblers and emulators with state-of-the-art debuggers, I can tell you this video was like hex porn to me. It's just freaking amazing! Keep on rocking and producing more content like this! 😃

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

    Absolutely incredible stuff! Always fascinating to see authentic setups like this.

  • @WesMakesStuff
    @WesMakesStuff 2 роки тому +2

    Love this! I could watch all day!

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

    Such an awesome and dreamed setup for this kind of Retro development. It's just priceless

  • @esnc954
    @esnc954 2 роки тому +2

    This is exactly what I have always wanted to do my whole life, or at least see. Thank you so much!!

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

    Outstanding work. The Apple and the Stag programmer brought back a lot of memories.

  • @LukeAvedon
    @LukeAvedon 3 місяці тому

    WOW so awesome. I always wondered how it was done back in the day.

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

    Thoroughly enjoyed this...intelligent guy, I am envious of your intelligence! Well done.

  • @euden
    @euden 3 роки тому +5

    I'd love to see a full series of this, perhaps making a small game (pong or breakout or something) that uses the sprites, sounds etc and fully compiled to run on the NES!

  • @nesmaster14
    @nesmaster14 3 роки тому +4

    Awesome video! Saw this featured on Hackaday this morning (congrats!). Cheers from VGS

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

      Thank you so much! I was surprised to see all the activity on this video all a sudden. Right back at you VGS crew!

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

    Excellent video. I can't get enough of this stuff, and you did a superb job capturing and explaining the process. Can't wait to see more!

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

      Thanks so much! i definitely plan on doing more. What I want to do next though starts getting deeper into how the NES has to be programmed. So it is taking a lot more time to get filmed than my overview here going over the steps from getting from code to cart.

  • @leandrotami
    @leandrotami 3 роки тому +5

    Man this is really impressive, I congratulate you. Unfortunately I could not follow you in the assembly programming part. Please treat your floppies with a little more love!

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

    @5:00 getting mechanical there lol 😅
    grand father mechanical came back to say hello 😂

  • @kenfagerdotcom
    @kenfagerdotcom 3 роки тому +4

    I'm looking forward to your progress. And a Floppy Emu isn't cheating. Subscribed.

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

      It is in my book, lol. Part of the process of 'doing it old school' includes fumbling around with floppy disks, and fearing that they might get damaged or corrupted! This is why I only used the Emu to get the card software and Merlin onto a physical disk and for nothing else.

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

      It's "cheating" only in the sense that it goes against his stated goal, to do this with only period-appropriate stuff.

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

    Such a cool idea. Thanks man!

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

      Thank you!! I appreciate it.

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

    Awesome video! Thank you so much for showing us this!!

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

    Awesome, now it would be nice to see how they programmed music and sound with this.

  • @stickyfox
    @stickyfox 11 місяців тому

    "Hello World" came from the c/unix world and wasn't really popular until the 90s even tho it was first recorded in 1978. It really took off when Turbo/Borland C became a hit. Prior to that the canonical first program on most 8-bits was "

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

    Wonderful video, thank you.

  • @Xorcist-Band
    @Xorcist-Band 3 роки тому +6

    Man this brings back memories. Also CALL -151 - FIRSTIES! lol. But honestly, what did we do while waiting for it to burn ROMs? Rhymes with Blalkashmol. I also had one of those ROM Burners but was a single card.
    As for NES, we had some sort of hardware emulator hooked right into a NES so no need to burn ROMs but this is definitely the path to home-brew! Just don't let Nintendo find ya! They're super strict (at least back then) on what can get put on their systems lol!

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

      I would love to make a homebrew Apple II card with some ram and ribbon cables going to a nes cart in order to have such a dev system. This is something that Garry Kitchen had when he coded a Donkey Kong clone for the Atari 2600 on an Apple II. My EE skills are not that high though.

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

      I found one of those in the e-waste. Speeds up retrogaming development incredibly (which is important on platforms that don't have decent emulators like the Interton VC4000 I'm developing for)

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

      hey, I recognize your name! You're the one who did the theme song for Iron Helix?? I had that bundled with my 486 multimedia kit! The song was the best part of that game by far!

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

    Awesome video! Looking forward to more.

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

      Thank you so much! I will certainly be making more on the Apple II

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

    Amazing stuff. It's simultaneously interesting and super relaxing to watch. I look forward to more!

  • @System-1541
    @System-1541 3 роки тому

    Super awesome! I wanted to do this same kind of thing with my C64 but now I have a IIc...

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

    Awesome Build!

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

    I just posted a video with this same code that I copied from the internet it's amazing that it's so similar and you make it look so easy

  • @MatthewBurton71
    @MatthewBurton71 3 роки тому +4

    Makes my brain hurt seeing you not put the disks in sleeves!

    • @1stSilence
      @1stSilence 3 роки тому

      Haha, i thought the same, when i saw this.

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

      @@1stSilence oh come on cut the kid a break!

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

    lol not just games!! I used to develop z80 & 6502 on industrial machines as well.. god I am old .. it was amazing what you could do with hardly any ram.. just shows how things change now we have arduinos and pi's ect ..writing proms and eproms .. lol takes me back lol all done so differently now

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

    I'm from Moorpark lol funny to see that company SCRG was from there. I looked up their old apple paddle-adapple online.

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

    Very cool. This definitely takes me back to late night hacking on the Apple ][+ and ZX80's. You have a _much_ nicer monitor than I had (a tiny amber Samtron IIRC). Love the EEPROM burner though. You also need to have a little UV cubby standing by for blanking those out when you mess up. ;-)

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

    Having to keep your Apple case open is so surprising. I wonder if one could have a fly out cable / board that the chip could be put in. Not sure if there are current concerns in that case. I think a lot of devs in that day used multiple machines (one to code on, one to compile and or write to disk).

  • @justinpoirier5285
    @justinpoirier5285 3 роки тому +5

    This promises to be fun! Thanks for doing this. As as aside, it looks like you power cycled to load a new disk at the beginning. Apple-Control-Reset will do the same thing and is a lot less brutal on the hardware. Although it does not power cycle the cards in the slots. Being unfamiliar with your suite of cards, maybe you need to use the power switch for those reasons...?

    • @TrebleWing
      @TrebleWing  3 роки тому +5

      Thanks so much for the info! Yes the soft reset is certainly useful, however when I bload my nes machine code into ram, I like to hard power cycle before booting the eprom software to make sure $1000-$9000 is cleaned up and there is not any of merlin or anything else weird still hiding there.

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

      @@TrebleWing Rebooting from the keyboard is very useful, even necessary if your Apple is like mine with marginal RAM. On the other hand, popping out that EPROM while the machine is on is pretty sketchy. Fumble and drop it and it could cause some serious damage to your system. Very interesting video.

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

      @@xotmatrix Soft booting can leave the ram space I use filled with other program code. I reboot to make sure that is cleared. When booting into merlin though I typically soft boot.
      Yeah true, though I'm not really worried about dropping the eprom. But will that be my undoing? I guess we'll find out; same bat time; same bat channel, lol. I ain't afraid of a soldering iron. I'll just film a repair video

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

    I watched the whole thing with intent, that gameplay footage was super satisfying. Glad you fixed that LDX $020 spello, I was wondering how you got it to compile correctly 😀

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

    Nasir Gebelli used Apple II to make Final Fantasy 1 for NES when he was at Square (later Squaresoft, Square Enix).

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

    So cool. I want to be like you

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

    I would kill for a setup like that

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

    27:18 Main File 24:04 Setup / Init 15:53 Reset Routine

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

    Amazing!
    Will you do more episodes?

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

      I will certainly try. I'm still learning as I go, so the more I learn the more I will want to film. I have my eye on doing some character set and drawing tiles to the screen next

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

    instant sub. !

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

    Awesome video man!!!

  • @johneygd
    @johneygd 11 місяців тому

    Interesting coolstuff,well i wouldn’t be surprised if both apple ||,atari 400,vic20,C64 along with it’s successors were used to program nes games with it,
    Becides am curious wich computers nintendo did used to program their own nes games.

  • @LifeIsGood-qg3xv
    @LifeIsGood-qg3xv Рік тому +1

    This is so interesting. Do you happen to have the actual assembly code to look over? I'd be interested to know how the memory allocation worked back.

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

    How about doing the same thing like Sega Genesis development on a 68k Mac or Super Nintendo development on IIGS like Rebecca Heineman (aka BurgerBecky) used to make an Out of This World port when she was at Interplay?

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

    I still use pen and paper, used a slide rule when I was in school, never used a calculator.

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

    YES !

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

    I'd love to see an actual game made on this, not super mario but like a brand new game. Maybe snake with 1 and 2 player modes

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

      I also remember seeing in an interview on dykg that they wrote there own proprietary graphics program to write sprites to the second chip, tho it may have been for super mario I doubt it was as it used smb1 mario

  • @kcinplatinumgaming2598
    @kcinplatinumgaming2598 3 роки тому +3

    erm... your doing something seriously wrong ... where's the disk sleeves lol

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

    Hello, can you explain with you burn program ROM and PPU ROM on diferents programers ?

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

    Convert hex to decimal using pen and paper, also use a sliderule, you will be all the better for it

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

    Interesting video! Just curious, is it possible if you could make a video about how to make a Game Boy rom during that time?

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

      And use an NES as a development computer like HAL did on Kirby's Dream Land

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

      I’m sorry, but I have no knowledge of programming for the GameBoy. I only know 6502. Thanks for watchin’!

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

      ​@@TrebleWingthe Gameboy OG was basically a Z80 based machine 😉😉😉😉

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

    lol in fact in 1989 I wrote z80 totally in hex thats was a nightmare

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

    This is awesome! Have a question about the code:
    LDX #$20
    ]VBLANK
    BIT $2002
    BPL ]VBLANK
    DEX
    BNE ]VBLANK
    Unless I misunderstood, you said that this waits for multiple vblanks (I'm guessing 32 in this case). However unless reading $2002 resets the vblank bit (which according to the PPU docs I read, it doesn't seem to), I don't see how this code doesn't just wait for a single vblank and then just break out of the loop once the counter counts down to zero. What am I missing here?
    Thank you! Would love to see more of these videos!

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

      Well spotted, That was a typo. I didn't remember to film when I spotted the mistake and fixed it.
      Waiting 32 vblanks versus 2 would not really break anything though.
      So, when the raster first hits the post render line, bit 7 of $2002 turns into a 1. This is is the only position that causes it to set. So you will not escape the BIT check on $2002 unless that has occured. The bit is naturally cleared at the first line of pre-rendering, but it does not make a difference whether we clear it to 0 early because it will not ever tick back up to 1 until the next frame finished and we make it back to the first line of post-render, where the bit becomes set to one again.
      It is basically just a nested loop, and we will never escape the BIT loop until a frame has passed and the post-render line sets bit 7 again. The confusion might just have been conflating the BNE at the end for handling the decreasing counter, and the BPL that will not escape unless bit 7 is set.

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

      @@TrebleWing Thanks for the explanation! Though, I think I'm still missing something.
      1) What was the typo?
      2) So let's say we're looping in the outer loop and bit 7 of $2002 is 0. Then, we finally hit vblank and bit 7 in $2002 set to 1. By the time "BNE ]VBLANK" (the end of the inner loop) is hit, is bit 7 of $2002 already cleared? I am thinking that wouldn't be enough time for it be cleared since it's only ~15 cycles between "BIT $2002" and "BNE ]VBLANK". But maybe I am wrong?

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

      @@danb91 The typo was when I typed LDX #$020, instead of LDX #$02.
      It seems to work, so I guess the bit must be cleared. I would probably not be equipped to really say for certain what the timing is.

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

      @@TrebleWing Understood, thank you!

  • @LukeAvedon
    @LukeAvedon 3 місяці тому

    They didn't have to burn a new eprom everytime they wanted to test their code? did they??

    • @TrebleWing
      @TrebleWing  3 місяці тому

      I can imagine a world where they had some special cartridge that allowed them to load their program into RAM chips instead of ROMS and run it, but I've never seen one to confirm.

  • @amonster8mymother
    @amonster8mymother 5 місяців тому

    Wow you can burn nes eproms?❤

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

    I have merlin for my c128

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

    Does Nintendo use apple computers to make NES Mario games?

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

      Nintendo Co., Ltd. was in Japan as well as the teams that programmed the games and all. So since the Apple //e and any Apple computers prior was US only(not counting the Europlus Apple computers)… there's actually photos of shigeru Miyamoto in his office… but I'm not sure about the programmers… I'd have to research it to find out… but some pictures WHERE in Nintendo Power when they were sharing the process of the making of Super Mario Bros. 3!! As far as I can remember anyway 😉😉😉😉

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

    Will this work on the c64 version of merlin

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

      The EPROM programmer central to this video is an Apple II device. It is unfortunately not compatible with a Commodore 64 system.

  • @mr7clay
    @mr7clay 11 місяців тому

    Insanity is STA-ing the same address twice and expecting a different result. Was/is this spooky action a common thing?

    • @TrebleWing
      @TrebleWing  6 місяців тому

      The NES has registers that incement on their own, and to access the PPU you only have the address register $2006, and the port $2007. If you want to load something into video ram... the CPU cannot do it without the PPU. You need to tell the PPU "Hey I want to access $3f00. So you load $2006 with $3f00. Then you say "OK ppu, here are the bytes I want you to put there" and feed it bytes into $2007

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

    Great video, couldn't watch, low pass filter your monitor squeal.

    • @TrebleWing
      @TrebleWing  2 місяці тому

      Sorry, It's authentic 1980's, so I'm gunna leave it in, lol.