Jump to content


War Room Source Code

Source Assembly ABBUC

1 reply to this topic

#1 Schlortt OFFLINE  


    Space Invader

  • 12 posts

Posted Tue Apr 10, 2018 11:06 PM

Since we want to always share our source code, I have been wanting to post this for some time, but I wanted to add better comments first.  I did try to add comments to communicate what the general purpose of a section of code is, but there is still a lot that will need to be interpreted. 


This was written in MADS and requires BATCMP9.xex to be in the source folder.


I hope that this is useful to someone.  If anyone reviews the code and thinks of tips you would like to share with us, that would be most welcome.  We are relatively new at this as War Room is the first game that we created that was created entirely in assembly.


This started out as a movement demo for acceleration, deceleration, skidding, etc.  As the ABBUC contest deadline loomed, we didn't have a new entry so we worked quickly to make this an entry which ended up being a very rudimentary game.  Since we were developing it up to the last minute, you will see some hard coded memory locations.  We also added the Halloween characters for our "final" release after ABBUC since the ABBUC version still had some shortcomings that we thought needed to be fixed.


One of the nice aspects is that since the game really doesn't come close to pushing the abilities of the computer so we were able to leave the code pretty straightforward.


I don't think there is anything novel here but we hope that since the examples are so simple, they can be beneficial for learning:

1. DLI - a very simple DLI that changes the playfield colors after that top of the screen

2. VBI - Deferred - again, very basic - it updates player locations, checks CD, disables break key and other housekeeping.  It also uses a very sloppy shortcut to stop the players from turning to double-width which was a recurring bug that would happen- as I recall, this bug was properly fixed, but the code to set it to single-width is still in the vbi.

3. Self-modifying code.  In order to save space, we overwrite the lo byte and hi byte of the LDA target.

4. Custom character set - very basic character set changes

5. Simple movement physics - acceleration

6. Very simple AI - I know what the AI is doing, and I very rarely win - simply stated, the AI is more aggressive when it has more life left than the opponent.  If it has less life or equal life, it runs around shooting bullets.  The big advantage that the AI has, is that it shoots very accurately.

7. PAL/NTSC detection and adjustments to try to make gameplay and music the same speed.


The characters were built with Paul Lay's player editor - 16 frames, 15 high.  The order of the frames is listed in the source - left, left, right, right, down left, down left, down right, down right, up left, up left, up right, up right, Up, Up, Down, Down.  I would attach some/all of those files but it won't let me attach .apl files.


Any questions regarding sound & music will need to be deferred to Eric.


I tried to acknowledge the help we received in creating this, but I am sure that I missed someone.  Eric probably has more to add because I don't know who he worked with.



Attached Files

#2 erichenneke OFFLINE  



  • 326 posts
  • Location:USA

Posted Sun Apr 15, 2018 7:29 PM

I'll add that War Room also has a music player routine incorporated into it for the title music which was modified from MidiJoy player code from Freetz (Frederik Holst).  MidiJoy is a very good tool, especially if you like composing in midi and then capturing the output like a chiptune player.  And with a little coding manipulation you can incorporating the playback logic into games pretty easily.


Freetz was very helpful in explaining ways to modify his MidiJoy player code in a way to fit how we were wanting to use it in War Room.


You can find more about MidiJoy here...




Also tagged with one or more of these keywords: Source, Assembly, ABBUC

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users