Jump to content


Photo

Openxdk Patches


  • Please log in to reply
7 replies to this topic

#1 friedgold

friedgold

    X-S Expert

  • Moderator
  • PipPipPip
  • 667 posts
  • Location:Bristol, England
  • Xbox Version:v1.1
  • 360 version:none

Posted 08 July 2006 - 11:22 AM

Posting here because this seems to be the best place to get the attention of OpenXDK devs. Also other developers using OpenXDK may find this helpful. Anyway would you consider the following patches for OpenXDK. All are made with diff -u against cvs HEAD.

Improved sdlvideo driver - Still uses direct to framebuffer writes but tries to avoid any necessary conversions between different colour formats. Blitting to the screen is about 3 or 4 times quicker than before for me.
sdl_mixer patch - SDL_mixer doesn't build correctly in CVS causing the OpenXDK build to fail. Patching SDL_mixer to remove a single #include solves this.
Remove bool typedef - xboxkrnl/type.h typedefs int as bool. This isn't needed anywhere else (OpenXDK builds fine without this) and it causes errors when compiling c++ programs with OpenXDK (redeclaration of built in type).
time() and gettimeofday() syscalls

Thanks

#2 friedgold

friedgold

    X-S Expert

  • Moderator
  • PipPipPip
  • 667 posts
  • Location:Bristol, England
  • Xbox Version:v1.1
  • 360 version:none

Posted 09 July 2006 - 12:15 AM

Also

HalReadSMCTrayState kernel export

#3 mokda

mokda

    X-S Young Member

  • Members
  • Pip
  • 31 posts

Posted 10 July 2006 - 12:11 AM

Thanks Friedgold.

The type redef fix solved one of my compiling problems.

I'm still getting linker issues that look like this:

C:\Dev-Cpp\XboxProj\main.o(.text+0x46) In function `XBoxStartup':
[Linker error] undefined reference to `XSleep'
[Linker error] undefined reference to `XReboot'

C:\cygwin\usr\local\openxdk\i386-pc-xbox\lib\libc.a(syscalls.o)(.text+0x19d) In function `execve':
[Linker error] undefined reference to `XLaunchXBE'

And so on like that...most of the linker problems are complaining about libc.a.

Do you know how to fix this (what am I missing)? My code is same as ColdReader's short tutorial:

extern "C"{
#include <hal/xbox.h>
#include <openxdk/debug.h>
#include <xboxkrnl/xboxkrnl.h>
}

extern "C" void XBoxStartup(){
{
debugPrint("hi there\n");
debugPrint("string=%s\n", "string");
debugPrint("number=%d\n", 123);
XSleep(10000);
XReboot();
}
}



#4 d0wnlab

d0wnlab

    X-S Expert

  • Moderator
  • PipPipPip
  • 557 posts
  • Xbox Version:unk

Posted 10 July 2006 - 12:53 AM

mokda: can you post your makefile? That will be where linker problems will be solved.

#5 mokda

mokda

    X-S Young Member

  • Members
  • Pip
  • 31 posts

Posted 10 July 2006 - 01:14 AM

I probably should have mentioned I am trying to use BSC++ (Dev C++). Here is the makefile that Dev C++ is spitting out for me:

# Project: Saja
# Makefile created by Dev-C++ 4.9.9.2

CPP = g++.exe
CC = gcc.exe
WINDRES = windres.exe
RES =
OBJ = main.o $(RES)
LINKOBJ = main.o $(RES)
LIBS = -L"C:/Dev-Cpp/lib" -L"C:/cygwin/usr/local/openxdk/lib" -L"C:/cygwin/usr/local/openxdk/i386-pc-xbox/lib" -nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20 -shared -Wl,--entry,_WinMainCRTStartup -Wl,--strip-all -lstdc++ -lSDL -lopenxdk -lhal -lc -lhal -lusb -lc -lxboxkrnl -mwindows
INCS = -I"C:/Dev-Cpp/include" -I"C:/cygwin/usr/local/openxdk/include" -I"C:/cygwin/usr/local/openxdk/i386-pc-xbox/include" -I"C:/cygwin/usr/local/openxdk/include/SDL"
CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/cygwin/usr/local/openxdk/include" -I"C:/cygwin/usr/local/openxdk/i386-pc-xbox/include" -I"C:/cygwin/usr/local/openxdk/include/SDL"
BIN = Saja.exe
CXXFLAGS = $(CXXINCS) -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM
CFLAGS = $(INCS) -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -DENABLE_XBOX -DDISABLE_CDROM
RM = rm -f

.PHONY: all all-before all-after clean clean-custom

all: all-before Saja.exe all-after


clean: clean-custom
${RM} $(OBJ) $(BIN)

$(BIN): $(OBJ)
$(CPP) $(LINKOBJ) -o "Saja.exe" $(LIBS)

main.o: main.cpp
$(CPP) -c main.cpp -o main.o $(CXXFLAGS)


#6 d0wnlab

d0wnlab

    X-S Expert

  • Moderator
  • PipPipPip
  • 557 posts
  • Xbox Version:unk

Posted 10 July 2006 - 01:42 AM

get that '-L"C:/Dev-Cpp/lib" ' out of there, first of all, then see what happens. There's no libraries in that directory that you want to link to, and right now it's probably using them instead of the openxdk libs. Since you're using a generated makefile I suppose you'll have to edit that in the build settings somewhere - someone familiar with dev-cpp should have a better idea than myself.



#7 mokda

mokda

    X-S Young Member

  • Members
  • Pip
  • 31 posts

Posted 10 July 2006 - 02:31 AM

d0wnlab, muchos gracias!

I removed C:\Dev-cpp\lib from my libraries in the Tools->Compiler Options section (libraries tab) and it did the trick!

I'll follow up this point of help on the forum thread that is specifically for this issue.

Thanks again!

#8 elupus

elupus

    X-S X-perience

  • Members
  • PipPip
  • 480 posts

Posted 17 July 2006 - 01:05 PM

Okey, i small request from xbmc devs for the openxdk devs out there. remove the automatic video init on startup, that should be up to starting application. causes double video init in our xbe shortcut.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users