![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on OSLIB - Exception - Syscall - FW 4.xx. Any working Samples? within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I have made a hard decision to move to Oslib but NOT A SINGLE sample works. Any one got a ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() QJ Gamer Gold
|
I have made a hard decision to move to Oslib but NOT A SINGLE sample works.
Any one got a simplistic working source that simply blits and image? ![]() I'm using MinPSPW with OSlib devpack.
__________________
Hardware Alarm Suite II v2.7 bld 1727 (1730 Latest)|Academic Aid 6.R769 w/ Motion|LocoRoco Motion Plugin|XmbController 1.61|More(32) TweakDISPLAY(NOW OUT!) | PaintOnXMB v1
|
|
|
|
|
|
#4 |
![]() ![]() Developer
|
here is the sample I have that compiles ok for 4.01 CFW
makefile Code:
TARGET = eboot OBJS = main.o INCDIR = sdk/include CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = sdk/lib LDFLAGS = LIBS = -losl -lmikmod -lpng -lz -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm PSP_FW_VERSION = 400 BUILD_PRX = 1 EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Simple OldSchool Library Sample PSP_EBOOT_ICON = ICON0.png PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak Code:
#include <oslib/oslib.h>
PSP_MODULE_INFO("OSLib Sample", 0x200, 1, 0);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
PSP_HEAP_SIZE_MAX();
int main(int argc, char* argv[])
{
OSL_IMAGE *imgCharacter;
OSL_SOUND *sndBgm;
//Initialization
oslInit(0); //The lib
oslInitGfx(OSL_PF_8888, 1); //Gfx
oslInitAudio(); //Sound
//Show the OSLib logo
oslShowSplashScreen(1);
//Quit directly if a file could not be found
oslSetQuitOnLoadFailure(1);
//Set bright pink as transparent for PNG files
oslSetTransparentColor(RGB(255, 0, 255));
{
//Image is swizzled for more speed (you should always swizzle your images, except if you are planning to modify them).
imgCharacter = oslLoadImageFilePNG("res/image.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_5551);
}
oslDisableTransparentColor();
//Load a MOD file
sndBgm = oslLoadSoundFileMOD("res/music.s3m", OSL_FMT_NONE);
//Loop the music
oslSetSoundLoop(sndBgm, 1);
oslPlaySound(sndBgm, 0);
//Set the rotation center to the center of the image
oslSetImageRotCenter(imgCharacter);
//Center the image on the screen
imgCharacter->x = OSL_SCREEN_WIDTH / 2;
imgCharacter->y = OSL_SCREEN_HEIGHT / 2;
//Triple size
imgCharacter->stretchX = imgCharacter->sizeX * 3;
imgCharacter->stretchY = imgCharacter->sizeY * 3;
//Crop the border (tricky hack to avoid weird borders when an image is zoomed and bilinear is turned on)
oslCorrectImageHalfBorder(imgCharacter);
while (!osl_quit)
{
//osl_skip indicates that frameskipping should be applied. Don't render anything when osl_skip is true!
if (!osl_skip) {
oslStartDrawing();
//The gradient blue background
oslDrawGradientRect(0, 0, 480, 272, RGB(0, 0, 128), RGB(0, 0, 128), RGB(0, 255, 255), RGB(0, 255, 255));
//Enable bilinear filtering for the image
oslSetBilinearFilter(1);
//Draw the image
oslDrawImage(imgCharacter);
//Disable it then
oslSetBilinearFilter(0);
//Draw some text
oslSetTextColor(RGB(255, 255, 255));
oslSetBkColor(RGBA(0, 0, 0, 128));
oslDrawString(0, 8, "Press triangle to quit");
oslSysBenchmarkDisplay();
oslEndDrawing();
}
oslReadKeys();
imgCharacter->angle++;
//Quit if triangle is pressed
if (osl_pad.pressed.triangle)
break;
oslEndFrame();
oslSyncFrame();
}
oslEndGfx();
oslQuit();
return 0;
}
__________________
www.xart.co.uk coreXlib, old school library. ColorSync Display Profiles for MacBook (LG LCD) & New MacBook (AUO LCD) Profile for LG LP133WX1 Profile for AUO B133EW01 |
|
|
|
|
|
#5 | |
![]() ![]() QJ Gamer Gold
|
Quote:
--- I am getting linking errors; Code:
psp-gcc -Isdk/include -I. -IC:/PSPSDK/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_V ERSION=400 -c -o main.o main.c psp-gcc -Isdk/include -I. -IC:/PSPSDK/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_V ERSION=400 -L. -LC:/PSPSDK/psp/sdk/lib -specs=C:/PSPSDK/psp/sdk/lib/prxspecs -W l,-q,-TC:/PSPSDK/psp/sdk/lib/linkfile.prx main.o C:/PSPSDK/psp/sdk/lib/prxexpo rts.o -losl -lmikmod -lpng -lz -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower - lpspgu -lpspaudiolib -lpspaudio -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -l pspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o eboot.elf C:/PSPSDK/psp/sdk/lib\libosl.a(mod.o): In function `oslLoadSoundFileMOD': audio/mod.c:232: undefined reference to `MikMod_LoadSong' audio/mod.c:220: undefined reference to `MD_RegisterDriver' C:/PSPSDK/psp/sdk/lib\libosl.a(mod.o): In function `my_error_handler': audio/mod.c:195: undefined reference to `_mm_errno' audio/mod.c:195: undefined reference to `_mm_errno' audio/mod.c:195: undefined reference to `_mm_critical' audio/mod.c:195: undefined reference to `_mm_critical' C:/PSPSDK/psp/sdk/lib\libosl.a(mod.o): In function `oslAudioCallback_DeleteSound _MOD': audio/mod.c:190: undefined reference to `MikMod_FreeSong' C:/PSPSDK/psp/sdk/lib\libosl.a(mod.o): In function `oslAudioCallback_AudioCallba ck_MOD': audio/mod.c:167: undefined reference to `md_mixshift' audio/mod.c:167: undefined reference to `md_mixshift' C:/PSPSDK/psp/sdk/lib\libosl.a(mod.o):(.data+0x58): undefined reference to `VC_V oiceReleaseSustain' collect2: ld returned 1 exit status make: *** [eboot.elf] Error 1 Last edited by Mr305; 08-17-2008 at 08:52 AM.. |
|
|
|
|
|
|
#6 |
![]() QJ Gamer Green
|
that example that xart posted comes with oslib210, its called SimpleSample. Your gonna need to download it yourself for the resources
edit you need to replace your libmikmod with the one that comes with the oslib archive |
|
|
|
|
|
#7 | |
![]() ![]() QJ Gamer Gold
|
Quote:
I was using the old sample one that comes with oslib 1.0.0. ![]() THank you all! ![]() --- What's 0x200; It's not user mode and still it works in 3.xx kernel |
|
|
|
|
![]() |
| Tags |
| 4xx , exception , oslib , samples , syscall , working |
| Thread Tools | |
|
|