assemblygraphicslc3

LC3 Assembly Memory Mapped Graphics


I'm attempting to create a 2D platformer with shooting mechanics in LC3 Assembly. Since this is from complete scratch, I also need to create the game engine. I have spent the past 4 hours creating a sprite library, and due to what I hope to be ignorance of a perhaps more efficient method, that means writing out the color data for each individual pixel in a 20px20p area for each sprite.

.ORIG x87B5
;-------------------------------------------------
;TITLE: R x8000
;-------------------------------------------------
.FILL   x0000
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x7C00
.FILL   x001F
.FILL   x0000
.FILL   x0000
.FILL   x0000
.FILL   x0000
.FILL   x0000
.FILL   x0000
.FILL   x0000
.FILL   x0000

This is the code for just one row of 20 pixels belonging to one sprite. If there is a way that I could perhaps draw the sprites using some sort of software, and then translate that into an LC3-compatible sprite data array such as this one, please point me in the right direction. For anyone curious, I'm using a version of LC3 OS that reserves xC000-xFDFF in memory for a memory-mapped graphical display, and I'm very happy to share for anyone interested.


Solution

  •   *****
      *   *
      *   *
      *****
    

    And the C program can read these lines and output corresponding .FILL statements.