Thread: Manipulation of Numbers?

  1. #1
    Registered User Sickjin's Avatar
    Join Date
    Jan 2011
    Posts
    6

    Manipulation of Numbers?

    I've been reading up on an archaic assembly language used on the original Nintendo and early Super Nintendo games and gotten the basics down. I've found a emulator that lets me test scripts, and written some basic functions like loading a number to A, loading a number to B, multiplying A by B and saving the result to X, etc. etc.

    what I'm wondering is, can someone explain to me in layman's terms how games were written entirely in this assembly language for the NES? So far what I'm seeing is an entire language that's more or less designed to edit, move, save, load and perform functions on numbers, and I don't understand how they used this language to produce things like music, graphics, text, and all the other things that make a game a game.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Text is just numbers (look up ASCII).

    Graphics is basically just numbers (think HTML color codes; think coordinates for drawing; motion is doing math on coordinates).

    Music (especially eight-bit music) is just numbers (frequency and duration).

  3. #3
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by Sickjin View Post
    what I'm wondering is, can someone explain to me in layman's terms how games were written entirely in this assembly language for the NES? So far what I'm seeing is an entire language that's more or less designed to edit, move, save, load and perform functions on numbers, and I don't understand how they used this language to produce things like music, graphics, text, and all the other things that make a game a game.
    What do you think the native language of all computers and consoles is? That's right, binary. Anything else is just an abstraction layer added by humans to allow us to interact with computers better. As tabstop pointed out, it is all numbers. Whether you are talking about the the NES and 8-bit graphics or the PS3 with HD.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  4. #4
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Maybe they made a higher level compiler with the assembly language to make things easier.

  5. #5
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by manasij7479 View Post
    Maybe they made a higher level compiler with the assembly language to make things easier.
    What?

    @OP:Also I think the big thing you are missing is the concept in general. The 6502 is just the central processor for the NES, all it does is operations. To say, display the image on screen you would trigger an interrupt which would activate the video processing circuitry which would then actually write the image to the screen based on the numbers in the CPU (which could be a pointer to the place in memory the sprite image is stored).

    Again, it all just comes down to binary though.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  6. #6
    Registered User Sickjin's Avatar
    Join Date
    Jan 2011
    Posts
    6
    @Andrew, your second post answered my question. I understand that all things come from numbers, what I didn't understand was how you would use a number manipulating machine to create something like, say, a world map in an RPG without doing it pixel by pixel, or creating music without doing it note by note. I didn't know that the NES had any sort of storage capacity for sprites and music and text.

  7. #7
    Registered User
    Join Date
    Jun 2011
    Posts
    4,513
    That's the beauty of low-level programming - everything is pixel by pixel and note by note.

    It doesn't appear that way when using higher level languages, but as Andrew said: "Anything else is just an abstraction layer added by humans to allow us to interact with computers better." With SDL, for example, you can appear to load a bitmap as a whole piece at once, but the underlying mechanisms are still handling it bit by bit (literally) for you.

    (Side note to OP: Love your pic!)

  8. #8
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Yes, the NES is a computer; it contains memory, a CPU, I/O hardware, ect. You can read on the specs here.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  9. #9

    Join Date
    May 2005
    Posts
    1,042
    what I'm wondering is, can someone explain to me in layman's terms how games were written entirely in this assembly language for the NES?
    Huge amounts of self-esteem. And coffee.
    I'm not immature, I'm refined in the opposite direction.

  10. #10
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by AndrewHunter View Post
    Yes, the NES is a computer; it contains memory, a CPU, I/O hardware, ect. You can read on the specs here.
    That's why it was called the Famicom.
    Quote Originally Posted by wiki
    In most of Asia, including Japan (where it was first launched in 1983), China, Vietnam, Singapore, the Middle East and Hong Kong, it was released as the Family Computer (ファミリーコンピュータ Famirī Konpyūta?), commonly abbreviated as Famicom (ファミコン Famikon}, or FC for short?)

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-08-2010, 10:26 AM
  2. Can anyone help me to break numbers into an array numbers
    By s2xcracker in forum C++ Programming
    Replies: 4
    Last Post: 08-25-2009, 05:17 PM
  3. Replies: 5
    Last Post: 12-21-2007, 01:38 PM
  4. Comparing numbers to a list of numbers held in a text file
    By jmajeremy in forum C++ Programming
    Replies: 3
    Last Post: 11-06-2006, 07:56 AM
  5. Replies: 4
    Last Post: 03-03-2003, 03:52 PM