|
Post by Stan on May 8, 2008 15:01:49 GMT
Thanks a ton for the help. Yeah, I thought it would have been a bit much, useful to know, but since we won't need it overall it seemed kind of pointless. You can read it after I put it up and then give your criticisms, but it's pretty straightforward to learn the complements and all that. I'm going to save the flowcharts for the actual programming part, getting into the hardware and functions of the hardware next.
|
|
|
Post by Maxim on May 9, 2008 0:55:43 GMT
Wow, my ears are burning.
I'm sorry if my tutorials are too hard to follow. I tried to gear them towards someone who knows a non-assembly language, eg. BASIC, rather than someone who knows nothing, because learning assembly as your first programming language is going to be very hard work. I also didn't want to be explaining concepts like iteration, binary operations, flags, RAM, ROM etc on top of the steep learning curve of the SMS hardware.
I also added a compulsory exercise to the first tutorial demanding feedback, and guess what? Basically nobody ever gave any. Anything can be explained further, all you have to do is ask. I'm happy to explain things.
As for what you've done... pardon me for not reading it (it's 1:30am and I have work tomorrow) but after a quick skim... I think the basics of binary and hex in 4700 words may not be the greatest of starts. Sure, it helps to understand that you're fundamentally making all that hex code inside a ROM, just by typing some mnemonics instead, and you won't get far without being able to get by in binary, decimal and hex, but I certainly just use a calculator for all that, or use the assembler's built-in operators. Maybe also being taught number bases at school when I was 11 helped.
Anyway, please skip right past octal, and then right past how to do addition and subtraction in binary. We have a CPU to do that for us. If I add 1 and 2 I don't need to know how it works on a binary level to be happy the answer will be 3.
Since you're still in the realm of binary I suggest you instead look at binary operators - AND, OR, XOR - and maybe touch on the link between bitshifting and multiplying by powers of 2.
After that you might want to start on high-level programming concepts like ordered execution (apparently a large chunk of the population finds that hard to understand), flow control (loops, jumps), and how to plan out a program's high-level operation (pseudocode).
At some point you'll want to run some code in a debugger and ideally get some output. You might want to look at the SDSC console proposals, but if you want to have something that works on a real console you're going to need a reasonably heavyweight, unexplained framework. Somewhat like a "Hello World" program, in fact...
And all this is before you've even considered the SMS hardware. You need to be fairly fluent in Z80 before you can start feeling comfortable with that. I reckon you'll be touching on half a million words of tutorial before you get very close to that.
As for my tutorial: I did start working on part 3 right after I finished part 2, in about 2003. Then I started university and then work and now it's 2008. I hope you have more free time than I do!
|
|
Aypok
Sonic the Hedgehog
Posts: 2,372
|
Post by Aypok on May 9, 2008 7:42:29 GMT
After that you might want to start on high-level programming concepts like ordered execution (apparently a large chunk of the population finds that hard to understand), flow control (loops, jumps), and how to plan out a program's high-level operation (pseudocode). Indeed. I'm not sure why so many people find it hard to understand, but it certainly is the case. A dose of Turtle seems to help them understand. :) As for my tutorial: I did start working on part 3 right after I finished part 2, in about 2003. Then I started university and then work and now it's 2008. Out of curiousity; what did/does lesson three cover?
|
|
|
Post by Maxim on May 9, 2008 9:50:18 GMT
Out of curiosity; what did/does lesson three cover? I don't think it ever got further than a mental plan of the contents. It was going to be Pong, which would introduce sprites and controllers (which are actually quite simple). Maybe some extremely simple PSG SFX too. I'd like to go back to the tutorial and convert it over to Meka (when I wrote it, the MekaW debugger wasn't very good; now, I think it's much better than eSMS/EmuKon) and maybe wikify it (to allow corrections and easy updates). If I can get through my scan backlog next week I might try that. One thing you guys might want to consider: I got several requests for a printable version. I always responded "just print the web page" followed by an anti-PDF rant, but I guess if you're aiming at people who don't know what hexadecimal is then I think you're more likely to also be finding people who print things before reading them :) [Edit] I just found my version of a hex/binary tutorial (as part of a tutorial aimed at less technical people), here: www.smspower.org/maxim/docs/musicenginehack.htmlI explain them in just under 600 words. Does that mean I'm too terse?
|
|
|
Post by Stan on May 9, 2008 17:14:12 GMT
Thanks for the suggestions, definitely going to use them as I put the rest together. I know this is going to be massive, but that's how I want it. Though I do even mention the use of an online calculator, I wanted to explain these things so they were 1. all in the same area of eventual programming explanations and 2. exercises to essentially get the user to start thinking like a computer. Sure, why bother figuring out two's complement when you can just find an online chart where it's already done for you? But I figured it would be a good mental exercise, in addition to learning basic concepts slowly. Again, I'm not putting down your tutorial at all, I think it's good, but I want to get a broader base so that people who may not even want to learn much at all still have a general, overall reference source for any information pertaining to SMS programming. School does get in the way, but this is all a hobby of mine so I make sure I make time for it at least once a week. By the way, Max, I thought you were signed up here for awhile, this is only your fourth post? Weird, for some reason I thought you were always here.
|
|
|
Post by Maxim on May 13, 2008 14:28:57 GMT
Don't call me Max.
/me puts the knives down
Yeah, I don't have time in my life to follow both sides of the great SMS website divide and I'm somewhat entrenched in SMS Power since I'm not a collector and I like hacking and roms and suchlike.
|
|
|
Post by Stan on May 16, 2008 18:59:15 GMT
Hmmm, divide? I never felt there was, though more tech-minded folk post on SMSpower than here. I think we're pretty tight-nit otherwise. Well, binary math is done. Going to go home, get the GIF and shite ready and put up the exercises. It should be all up by later today in the evening (my time). I've already got a ton written for the Z80 MPU poopolio, so that comes next. Looking pretty sweet, I found this cool picture of a Z80 burned open so you can see the chip inside. The site even explained what chemical to use if you want to do it yourself. Why would I want to? I guess to look at it under a microscope. Update: All done! Phew. The gif is a little simple, but I didn't want to make it too distracting. At any rate, the next step my friends is binary math, so get on to it right over on to here. Any criticism is welcome, so please bash away, but this should be sufficient for our purposes. Aypok, if you get a chance to read it, pick out any mistakes I may have made. After reading it so many times little things and issues I may not have made clear enough can escape me. After this we'll FINALLY get into the nitty gritty of the MPU, and I'm sure you're drooling to learn about it, with nice, colored diagrams and everything! That will be coming up in a few weeks, a lot to write for that one, it's a beast.
|
|
|
Post by Bock on May 18, 2008 9:07:08 GMT
Binary maths is exactly the kind of thing NOT required to get into programming at first and which is bound to scare off newcomers away
|
|
|
Post by rupert on May 18, 2008 9:19:44 GMT
Just the fact you have used the word 'math' has made me not want to read it. Isnt it 'maths'?
Can this not be made abit more fun? surly there is somthing fun in programming?
edit* sorry to sound negative, I can see you have put quite abit of time into that.
|
|
|
Post by Bock on May 18, 2008 12:16:35 GMT
Actually binary operations (AND, OR, XOR) are useful - and easier ihmo - to learn but they would rather be learned in context when first using them. Performing an addition manually really isn't any useful. I can't recall ever doing that in any productive context.
Rupert, programming is fun. Learning basic skills is not always fun - as in, writing fun while useful explanation is hard.
I tried writing that Hang On hacking guide but was not satisfied, looks like too much work. If you're curious, you can open a game such as Alex Kidd in Miracle World in MEKA. In the TOOLS menu, open Palette, Tiles Viewer, Tilemap Viewer, Memory Editor and watch things moving while playing. In Memory Editor click VRAM (video memory) and try to randomly change values it should affect the display. Maybe from there you could have questions to ask.
|
|
|
Post by Stan on May 18, 2008 14:55:27 GMT
Well, as I say at the beginning of this part, it's not really something you're going to use, it's just there to get you thinking like a computer, that's the only purpose of it really. Isn't 'Maths' a Brit thing that Americans removed during our spelling reform? The problems I chose are easy as hell, so I don't think it should be too off-putting. At any rate, we're going to get into the actual hardware next so that should be more of an interest to some people.
|
|
|
Post by Stan on May 19, 2008 1:15:57 GMT
Man, it's good having time off now with Summer, I can beast out a bunch of these pages in shorter amounts of time. I just finished up the introduction and first page of the Z80 Section. I have it set up with a table of contents so I can just add page after page as I go on (probably going to be about 12 total). Just need to get the GIF ready this week and you guys can check it out and FINALLY get into some nitty gritty.
|
|
|
Post by Stan on May 20, 2008 4:52:42 GMT
Jeaaaaaaaaah biatches! So, got the first two pages of the Z80 shite up. Check it out here. It's not complete yet, I figured I'd add up the real deal now so that you can at least start reading about it. I'll add about a page a week or so, looks like I'll have around 10 total for this part of the tutorial. You'll learn all about how the MPU works, what stuff means and so forth. The first page is some basic, lame history, the second page starts up the mind bleeding. I especially want to hear some programming deficient users comment on it, let me know how easy it is to read. I used all my sources and tried to put it together so it makes the most sense, is complete but yet isn't overly devastating to read. Check it.
|
|
|
Post by Stan on May 29, 2008 4:27:47 GMT
Next part is up in the Z80 section.
|
|
|
Post by Maxim on May 30, 2008 12:02:24 GMT
I really want to encourage people to learn this stuff, but... if I'd tried to read that when I was getting started it would have totally put me off. Maybe it suits other people, but you're thousands of words in and you're just juggling meaningless unhelpful concepts like MPU (I don't even know what that means), bitshifters, ALUs, muxing, internal 8 bit data paths, MOS, flip-flops...
There is an aphorism that to understand one level of programming thoroughly, you need to understand the level below it adequately; thus, to know C you need to understand assembler, to know Java you need to understand bytecode, or similar. To really know assembler you do need to understand concepts like bitwise operations, carry/overflow/parity, two's complement, maybe even a little about buses and data flow between them; but I really think you don't need to know about transistor operation or CPU internal architecture. That's a few levels too far.
And, I hesitate to suggest, the number of conceptual errors and vague references to unexplained things suggests that you don't "know" about them either. I hope I wouldn't attempt to teach something in which I was not confident of my expertise, and my experience has shown me that even when I have, a significant proportion of the time I've made "rookie" mistakes. Certainly your work has made me read back my own tutorials and find lots of scope for improvement.
I suggest you stop writing and figure out how to make a simple program for the Master System. Maybe even "Hello World", or if that's too programmer-like, maybe show a picture or beep or something. Then look back on what you did to get there and try to explain how, and why, for all the parts of it that you feel you really understand. then others can take the same steps with the benefit of your hindsight, rather than following along as you find your own way. Otherwise you'll reach 100,000 words and lose interest before a single opcode has been executed.
PS. I really don't want to be overly negative. I'm just worried about how much you'll scare people off a great hobby.
|
|