Jump to content


Photo

Openxdk Status ...


  • Please log in to reply
9 replies to this topic

#1 KRAK_JOE

KRAK_JOE

    X-S Member

  • Members
  • Pip
  • 70 posts
  • Location:UK
  • Xbox Version:v1.6
  • 360 version:none

Posted 16 December 2008 - 11:09 PM

It's been a while, and I'm messing with OpenXDK, I see reports of people saying it's working, but in CVS source code it says it's //NOT WORKING YET ...

Can someone please clarify if SDL_Mixer is implemented properly, possibly show an example that you KNOW to work.

If it's not implemented yet, can someone please tell me if it's ever likely to be ??

#2 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 824 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 17 December 2008 - 11:39 AM

Well, about current status of OpenXDK :
Yes, it's stable and usable. But for SDL I don't know at all (I don't use it).
I wonder if anyone is currently working on openxdk (next gen is attracting!)

Backup of original site openxdk.org (it's gone now), thanks to maturion :
http://openxdk.maturion.de/
(the sourceforge link leads to an obsolete project page of course...)

Lastest stable version I know about (May 2007) :
http://minilgos.com/xbx/openxdk.zip
I've included a 480i patch from Zagon
(He was asking to get it included in official repository, but I'm not sure anyone with the rights is reading this forum anymore. I don't have the rights myself)

Last official change I've heard about was the one made by Carcharius for pbkit compatibility (May 2007). I don't plan to use SDL since I have pbkit for direct GPU low level access :
http://minilgos.com/...t/changelog.txt
(I don't know SDL at all... If I ever find time to work on sound I will probably handle sound at lowest level)

If anyone wants to create patches, I will be happy to include them in the archive I keep online.

EDIT:
I downloaded CVS source to be sure. No changes since 2006 (when it turned stable with the help of rpc's). Then, just one change in May 2007 for pbkit (no mandatory lock up of GPU Irq 3, so pbkit demos can use it).


Edited by openxdkman, 20 May 2015 - 06:55 PM.


#3 KRAK_JOE

KRAK_JOE

    X-S Member

  • Members
  • Pip
  • 70 posts
  • Location:UK
  • Xbox Version:v1.6
  • 360 version:none

Posted 17 December 2008 - 01:04 PM

So in short, sound still doesn't work ??

I'm not that familiar with SDL either, I've just run out of patience trying to link SDL_Mixer, I get endless _undefined it's getting on my tits.

I wouldn't have a clue how to implement sound myself without using SDL, and I can't get SDL_Mixer or SDL_Audio to work, not even a little bit ...

I guess I should give up ??

#4 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 824 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 22 December 2008 - 09:07 AM

Try this sound sample (I haven't retested it since 2006, but should work).
(you need chimes.wav 121252 bytes, PCM, 48Khz, 16 bits)

Makefile (you need true tabulations at beginning of indented lines) :
CODE

#
# update this variable to wherever you installed the OpenXDK libraries
#
PREFIX = /usr/local/openxdk

CC = gcc
CPP  = cpp
CXBE = $(PREFIX)/bin/cxbe

SDLFLAGS = -DENABLE_XBOX -DDISABLE_CDROM
CC_FLAGS = -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 $(SDLFLAGS)
INCLUDE  = -I$(PREFIX)/i386-pc-xbox/include -I$(PREFIX)/include -I$(PREFIX)/include/SDL

CLINK = -nostdlib
ALIGN = -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20
SHARED = -shared
ENTRYPOINT = -Wl,--entry,_WinMainCRTStartup
STRIP = -Wl,--strip-all
LD_FLAGS = $(CLINK) $(ALIGN) $(SHARED) $(ENTRYPOINT) $(STRIP)
LD_DIRS = -L$(PREFIX)/i386-pc-xbox/lib -L$(PREFIX)/lib
#LD_LIBS  = $(LD_DIRS) -lSDL -lopenxdk -lhal -lusb -lc -lxboxkrnl

LD_LIBS  = $(LD_DIRS) -lSDL -lm -lopenxdk -lhal -lc -lusb -lc -lxboxkrnl -lc -lhal -lxboxkrnl -lhal -lopenxdk -lc

all: default.exe

.c.o:
    $(CC) -c $< $(CC_FLAGS) $(INCLUDE)

default.exe: test.o
    $(CC) -o $@ $< $(LD_LIBS) $(LD_FLAGS)
    $(CXBE) -TITLE:"$@" -DUMPINFO:"default.cxbe" -OUT:"default.xbe" $@ > /dev/null

clean:
    rm -f *.o *.exe *.dll *.xbe *.cxbe




testAudio2.c :
CODE


#include <hal/xbox.h>
#include <hal/fileio.h>
#include <openxdk/debug.h>
#include <xboxkrnl/xboxkrnl.h>

#include "string.h"
#include "stdio.h"
#include <stdlib.h>

#include <hal/input.h>
#include <hal/audio.h>


//"D:" stands for ".", it seems.

void readFromFile(char *buffer, int size)
{
    int handle;
    //"d:/" is considered as "./"
    XCreateFile(&handle, "d:/chimes.wav", GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL);
    int newLocation, read;
    XSetFilePointer(handle, 0x3A*0+64, &newLocation, FILE_BEGIN);
    XReadFile(handle, buffer, size, &read);
    XCloseHandle(handle);
}

#define BUF_SIZE 4096
char *current=NULL;
int   left=0;
void mycallback(void *pac97device, void *data)
{
    if (left==0) return;
    if (current==NULL) return;

    if (left>BUF_SIZE)
    {
        XAudioProvideSamples(current, BUF_SIZE, false);
        current += BUF_SIZE;
        left -= BUF_SIZE;
    }
    else
    {
        XAudioProvideSamples(current, left, true);
        current = NULL;
        left=0;
    }
}

void initplayback()
{
    int bufferSize;
    char *buffer;

    bufferSize = 121188; //chimes.wav=64 bytes of header and 121188 bytes of data
    buffer = (char *)malloc(bufferSize);
    current=buffer;
    left=bufferSize;

    debugPrint("Reading data\n");
    readFromFile(buffer, bufferSize);
    debugPrint("Init\n");
    XAudioInit(16, 2, mycallback, NULL);
    // lets give it something to play...
    XAudioProvideSamples(current, BUF_SIZE, false); current += BUF_SIZE; left -= BUF_SIZE;
    debugPrint("Playing\n");
    // and now play...
    XAudioPlay();
}




void XBoxStartup()
{
    XKEYBOARD_STROKE xk;
    int i;

    int initplaybackdone=0;

    XInput_Init();

    debugPrint("Hit B to exit program. Hit repeatedly A. Y starts playback.\n");

    while (!done)
    {
        //Let's check for joypad events    
        //(assuming tester is hitting A button all the time)    

        XInput_GetEvents();

        for(i=0; i<4; i++)
        {
            if(g_Pads[i].PressedButtons.ucAnalogButtons[XPAD_A])
                debugPrint("Pressed A on Pad %d - %d\n", i+1, g_Pads[i].CurrentButtons.ucAnalogButtons[XPAD_A]);

            if(g_Pads[i].PressedButtons.ucAnalogButtons[XPAD_B])
            {
                debugPrint("Pressed B on Pad %d - %d\n", i+1, g_Pads[i].CurrentButtons.ucAnalogButtons[XPAD_B]);
                done=1;
            }

            if(g_Pads[i].PressedButtons.ucAnalogButtons[XPAD_X])
                debugPrint("Pressed X on Pad %d - %d\n", i+1, g_Pads[i].CurrentButtons.ucAnalogButtons[XPAD_X]);

            if(g_Pads[i].PressedButtons.ucAnalogButtons[XPAD_Y])
            {
                debugPrint("Pressed Y on Pad %d - %d\n", i+1, g_Pads[i].CurrentButtons.ucAnalogButtons[XPAD_Y]);
                if (!initplaybackdone)
                {
                    initplayback();
                    initplaybackdone=1;
                }
            }
        }

        XSleep(40);
    }
  
    debugPrint("End of test. Rebooting...\n");
    XSleep(1000);
    XReboot();
}


Edited by openxdkman, 22 December 2008 - 09:50 AM.


#5 Maturion

Maturion

    X-S Member

  • Members
  • Pip
  • 131 posts
  • Location:Munich, Germany
  • Xbox Version:v1.1
  • 360 version:v3.0 (falcon)

Posted 22 December 2008 - 12:05 PM

I think Carcharius is still around. openxdkman mentioned above that he has the permissions to upload files to the OpenXDK CVS and Caustik, who founded the whole project is also still there. (At least he posted an update to his Cxbx blog some days ago - http://www.caustik.com/cxbx).

I am not sure, but I think it would be the best to start a new sourceforge project and to upload all patches that were made in the last years to this new project.

Edited by Maturion, 22 December 2008 - 12:07 PM.


#6 Maturion

Maturion

    X-S Member

  • Members
  • Pip
  • 131 posts
  • Location:Munich, Germany
  • Xbox Version:v1.1
  • 360 version:v3.0 (falcon)

Posted 18 February 2009 - 10:56 PM

I just want to inform you that I am an official project administrator over at the OpenXDK sourceforge project now. If you have any patches and/or examples that you would like to have added to the sourceforge page, just let me know.

Kudos go to edwardaux aka Craig for setting me up as a project admin.

#7 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 824 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 20 February 2009 - 10:26 AM

Great News!

Please grab Zagon's patch, that allows 480i display, from the Zagon directory in the May 2007 pre-compiled archive (link is at top of this thread)

Feel free to add pbkit module and samples if you like (as separate samples).

My job is still eating up all my free time, so I'm a bit out of homebrew projects at the moment... (I barely manage to take the time to follow up progresses of homebrew possibilities on different platforms and keep my modified consoles in good shapes...)

Edited by openxdkman, 20 February 2009 - 10:31 AM.


#8 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 824 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 20 February 2009 - 10:41 AM

Oh, I forgot! Please add in the official source depository the AFL network packet driver & sample.
That should help to build up a future tcp/ip stack.
(you can retrieve link from the changelog.txt file at top of thread)

I predict all my archives to be gone this summer (my ISP as been purchased by another one and will plug out servers this summer). I won't reupload those that are hosted in official repository.

Edited by openxdkman, 20 February 2009 - 10:44 AM.


#9 Maturion

Maturion

    X-S Member

  • Members
  • Pip
  • 131 posts
  • Location:Munich, Germany
  • Xbox Version:v1.1
  • 360 version:v3.0 (falcon)

Posted 20 February 2009 - 05:43 PM

All requested files have been added.

#10 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 824 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 22 February 2009 - 10:37 AM

Many thanks!

For those who wonder how to download :
sourceforge.net (not .com)
search for 'openxdk'
new fresh downloads are ready there behind the green button

Thanks a lot for putting pbkit there. I feel relieved.

In the full package list, click the first column instead of the last column (download) to really see all existing packages.

Edited by openxdkman, 22 February 2009 - 10:41 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users