Getting back into the swing.

Discuss general Uzebox topics here: features, wish list. nice to have, etc.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Getting back into the swing.

Post by hpglow »

D3thAdd3r wrote:I would make sure every kernel file you have is up to date. I believe I had just that and then realized I had some outdated files somehow
Ok so this was the problem. There are links to two trunks at google.code (image below.) After compile I cannot get my .hex file to run in uzem. I will download a fresh version tomorrow.
Attachments
Problem.jpg
Problem.jpg (91.13 KiB) Viewed 6701 times
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Getting back into the swing.

Post by hpglow »

Ok I got the emulator to work finally. It turns out that there was a mismatch between uzem and sdl on my pc. It seems like this happens every time uzem gets updated.
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Getting back into the swing.

Post by CunningFellow »

The C code for asteroids is a bit messy and the comments are poor.

It was all done in a bit of a rush as I spent far too much time on optimizing the line draw routines and the object-management/collision routines.

If it is at all confusing - then just grab me.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Getting back into the swing.

Post by hpglow »

It didn't take too long to figure out what was going on (in a basic sense). That doesn't mean that I fully understand yet but I think I can modify your code to make something now. I was wondering if you used any type of program to define your coordinate pairs for each vector line or if you just did it by hand?

I see the ship, fonts, ect in the header file I was just wondering if there was something that would parse all that info for me?
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Getting back into the swing.

Post by CunningFellow »

The ships/rocks where just done by hand on paper.

The fonts/etc where in a spreadsheet.

I'll cut those bit out for you when I get to my other computer on the weekend.
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Getting back into the swing.

Post by CunningFellow »

I think maybe I should make a Qt app that lets you design vector objects on the desktop and save them to a .h file.

If I do that and document the API-ish things that would make the vector mode very useable for other people to jump straight into.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Getting back into the swing.

Post by hpglow »

Ok I have some questions about this video mode. I assumed that lines would start at 0,0 and go out from there like vector math, but I was trying to hand graph some of the graphics just to make sure things were working the way I thought and it wasn't coming out properly.

So if we look at the ship

Code: Select all

{{{  14,   0}, {  14, 108}, {   9, 128}, {  14, 148}, {  14,   0}, { 255,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}, {   0,   0}}}, //  1 Ship
First cord is 14x and 0y correct? Does that mean that it starts drawing from the origin 0,0 or does it start from that first pair? Next would be 14x, and 108y? And so on. I plot this and it ends up looking nothing like the ship. Also which corner is 0,0? Upper left or lower left (or something else I have not thought of)?

I'm trying to plot my graphics with GIMP using a 256 x 256 px image with the grid on.

Thanks for your help.
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Getting back into the swing.

Post by CunningFellow »

There are two kinds of objects in my code

Polar
Cartesian

The rock and spaceship are polar

The text is cartesian

I just dug through my C code to find the routine names. God it is terrible code - sorry for that.

DrawPolarObjectFastC(uint8_t x, uint8_t y, uint8_t CharNo, uint8_t Theta, uint8_t scale);

Is the one for drawing the space ship and rocks.

Storing them as polar coords saves on a set of sin/cos thingies
CunningFellow
Posts: 1480
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Getting back into the swing.

Post by CunningFellow »

So yeah.

The 1st point is 14 units out at 0 degrees.
The 2nd point is 14 units out at 108 deg.

Note though that there are 256 degrees to a circle in this case.
hpglow
Posts: 269
Joined: Wed Apr 14, 2010 6:06 am

Re: Getting back into the swing.

Post by hpglow »

Something like 1.4 degrees per unit? I'll try and re-graph it tonight.
Post Reply