PongBoy

A Bad Pong Clone, press Start A game of Pong. Left side has a score of 10, right side has a score of 9.

This is a simple Pong clone for the Game Boy written in its native assembly language. The program is written in a sort of “guide” style using tools for what’s known as “literate programming”, specifically Justin Meiners' srcweave tool.

Despite that, decisions here are made ad-hoc (aka “I’m winging it”) and you will see me explaining bad design choices and use questionable choice of words, so it might not even be fit for an actual “tutorial”. Furthermore, I was gonna use “we” as it might be usual to see in guides, but seeing how not very good this is I decided to just use a straight-up first-person perspective (“I”).

That being said, hope you find it useful somehow. Also, feel free to rip it to shreds.

    1. Introduction and setup
      1. Some prerequisites
      2. Code layout
      3. Setup constants and variables
      4. Memory definitions
      5. Hardware jump vectors
      6. Entry point and header
      7. Main program layout
      8. Basic helper functions
      9. VBlank
    2. Initialization
      1. First steps
      2. Setting up RAM and stack
      3. Clearing the screen
      4. Reset audio
      5. Copy DMA code
      6. Set up the game graphics
      7. Initializing variables
      8. Setting up sprites
      9. Finishing up initialization
    3. Making the main game loop
      1. Updating the screen
      2. First visuals
      3. Input handling
      4. Ball physics
      5. Giving players some points
      6. The simplest possible AI
      7. First proof of concept
    4. Using game modes
      1. Set up for game mode support
      2. Adapting my code for the new system
      3. Adding a title screen
      4. Booting up to the title screen
      5. Fading the screen in and out
    5. Conclusion
      1. End result
      2. Known Bugs
      3. Suggestions
    6. Appendices
      1. Makefile
      2. Game Boy Hardware Constants