Jump to content
IGNORED

War Room Source Code


Recommended Posts

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.

 

Enjoy!

batcmp9.xex

Published WarRoom.asm

  • Like 7
Link to comment
Share on other sites

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...

http://www.phobotron.de/midijoy_en.html

 

-Eric

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

Hey all, question here about how to take Assembly source code out of the WUDSN/Eclipse environment and get it loaded into MAC/65?

 

The source code that Rob I and developed was all done in WUDNS/Eclipse and compiled using MADS compiler.

 

trbb is trying to load our source code into MAC/65 and running into challenges to do so.

 

I had never tried this myself either. I've tried several approaches (as has trbb) but so far we can't figure out how to get it into MAC/65.

 

Appreciate any hints or advice.

 

Thanks!

-Eric

  • Like 1
Link to comment
Share on other sites

Don't know about the opcodes but you should be able to save to a text file, put that textfile onto a floppy image and ENTER it into MAC/65 (which will probably mark all lines with opcodes it doesn't understand with "ERROR". You'll need to add line numbers to the text file.

 

To store the PC/Mac Textfile onto an ATR you can use Omnivore.

 

I just tried that in Atari800MacX using Select All and Copy in the Editor and then simply pasting the clipboard into Atari800MacX which worked as well (although you need to adapt the Pseudo-Opcodes to MAC/65 style before.

  • Like 1
Link to comment
Share on other sites

thanks slx,

I tried entering the "PC" text file they sent me into MAC/65 (via APE) in text mode but "truncated record" message is shown as each line is processed / nothing comes in. I would like to do this directly on my XE without having to use emulation. This is a probably a file type/line termination issue and someone has a utility/convertor/way of doing this ?

Link to comment
Share on other sites

OK thanks - I think it does the same EOL changes as the Memopad util. The problem is that the lines are not numbered, I forgot about this and thought TEXT mode would take them in anyway! Previously I did a cut and paste of the text file into emulator runing MAC/65 with autonumber on and that worked. It would be nice if there is another util that can number them to avoid doing this?

 

Please can the PC based assembler users confirm if (and say how) they can auto-number the files (or not)?

MADS...

WUDSN...

others?

Link to comment
Share on other sites

Thanks I knew that too - think I've been doing too much Atari this weekend if there is such a thing, will try this again tomorrow need some sleep! Thanks again.

Link to comment
Share on other sites

Just to report back:

I've successfully "imported" files from both WUSDN and MADS into MAC/65

 

1. Convert end of line to atascii (with fox's convertor above, or memopad - it doesn't matter about graphic blocks you see instead of tabs in memopad you can replace them later)

 

2. Set MAC/65 to TEXT mode (using the TEXT command!)

 

3. ENTER #D:FILENAME.EXT,A this will import the file a line at a time - if you have a large file try it on a small section first.

 

Notes:

If you don't convert the end of line the import will go through the motions but you will not end up with anything!

 

if you get "ERROR 137 Truncated Record" the import will stop - the maximum line size is 124 characters (I thought it would be 120) so probably it's a long comment that needs trimming!

 

Thanks again everyone :thumbsup:

:-D

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...