PDA

View Full Version : Project Catalina based Game



wuut
11-15-2010, 04:36 PM
Hi,

At first a small introduction.
We plan to make a C based game for the Hydra DevKit for our university.
As a warm up course for our Game Engineering Students.

We would like to write a game-mixture between Pong and Ball Buster (Breakout).
Planned is:
* Singleplayer against an AI
* Multiplayer via Controller J6/J7 on the Hydra Board
* Graphics (via a Bitmap)
* Simple physics for the ball movement

It is required to work with VGA,C and Catalina (no ImageCraft because of the costs and as less spin as possible).

We currently have some issues with the graphics. We would like to use a bitmap (f.e. X:\Hydra\demos\JT_Cook\JTC_B_Buster_03_09_06\bbust er.bmp) but till now we did not find a working VGA driver supporting our needs.

Has such a thing been done before?
Are there any Catalina based games using bitmaps?

We appreciate every kind of help :)

greetings
wuut

ps: i'm going to give a better explanation the next days

Dr_Acula
11-16-2010, 01:48 AM
At the moment what we have is a number of VGA drivers supported, and also a number that we are working on adding. The process of adding drivers is quite complicated so recently Ross created a new way and wrote it up as a "for dummies".

I'm just about to check it out myself, as I'd like to add a number of VGA drivers - both graphics and text. Eg there is a full color VT100 driver that was written earlier this year that could be incorporated (and which could be useful for blocky graphics for simple games).

Lots of things are *very* close to working!

jazzed
11-16-2010, 02:13 AM
Lots of things are *very* close to working!

Umm. Lots of things have been working for a very long time.

You are obviously talking about some of the new things.

Dr_Acula
11-16-2010, 03:18 AM
Yes I am talking about new things like sprites that use the full color palatte of the propeller.

We currently have some issues with the graphics. We would like to use a bitmap (f.e. X:\Hydra\demos\JT_Cook\JTC_B_Buster_03_09_06\bbust er.bmp) but till now we did not find a working VGA driver supporting our needs.

Has such a thing been done before?
Are there any Catalina based games using bitmaps?


@jazzed, do we have any Catalina based games using bitmaps? And if so, what color depth and resolution? I'd love to see some demos.

jazzed
11-16-2010, 03:45 AM
@jazzed, do we have any Catalina based games using bitmaps?
Not that I know of. To me your statement made Catalina sound immature. There is much more to a programming language than being able to do bit-mapped graphics. I would bet though that given Ross' apparent interests that he has something to show for all his work.

RossH
11-16-2010, 05:31 AM
Not that I know of. To me your statement made Catalina sound immature. There is much more to a programming language than being able to do bit-mapped graphics. I would bet though that given Ross' apparent interests that he has something to show for all his work.

Don't I wish! This was why I originally bought my first Propeller - but I don't have any time for it these days :confused:

Ross.

Paxi
11-16-2010, 11:27 AM
Since I just finished my gampad driver in C and I also intend to do a game on the Hydra i had a look at the current VGA Drivers too.
I never used bitmaps in C so far, so I donīt have much understanding of how to use them in general (f.e how to move them and interact with them, maybe someone knows a nice tut on that?)
Anyway back to topic:
As far as a bitmap is realised as an array of color codes in C, it should be at least possible to show a bitmap on the display with using the VGA_LOWRES driver since you can select and color each pixel individually (t_setpos(int curs, int col, int row)). Anyhow since the VGA_LOWRES driver is only 32x16px 8bit, you wonīt be able to do some nice graphics with it. Since 1px = 1byte with 8bit Color Mode, i had the idea to use the single bits with a mask to split 1px into a 4x4 array of bits, but that didnīt work(probably it was a stupid idea anyway, since i donīt know much about how the driver behind works, I just had to give it a try..)
The included VGA_HIGHRES driver in contrast should be better regarding the resolution but the problem here is, that you can only color a whole row and not a single pixel. So probably someone is able to write another function for the VGA_HIGHRES driver, to select and color each pixel individually as on the VGA_LOWRES driver? Btw whats the differece between those two, that selecting and coloring each pixel is possible in the VGA_LOWRES but not with the VGA_HIGHRES?

RossH
11-16-2010, 10:42 PM
Since I just finished my gampad driver in C and I also intend to do a game on the Hydra i had a look at the current VGA Drivers too.
I never used bitmaps in C so far, so I donīt have much understanding of how to use them in general (f.e how to move them and interact with them, maybe someone knows a nice tut on that?)
Anyway back to topic:
As far as a bitmap is realised as an array of color codes in C, it should be at least possible to show a bitmap on the display with using the VGA_LOWRES driver since you can select and color each pixel individually (t_setpos(int curs, int col, int row)). Anyhow since the VGA_LOWRES driver is only 32x16px 8bit, you wonīt be able to do some nice graphics with it. Since 1px = 1byte with 8bit Color Mode, i had the idea to use the single bits with a mask to split 1px into a 4x4 array of bits, but that didnīt work(probably it was a stupid idea anyway, since i donīt know much about how the driver behind works, I just had to give it a try..)
The included VGA_HIGHRES driver in contrast should be better regarding the resolution but the problem here is, that you can only color a whole row and not a single pixel. So probably someone is able to write another function for the VGA_HIGHRES driver, to select and color each pixel individually as on the VGA_LOWRES driver? Btw whats the differece between those two, that selecting and coloring each pixel is possible in the VGA_LOWRES but not with the VGA_HIGHRES?

Hi Paxi,

As you've probably realized, the underlying low level TV or VGA drivers that Catalina uses are just the standard Parallax drivers with trvial modifications - mostly to just emove the SPIN methods and VAR blocks.

What Catalina does is replaces the VAR blocks with buffers allocated at run-time, and the SPIN functions with a new "HMI" plugin - which essentially just adds text processing capabilities back in over the top of the low level driver.

What I plan to do for wuut is add a new "GRAPHICS" plugin that does essentially the same thing for the standard Parallax graphics object. For anything that this doesn't address, I would also add some functions to retrieve the memory address of the video buffers, so that you could fool about with them yourself directly from C (or LMM PASM). This would not generally be fast enough for some low-level graphics - but it would be fine for doing things like loading bitmaps etc. Of course, for actual bitmap manipulation, you would still be completely on your own - Catalina will just provide the basic functions you will need. Adding a library of useful functions is something I will leave to others.

Ross.

P.S. Have you posted your final gamepad driver code?

wuut
11-17-2010, 07:04 AM
Sounds perfect thank you ross :)

Paxi
11-17-2010, 02:28 PM
Hi Ross,

That sounds really nice. I guess you will import this driver (http://obex.parallax.com/objects/71/) right? So I can have a look at how it works in principle before.
I got a last question regarding the whole driver stuff:
Would it be possible to write a driver in ASM only, and call some functions out of a .c file? Like you did with the register access. Because if this works, it would be probably possible to use most of the ASM code from the current .spin drivers out of the DAT block and modify or add things you like.

Regarding the driver:
I havenīt posted the final code so far but iīll do when I come home. Currently only Gamepad1 is supported. But support for Gamepad2 should be no problem, I just need a second global variable and the datapin mask at P6 instead of P5.
I also wrote a little documentation on the driver, but itīs in german so i think it makes no sense to upload it here apart from that you wont need it anyway^^
If you like the driver, feel free to change or modify and include it in your next Catalina Release.

EDIT: I just read the Cataline Unplugged Thread, so the the point is moot :D

RossH
11-17-2010, 11:47 PM
Hi Paxi,

Not quite. I'm currently incorporating the Parallax graphics (http://obex.parallax.com/objects/55/)object, for use with the standard TV driver, although the object itself says it will work with the standard VGA driver as well. I'll include support for both if I get time.

I'm replacing the SPIN methods with C equivalents, so you can have a play with the SPIN demo to see how it is used and what the results will look like.

Ross.