Table of Contents

Project: "Under the Hood" of Super Mario Bros

A project for HPC by Brett Krisher during 2013.

This project was begun on 3/17/2013 and is anticipated to take X AMOUNT OF TIME. (Upon completion you can correct this with the actual length).

Objectives

State the purpose of this project. What is the point of this project? What do we hope to accomplish by undertaking it?

With this project I want to learn how super mario bros does what it does. More specifically I want to learn how the code itself is structured and how it functions. By undertaking this project I will also try to learn how the game genie changes the code to better suite the player.

Prerequisites

In order to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:

Background

State the idea or purpose of the project. What are you attempting to pursue?

Upon approval, you'll want to fill this section out with more detailed background information. DO NOT JUST PROVIDE A LINK.

Providing any links to original source material, such as from a project page, is a good idea.

You'll want to give a general overview of what is going to be accomplished (for example, if your project is about installing a web server, do a little write-up on web servers. What is it, why do we need one, how does it work, etc.)

Scope

Give a general overview of your anticipated implementation of the project. Address any areas where you are making upfront assumptions or curtailing potential detail. State the focus you will be taking in implementation.

One assumption that I have is that this code (which is for the DOS edition) is similar in style to how the original game is coded. Im going to have to change a little bit on how I can implement a code changing device like a game-genie.

Attributes

State and justify the attributes you'd like to receive upon successful approval and completion of this project.

Procedure

The actual steps taken to accomplish the project. Include images, code snippets, command-line excerpts; whatever is useful for intuitively communicating important information for accomplishing the project.

brett300x@The-One:~/Emulators/Mario Bros Source$ ls
BGRND001.PCX  BLOCK002.PCX  GAMEDEFS.H    LEVEL002.DAT  MARIO.OBJ  SMB.DSK    SMB.OBJ    XBMTOOLS.H    XLINE.H     XPBITMAP.OBJ  XRECT.OBJ
BGRND002.PCX  BLOCK003.PCX  KEY.C         LEVEL003.DAT  MARIO.PCX  SMB.EXE    SMB.PRJ    XBMTOOLS.OBJ  XLINE.OBJ   XPOINT.H      XVSYNC.H
BGRND003.PCX  BLOCK004.PCX  KEY.H         LEVEL004.DAT  SCORE.C    SMBFUNC.C  TCDEF.DPR  XLIB.H        XMAIN.OBJ   XPOINT.OBJ    XVSYNC.OBJ
BLOCK001.PCX  COIN.PCX      LEVEL001.DAT  LOGO.PCX      SMB.C      SMB.H      TCDEF.DSK  XLIB.OBJ      XPBITMAP.H  XRECT.H
brett300x@The-One:~/Emulators/Mario Bros Source$
  1 //SET UP ALL OF THE GRAPHICS AND OTHER JUNK//////////////////////////////////                                                               
  2 void init()
  3 {
  4   int loop;
  5   x_set_mode(X_MODE_320x240,320);   //SET MODE X//
  6   x_set_tripplebuffer(240);     //INSTALL TRIPPLE BUFFER//
  7   install_new_key_handler();        //INSTALL KEYBOARD HANDLER//
  8   x_install_vsync_handler(1);       //INSTALL VSYNC HANDLER//
  9   for (loop=0;loop<52;loop++)       //ALLOCATE MEM FOR GRAPHICS//
 10     if ((data.block[loop]=(char far *)malloc(258))==NULL)
 11       exitgame();
 12   for (loop=0;loop<3;loop++)
 13     if ((data.coin[loop]=(char far *)malloc(258))==NULL)
 14       exitgame();
 15   if ((bcoin=(cointype *)malloc(sizeof(cointype)))==NULL)
 16     exitgame();
 17   bcoin->next=NULL;
 18   if ((bscore=(scoretype *)malloc(sizeof(scoretype)))==NULL)
 19     exitgame();
 20   bscore->next=NULL;
 21   for (loop=0;loop<2;loop++)
 22   {
 23     player[loop].lives=3;
 24     player[loop].level=1;
 25     player[loop].screenx=0;
 26   }
 27 }

Code

Upon completion of the project, if there is an applicable collection of created code, place a copy of your finished code within <code> </code> blocks here.

/*
 * hello.c - A sample "Hello, World!" program
 * 
 * written by NAME for COURSE on DATE
 *
 * compile with:
 *   gcc -o hello hello.c
 *
 * execute with:
 *   ./hello
 */
 
#include <stdio.h>
 
int main()
{
    printf("Hello, World!\n");    // Output message to STDOUT
    return(0);
}

Execution

Again, if there is associated code with the project, and you haven't already indicated how to run it, provide a sample run of your code:

lab46:~/src/cprog$ ./hello
Hello, World!
lab46:~/src/cprog$ 

Reflection

Comments/thoughts generated through performing the project, observations made, analysis rendered, conclusions wrought. What did you learn from doing this project?

The only thing the main file has in it are calls to other files. Hmm interesting.

References

In performing this project, the following resources were referenced:

Generally, state where you got informative and useful information to help you accomplish this project when you originally worked on it (from Google, other wiki documents on the Lab46 wiki, etc.)