Jump to content

Photo

Space Wars V0.8 - demo released

xb assembler cartridge

53 replies to this topic

#51 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,806 posts
  • Location:Denmark

Posted Tue Mar 14, 2017 5:04 AM

A motion of 16 (>10) with XB moves a sprite one pixel every frame. The lower 4 bits of the motion parameter are auxiliary data. If you have a motion of one (>01) it will add to the auxiliary data 16 times before the sprite is moved one pixel.

 

I use 16 bit words in CPU RAM with the upper 8 bits being the sprite position. Sprite motion etc. is handled with 16 bit operations (A), and the actual sprite location is then handled (transfered to the VDP) with a simple 8 bit operation (MOVB).

 

I use a 20 word lookup table for sine and cosine. I was sure I could use the same table to fire the missile, but it proved a challenge. Main problem was, with a location (sprite is without fraction), you can add without moving it, but you only need subtract once to move it. So I had to get position of spaceship, loose fractions, and then add to internal location to locate between pixels and go from there. Well, if I wanted missiles to shoot perfectly.

 

:)


Edited by sometimes99er, Tue Mar 14, 2017 5:58 AM.


#52 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,806 posts
  • Location:Denmark

Posted Wed Mar 15, 2017 4:25 AM

I've been thinking about how to store the map. 

 

So I made an initial tile template. Half bitmap. 8 characters wide and 32 characters high. The upper part of characters has horizontal wall designs, and the lower part has vertical walls.

 

My map data structure becomes, one word for screen location or end of map, one byte for starting character (tells if we're going horizontal or vertical) and one byte for length. Horizontal walls are 2 characters high, and vertical walls are 3 characters wide.

 

This test screen below has a map size of 78 bytes. A perhaps more traditional layout of 2 by 2 character tiles for the complete screen would always have 768 / 2 / 2 = 192 bytes per screen. 25 screens would then take 4,800 bytes. Perhaps with a bit om compression. Perhaps 4 by 4 characters would do. That would only be 48 bytes per screen, but I'd only have 16 tiles, unless I went full bitmap. And then I guess there has to be room for damage meter, score etc.

 

It would be nice not to edit maps by hand in data statements. And I think it would be easier for me to make a new and dedicated mapper rather than forking or shoehorning into Magellan.

 

Maybe I should define each room by the exits and have a random seed cleverly draw the rest.

 

spacewar15.png

 

 

 



#53 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,220 posts
  • Location:Cookeville, TN

Posted Wed Mar 15, 2017 10:16 AM

Sh**, that looks cool. :)

#54 --- Ω --- OFFLINE  

--- Ω ---

    --- Ω ---

  • 9,971 posts
  • Location:Virgo Supercluster, Gould Belt in the Orion arm of Milky Way galaxy.

Posted Wed Mar 15, 2017 10:36 AM

Sh**, that looks cool. :)

 

gallery_35324_1027_1406.png                  It sure does!







Also tagged with one or more of these keywords: xb, assembler, cartridge

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users