NES C Programming Examples

Ойындар

This video shows examples of programming for the NES game console in C language, using cc65 and my low level library neslib.
Video may look not very smooth, as it is 30 FPS, but all examples running at 60 FPS.
Download examples: shiru.untergrund.net/files/src...
Read article: shiru.untergrund.net/articles/...

Пікірлер: 43

  • @jomo0825
    @jomo08257 жыл бұрын

    This is by far the BEST NES dev C library I've ever seen! The structure is neat and simple. And all examples are well addressed. I'm teaching game dev in 3 university at Taiwan and I'm considering to make a full tutorial series for Shiru's C library!

  • @NesrocksGamingVideos
    @NesrocksGamingVideos5 жыл бұрын

    Just came back to say your song is awesome.

  • @thegreatawakening3601
    @thegreatawakening36014 жыл бұрын

    I’d like the make a geometry dash or impossible game type for nes.. Can’t believe no one thought of that back in the day.

  • @lecapitaine1017
    @lecapitaine10174 жыл бұрын

    This is great. Lately also, there's been a GUI-based NES dev suite called NESMaker that's been compared to Unity, but still relies on 6502 assembly for code, leaving non-wizards in the dust when it comes to expanding beyond the ready-made templates. You think you could join forces? Assembly is pretty much the only thing left standing between us and a full-featured high-level NES dev environment.

  • @shiru8bit

    @shiru8bit

    4 жыл бұрын

    Sorry, I'm not really interested in supporting someone's commercial initiative. Also, for whatever reason NESMaker community decided to define me as an 'assembly elitist', and kind of enemy of their state, so I'll prefer to stay away.

  • @2SUB-TV_space

    @2SUB-TV_space

    5 ай бұрын

    @@shiru8bit Вначале, объясните толком как установить правильно Neslib? У меня постоянно выдаёт ошибку. То ищёт `example1.c', `example2.c' потом типа нет zeropage.inc', `crt0.s' и тд. Бред какой-то.. Я скачиваю с вашего официального сайта. Какие файлы можно удалить, какие нет? Папка .bin у меня с сс65 и тд. Брал даже с других проектов у людей.. Всё равно те же ошибки. А на счёт "Элитиста ассемблера" .. 😄 Наверное завидуют знаниям. Вообще, у них коммерческий проект и надо обоср@ть всех кто рядом.. Брать деньги за прогу, которая только помогает чуть кодить игры для ретро консолей... 🤔 Одно дело донаты.. Но выманивать 36 баксов.. По сути люди пишут игры по фану, а здесь жёсткая коммерция внедрилась. Даже смешно, честно говоря.

  • @NesrocksGamingVideos
    @NesrocksGamingVideos5 жыл бұрын

    Hey Shiru amazing showcase. I also want to vote for that first song as being totally awesome.

  • @shiru8bit

    @shiru8bit

    5 жыл бұрын

    Tnanks!

  • @ShadedWarrior
    @ShadedWarrior7 жыл бұрын

    I loooooove the music, especially the first song... do you listen to a lot of chiptune stuff? What tracker did you use? Thanks for the cool video.

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    I don't listen to chiptune stuff. The first song is for AY-3-8910, made wih Vortex Tracker II; the second is for the NES, made with FamiTracker.

  • @creative3179
    @creative31797 жыл бұрын

    Pretty cool stuff.

  • @TalesCembraneliDantas
    @TalesCembraneliDantas9 жыл бұрын

    I already create something for NES 6502, but in ASM, do you have a C compiler? how it works???

  • @jeremyseay
    @jeremyseay5 жыл бұрын

    How is there no flickering with more than 8 sprites per scanline?

  • @shiru8bit

    @shiru8bit

    5 жыл бұрын

    There is. Not flickering, but disappearing, in fact - flickering needs to be implemented by hand in each game. In this demo it just looks like there is often more than 8 sprites per scanline, but in fact no, chances for 8 balls to take the same scanline is rare, and when it happens, extra sprites disappear like usual.

  • @thisisreallyme3130
    @thisisreallyme31302 жыл бұрын

    Can we get more of this please?

  • @mtnnoonan
    @mtnnoonan10 жыл бұрын

    Speedy as any ASM I've seen...

  • @shepardpower
    @shepardpower4 жыл бұрын

    What’s the name of the first song?

  • @atirutwattanamongkol8806
    @atirutwattanamongkol88062 жыл бұрын

    How is that amount of sprites possible without flickering?

  • @shiru8bit

    @shiru8bit

    2 жыл бұрын

    It just happens so they're rarely intersects in amounts of 8+ per scan line, this creates the illusion of the lack of flickering.

  • @valdirsalgueiro9087
    @valdirsalgueiro90874 жыл бұрын

    Any examples of horizontal scrolling? I know it can be modified to do that, but i still cant wrap my head to some of the concepts in the source code. Besides being unable to debug doesnt help either(of course it isnt neslib fault)

  • @shiru8bit

    @shiru8bit

    4 жыл бұрын

    Sorry, I don't have an example for horizontal one. It is much the same, just needs to use vertical column updates, and attribute calculations has to be modified. Info from NesDev.com wiki one the topic could be handy to understand.

  • @grandlovania8454
    @grandlovania84543 жыл бұрын

    Hi I know it has nearly nothing to do with that but I would like to know how could I use your Neslib + Famitracker player with the MMC3 Mapper

  • @shiru8bit

    @shiru8bit

    3 жыл бұрын

    It depends a lot on how you're using MMC3 mapper in your program. I guess your actual question boils down to how to use bankswitching with cc65, which is a broad topic with a number of possible approaches. You can see one in my HEOHDEMO source code: shiru.untergrund.net/files/nes/heohdemo_final_version.zip

  • @grandlovania8454

    @grandlovania8454

    3 жыл бұрын

    @@shiru8bit Thanks a lot! :D

  • @softhwarangpark870
    @softhwarangpark8704 жыл бұрын

    An error occurs in the latest version of cc65 (Windows) cc65-win32-2.13.2-1 : csdb.dk/release/?id=6032 I checked to build properly in this version.

  • @shiru8bit

    @shiru8bit

    4 жыл бұрын

    This code is not meant for the latest version. You either need to use 2.13.3 svn5495, or modify the code to work with newer versions.

  • @lolwut5235
    @lolwut52357 жыл бұрын

    great, did you also make the bgm?

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    Yes, I composed both songs used in the video.

  • @davidfigaromacintosh

    @davidfigaromacintosh

    7 жыл бұрын

    Hi Shiru, I am actually doing my own NES homebrew game and I have one question: How actually BG collision detection works? How to do it in asm6??? If you know where should I look for the answer, please give me a link or sth =3 Thanks Nice work btw =P

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    Collision detection is not related to any particular platform or CPU or assembler, so you can just search for general 2D game programming basics. NES particular case is the tile grid collisions. You just need to translate a pixel world space coordinates into (meta) tile coordinates in the level map, fetch the tile, and decide either it solid or not (by index, or table of flags, or something). I.e. divide pixel coords to tile size, then calculate offset in the tile array (pixel_y/tile_height*map_width+pixel_x/tile_width). That's actually demo'ed in the example 11 of this video, line 395 and get_metatile function.

  • @davidfigaromacintosh

    @davidfigaromacintosh

    7 жыл бұрын

    Ah, now I got it, thanks a lot =P Oh, and one more thing: Is there a website where I can publish my homebrew?

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    If you want just post the ROM for free download, check nintendoage.com forums. If you want to get your game published on actual cartridge, there is a number of homebrew publishers out there. Piko Interactive, 8bitcollective, Second Dimension, RetroUSB to name a few.

  • @fixedgerald
    @fixedgerald7 жыл бұрын

    When I try to run the compile all batch file I get this error: ld65: Error: nrom_128_horz.cfg(53): Attribute expected, got '__STACKSIZE__' Anyone know how to fix this?

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    The examples has been made for an older CC65 version, 2.13.3. Later versions had various changes, including introduced incompatibility in the linker attributes. I never migrated the examples to the latest version, because tests shown decrease in perfomance of the compiled code, with no obvious improvements/critical fixes that would justify it. So you either need to get the older CC65, or, if you deem perfomance not so important, edit the config file according to the latest docs.

  • @fixedgerald

    @fixedgerald

    7 жыл бұрын

    Thanks!

  • @fixedgerald

    @fixedgerald

    7 жыл бұрын

    Do you know where I can download version 2.13.3? I can find the source on github but not the binary's.

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    Sorry, I have no idea. Many things has changed since, CC65 project and website changed owners, etc. I just kept the older binaries around since then.

  • @shiru8bit

    @shiru8bit

    7 жыл бұрын

    Actually I checked the old FTP, and files seem to be there: ftp://ftp.musoftware.de/pub/uz/cc65/

  • @Oddlyoko2K
    @Oddlyoko2K7 жыл бұрын

    This is all very confusing as most tutorials on the internet use 6502 assembly language as examples so you'll have to learn assembly and have a nice knowledge of C before making complex scripts.

  • @SitronXie
    @SitronXie Жыл бұрын

    :)

Келесі