Project Catalina based Game
wuut
Posts: 17
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\bbuster.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
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\bbuster.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
Comments
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!
Umm. Lots of things have been working for a very long time.
You are obviously talking about some of the new things.
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.
Don't I wish! This was why I originally bought my first Propeller - but I don't have any time for it these days
Ross.
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?
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
Not quite. I'm currently incorporating the Parallax graphics 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.