LINUX CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>

7-DAY TOP DOWNLOAD

#
Program
BackTrack 3.0 / 4.0
Pre-Final

5,487
Ubuntu 9.10
4,487
VLC 1.0.3
3,388
Wine 1.0.1 / 1.1.32
2,824
Yahoo Messenger
1.0.4

2,483
Adobe Flash Player
for Linux 10.0.32.18

2,320
Thunderbird PST
Import plugin 1.2

2,290
Mandriva Linux
2010.0

1,992
Super Grub Disk
0.9799

1,577
Yellow Dog Linux 6.2
1,441

WEEK'S BEST

  • Ubuntu 9.10
  • Ubuntu Netbook Rem...
  • Pidgin 2.6.3
  • Wine 1.0.1 / 1.1.32
  • Linux Kernel 2.6.3...
  • Mozilla Firefox 3....
  • Fedora 11
  • OpenOffice.org 3.1.1
  • Firestarter 1.0.3
  • The Gimp 2.6.7 / 2...
  • FileZilla 3.2.8.1 ...
  • Transmission 1.76
  • Super Grub Disk 0....
  • Gufw 9.04.2
  • Skype 2.0.072 / 2....
  • openSUSE Linux 11....
  • Opera 10.01 / 10.1...
  • Adobe Flash Player...
  • wine-doors 0.1.3
  • Google Gadgets 0.1...
  • Home / Linux / Games / Arcade

    aPong

    Download button

    No screenshots available
    Downloads: 344  Add to download basket  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)  Add a review  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

      


    TAGS:

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



    HTML code for linking to this page:


    Go to top

    Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM