SMS Power!

Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats
Music - Videos - Development - Translations - Homebrew
Sega8bit & SMS Power! 2013 Event - 10th August

View topic - How to build for Linux amd64?

Reply to topic
Author Message
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
How to build for Linux amd64?
Post Posted: Sun Sep 05, 2010 2:00 pm
Hi,

I couldn't find instructions on how to build for Linux 64 bits. I'm using Debian Squeeze. Simply running 'make' doesn't work (wrong architecture):
otto@debian:~/meka/srcs$ make
./buildupd.exe
gcc -I. -I./tools -I./sound -Ilibs -I../include                                         -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE -DMEKA_SOUND -DMEKA_ZIP -DMEKA_PNG -DMEKA_JOY -DMEKA_Z80_DEBUGGER -Wall -march=pentium -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer  -DMARAT_Z80 -c meka.c -oobj/meka.o
meka.c:1: error: CPU you selected does not support x86-64 instruction set
meka.c:1: error: CPU you selected does not support x86-64 instruction set
make: *** [obj/meka.o] Error 1
otto@debian:~/meka/srcs$


Can anyone help?
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Sun Sep 05, 2010 2:35 pm
Try to remove "-march=pentium" from the Makefile.
I don't think it has ever been tested on a 64-bit architecture so it would likely require other changes.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 2:50 pm
It went further, then failed. Output: http://pastebin.ca/1933362
Some said in this thread he was sucessful on 0.70, but there aren't any comments about it: http://www.smspower.org/forums/viewtopic.php?t=11165
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Sun Sep 05, 2010 2:51 pm
Well for once you don't have Allegro installed.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 3:00 pm
Right.
Now complaining about audio.h.

The sources.txt told me to replace <seal> by <audio> in sound/sound.h, but it was already audio.h.

otto@debian:~/meka/srcs$ make
./buildupd.exe
gcc -I. -I./tools -I./sound -Ilibs -I../include                                         -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE -DMEKA_SOUND -DMEKA_ZIP -DMEKA_PNG -DMEKA_JOY -DMEKA_Z80_DEBUGGER -Wall  -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer  -DMARAT_Z80 -c meka.c -oobj/meka.o
In file included from shared.h:95,
                 from meka.c:11:
./sound/sound.h:18:57: error: audio.h: No such file or directory
In file included from shared.h:95,
                 from meka.c:11:
./sound/sound.h:65: error: expected specifier-qualifier-list before ‘HAC’
In file included from ./sound/sound.h:177,
                 from shared.h:95,
                 from meka.c:11:
./sound/sasound.h:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘saInitSoundCard’
make: *** [obj/meka.o] Error 1
otto@debian:~/meka/srcs$
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Sun Sep 05, 2010 3:29 pm
Have you installed SEAL ?
Double-check whats the filename is your distribution.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Sep 05, 2010 4:50 pm
Now I do. It didn't help, though.
  View user's profile Send private message
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 8:12 am
Hi

I can compile Meka under Debian amd64, but can't link it because of 32bits asm.
To compile you need to install libseal-dev and libxxf86dga-dev if you don't have it.
Also you need to modify sound/sound.h changing:

#include "audio.h" // Official SEAL distribute name

//#include "seal.h" // Debian package header file was renamed to seal.h

by

//#include "audio.h" // Official SEAL distribute name
#include "seal.h" // Debian package header file was renamed to seal.h

Once this is done, you can compile, but the proccess stops at link time.
 
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 8:18 am
Sorry, I forgot to mention that also you need to modify the Makefile deleting the ocurrences of "-march=pentium"
 
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 10:06 am
Hi again.

Ok, now I have Meka build under Debian amd64, this is how I did it:

- First you need to install this packages if you don't have it:
liballegro4.2-dev
libseal-dev
libxxf86dga-dev

- Modify sound/sound.h changing:
#else
// Uncomment the appropriate:
#include "audio.h" // Official SEAL distribute name
//#include "seal.h" // Debian package header file was renamed to seal.h
// FIXME: Need to automate this of use some Makefile trickery to detect.
#endif

by

#else
// Uncomment the appropriate:
//#include "audio.h" // Official SEAL distribute name
#include "seal.h" // Debian package header file was renamed to seal.h
// FIXME: Need to automate this of use some Makefile trickery to detect.
#endif

- Modify Makefile:
* Change where it says:
#---[ UNIX/GCC ]---------------------------------------

ifeq ($(SYSTEM), unix)

This line:
DEF_OS = -DARCH_UNIX -DX86_ASM -DASM_SYMBOLS_REQUIRE_UNDERSCORE

By this one:
DEF_OS = -DARCH_UNIX -DX86_64 -DASM_SYMBOLS_REQUIRE_UNDERSCORE

* Change:
En
CFLAGS += -Wall -march=pentium -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer
by
CFLAGS += -Wall -march=x86-64 -O6 -ffast-math -fno-strength-reduce -funroll-all-loops -fomit-frame-pointer

* Change:
OTYPE = elf
by
OTYPE = elf64

* And finally change:
En
OBJ_BLIT = $(OD)/blit.o $(OD)/blitintf.o $(OD)/eagle.o $(OD)/hq2x.o $(OD)/hq2x16.o $(OD)/hq2x32.o

By
OBJ_BLIT = $(OD)/blit.o $(OD)/blitintf.o $(OD)/eagle.o $(OD)/hq2x.o

This last change removes the hq2x16 and hq2x32 support. This is because hq2x16.asm and hq2x32.asm does not compile under 64bits, so we need to make one more change:
* In file srcs/blit.c, change:
Cambios en blit.c
void Blit_Fullscreen_HQ2X (void)
{
// Perform HQ2X into double buffer
// FIXME-OPT: Apply on full width.
hq2x_16(
(unsigned char *)((u16 *)screenbuffer->line[blit_cfg.src_sy] + 0),
(unsigned char *)((u16 *)Blit_Buffer_Double->line[blit_cfg.src_sy * 2] + 0),
MAX_RES_X+32, cur_drv->y_res, (MAX_RES_X+32)*4);
Blit_Fullscreen_Misc();
Blit_Fullscreen_CopyStretch(Blit_Buffer_Double, 2, 2);
}

por
void Blit_Fullscreen_HQ2X (void)
{
Blit_Fullscreen_Eagle();
}

This will make the HQ2X blit work as if it were Eagle.

I hope this can help.
 
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Sun Oct 03, 2010 11:09 am
Thanks for the info.
Does it works well? (under a 64-bits architecture, I mean)
  View user's profile Send private message Visit poster's website
jamf
  • Guest
Reply with quote
Post Posted: Sun Oct 03, 2010 4:23 pm
Hi Bock.

Bock wrote
Thanks for the info.
Does it works well? (under a 64-bits architecture, I mean)


ok, with sound (Linux Voxware) it is so slow that is impossible to test nothing.
With no sound It works really fine, but some systems do not work.
I have tested ColecoVision, SG1000, Master System and Game Gear, the first two works really fine except for the lack of sound. Master and GameGear do not work, I get only color screens and meka writes to console in a bucle:
Quote

video_c.c::Decode_Tile_C() is empty,
tiles will not be showing.


If you give me an e-mail, I will send you some screenshots.

Greetings
jamf
gelide.sf.net
 
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Sun Oct 03, 2010 6:25 pm
Hi, thanks for answering.

Since it's not really working well for now and the installing process isn't that simple (some of those packages aren't in the official repos), I'll wait a bit more to test again.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Mon Oct 04, 2010 3:34 am
The Decode_Tile_C function has to be created based on the X86 assembly version. It is a pretty trivial function to implement. You can give it a look or I will someday.
  View user's profile Send private message Visit poster's website
jamf
  • Guest
Reply with quote
Post Posted: Mon Oct 04, 2010 7:27 am
I installed those packages from the official Debian repos.

Sorry, I can help with asm, long timesince the last time I programmed in assembly.

Anyway if I have time, I will give it a try.

Greetings
jamf
gelide.sf.net
 
  • Joined: 05 Sep 2010
  • Posts: 6
Reply with quote
Post Posted: Mon Oct 04, 2010 10:46 pm
libseal-dev isn't.At least not for squeeze.
  View user's profile Send private message
jamf
  • Guest
Reply with quote
Post Posted: Tue Oct 05, 2010 1:40 pm
Otto wrote
libseal-dev isn't.At least not for squeeze.


You are right, It is in lenny:
packages.debian.org/lenny/libseal-dev

Greetings
jamf
 
  • Joined: 07 Aug 2007
  • Posts: 54
  • Location: Yach
Reply with quote
Post Posted: Sat Nov 20, 2010 3:06 pm
How about making another Meka release once all the Linux compilation issues have bee fixed?

Philipp
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 6317
  • Location: London, UK
Reply with quote
Post Posted: Sun Nov 21, 2010 1:14 am
I am taking patches if any (but wouldn't be able to test them for Linux).
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!