Agreed. Your example also shows the simplicity very well.tokumaru wrote:This was my original suggestion. I don't think it's too overwhelming.blargg wrote:Maybe I didn't read your objection carefully. I thought you were suggesting an NMI handler that did more than increment a counter, as something to teach a new programmer before the model tepples described.
Which is what multi-threading is. Any shared data structures must be updated atomically. Basically you must use lock-free techniques.IMO what goes on in the NMI is hardly multi-threading [...] They must understand that the main program WILL be interrupted at certain points in time and they must write a separate piece of code to handle that situation.
Flawed, bad, same thing. It's only flawed if it doesn't meet the requirements. If the game were doing a status bar or whatever, or did VRAM updates and could fall to 30 FPS sometimes, then I agree it would be a flawed approach since it would glitch. If it won't glitch, AND it reduces complexity, I call that success, not flawed.I did object to the dissemination of a piece of code that I considered flawed
Absolutely. I at least have a vision of NES tutorial materials covering the spectrum. BTW, you referred to "clueless newbie". The only kind of clueless newbie I envision is one whose natural learning capacities have been destroyed by compulsory "education", and who now learn by rote. I always try to counter this by encouraging involvement and experimentation, so that deep understanding can be achieved. Even deep understanding of LDA immediate is notable in my book.Some of them [NES newbies] come from other systems or languages, and have enough knowledge to experiment with the "difficult" stuff, so I think that information should be offered somewhere.
Everything has shortcomings, and those are liabilities in some contexts. In others, they are not a problem. If these shortcomings are due to benefits the approach also has, then it will be superior in some contexts. If you have a way that is just as good or better than tepples' in all aspects, THEN I won't object to you offering it as all-around better.I DID say tepples' was bad because of it's limitations, but I DIDN'T say the other method was the best, I just mentioned it didn't have the same shortcomings.
I'm all for discussion of the good and bad aspects of an approach, especially in a particular context, and comparisons to other approaches. But I'm against "this is bad, get rid of it" kinds of "discussion".Since there seems to be some kind of consensus that tepples' way to handle VBlanks is the easiest one for newbies, I'll just have to shut up on this one, even though I don't agree with it. But I'm sure there will eventually be people asking "why is my status bar jumping", if these newbies persist enough to make a scrolling game.
Your main argument for "your" approach seems to be that it will handle more advanced game designs better. But why not argue for an even more complex one, since it can handle even more than yours? I think tepples' approach is better than yours IN THE CONTEXT of people learning NES programming, up to the part where they do status bars, interrupts, etc. That's a lot of ground between.
Again, I'd love to have a discussion of the relative merits of each approach, without one side believing that his approach is better and that he simply needs to make the other believe the same. Even though I prefer clearing, I am open to discussion of both. Ideally, we'd explore the issue from a fresh perspective and consider all the approaches, even beyond clearing or not clearing. In your case, the bug would be easy to find: start the first level, let the player run through it, then start it again. If it behaves differently the second time, you forgot to initialize something.Another thing I happen to not agree with is clearing the whole memory to 0. Say, if a person forgets to initialize a variable before starting a level, but everything works fine because the variable was cleared at the beginning of the program. Now, when the second level starts and the variable is no longer 0, something goes wrong. Wouldn't you say this bug would be harder to catch, since the first level worked fine but the second one didn't?
That's a scary thought... I wish you hadn't mentioned that. A time when there are no more working NES units? *shudder*[...] I don't think I'll even abandon NESDEV, even when I'm 80 years old or so. I just hope that by then someone will have successfully made an accurate NES clone, otherwise we'll probably have to rely solely on emulators... =)