It is currently Fri Oct 20, 2017 8:19 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
PostPosted: Sun Aug 23, 2015 10:40 am 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1780
Location: DIGDUG
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


Top
 Profile  
 
PostPosted: Sun Aug 23, 2015 10:45 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
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)


Top
 Profile  
 
PostPosted: Sun Aug 23, 2015 11:15 am 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6289
Location: Seattle
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.


Top
 Profile  
 
PostPosted: Tue Aug 25, 2015 4:43 pm 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19112
Location: NE Indiana, USA (NTSC)
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/python-3.5.1.exe
  2. Open a Command Prompt and do this:
    Code:
    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:
    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


Top
 Profile  
 
PostPosted: Tue Aug 25, 2015 7:39 pm 
Online
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1780
Location: DIGDUG
Quote:
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 846 times ]

_________________
nesdoug.com -- blog/tutorial on programming for the NES
Top
 Profile  
 
PostPosted: Wed Aug 26, 2015 7:16 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19112
Location: NE Indiana, USA (NTSC)
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.

Quote:
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.

Quote:
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.


Top
 Profile  
 
PostPosted: Tue Sep 01, 2015 11:22 am 
Offline
User avatar

Joined: Fri Nov 08, 2013 7:56 pm
Posts: 33
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 97 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7

All times are UTC - 7 hours


Who is online

Users browsing this forum: tepples, Yahoo [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group