Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Games > Arcade

    aPong

    Download button

    No screenshots available
    Downloads: 695  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.3/5)
    15 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Richard Whitty | More programs
    GPL / FREE
    March 5th, 2007, 15:05 GMT
    ROOT / Games / Arcade

     Read user reviews (0)  Refer to a friend  Subscribe

    aPong description

    aPong is a Pong game written in x86 Assembly language.

    aPong is a Pong game written in x86 Assembly language.

    As I run Linux on my own machine, I don't do a lot with intel syntax. I needed to learn this for a lab. After scouring the internet for a few hours, I came across NASM. This looked as though I'd be able to just code in this, take it into the Windows computers and have it just work.

    No such luck. So, that's beside the point now, but I wrote this in order to get to grips with the syntax (which turned out to be the wrong one.)

    Here are some key features of "aPong":

    · 2-player

    The left one uses Q/A to go up/down, the second one uses P/L. Escape to quit.

    · Uses SDL from assembly language

    I quite like SDL. I quite dislike x86. I already know SDL. It was already a learning exercise, I wasn't going to go off learning xlib or something at the same time. This gave me a way to quickly get the code written.

    · Avoids the use of frame pointers

    Why do you need frame pointers if you're not going to be running it in a debugger. It's not difficult to keep track of the stack frame if you're writing it yourself. You don't need to keep moving the stack pointer inside a function, just once at the start and once at the end. Then all you need is to take offsets from esp (so long as you remember how big the frame is at the time.)

    This really gets on my nerves. People don't seem to realise the amount of overhead (in terms of 'lost' cycles) that a function call has. To say global variables are BAD is just plain wrong. Sure, it can lend itself to abuse, but that's like saying you shouldn't code in C or use UNIX because they don't hold your hand.

    · The input system isn't great.

    Because I was trying to keep the code size down, I went the way of using SDL_GetKeyState and SDL_PumpEvents. These mean that if the key is not actually down at the time of the PumpEvents call, it drops the keypress. (if you want to see how you should do it, look at the events system in STP

    Requirements:

    · NASM
    · GCC (for linking)
    · libSDL (for graphics and input)

    Compilation:

    nasm -f elf pong.o
    gcc -o pong pong.o -lSDL

    Controls:

    Player one Q (up), A (down)
    Player two P (up), L (down)
    Escape - quit

    Product's homepage

      


    TAGS:

    pong game | arcade game | board game | aPong | pong | arcade

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM