#10916 - Stephanj - Sat Sep 20, 2003 7:07 am
I was wondering, could I use the GBA C++ game programmnig techniques and graphic modes to make a comp game, taking advantage of a comps HDD, Memory, Display, etc. Also, if this works, could network code be implemented for LAN/Internet gaming? Thnaks.
#10921 - tepples - Sat Sep 20, 2003 12:34 pm
If your game uses mode 3, 4, or 5, it would generally be straightforward to port from GBA Direct Draw to M$ DirectDraw, GBA Direct Sound to M$ DirectSound, etc. Mode 0, 1, and 2, on the other hand, would need some sort of tile engine, but you can probably steal one out of a BSD-licensed emulator.
EDIT: clarified what I was talking about
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Fri Sep 26, 2003 2:09 am; edited 1 time in total
#11098 - Tux - Fri Sep 26, 2003 12:18 am
Hmm. You might be interested in what I did. I made a "Ping pong" game to work on ANY computer. It can run on linux and windows...that is if yah reboot X-)
It's called OSdev. But what you ask for will be confusing tasking code and on. It's called "Live-CD" for live CD games. For floppy games, they are refered to as "bootable floopy games".
#11868 - marcmccann - Wed Oct 22, 2003 3:00 pm
good point tepples, however you would need to use directx 7 or less as 8 and above does not have directdraw functionality in it and porting GBA graphics code to direct3d code would be to say the least, HARD!!
Also directsound doesnt exist as a single API anymore and so you would have to use direct music or again a version of directx below 8.
an easier way to do it would be to get the source code for an emulator and customize it to just play your game, hence the game would work on windows (so to speak) and GBA.
I think the way that DirectX has gone and is still going is making it extremely hard for newbie game programmers to make decent 2d games for windows. for example in directx 8 surfaces have been made utterly useless unless you use vectors and matrices and lock the surface. This is 3d stuff!!
_________________
The GBA is one Lean and Mean machine!
#11870 - Gopher - Wed Oct 22, 2003 3:36 pm
When I was first getting started with GBA work, I daydreamed for a while about setting up a source library to emulate the GBA at the source level. You'd have to have a seperate thread that ran on the windows version to do the work of the actual hardware, translating user input into gba input info and calling interrupts.
This would require either that all code be in C/C++, or that any asm code would have to be duplicated. IF you're like me, prototyping everything in C before you rewrite in asm, it wouldn't be a big deal to set it to compile the asm for GBA but the C for any other platform, and since a window target will be so much faster than the actual GBA anything that would run be fast enough on the GBA in asm would be more than fast enough on the PC without optimization.
At first I thought such a thing might be useful for debugging, and in some specific situations it might as compiling for windows you could use VC++'s full array of debugging tools. Ultimately I dropped the idea in favor of the more practical approach of just writing a library of debugging tools for the GBA.
marcmccann pointed out that DX8 and up don't have direct draw, but porting it to direct3d wouldn't actually be very hard either. You could just render to a texture which is mapped to a single quad. D3D may not encourage this sort of thing, but because of the extreme simplicity of this case (draw texture in memory, send to card, draw quad, repeat) it wouldn't run into any performance issues from forcing Direct3D's round peg into this square hole.
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein
#11873 - tepples - Wed Oct 22, 2003 5:18 pm
' Gopher wrote: |
porting it to direct3d wouldn't actually be very hard either. You could just render to a texture which is mapped to a single quad. D3D may not encourage this sort of thing, but because of the extreme simplicity of this case (draw texture in memory, send to card, draw quad, repeat) it wouldn't run into any performance issues from forcing Direct3D's round peg into this square hole. |
This could work, except some video cards seem to have totally unoptimized drivers, and the "send to card" step would be almost unusably slow.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#11875 - Gopher - Wed Oct 22, 2003 6:28 pm
Tepples said:
Quote: |
This could work, except some video cards seem to have totally unoptimized drivers, and the "send to card" step would be almost unusably slow.
|
I can't imagine any drivers being so bad they couldn't handle a single 256x256 texture and 4 vert coords 60 times a second, tho.
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein
#11879 - tom - Wed Oct 22, 2003 10:32 pm
directdraw wasn't "removed". nor was direct3d. they were merged into what's now called directgraphics.
#11883 - tepples - Thu Oct 23, 2003 1:05 am
Gopher wrote: |
I can't imagine any drivers being so bad they couldn't handle a single 256x256 texture [...] 60 times a second, tho. |
If the app doesn't know how to send the texture in one of the pixel formats that the card can natively handle, the driver has to translate it, pixel-by-pixel. This can become scary on a low-end machine when added to all the CPU cycles used emulating video (especially with mode 1 or 2) and sound.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#11887 - torne - Thu Oct 23, 2003 3:44 am
No parts of DirectX have ever been removed, really. Many have been renamed, moved to new headers, moved to new libraries, marketed under different banners.. but nothing has gone. You can still use interfaces equivalent to all the stuff in DX2/3 under DX9, they are just in odd places, with stupid names, and sometimes labelled as deprecated. =)
--
Torne
"Trust me, I have the Windows source code"
#11897 - marcmccann - Thu Oct 23, 2003 9:42 am
No1 sed anything had been removed, i was just stating that directdraw does not exist as a single API anymore and requires a pretty big workaround via direct3d to be used as it used to be. For example surfaces do not support colour keying anymore and this means a pain in the ass job for 2d developers.
Thinking about it, i was wrong in saying that porting GBA code to direct3d would be hard. Ok it wouldnt be easy but after all neither is anything to do with games programming!
I think that Open GL would be worth considering if you wanted to port a GBA game to the windows platform as it is more willing to accept 2D coding rules than the latest incarnations of DirectX. Also i would seriously consider Allegro, especially if it is in the process of being ported to the GBA it'self.
_________________
The GBA is one Lean and Mean machine!
#11910 - sajiimori - Thu Oct 23, 2003 7:17 pm
Here's one way to do simple color keys in dx8:
http://www.mvps.org/directx/articles/colorkeydx8.htm
Better solution: Use SDL (or Allegro if you don't mind the size).
#11916 - dagamer34 - Thu Oct 23, 2003 10:13 pm
The DirectX veteran (and newbie GBA programmer) to the RESCUE!!!
As to clear some stuff up about directx:
1) DirectX is built on COM framework, basically everyone thinks of DX when they think of COM. It stands for Component Object Model and is used to speed up development for large libraries.
2) DirectX gets new version every 2 years or so and an update every other 2 years.
The english side of what i just said:
1) COM basically means that you can't change stuff from an old version, only add new stuff. So if you go looking for a DX5 SDK, it will be smaller than the DX9 SDK.
2) same
3) another thing. STUFF IS NEVER DELETED (with the exception of the final revision of a release ex. 8.0 and 8.1) So you can still use your old directdraw under dx7.
Lastly, if a person is even thinking about playing games, he should have a good enough video card in order to render a texture (the display) on 2 triangles and an unbelievably fast rate. In fact, my old Celeron 667mHz will render about 2000 polygons still maintaining the good old 60 fps (cheap video card installed too). So the video card shouldn't be a problem.
And the DirectX guru leaves!! That will be $24.50 plus a "Posting Answer Forum Change" of $15.00. I'll need that in cash, please.
_________________
Little kids and Playstation 2's don't mix. :(
#11928 - marcmccann - Fri Oct 24, 2003 9:49 am
Look, no1 gets my point here, i know you can do colour keying in directx 8(thanks for that sajiimori i was previously using my own function to do it which had a slight memory leak in Me/Xp for some reason).
And as for the DirectX guru, again i never stated that anything got deleted, i just said that directdraw wasnt a single API anymore and in my opinion a damn site harder to use than it used to be post directX 8.
My point originally was that if you were going to port a GBA game to the PC you would be better off sticking to directX 7 or lower as they are easier to work with from a 2d programmers persective.
Neways enough of this stupid argument because this forum is about GBA programming and not the inner workings of DirectX! lol
_________________
The GBA is one Lean and Mean machine!
#11931 - torne - Fri Oct 24, 2003 12:26 pm
Yes, and the guru's point was that you can still use the old API. The API cannot be changed; that's how COM works. You can write programs for the DX5 API and that will work on any future DX version just fine. =)
#11953 - JasperW - Fri Oct 24, 2003 9:18 pm
In the past I've attempted something like this. You can download the result here. It plugs into Visual C++ 6.0 and 'emulates' the graphics hardware of the GBA (using DirectX 7). The advantages are that you can source step your code this way. The disadvantages are that's it's pretty slow because I've tried to emulate the graphics as accurate as possible.
If you're interested give it a try. I've abandoned the project but still use it sometimes when I need to test something out and stuff.
Jasper