Emulator build instructions

The Uzebox now have a fully functional emulator! Download and discuss it here.
Post Reply
User avatar
etamme
Posts: 11
Joined: Mon Dec 22, 2008 9:42 pm
Location: New York, NY USA
Contact:

Emulator build instructions

Post by etamme »

How to build the bloody thing!
User avatar
etamme
Posts: 11
Joined: Mon Dec 22, 2008 9:42 pm
Location: New York, NY USA
Contact:

Linux build instructions

Post by etamme »

1. Prerequisites: libsdl-dev and a g++ toolchain

2. Download the source from one of these forum threads (not sure where else to get it)

3. Modify the SDL include line (was line 36 for me with the zip i got )

from

Code: Select all

#include "SDL.h"
to

Code: Select all

#include "SDL/SDL.h"
3. g++ -O3 -lSDL avr8.cpp -o uzem
Last edited by etamme on Tue Dec 23, 2008 1:42 am, edited 1 time in total.
DavidEtherton
Posts: 252
Joined: Tue Dec 02, 2008 12:38 am
Location: Carlsbad, California (USA)

Re: Emulator build instructions

Post by DavidEtherton »

I'm not sure modifying the source code is necessary -- here's how I build it on my mac: (note the -I directive)

gcc -O3 -DGUI=1 -I /usr/local/include/SDL avr8.cpp -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa -lstdc++ -o uzem
Telthos
Posts: 14
Joined: Sat Mar 14, 2009 5:57 am
Location: Orlando, FL

Re: Emulator build instructions

Post by Telthos »

Hey guys..I am getting an error when I run the g++ -O3 -lSDL avr8.cpp -o uzem part. Here is what I get (also I'm running ubuntu 8.10 and my SDL/gcc have been updated):

arlan@arlan-dev:/usr/include$ sudo g++ -O3 -lSDL avr8.cpp -o uzem
avr8.cpp: In member function ‘u8 avr8::exec(bool, bool)’:
avr8.cpp:1398: warning: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘long unsigned int’

Any ideas on what I may be doing wrong?

~Telthos
DavidEtherton
Posts: 252
Joined: Tue Dec 02, 2008 12:38 am
Location: Carlsbad, California (USA)

Re: Emulator build instructions

Post by DavidEtherton »

Telthos wrote:Hey guys..I am getting an error when I run the g++ -O3 -lSDL avr8.cpp -o uzem part. Here is what I get (also I'm running ubuntu 8.10 and my SDL/gcc have been updated):

arlan@arlan-dev:/usr/include$ sudo g++ -O3 -lSDL avr8.cpp -o uzem
avr8.cpp: In member function ‘u8 avr8::exec(bool, bool)’:
avr8.cpp:1398: warning: format ‘%u’ expects type ‘unsigned int’, but argument 2 has type ‘long unsigned int’

Any ideas on what I may be doing wrong?

~Telthos
I'm curious what platform you're on? Something other than x86? The warning is harmless -- u32 is typedef'd to unsigned long so strictly speaking the format specifier should be %lu and not %u. Or u32 should be typedef'd to just unsigned.

-Dave

ps. I thought the forums were totally dead for weeks, and finally noticed that "automatic login" had been turned off so I was never seeing "new posts o' red"
Last edited by DavidEtherton on Tue Mar 31, 2009 4:45 am, edited 1 time in total.
tim1724
Posts: 30
Joined: Mon Dec 08, 2008 8:38 pm

Re: Emulator build instructions

Post by tim1724 »

DavidEtherton wrote:ps. I thought the forums were totally dead for weeks, and finally noticed that "automatic login" had been turned off so I was never seeing "new posts o' red"
hehe, I had the same problem.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Emulator build instructions

Post by uze6666 »

Yeah, it also happened to me! I really don't know what happened, some glitch with phpBB....Perhaps I should put a warning in the header to check your login!

Uze
User avatar
pragma
Posts: 175
Joined: Sat Sep 20, 2008 2:16 am
Location: Washington, DC

Re: Emulator build instructions

Post by pragma »

uze6666 wrote:Perhaps I should put a warning in the header to check your login!
I second that. For a little while, I thought the entire community died on it's feet.
User avatar
pragma
Posts: 175
Joined: Sat Sep 20, 2008 2:16 am
Location: Washington, DC

A Makefile

Post by pragma »

My workspace has the SDL library release installed under minGW in Windows. If this sounds like your setup, feel free to give this makefile a shot. YMMV.

NOTE: you'll have to replace the indentations on each line with TAB characters. BBCode keeps replacing them with spaces.

Code: Select all

TARGET = uzem.exe
GCCBASE = c:\minGW

CPPFLAGS = -O3 -I$(GCCBASE)\include
CPPFLAGS += -I$(GCCBASE)/include/SDL -D_GNU_SOURCE=1 -DGUI=1
LFLAGS += -L$(GCCBASE)/lib -lmingw32 -lSDLmain -lSDL

OBJECTS = avr8.o

$(OBJECTS): %.o: %.cpp
	g++ -c $< -o $@ $(CPPFLAGS)

$(TARGET): $(OBJECTS)
	g++ $(OBJECTS) -o $(TARGET) $(LFLAGS)

all: $(TARGET)

run: clean all
	$(TARGET)

debug: clean all
	$(TARGET) test.hex

clean:
	-@rm $(OBJECTS) $(TARGET)
Post Reply