What do we want in a tutorial?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: What do we want in a tutorial?

Post by dougeff »

My understanding is that 'short int' is stored 16bit and uses math 16bit, but the upper 8bits are masked out (like I said "shoves a 0 in the upper byte"), and so 'short int' might actually be LESS efficient, since it has to take the additional step of masking the high byte at each step.
nesdoug.com -- blog/tutorial on programming for the NES
Sik
Posts: 1589
Joined: Thu Aug 12, 2010 3:43 am

Re: What do we want in a tutorial?

Post by Sik »

tepples wrote:
Sik wrote:and indeed short int is 8-bit on many old systems
Do these systems predate the C standard? Because in the standard, short int is at least -32767 to 32767, which means at least 16-bit.
¯\(º_o)/¯

Started looking around but I can't find any references to short being 16-bit from earlier than C99 (though I didn't do that exhaustive of a search). What do the older standards say? I know that char being required to be 8-bit is a relatively recent addition (if you ignore POSIX, which is its own competing standard)
lidnariq
Posts: 11429
Joined: Sun Apr 13, 2008 11:12 am

Re: What do we want in a tutorial?

Post by lidnariq »

The official C89/90 standards have been withdrawn, and so it's harder to get a copy of it, but: C89 §2.2.4.2 indirectly states that short int must be at least 16 bit. A random other source implied that K&R C did not define a minimum size.

Similarly, C89 defined char must be at least 8 bits, but I believe weirder systems use 9-bit chars.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What do we want in a tutorial?

Post by tepples »

I came up with revised Python installation instructions. Steps 1 and 2 actually install it, and steps 3 through 5 test the installation.
  1. First install Python from here: https://www.python.org/ftp/python/3.5.1 ... -3.5.1.exe
  2. Open a Command Prompt and do this:

    Code: Select all

    C:\Python35\Scripts\pip.exe install Pillow
  3. From the Start menu, inside All Programs, inside Python, choose IDLE (Python GUI).
    or: From the Start menu or Windows 8 Start screen, type IDLE and then choose IDLE (Python GUI).
  4. From IDLE's Run menu, choose Python Shell. This should open a new window titled "Python Shell".
  5. Paste in each of the two following lines, pressing Enter after each one:

    Code: Select all

    from PIL import Image
    Image.new('RGB', (100, 100), (0, 191, 0)).show()
    This should cause a small green box to appear on the screen. If it does not, or you see a bunch of red text in the IDLE window, let me know.
Could you put on your newb hat and try these steps?

EDIT: updated Python (Windows 32-bit) link to 3.5.1
User avatar
dougeff
Posts: 3078
Joined: Fri May 08, 2015 7:17 pm

Re: What do we want in a tutorial?

Post by dougeff »

newb hat
:)

From C:\Python34\Scripts>
I typed "pip install Pillow", btw.

And, I have windows 8.1. I just slid from right to left (opens the right menu), and hit "search", typed in "IDLE", chose the first option, and "Python 3.4.3 Shell" Opened.
Attachments
green.gif
green.gif (9.66 KiB) Viewed 3649 times
nesdoug.com -- blog/tutorial on programming for the NES
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: What do we want in a tutorial?

Post by tepples »

dougeff wrote:From C:\Python34\Scripts>
I typed "pip install Pillow", btw.
That'll work too. I just wanted something that would work even for Command Prompt newcomers who can't yet tell a cd from a Compact Disc.
And, I have windows 8.1. I just slid from right to left (opens the right menu)
That works on touch laptops, not on desktops or non-touch laptops. I'm trying to come up with a single set of instructions with as few variations as possible.
and hit "search", typed in "IDLE", chose the first option, and "Python 3.4.3 Shell" Opened.
So it mostly worked; thanks. One thing I learned is that some Python installations are configured to open a shell by default instead of a new Python script by default. I'll add this to the instructions:

4. (If IDLE's window is titled "Python 3.x.x Shell", skip this step.) From the Run menu, choose Python Shell.
User avatar
cubeboy
Posts: 33
Joined: Fri Nov 08, 2013 7:56 pm

Re: What do we want in a tutorial?

Post by cubeboy »

tepples wrote:I've put the outline on a wiki page.
Speaking as someone making an attempt at my own game (although very slowly), I like this outline. It starts with first learning how to display something on screen, how to make them move, how to make them interact, and then how to make something more complex.

This is my thought process on how I would like to learn how to program from scratch, in case this is helpful in any way.
1) Give me the tools I need to create a .nes file that can run on a powerpak/emulator. Use these tools, as instructed, to create .nes files for the following "stages".
2) Display "Hello World" text.
3) Display tiles that I have created or found online.
4) Combine tiles and turn them into a sprite.
5) Animate my sprite.
6) Use inputs from a control pad to force animation of my sprite.

Of course I would essentially want someone to spoon feed me everything I need up through this point. From there, I would want to learn how to create backgrounds, introduce more sprites, have the sprites interact. Although I would still love to be spoon fed all this, I would think it could become a little more advanced in teachings at this point.
Post Reply