Jump to content
IGNORED

Simon (game) in assembly language


Dexter

Recommended Posts

The TIFILES header is just a partial copy of the FDR from the disk.

 

For a first game, I’d like to start with something simple. I’ve chosen the game Simon, (a thrilling high speed assembly action game). :-D Simple enough as a game, complex enough to learn a lot, when doing it in assembly language.

 

post-41771-0-80285000-1430506967_thumb.png

 

This should be the in game screen. Made it with Photoshop, and converted it with Convert9918. I saved it as bitmap TIFILES. Now I have two files, the color and pattern data. Stripping off those 128 byte headers leaves oly the raw date? How do I get that data into the source code? Magellan has that nice feature to export the data as assembler data lines.

 

 

 

 

  • Like 2
Link to comment
Share on other sites

I use a small Java program for converting binary files to data or byte statements. Attached here as a zipped jar file.

 

That's exactly what I was looking for! post-41771-0-32244100-1430546819_thumb.jpg

 

Do you use NetBeans for that kind of things?

Link to comment
Share on other sites

I wrote TIImageTool simply with a text editor (jEdit).

 

If you think that's hardcore?

Now THAT'S hardcore coding.

https://www.youtube.com/watch?v=cclQ7E-Oj78

Liked the video, but not the sound. :-D

 

If I'm forced to program something in C, I'd use Code::Blocks.

 

What I don't like on IDE's are those bulky installs. It's kind of ridicules when you see how big ATMEL Studio is to program such a small binary for an AVR. Although I like IntelliSense, syntax highlighting, and different colors for variables.

  • Like 1
Link to comment
Share on other sites

Liked the video, but not the sound. :-D

 

Not the sound? This is the ending score of Portal! Just for that part I'd be willing to play it once more. ;)

 

Edit: Also, I'm not aiming at hardcore programming. :) The bloatedness of IDEs is what keeps me with simple tools. I've got my API documentation on one half of the screen so I can quickly look up methods and classes.

 

I'm not hardcore enough to write programs with vim (except for those like the AND test), but jEdit proved to be very helpful with syntax highlighting and other tools, and still being quite fast.

Edited by mizapf
  • Like 1
Link to comment
Share on other sites

 

Edit: Also, I'm not aiming at hardcore programming. :)

 

 

 

Of course not, I was just kidding.

 

 

jEdit proved to be very helpful with syntax highlighting and other tools, and still being quite fast.

 

I'm using TextPad for machine language, that’s what I’m used to. It also has syntax highlighting and can use external tools.

 

 

 

 

Link to comment
Share on other sites

You guys have not programmed hardcore until you've flipped switches to enter binary data. I did this with my Elf replica to create a "Cylon eyes" demo with the board LEDs. Incredibly laborious, but also incredibly satisfying. Why? Who the hell knows. I'm weird that way :)

  • Like 2
Link to comment
Share on other sites

Finally I got the Graphics II mode working on the real thing!

post-41771-0-25172600-1430822110_thumb.jpg

If I understand correctly, E/A3 object file can be as big as the total amount of free memory, it first fills up HIMEM, then LOMEM.

 

I convert the object file to E/A5 files with Classic99 by loading and running the E/A3 file, stop the program in the debugger with F1, then choose Make, Save Memory as Program. I use SLOAD, SFIRST and SLAST.

 

Although this seem to work, is that the most convenient and correct method?

       DEF SFIRST,SLAST,SLOAD
SFIRST EQU $
SLOAD  EQU $
       B   @MAIN
 
Source listing
 
SLAST  END

Some object files seem to automatically start, how could that be accomplished?

  • Like 2
Link to comment
Share on other sites

 

 

If I understand correctly, E/A3 object file can be as big as the total amount of free memory, it first fills up HIMEM, then LOMEM.

 

Yes, but it will not split files up for you - to get them to split up between the 24k and 8k blocks you need to use multiple files or AORG directives. (Absolute Origin)

 

 

 

I convert the object file to E/A5 files with Classic99 by loading and running the E/A3 file, stop the program in the debugger with F1, then choose Make, Save Memory as Program. I use SLOAD, SFIRST and SLAST.

 

Classic99 doesn't require the labels, although they likely make it easier to see where you loaded the file. ;)

 

Nice work so far!

Link to comment
Share on other sites

  • 2 weeks later...

I’ve had fun composing the graphics for SIMON. Because of the 256 character restriction of Magellan, I managed to squeeze all the graphics I need within 256 characters. Though I’m not sure what graphic mode to use, graphics 1 mode gives me a color restriction. So graphics 2 mode is more likely. However, I have used up only 256 characters which I’d like to place on the display to my likings.

 

I’ve watched, and mostly understood, Tursi’s video on the pattern and color masking bits. https://www.youtube.com/watch?v=XJljSJqzDR0

 

So if I set register 4 to "00000000", I set the VDP to use only one character set, i.e. 256 characters. Can I set the color table also to one color table?

 

The real question here is, which graphics mode / VDP settings do I have to use for this screen layout, with the ability to show the characters for text that are on the 3th area of the screen, also to show on the second or first area of the screen. Should I use one or three pattern tables, and one or three color tables?

 

post-41771-0-61659500-1432026790_thumb.png

Edited by Dexter
Link to comment
Share on other sites

I’ve had fun composing the graphics for SIMON. Because of the 256 character restriction of Magellan, I managed to squeeze all the graphics I need within 256 characters. Though I’m not sure what graphic mode to use, graphics 1 mode gives me a color restriction. So graphics 2 mode is more likely. However, I have used up only 256 characters which I’d like to place on the display to my likings.

 

I’ve watched, and mostly understood, Tursi’s video on the pattern and color masking bits. https://www.youtube.com/watch?v=XJljSJqzDR0

 

So if I set register 4 to "00000000", I set the VDP to use only one character set, i.e. 256 characters. Can I set the color table also to one color table?

 

The real question here is, which graphics mode / VDP settings do I have to use for this screen layout, with the ability to show the characters for text that are on the 3th area of the screen, also to show on the second or first area of the screen. Should I use one or three pattern tables, and one or three color tables?

 

attachicon.gifgraphicsS5b.png

 

You could use two pattern tables and two color tables, see:

http://www.unige.ch/medecine/nouspikel/ti99/tms9918a.htm#hybrid%20bitmap

Link to comment
Share on other sites

 

You could use two pattern tables and two color tables, see:

http://www.unige.ch/medecine/nouspikel/ti99/tms9918a.htm#hybrid%20bitmap

Why two, I have enough characters with one pattern table, or do you mean I could use 2/3 of the screen and the last 1/3 for text writing?

 

It's a bit confusing, Magellan has bitmap mode (among others), but yet uses 256 characters. I suppose it is the so called half bitmap mode?

Link to comment
Share on other sites

Why two, I have enough characters with one pattern table, or do you mean I could use 2/3 of the screen and the last 1/3 for text writing?

 

It's a bit confusing, Magellan has bitmap mode (among others), but yet uses 256 characters. I suppose it is the so called half bitmap mode?

 

Sorry, I thought you had used all 256 characters for the Simon logo and needed more for the text. But in that case you can just use the badly named 'half bitmap' mode (perhaps 1/3 bitmap mode would have been a better name?).

 

Magellan has support for bitmap mode colors - but not for full bitmap mode as such. For a scrolling map, which is what Magellan is designed for, you need the same characters all over the screen. You can obtain this with half bitmap mode, but also in full bitmap if you load the same character set 3 times.

 

Sprites above 7 do not work in half bitmap mode on the real hardware (no emulators emulate this glitch). A compromise, if you want to save VDP RAM but need to use sprites, is to have 3 pattern tables with the same content but only 1 color table. All sprites work in this special mode.

Link to comment
Share on other sites

So I can use one pattern table and one color table. For scrolling I have to study your 2plane demo, but that’s not necessary for SIMON. :)

 

In that particular demo I see tow sources included at the end of the file:

          COPY      "tiplayer.a99"
          COPY      "CollisionChaos.vgm.a99"

For SIMON it’s probably overkill, but what are the tools to create simple music or convert existing?

 

Sorry if this all seem random questions, but there are just so many aspects. But I guess you all know that. :D

 

Link to comment
Share on other sites

So I can use one pattern table and one color table. For scrolling I have to study your 2plane demo, but that’s not necessary for SIMON. :)

 

In that particular demo I see tow sources included at the end of the file:

          COPY      "tiplayer.a99"
          COPY      "CollisionChaos.vgm.a99"

For SIMON it’s probably overkill, but what are the tools to create simple music or convert existing?

 

Sorry if this all seem random questions, but there are just so many aspects. But I guess you all know that. :D

 

 

The 2 plane demo is using F18A Enhanced Color Mode (ECM) graphics and F18A hardware scrolling. This is not graphics mode 2, but graphics mode 1 with enhanced colors, so no table masking is necessary.

 

The music is played using Tursi's VGM compressor and player:

http://www.harmlesslion.com/cgi-bin/onesoft.cgi?130

Link to comment
Share on other sites

Thanks, one step further!

 

Well, actually two, I managed to set up the half bitmap mode.

post-41771-0-09036600-1432148489_thumb.png

The nine big colored items each have an individual color, that way I can manipulate them seperately with the F18A palette registers.

 

The white characters are from a charset site: http://kofler.dot.at/c64/font_01.html

I don't know if I need them, but I still have 5 unused chars left.

 

The other thing is that I included music. It's more a proof of concept, and I'm not going to use that music in the game. Just a few simple sound effects and the simon tones.

 

simon.obj

source.zip

 

It really sounds great on the real TI, hooked up on the stereo. :D :music:

Edited by Dexter
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...