aliens

Author Topic: Porting to DS  (Read 21101 times)

Offline bullitmagnet

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Porting to DS
« on: July 12, 2013, 12:36:45 pm »
Hi, I'm not 100% sure this is the right section to make a request, but thought it fit better than anything else.

Is anyone intersted in porting this to the ds at all, or know if its possible. I think the DS is a good platform form a game like this (and should have many games that are similar in its life).

Thanks :)

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: Porting to DS
« Reply #1 on: July 13, 2013, 12:57:22 pm »
It certainly is possible, methinks.

Offline bullitmagnet

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Re: Porting to DS
« Reply #2 on: July 13, 2013, 09:17:35 pm »
It certainly is possible, methinks.

LOL, cool.... anyone know how one might go about this, i'm just getting into game making and stuff so might take a shot at it, what could possibly go wrong? :D

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Porting to DS
« Reply #3 on: July 14, 2013, 02:25:21 am »
i guess the first step would be getting your hands on a DS compiler?

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Porting to DS
« Reply #4 on: July 14, 2013, 10:18:59 am »

Offline bullitmagnet

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Re: Porting to DS
« Reply #5 on: July 24, 2013, 05:10:51 pm »
bah....thoseare so far beyond my current level of knowlege! I am trying to learn programming and wold love to port to the ds and maybe use bith screens, no idea wht for other than show various bits of info on the top one but yeah....oh well. LOL

Offline pmprog

  • Commander
  • *****
  • Posts: 647
  • Contributor
    • View Profile
    • Polymath Programming
Re: Porting to DS
« Reply #6 on: July 24, 2013, 06:29:39 pm »
How much programming knowledge do you have?

If you're literally just starting, I'd recommend:

1. Start with a desktop system (Windows or Linux). It's far easier to get into, and debugging is much simplier.
2. Start with a much smaller project
3. Start with a simple language (ie BASIC or python) to learn programming fundamentals, then move on to more complex languages

If you get stuck anywhere, feel free to ask

Offline goldnux

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Porting to DS
« Reply #7 on: July 28, 2013, 01:13:05 am »
Even if this can compile on the DS, it probably wouldn't run at a decent speed, at least not without some work. That said, I've been trying to do this today. So far I've only compiled individual files. Right now my main problem is the lack of openGL, as such. I'm wondering if there's a switch to make it use all SDL instead of openGL?

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Porting to DS
« Reply #8 on: July 28, 2013, 02:03:35 am »
OpenGL is used only for resizing and filters, it can be removed without big problems.

Offline bullitmagnet

  • Sergeant
  • **
  • Posts: 17
    • View Profile
Re: Porting to DS
« Reply #9 on: July 28, 2013, 02:22:39 pm »
Even if this can compile on the DS, it probably wouldn't run at a decent speed, at least not without some work. That said, I've been trying to do this today. So far I've only compiled individual files. Right now my main problem is the lack of openGL, as such. I'm wondering if there's a switch to make it use all SDL instead of openGL?

Awesome! I have been slowly (very slowly) trying to learn LUA as a language, while it probably wont help me do things with this, I might get a better understanding of programing etc which is something that I really want to do. I would love to help out with this if I can in some way, not sure what but, someway anyway :D


Offline goldnux

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Porting to DS
« Reply #10 on: July 29, 2013, 06:25:55 am »
If you're not experienced with c++ there's probably not so much you can help with. The DS can be a fun platform to work with, but porting a game to a handheld with such limited resources can be complicated. Thanks though.

Anyway... I've compiled an executable. I did disable the opengl stuff when compiling in ds mode. It displays the "loading..." text on the top screen, though it's extremely squished and unreadable. But there's output on the other screen. Here's what I've got so far:

Code: [Select]
NDS_SetVideoMode
Setting mode 640x4000 (ndsmode 4)
Loading...
Loading ruleset...
std::bad_alloc

bad_alloc means it ran out of memory. The ds has a measly 4 megabytes of memory, and the executable itself has to fit in there. I knew this would be a problem, which is why I compiled everything with the -Os flag (optimize for size). I have an ez-flash 3in1 with 16 extra megabytes of ram, which might be enough. Though I haven't figured out yet how to use this extra memory with malloc() and new.

Oh, and I checked the memory used by openxcom on my computer. 20 megabytes in the main menu. Basically, if this does work, it will probably require the ram expansion.
« Last Edit: July 29, 2013, 06:30:29 am by goldnux »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Porting to DS
« Reply #11 on: July 29, 2013, 09:53:50 pm »
OpenXcom isn't really designed for efficiency so it just loads everything at startup, for something like a DS you would probably need a smarter resource manager to only load what's needed on each screen.

Offline goldnux

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Porting to DS
« Reply #12 on: August 27, 2013, 12:12:47 am »
I should have replied earlier, but I don't think will go anywhere. The ram expansion seems to be limited in that it doesn't support 8-bit writes, that might be screwing things up. And I'm not really interested in reworking memory allocation and all that. I've still got the code if anyone is interested, but it's probably more trouble than it's worth.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: Porting to DS
« Reply #13 on: August 27, 2013, 12:47:17 am »
I should have replied earlier, but I don't think will go anywhere. The ram expansion seems to be limited in that it doesn't support 8-bit writes, that might be screwing things up. And I'm not really interested in reworking memory allocation and all that. I've still got the code if anyone is interested, but it's probably more trouble than it's worth.
whole ram cant 8-bit writes? or only part of it? is memcpy forbidden on DS?
I dont see this as blocking problem, its lot less than limitation of 128-bit writes/reads by SSE2 intrinsic :)
Only place in OpenXcom where 8-bit is require is graphic that in most cases handled by my code.
If I know all limitation maybe I could find some solution that could work around this.

Offline goldnux

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: Porting to DS
« Reply #14 on: August 27, 2013, 06:34:38 pm »
whole ram cant 8-bit writes? or only part of it? is memcpy forbidden on DS?
I dont see this as blocking problem, its lot less than limitation of 128-bit writes/reads by SSE2 intrinsic :)
Only place in OpenXcom where 8-bit is require is graphic that in most cases handled by my code.
If I know all limitation maybe I could find some solution that could work around this.
Just the ram expansion doesn't seem to do 8-bit writes properly. So that's 4 megabytes of normal ram, and 16 megabytes which don't do 8-bit writes. This still may not be enough ram without reworking how things are loaded. My life's about to get pretty busy with university and whatnot, so I don't want to spend more time on this.