News for hackers. Stuff that matters.
Re:The NES Homebrew Scene by pubby on Thursday April 12, 2018 @12:42PM (#16822638)
Nowdays, it's impossible to do modern programming without relying on millions of lines of other people's code. It's frameworks and libraries all the way down.

On the NES however, every line of code is yours. There's no such thing as libraries, operating systems, or frameworks. They don't exist. It's refreshing.

One of the big problems of modern programming is how easy it is to add complexity. As Charles Moore once said:

>"Simplify the problem you've got or rather don't complexify it. I've done it myself, it's fun to do. You have a boring problem and hiding behind it is a much more interesting problem. So you code the more interesting problem and the one you've got is a subset of it and it falls out trivial. But of course you wrote ten times as much code as you needed to solve the problem that you actually had."

It's easy to add complexity on modern systems, but it's hard on the NES. The programming too clunky; it's too much work to anything but simple things. For that reason, it's far more common to simplify the problem and reduce features rather than add them. It's a wonderful thing.

Re:The NES Homebrew Scene by drewying on Thursday April 12, 2018 @02:44PM (#16823737)
I agree with you in general, but I think it's worth pointing out that programming the NES's PPU is actually very similar to programming with a 2D graphics library today.

NES games never wrote their own scrolling logic, or there own graphics logic. They wrote tile values into a background table and then told the NES how much to scroll the playing field, and the NES rendered and scrolled everything automagically.

NES games never drew their own sprites. They just said "Hey NES, write the sprite at this x and y location" and the NES did it.

Audio worked the same way.

Honestly, coding for the NES would be similar to working with a simple 2D graphics library. So I don't know if it would be accurate to say "every line of code is yours" on the NES. It's more just that the "libraries" used were implemented in hardware instead of software.

Re:The NES Homebrew Scene by marshray on Thursday April 12, 2018 @03:51PM (#16824323)
> NES games never drew their own sprites. They just said "Hey NES, write the sprite at this x and y location"

Yeah, but the hardware is so limited with weird corner cases that writing a bitblt might be easier. For example, some games have to reconfigure their sprites at the beginning of every horizontal scan line to overcome the hardware limitation on simultaneously displayed sprites (8).

Re:The NES Homebrew Scene by klodolph on Friday April 13, 2018 @02:05PM (#16832415)
Which games? To my knowledge this is at best exceptionally rare because there are only ~114 CPU cycles in a scan line. The reports I've heard are that if you do any OAM changes mid-frame, you get something like four lines of glitches. More common is to just do a full OAM DMA during vertical blank, at least from the ROMs I've seen.
Re:The NES Homebrew Scene by marshray on Monday April 16, 2018 @02:52PM (#16851664)
I can't find the original link where I read about this, it may have been more theory than about specific games. These links seem to be relevant: http://wiki.nesdev.com/w/index.php/Sprite_overflow_games http://forums.nesdev.com/viewtopic.php?t=16299
Re:The NES Homebrew Scene by annywhey on Thursday April 12, 2018 @04:28PM (#16824653)
This is only sort of true in that while there are hardware supported things, the way in which you work with them is both more finicky than most APIs, and they get you relatively less close to a finished renderer.

For example, concepts like a scroll register don't typically appear in an abstracted API. They're a hardware detail that happens to assist in implementing a smooth scroll by reducing the necessary computation. But they aren't a "smooth scrolling API" because it works on the tilemap data only - you can also have sprites scroll. That necessitates a software implementation specifically for the task of sprite rendering. Witness the numerous NES games that either let sprites disappear when they hit negative X coordinates or put up a convenient black bar to hide it.

Re:The NES Homebrew Scene by derefr on Thursday April 12, 2018 @01:52PM (#16823256)
> On the NES however, every line of code is yours. There's no such thing as libraries, operating systems, or frameworks. They don't exist. It's refreshing.

I would say that there’s still “other people’s code” that you rely on—that code is just reified into ASICs you drive with control messages over IO ports, rather than being OS system-service daemons you drive with control messages over IPC.

Also keep in mind that, despite the lack of a forced OS or BIOS on the system itself, Nintendo’s SDKs included snippets or code samples (or sometimes complete small libraries as modifiable assembler source), and developers shared others around when they came up with them to solve a particular problem.

(Later on, in SNES/N64/GameCube era, Nintendo effectively handed you a whole library exokernel worth of precompiled, static-linkable libraries for you to use, too. The NES was too small for that, though.)

Re:The NES Homebrew Scene by pjmlp on Thursday April 12, 2018 @12:59PM (#16822807)
Not necessarily, there are hundreds of embedded devices that can be programmed just like in the old days.

Arduino, ESP286, ESP32, <pick your own flavour>.

And since we are in the context of games and Nintendo, something like Arduboy.

https://arduboy.com

Re:The NES Homebrew Scene by zokier on Thursday April 12, 2018 @03:56PM (#16824361)
> Arduino, ESP286, ESP32, <pick your own flavour>.

Both the Arduino libs and Espressif SDK are fairly big chunks of code.

Yes, you can program AVRs without libs too, but you did specifically say Arduino. It is also my understanding that ESPs are both bit obscure and fairly complex beasts to be managed without SDK.

While there are still some nice cases of simplicity in the embedded world, the complexity and layers of libraries and frameworks model is encroaching there too.

Re:The NES Homebrew Scene by Lerc on Thursday April 12, 2018 @07:38PM (#16825890)
Here's a sneak peek of something I'm working on

http://fingswotidun.com/avr/AvrAsm/Testbed/

It's pretty much a project to scratch the itch being described in this thread. It gives you an in-broswer 8-bit AVR based fantasy console and Assembler.

Re:The NES Homebrew Scene by pjmlp on Friday April 13, 2018 @02:17AM (#16827497)
It looks quite cool.
Re:The NES Homebrew Scene by s_m_t on Thursday April 12, 2018 @04:34PM (#16824698)
The core of the esp-idf is like a wrapper + a tiny bit of logic over the registers, there is a ton of extra stuff packed in there but you don't need to use it if you don't want to and it is pretty clearly separated in the source directory. I really like it because it gets out of my way when I don't want it, and when I do want it there is usually something there to help.
Re:The NES Homebrew Scene by falcrist on Thursday April 12, 2018 @01:19PM (#16822996)
Even worse than that, people still use legacy devices like 8051 MCUs in modern products. I'm currently working on an assembly codebase for a SiLabs part.

Like... Please move to an ARM MCU with a C codebase.

Re:The NES Homebrew Scene by magduf on Thursday April 12, 2018 @03:07PM (#16823953)
An ARM might be overkill (and a bit expensive) for something that can be done with an 8051. A better choice might be something like an Atmel AVR or Microchip PIC(16 or 32 probably). Those are dirt-cheap, and specifically designed for microcontroller applications with features like on-board ADCs, comparators, timers, GPIOs, etc.
Re:The NES Homebrew Scene by morio on Thursday April 12, 2018 @04:15PM (#16824536)
I hear this argument a lot in the EE community. Yet, the cheapest 8051 part in single quantities on DigiKey: $0.43. Cheapest ARM Cortex-M0 part on DigiKey: $0.47. I'll take the ease of development and features on ARM for $0.05. You can develop without proprietary development environments. I do my development with a basic gcc+make setup.

Of course you can pick up old parts which fell off a truck for cheaper but I'd rather not do that when I depend on these parts for many years to come.

Re:The NES Homebrew Scene by janekm on Thursday April 12, 2018 @04:29PM (#16824659)
The cheaper 8051s aren't on digikey (they are usually integrated into something like the custom MCU used for a pregnancy test or tooth brush), and $0.05 is very worth it if you are making 1000000.
Re:The NES Homebrew Scene by vardump on Friday April 13, 2018 @01:04AM (#16827241)
8051 is a complete overkill for a pregnancy test or a toothbrush.

That's why those applications use less known 4-bit processors.

Re:The NES Homebrew Scene by pkaye on Thursday April 12, 2018 @03:01PM (#16823895)
There is C available for an 8051. The Keil 8051 compiler (now owned by ARM) was pretty good and it had a nice GUI environment. The 8051 is pretty good for certain tasks but when you push it beyond the limits, your effort switches from solving the core problem to managing memory and micro optimization to make things work. Meanwhile with an ARM MCU you don't have to worry about a lot of things. I once spent a couple days optimizing a 32-bit divide for an 8051 to squeeze a couple % improvement in product performance.
Re:The NES Homebrew Scene by jdblair on Thursday April 12, 2018 @07:34PM (#16825872)
You can program 8051 in c using tinycc. It functions great as an assembler as well. You can structure the parts that must be in assembly as c functions using inline assembly. Very convenient!

Using c does come at the cost of some code compactness, but you can selectively optimize as the need arises.

Re:The NES Homebrew Scene by pjmlp on Thursday April 12, 2018 @01:53PM (#16823269)
Well, if it is an ARM MCU, Basic, Pascal, Java, C++, Oberon, Ada and Rust are also possible options. :)
Re:The NES Homebrew Scene by gdubs on Thursday April 12, 2018 @12:58PM (#16822803)
Steve Woz in his autobiography said a similar thing about growing up in the Apple II era vs the kids he teaches today; there’s a lot more you can do today, but what you miss is the insight and power that comes from understanding the system as a whole, and being able to leverage all of its parts.
Re:The NES Homebrew Scene by corysama on Thursday April 12, 2018 @02:23PM (#16823559)
> On the NES however, every line of code is yours.

I once stuck my nose into Game Boy Advance homebrew and was happy to find it can be the same there. Every piece of the hardware is memory mapped. That means, given a reference of the mapped addresses and struct definitions, you can do whatever you want with the machine without any magic, black-box external code.

Re:The NES Homebrew Scene by zokier on Thursday April 12, 2018 @04:00PM (#16824413)
GBA was the very last of the "old-fashioned" consoles, and as such one of the best targets for homebrew.
Re:The NES Homebrew Scene by vages on Thursday April 12, 2018 @12:51PM (#16822719)
I also adore old programs for their simplicity. However, I've come to terms with "unnecessary" complexity as a necessary cost of growth and abstraction.

Each part of a bacteria, relative to its mass, may be more cost effective than that of a mammal. I'd much rather be the latter.

Re:The NES Homebrew Scene by TeMPOraL on Thursday April 12, 2018 @01:07PM (#16822890)
It's true insofar you also count in the evolutionary, worse-is-better nature of software development. I.e. there's lots more of complexity than it's necessary for the level of abstraction and capabilities you want, but that complexity was accrued as people developed and iterated on every layer, mostly leaving it be as it got good enough, and moving on to something else.
Re:The NES Homebrew Scene by digi_owl on Thursday April 12, 2018 @01:19PM (#16822995)
Funny because at least over in the Linux world i feel the complexity has come as people had started hunting for "perfection".

Where before you had a GUI part talk to a CLI part via pipes, now you have them talking to each other via a XML based bus mediated by multiple daemons (one for the bus, one to uphold a fine grained security layer again using XML and JSON).

Re:The NES Homebrew Scene by digi_owl on Thursday April 12, 2018 @01:14PM (#16822963)
Especially now that every damned language comes with their own custom package manager, with node.js as the posterboy:

https://medium.com/@caspervonb/the-internet-is-at-the-mercy-...

Re:The NES Homebrew Scene by icebraining on Thursday April 12, 2018 @02:32PM (#16823626)
Blame Perl :)
Re:The NES Homebrew Scene by coding123 on Thursday April 12, 2018 @01:30PM (#16823093)
The graphic on there is brilliant.
Re:The NES Homebrew Scene by fenwick67 on Thursday April 12, 2018 @01:54PM (#16823271)
They couldn't bother to cite the image apparently but it's from a web comic called Gunshow
Re:The NES Homebrew Scene by freedomben on Thursday April 12, 2018 @03:32PM (#16824161)
Yes it is from Gunshow, and that isn't the full comic. It's even better when you see the whole thing: http://gunshowcomic.com/648
Re:The NES Homebrew Scene by khedoros1 on Thursday April 12, 2018 @05:52PM (#16825229)
Those two panels are well-known as a meme image, over probably the past 4 years. Memes tend to transcend their original source; that's probably why the image wasn't properly cited.
Re:The NES Homebrew Scene by egypturnash on Thursday April 12, 2018 @09:25PM (#16826420)
Because clearly nobody working on the web as an artist deserves to get credit for their work once it passes a certain threshold of popularity.

That said, when K C Green ran a Kickstarter for a plush This Is Fine dog it took in more than ten times what he was asking for; how much of that went into his bank account as profit, I dunno.

Re:The NES Homebrew Scene by khedoros1 on Friday April 13, 2018 @02:12AM (#16827485)
I'm not trying to say whether they deserve credit. I'm just trying to describe something observed about how people treat images that reach the level of "meme".
Re:The NES Homebrew Scene by fenwick67 on Friday April 13, 2018 @10:35AM (#16830343)
"it's a meme" isn't an excuse for not giving credit.

If KC Green made an image macro and posted it on Reddit it would be one thing. But they didn't, they made a comic and put it on their own site.

I can't speak for KC but it's just bad taste not to cite things that are flat-out copyright somebody else.

Re:The NES Homebrew Scene by khedoros1 on Friday April 13, 2018 @03:42PM (#16833288)
Describing reality isn't making an excuse.