Author Topic: Makefile for Dingoo A320  (Read 44577 times)

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Makefile for Dingoo A320
« on: July 13, 2010, 04:18:04 pm »
Hello everybody, considering the requests from users from Dingoonity community, I just created a makefile to compile openxcom to Dingoo-linux. It was only necessary to make some minor code changes, which follows in the patch file (REV. 96).

And here's the Makefile.dingoo

Code: [Select]
PROG = openxcom.dge
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
CXX  = mipsel-linux-g++
SDL-CONFIG = /opt/mipsel-linux-uclibc/usr/bin/sdl-config

CXXFLAGS = -Wall -O2 `$(SDL-CONFIG) --cflags` -DDINGOO
LDFLAGS = `$(SDL-CONFIG) --libs` -lSDL_gfx -lSDL_mixer

$(PROG): $(OBJS)
$(CXX) $(OBJS) $(LDFLAGS) -o $(PROG)

clean:
rm -f $(PROG) *.o

.PHONY: clean


As I can see the application is running just fine on my device.
I hope this help  ;)

Offline Eeyoocah5Moh

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: Makefile for Dingoo A320
« Reply #1 on: July 13, 2010, 05:12:25 pm »
Instead of replacing CXX and adding SDL-CONFIG in makefile, you can run make like this:
Code: [Select]
PATH=$PATH:/opt/mipsel-linux-uclibc/usr/bin/
CXX=mipsel-linux-g++
export CXX PATH
make

I also think
Code: [Select]
if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
should be replaced in code with
Code: [Select]
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_TIMER) < 0)
for all platforms so only neccessary things are initialized.

Instead of pathing initialization of `scale` variable you can just run game as
Code: [Select]
openxcom -scale 1


Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #2 on: July 13, 2010, 07:24:52 pm »
Thank you for your help, Eeyoocah5Moh  :)

I have only one question:

Instead of replacing CXX and adding SDL-CONFIG in makefile, you can run make like this:
Code: [Select]
PATH=$PATH:/opt/mipsel-linux-uclibc/usr/bin/
CXX=mipsel-linux-g++
export CXX PATH
make

This does not conflict with the sdl-config of my system, located in /usr/bin/?
Both directories /usr/bin/ and /opt/mipsel-linux-uclibc/usr/bin/  are already set in my path, permanently.

See ya!

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Makefile for Dingoo A320
« Reply #3 on: July 13, 2010, 08:39:03 pm »
Thanks for the makefile Shin-NiL, I've added it to the SVN. :)

I also took Eeyoocah5Moh's advice and just changed the initialization on all platforms, since OpenXcom only really uses VIDEO and AUDIO, and to keep the source clean of platform-specific-stuff.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: Makefile for Dingoo A320
« Reply #4 on: July 13, 2010, 09:07:27 pm »
Hello, could you make some photos (or even better - videos) of dingoo with openxcom? It could be interesting media to share on main site - what do you think SupSuper? OpenXCom on mobile consoles :D

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #5 on: July 13, 2010, 09:46:38 pm »
Hello michal!

No prob, I'll upload a video as soon as possible  ;)

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Makefile for Dingoo A320
« Reply #6 on: July 13, 2010, 10:10:57 pm »
Hello, could you make some photos (or even better - videos) of dingoo with openxcom? It could be interesting media to share on main site - what do you think SupSuper? OpenXCom on mobile consoles :D
Sounds good, I'll be sure to post it on the front page.

Mobile consoles are always neat, I should look into getting it working on my phone too. :P

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #7 on: July 14, 2010, 03:58:18 am »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Makefile for Dingoo A320
« Reply #8 on: July 14, 2010, 07:24:27 am »
Very nice!

Seems to run kinda slow though, should I be worried or is that normal for the hardware?

Also, what do you do for a keyboard? :P

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #9 on: July 14, 2010, 03:40:08 pm »
I believe the feeling of slowness is because the virtual mouse movement speed. The only thing I really noticed were some flaws in music in some screens.

Anyway, our hardware is quite limited:

# CPU Ingenic JZ4732 @ 336MHz, underclocked from 360MHz (clocks up to 433MHz) (MIPS architecture)
# RAM 32MB @ 112MHz (in our case, shared for linux and applications)
# Input D-Pad, 2 shoulder, 4 face, Start & Select buttons, Mic.

Which keys are actually used in the game? I had never before played X-Com  :-[
So far, I just missed the keyboard to type the base's name, but this can be corrected with a routine to use D-pad to switch characters.

Goodbye!

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Makefile for Dingoo A320
« Reply #10 on: July 14, 2010, 07:18:58 pm »
I believe the feeling of slowness is because the virtual mouse movement speed. The only thing I really noticed were some flaws in music in some screens.

Anyway, our hardware is quite limited:

# CPU Ingenic JZ4732 @ 336MHz, underclocked from 360MHz (clocks up to 433MHz) (MIPS architecture)
# RAM 32MB @ 112MHz (in our case, shared for linux and applications)
# Input D-Pad, 2 shoulder, 4 face, Start & Select buttons, Mic.

Which keys are actually used in the game? I had never before played X-Com  :-[
So far, I just missed the keyboard to type the base's name, but this can be corrected with a routine to use D-pad to switch characters.

Goodbye!
Just the mouse actually, the keyboard is only used for typing in names so it looks like you did fine.

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #11 on: July 14, 2010, 09:48:03 pm »
Hello guys,

here is my quick workaround which permits the base name's input on Dingoo platform.
I know it's not the best solution, but I think I'll use it for now.


See ya.

Offline Eeyoocah5Moh

  • Sergeant
  • **
  • Posts: 28
    • View Profile
Re: Makefile for Dingoo A320
« Reply #12 on: July 14, 2010, 11:34:32 pm »
I also took Eeyoocah5Moh's advice and just changed the initialization on all platforms, since OpenXcom only really uses VIDEO and AUDIO, and to keep the source clean of platform-specific-stuff.

So you didn't add #ifdef DINGOO anywhere. Then -DDINGOO in makefile is unnecessary.

Offline Shin-NiL

  • Sergeant
  • **
  • Posts: 18
    • View Profile
Re: Makefile for Dingoo A320
« Reply #13 on: July 15, 2010, 01:04:40 am »
Yes, I did. Only in my latest patch "DingooTextEdit.patch".

But if you do not want to mess up your code, I can keep my changes separate.


EDIT: I don't know why, but the map was really, really slow on my Dingoo just after enter the base's name in Rev. 102  :(

EDIT2: In fact, everything slows down when the timer starts to run.

See ya!
« Last Edit: July 15, 2010, 05:22:55 pm by Shin-NiL »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Makefile for Dingoo A320
« Reply #14 on: July 18, 2010, 12:49:22 am »
Yes, I did. Only in my latest patch "DingooTextEdit.patch".

But if you do not want to mess up your code, I can keep my changes separate.
Well I meant I want to keep things consistent across all platforms (so if I have to optimize somewhere, I optimize everywhere, etc.), but I guess for limitations like these it's inevitable. I'll have a look.

EDIT: I don't know why, but the map was really, really slow on my Dingoo just after enter the base's name in Rev. 102  :(

EDIT2: In fact, everything slows down when the timer starts to run.

See ya!
Which revision did you have before? Does this only happen when you're looking at the globe?

We recently introduced textures and lighting to the globe, which require a lot more intensive drawing there, so that could be the problem. Depending on which causes the slowdown, it might be optimizable or at least have a "low-detail" version.