First level

Most of the games in 80's were arcade games based on multiple levels. Every game had first level. I'm trying to make a game like that. This is my atempt to blog development of that first level :)

07 August 2010

Long time no see....

Long time since last post...
Real life took so much needed free time for retro coding...

Now its better, and summer will be over soon, so lots of cold and rainy days ahead, perfect for cup of tea or coffee and retro coding :)

Sprite routines are on the hold now...
I'm doing some 3d routines now, and will post about it when I have something to show.

Labels:

14 April 2009

First steps made....

Well, it's been a while since I created this blog. Busy life stood in the way of making this project happen.

But first steps happend and here is small post about what have I done so far.
I just realized I haven't told the most important thing of all :)
Main platform for this game is going to be Commodore 64 :)
I plan to develop it completely for it, and then make same game for modern computers, phones and other devices that will appear til the day that I start that part of development.
I can reuse level data, graphic would be improved offcourse, but logic would stay the same.

So what have I done on C64 so far:
I always wanted to create a software sprite routine to be used together with hardware sprites to improve graphics. About a year ago I had my first software sprites routine done. It used character screen to show 8 monochrome sprites. Each sprite is 24x21 pixels, black, with priority above hardware sprites. They are properly masked. In next post I'll post some pictures or video so you se it in action.

Problem is, its slow... :(

It works like this:

Every sprite is composed of 16 chars positioned in vertical stripes (32 bytes) in a 4x4 char grid.
8 sprites take 128 chars in charset so I have 128 chars left to use for background.

First step is to return background chars in the place of previous position of sprite.
So I have to put 16 bytes on screen and its fast enough and can not be avoided.
Than I take each of 16 bytes from screen on new sprite position, find its definition in charset, and put those 8 bytes on a correct place in that sprites definition.
this calculating of addresses in charset, transfering 128 bytes takes a lot of time and is main cause of slow speed.

Than I draw shifted sprite image to sprite definition. This is done using tables for every possible byte-shift combination and is fast as it can be... (almost :) )

Main loop is like this:

lda sprite
and mask
ora spritedata
sta sprite

Offcourse its not simple like that (there is lot of indexing, and self modified code..) but you get a picture.

So I had an idea. Instead of transfering whole background data to sprite buffer and then drawing sprite, I could make routine look like this:

lda background
and mask
ora spritedata
sta sprite

and make routine almost twice the speed it was. Trick is not to transfer background bytes to buffer and then read it from that again, but to somehow connect those two rotines in one.
Problem is that addressing of background is so tricky that I havent managed to make workable code so far...
Sprite buffer is simple, four vertical stripes of 32 bytes.
Char background is in 16 x 8-byte blocks with completly random addresses...
I have core of routine and I'll try to make it work...

But, even with twice the speed I'm afraid it wouldnt be fast enough for this game so I had to deceide and make something else.

Charmode has one more drawback - it's lack of color. So next step is software sprite routine for multicolor bitmap mode.
I'm currently making routine that will display 8 multicolor sprites 12x21 pixels, overlayed with monochrome hardware sprite anywhere on screen, but without masking. This will give me fastest routine possible and still usable in platform game.

There can not be sprite overlaping in this case but with good game design I think I can work with it.

Well, have to go to work so.... till next time... hope it will be soon... :)

Labels:

14 August 2008

Welcome !

Welcome to my blog!
Ill try to make this interesting. Main reson for starting a blog is to make me code more :)

Labels: