Agon Light Graphics Tests

It’s the Easter holidays and I’ve got two weeks off work. Amongst highly exciting things like weeding the garden and waiting for a new washing machine to be delivered, I’m doing some programming.

After spending a bit too long remembering how my own code works, I managed to create a simple starfield that looks quite nice

Then I went off to figure out how drawing bitmaps worked again on the Agon Light. It’s not that difficult really, you just have to read the documentation a bit and have a good old play around.

It was then pointed out to me on Discord that I can use negative co-ords so things don’t plop onto the screen and can instead slide onto the screen more neatly. Now, while this was as simple as putting negative values in the x and y positions I got severely sidetracked by scrolling the entire screen and learning all about the co-ords system the Agon has inherited from the BBC Micro.

The end result is this, which also contains some bonus scrolling text because everything needs scrolling text.

The code to do all this is not that great. Well, it is, it’s quite nice code… if you’re programming on a machine that has a faster CPU and can do floating point numbers natively.

I’m on an eZ80 that’s running at 20MHz which doesn’t know what floating point values are. And I’m asking it to do sine, cosine and some quite intense floating point calculations every frame.

A less exciting side quest is going to be creating a robust fixed point maths library and a bunch of sin/cos lookup tables. I might do that tomorrow while waiting for the washing machine to arrive. Or I might go and watch the grass grow, that could be more interesting.

Leave a Reply

Your email address will not be published. Required fields are marked *