gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > need help porting a game

#101420 - sasuke_kun12 - Tue Sep 05, 2006 10:45 am

i know it sounds stupid but I've currently run into a problem whilst porting C-Dogs onto the DS

I don't know how to port!

yes i do have basic C++ knowledge and I've got everything i need. I just need someone (or a document) that'll point me to the right direction
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#101711 - GPFerror - Thu Sep 07, 2006 4:14 pm

sasuke_kun12 wrote:
i know it sounds stupid but I've currently run into a problem whilst porting C-Dogs onto the DS

I don't know how to port!

yes i do have basic C++ knowledge and I've got everything i need. I just need someone (or a document) that'll point me to the right direction


Iv got it compiled already for the DS, but running into problems with it reading the datafiles, not sure whats wrong with it yet.

What problems are you having?

Troy(GPF)
http://gpf.dcemu.co.uk

#101773 - sasuke_kun12 - Fri Sep 08, 2006 12:08 am

just dunno where to start.

did u convert the keyboard.c and .h and input.c and .h to NDS inputs?

actaully could you send me a copy of the source to study on? i can help out too if you like!
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#101789 - GPFerror - Fri Sep 08, 2006 1:17 am

sasuke_kun12 wrote:
just dunno where to start.

did u convert the keyboard.c and .h and input.c and .h to NDS inputs?

actaully could you send me a copy of the source to study on? i can help out too if you like!


I'm using my SDL lib I ported to the ds, so it wasnt that difficult to compile, and I haven"t got to rewriting input code, Trying to figure out why my fat lib code can't find the datafiles right now.

Troy

#101799 - Sektor - Fri Sep 08, 2006 3:16 am

I got the menus working but it freezes when I go to start the game.

The font is difficult to read at that resolution.

Feel free to fix it. Tested on M3CF. It checks for the data at /data/cdogs/. Use at own risk, always backup CF/SD cards.
_________________
GTAMP.com/DS


Last edited by Sektor on Sun Sep 10, 2006 9:26 am; edited 2 times in total

#101809 - sasuke_kun12 - Fri Sep 08, 2006 5:14 am

ok cool thanks!

did u use the original source code or the SDL port?
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!

#101813 - Sektor - Fri Sep 08, 2006 5:40 am

I copied and modified keyboard.c, keyboard.h and gp2x.h (now ds.h) from the gp2x source over the ones in the official SDL source . I modified files.c, cdogs.c, gamedata.c and probably some minor changes to a few more files.

I downloaded cdogs-sdl-current.tar.bz2 from http://members.optusnet.com.au/lmartinking/hacks/cdogs/

Apparently there is a slightly newer version on the svn server, I'll try that one later.

-----------------

For any ports, you start with the makefile or the configure script. With c-dogs, I just used the generic makefile that is included with devkitarm examples. I added "-lSDL -lfat" to include the SDL and libfat libraries. I changed the INCLUDES line to: src/include src/missions

The seperate level editor source was in the src folder. I had to move that out of there, so there would be only one "main".

main was in cdogs.c, so first I opened that. I wanted text to be output on the bottom screen, so I had to include nds.h,console.h and add some code to set the display/vram. Then I tried to compile. If/when errors appear, I try to fix them or often just comment out the offending lines and rewrite them later if they are important.

If the program runs in a window by default then I look for an option to set it to fullscreen. If it compiles and I get the video output I was expecting then I move onto getting the input/joystick/keyboard working.
_________________
GTAMP.com/DS


Last edited by Sektor on Sun Sep 10, 2006 10:47 am; edited 1 time in total

#102049 - Sektor - Sun Sep 10, 2006 6:04 am

I got the game starting by commenting out:

file: game.c
Code:
while (gameTicks <= 1)
    SDL_Delay(10);


It's a bit slow and game over really is game over because you have to restart the DS. The external missions aren't supported yet. Download is on my site.
_________________
GTAMP.com/DS

#102103 - MaHe - Sun Sep 10, 2006 9:52 pm

Love you, dude, I'm a big fan of this game myself ... Umm, do you intend to implement wifi multiplayer too in the future?
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]

#102117 - Hogmeister - Sun Sep 10, 2006 11:55 pm

OMG i dont know how much you guys know this but i f'en love you! i have LOVED cyberdogs and C-Dogs since wayyy back when c-dogs first came out >< had an unholy facination with it and if you guys hadn't started porting it i was going to try learning C++ and eventually port it myself i think it'd be great on the ds.


anyway much love, keep up the great work !

#102161 - Sektor - Mon Sep 11, 2006 10:25 am

I have no plans for network mode (the PC version doesn't have network functions) although that would be fun to play. It supports split screen, two players on one system but that's very impractical on the DS.
_________________
GTAMP.com/DS

#102217 - MaHe - Mon Sep 11, 2006 9:38 pm

Maybe just a simple keypress exchange system? :)
_________________
[ Crimson and Black Nintendo DS Lite | CycloDS Evolution | EZ-Flash 3-in-1 | 1 GB Transcend microSD ]

#102252 - sasuke_kun12 - Tue Sep 12, 2006 9:26 am

MaHe wrote:
Maybe just a simple keypress exchange system? :)


thats what i was tryin to do!

i went (for examples sake)

Code:
 #define Key A Key_A


and thanks sektor! that really really helps!
_________________
Current Projects: Rise Of The TriaDS
Percentage Complete: 15% - woot! commenting out the loader GUI
http://sasukekunds.blogspot.com
RELEASE DATE! 15th October it would really help if someone wants to help! if so PM me!