Jump to content

Photo

War Room Source Code

Source Assembly ABBUC

12 replies to this topic

#1 Schlortt ONLINE  

Schlortt

    Space Invader

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

 

Enjoy!

Attached Files



#2 erichenneke OFFLINE  

erichenneke

    Moonsweeper

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

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

 

-Eric



#3 erichenneke OFFLINE  

erichenneke

    Moonsweeper

  • 358 posts
  • Location:USA

Posted Sat Apr 28, 2018 10:28 AM

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



#4 slx ONLINE  

slx

    Stargunner

  • 1,489 posts
  • Location:Vienna, Austria

Posted Sat Apr 28, 2018 1:07 PM

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.



#5 therealbountybob OFFLINE  

therealbountybob

    Quadrunner

  • 7,961 posts
  • assembling for abbuc 2018
  • Location:Still time to join in the new high score club season!

Posted Sat Apr 28, 2018 1:55 PM

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 ?



#6 Fox-1 / mnx OFFLINE  

Fox-1 / mnx

    Stargunner

  • 1,556 posts
  • What is your Alternate Reality?
  • Location:NL, Earth 2.0

Posted Sat Apr 28, 2018 4:21 PM

You need something like this

http://atari.fox-1.n...scii-converter/

to convert ASCII to ATASCII.



#7 therealbountybob OFFLINE  

therealbountybob

    Quadrunner

  • 7,961 posts
  • assembling for abbuc 2018
  • Location:Still time to join in the new high score club season!

Posted Sun Apr 29, 2018 6:48 AM

You need something like this

http://atari.fox-1.n...scii-converter/

to convert ASCII to ATASCII.

thanks but I can't extract .7z files could someone post the ATR (renamed) here please ;)



#8 Fox-1 / mnx OFFLINE  

Fox-1 / mnx

    Stargunner

  • 1,556 posts
  • What is your Alternate Reality?
  • Location:NL, Earth 2.0

Posted Sun Apr 29, 2018 7:15 AM

Attached File  ATIBM-IBMAT.atr   90.02KB   36 downloads



#9 therealbountybob OFFLINE  

therealbountybob

    Quadrunner

  • 7,961 posts
  • assembling for abbuc 2018
  • Location:Still time to join in the new high score club season!

Posted Sun Apr 29, 2018 4:13 PM

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?



#10 Fox-1 / mnx OFFLINE  

Fox-1 / mnx

    Stargunner

  • 1,556 posts
  • What is your Alternate Reality?
  • Location:NL, Earth 2.0

Posted Sun Apr 29, 2018 4:44 PM

With ENTER #file.ext,A you can load a source code if it has no line numbers (ATASCII format, not ASM or ASCII format).  The editor should add them automatically.



#11 Stephen OFFLINE  

Stephen

    Quadrunner

  • 7,128 posts
  • A8 Gear Head
  • Location:No longer in Crakron, Ohio

Posted Sun Apr 29, 2018 4:55 PM

Failing that, the open source Notepad++ has great column editing and auto-numbering built in (among a few hundred other cool features).



#12 therealbountybob OFFLINE  

therealbountybob

    Quadrunner

  • 7,961 posts
  • assembling for abbuc 2018
  • Location:Still time to join in the new high score club season!

Posted Sun Apr 29, 2018 4:56 PM

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.



#13 therealbountybob OFFLINE  

therealbountybob

    Quadrunner

  • 7,961 posts
  • assembling for abbuc 2018
  • Location:Still time to join in the new high score club season!

Posted Mon Apr 30, 2018 2:42 AM

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







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