Page 3 of 4

Re: Linux Uzebox how-to

Posted: Tue Mar 24, 2015 3:22 am
by uze6666
Thanks! No more complaints about the bin dir missing. But, there was a ']' missing on the roms folder creation, on windows didn't create the folder but instead a file! Fixed. Now I need to know how to commit to GitHub!

Edit: Done!

Re: Linux Uzebox how-to

Posted: Thu Jun 04, 2015 5:40 pm
by Artcfox
I just built an UZEBOX kit that I purchased from Adafruit, and I ran into the same:

Code: Select all

SDEmulator.h:134:30: error: ‘memset’ was not declared in this scope
error when trying to compile the emulator on Linux.

The solution is to add:

Code: Select all

#include <string.h>
to the top of the SDEmulator.h file, because it is trying to use the memset function without including its header file.

Re: Linux Uzebox how-to

Posted: Fri Jun 05, 2015 2:18 am
by uze6666
The solution is to add:
CODE: SELECT ALL
#include <string.h>
to the top of the SDEmulator.h file, because it is trying to use the memset function without including its header file.
Alchemist reported the same error and was sure I had fixed it. My bad. I fixed that and commited.

Re: Linux Uzebox how-to

Posted: Sun Jun 14, 2015 7:52 am
by CunningFellow
OK - I am trying to compile everything under Debian 8.x so I can build a live CD that has everything someone needs for development on it (to help me teach people)

I just did a git clone this morning - so I assume I have the most up to date uzem source

Trying to compile uzem and I keep getting

'strlwr" was not declared in this scope

now from reading strlwr is not a standard part of C, but might be part of SDL.

If I just write my own local function

void strlwr(char* strToConvert){

then I can compile OK.

Does anyone else have this problem. Is it caused by some -ansi-strict switch or something I have done wrong with SDL ?

Re: Linux Uzebox how-to

Posted: Sun Jun 14, 2015 9:08 am
by CunningFellow
follow up.

All the HEX files for games compile fine under Linux, but Uzem seg faults even after I provide my replacement strlwr() function to get it to compile.

Re: Linux Uzebox how-to

Posted: Tue Jun 16, 2015 1:26 am
by uze6666
Interesting...is anybody else using Linux can reproduce the segfault?

Re: Linux Uzebox how-to

Posted: Tue Jun 16, 2015 1:40 am
by nicksen782
Artcfox wrote:I just built an UZEBOX kit that I purchased from Adafruit, and I ran into the same:

Code: Select all

SDEmulator.h:134:30: error: ‘memset’ was not declared in this scope
error when trying to compile the emulator on Linux.

The solution is to add:

Code: Select all

#include <string.h>
to the top of the SDEmulator.h file, because it is trying to use the memset function without including its header file.
Actually, I am using Linux for my environment. I applied the same above fix. I just had to make sure that avr-gcc and some other things were installed.

Re: Linux Uzebox how-to

Posted: Tue Jun 16, 2015 11:38 am
by CunningFellow
OK - did some printf debugging.

Found out the segfault came from the read diretory command in SDL being handed a NULL.

It was being handed a NULL because there is something wrong with the "get default directory from HEX file" functionality in the linux build.

Under windows if you dont specify

-sd <path>

then it takes the path from the HEX file.

On the linux build it just took the NAME of the hex file and then crashed non gracefully.

I can now get the emulator to work under Linux (by specifying "-sd ./") for T2K. However quite a few other games that are working under Win32 freeze.

Will keep investigating as I would love to make a live CD for people to just be able to boot and fire up eclipse and write a game (for a classroom / lesson)

Re: Linux Uzebox how-to

Posted: Tue Jun 16, 2015 11:48 am
by CunningFellow
in SDEmualto.cpp should the

Code: Select all

if(dir < 0) {
    return -1;
}
be

Code: Select all

if(dir == NULL) {
    return -1;
}
?

This at least makes uzem fail with an error message for me rather than a seg fault.

I know nothing about SDL though so it might not be the right thing to do.

BTW if I specify the relative path in the hex file name

uzem ./hexfile.hix

With the dot slash at the front it works OK and the opendir() command gets handed "./" if I just type

uzem hexfile.hex

then it passes "hexfile.hex" to opendir() and the SD Emulation fails.

Re: Linux Uzebox how-to

Posted: Wed Jun 17, 2015 4:32 am
by uze6666
I really like your live CD idea! :)

If you think you can fix that path thing to work both under windows and linux using conditionals, you can submit a patch (pull request) via GIT and I'll merge it.