Help with cdvdfs/gsKit

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Help with cdvdfs/gsKit

Post by methos3 »

Hello! I need help again :(
I was working on a little program to browse files and folders of any cd/dvd, used the libcdvdfs and gskit to display everything.
I tested the program on my pc using an emulator(I made a emulator-friendly version :p, used the GS_PERSISTENT mode, refreshing the screen only with a button press) , and it seemed to work.
I tested the same version that worked with the emulator on my SCPH-70001 ps2, and, before anything ,the screen crashed before anything showed up.
The controller seems to work, because the analog led becomes locked.
I tryed a non-emulator version, using the GS_ONESHOT mode, but tha screen crached in the same way :(
Some parts of the code I copied from samples, but the file browser itself was written by me.

Look at the code: (may look a little confusing)

Code: Select all

#include <tamtypes.h>
#include <stdio.h>
#include <kernel.h>
#include <fileio.h>
#include <malloc.h>
#include <debug.h>
#include <string.h>
#include <iopcontrol.h>
#include <iopheap.h>
#include <libpad.h>

#include "gsKit.h"
#include "dmaKit.h"

#include "irx/cdvd.h"
#include "irx/freesio2.c"
#include "irx/usbd.c"
#include "irx/freepad.c"
#include "irx/usb_mass.c" // for duture mass&#58; compatibility.

#include <sifrpc.h>
#include <loadfile.h>

#include "cdvd.h"
#include "cdvd_rpc.h"

#define ENTRIES 30

char* padTypeStr&#91;&#93; = &#123;	"Unsupported controller", "Mouse", "Nejicon",
						"Konami Gun", "Digital", "Analog", "Namco Gun",
						"DualShock"&#125;;

    u32 port;
	struct padButtonStatus buttons;
	int dualshock&#91;2&#93;;
	int acts&#91;2&#93;;





static char *padBuf&#91;2&#93;;
u32 portConnected&#91;2&#93;;
u32 paddata&#91;2&#93;;
u32 old_pad&#91;2&#93;;
u32 new_pad&#91;2&#93;;
u8 actDirect&#91;2&#93;&#91;6&#93; = &#123; &#123;0,0,0,0,0,0&#125;, &#123;0,0,0,0,0,0&#125;&#125;;

u64 White, Black, BlackFont, WhiteFont, RedFont, GreenFont, BlueFont, BlueTrans, RedTrans, GreenTrans, WhiteTrans;
	GSGLOBAL *gsGlobal;

	GSFONT *gsFont;

void initScreen&#40;&#41;&#123;
gsGlobal = gsKit_init_global&#40;GS_MODE_PAL&#41;;
    gsFont = gsKit_init_font&#40;GSKIT_FTYPE_FONTM, NULL&#41;;
    dmaKit_init&#40;D_CTRL_RELE_OFF, D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
		    D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF&#41;;


	dmaKit_chan_init&#40;DMA_CHANNEL_GIF&#41;;
	dmaKit_chan_init&#40;DMA_CHANNEL_FROMSPR&#41;;
	dmaKit_chan_init&#40;DMA_CHANNEL_TOSPR&#41;;

	White = GS_SETREG_RGBAQ&#40;0xFF,0xFF,0xFF,0x00,0x00&#41;;
	Black = GS_SETREG_RGBAQ&#40;0x00,0x00,0x00,0x00,0x00&#41;;




	BlueTrans = GS_SETREG_RGBAQ&#40;0x00,0x00,0xFF,0x40,0x00&#41;;
	RedTrans = GS_SETREG_RGBAQ&#40;0xFF,0x00,0x00,0x60,0x00&#41;;
	GreenTrans = GS_SETREG_RGBAQ&#40;0x00,0xFF,0x00,0x50,0x00&#41;;
	WhiteTrans = GS_SETREG_RGBAQ&#40;0xFF,0xFF,0xFF,0x50,0x00&#41;;
	WhiteFont = GS_SETREG_RGBAQ&#40;0x80,0x80,0x80,0x80,0x00&#41;;
	BlackFont = GS_SETREG_RGBAQ&#40;0x00,0x00,0x00,0x80,0x00&#41;;
	RedFont = GS_SETREG_RGBAQ&#40;0xFF,0x80,0x80,0x80,0x00&#41;;
	GreenFont = GS_SETREG_RGBAQ&#40;0x80,0xFF,0x80,0x80,0x00&#41;;
	BlueFont = GS_SETREG_RGBAQ&#40;0x80,0x80,0xFF,0x80,0x00&#41;;

	gsKit_init_screen&#40;gsGlobal&#41;;

	gsKit_mode_switch&#40;gsGlobal, GS_PERSISTENT&#41;;

	gsKit_clear&#40;gsGlobal, White&#41;;

	gsKit_font_upload&#40;gsGlobal, gsFont&#41;;

	gsKit_clear&#40;gsGlobal, Black&#41;;
	gsKit_queue_exec&#40;gsGlobal&#41;;

    gsKit_sync_flip&#40;gsGlobal&#41;;
    gsKit_mode_switch&#40;gsGlobal, GS_ONESHOT&#41;;






&#125;

void resetIop&#40;&#41;&#123;
    printf&#40;"Resetando IOP...\n"&#41;;
    SifExitIopHeap&#40;&#41;;
	SifLoadFileExit&#40;&#41;;
	SifExitRpc&#40;&#41;;
    if &#40;SifIopReset&#40;"rom0&#58;UDNL rom0&#58;EELOADCNF",0&#41;&#41; printf&#40;"IOP RESETADO\n"&#41;;
    printf&#40;"Aguarde ate a sincronizacao do IOP...\n"&#41;;
    while &#40;SifIopSync&#40;&#41;&#41;;
    printf&#40;"IOP Sincronizado!\n"&#41;;
&#125;

void loadmodules&#40;int free&#41;
&#123;
    s32 ret;


    SifExecModuleBuffer&#40;freesio2, size_freesio2, 0, NULL, &ret&#41;;
    if&#40;ret<0&#41; printf&#40;"Erro ao carregar modulo!!\n"&#41;;
    SifExecModuleBuffer&#40;freepad, size_freepad, 0, NULL, &ret&#41;;
    if&#40;ret<0&#41; printf&#40;"Erro ao carregar modulo!!\n"&#41;;
    SifExecModuleBuffer&#40;usbd, size_usbd, 0, NULL, &ret&#41;;
    if&#40;ret<0&#41; printf&#40;"Erro ao carregar modulo!!\n"&#41;;
    SifExecModuleBuffer&#40;usb_mass, size_usb_mass, 0, NULL, &ret&#41;;
    if&#40;ret<0&#41; printf&#40;"Erro ao carregar modulo!!\n"&#41;;



&#125;

void padWait&#40;int port&#41;
&#123;
	/* Wait for request to complete. */
	while&#40;padGetReqState&#40;port, 0&#41; != PAD_RSTAT_COMPLETE&#41;;
		//wait_vsync&#40;&#41;;

	/* Wait for pad to be stable. */
	while&#40;padGetState&#40;port, 0&#41; != PAD_STATE_STABLE&#41;;
		//wait_vsync&#40;&#41;;
&#125;


int getCdvdPath&#40;char* path&#41;&#123;

    static struct TocEntry* TocEntryList;
    int selected = 0, liststart = 0, listend = liststart + ENTRIES;
    int y=0;
    int request = 1;
    int printrequest = 1; // For the emulator version
    char pathname&#91;128&#93; = "/";
    int numfiles, filenum, end = 0;
    TocEntryList = memalign&#40;64,1000*sizeof&#40;struct TocEntry&#41;&#41;;
    char EntryList&#91;1000&#93;&#91;64&#93;;
    while&#40;!end&#41;&#123;
        if&#40;selected<liststart&#41; liststart--;

    if &#40;selected>=listend&#41; liststart++;
    listend = liststart + ENTRIES;
    if&#40;request&#41;&#123;
    numfiles = CDVD_GetDir&#40;pathname, NULL, CDVD_GET_FILES_AND_DIRS, TocEntryList,1000, pathname&#41;;
    request=0;
    &#125;



    if&#40;printrequest&#41;&#123;


    for&#40;filenum=0; filenum < numfiles; filenum++&#41;
    &#123;

        if&#40;TocEntryList&#91;filenum&#93;.fileProperties & 0x02&#41;&#123;
            if&#40;filenum == selected&#41; sprintf&#40;EntryList&#91;filenum&#93;, "/%s*", TocEntryList&#91;filenum&#93;.filename&#41;;
            else sprintf&#40;EntryList&#91;filenum&#93;, "/%s", TocEntryList&#91;filenum&#93;.filename&#41;;
        &#125;
        else &#123;
            if&#40;filenum == selected&#41; sprintf&#40;EntryList&#91;filenum&#93;, "%s*", TocEntryList&#91;filenum&#93;.filename&#41;;
            else sprintf&#40;EntryList&#91;filenum&#93;, "%s", TocEntryList&#91;filenum&#93;.filename&#41;;
        &#125;


    &#125;

    y=20;
    char mensagem&#91;64&#93;;
    sprintf&#40;mensagem, "Número de arquivos e pastas&#58; %d", numfiles&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 0, y, 5, 0.5f,  WhiteFont, mensagem&#41;;
    y+=12;
    for&#40;filenum = liststart; filenum<listend && filenum<numfiles; filenum++&#41;
    &#123;
        gsKit_font_print_scaled&#40;gsGlobal, gsFont, 0, y, 5, 0.5f,  WhiteFont, EntryList&#91;filenum&#93;&#41;;
        y+=12;

    &#125;
    /* For the emulator version
    gsKit_queue_exec&#40;gsGlobal&#41;;
        gsKit_sync_flip&#40;gsGlobal&#41;;
        printrequest = 0;*/
    &#125;


    if&#40;1&#41;&#123;
			s32 state = padGetState&#40;port, 0&#41;;

			if&#40;&#40;state == PAD_STATE_STABLE&#41; && &#40;portConnected&#91;port&#93; == 0&#41;&#41;
			&#123;
				u32 i;
				u8 mTable&#91;8&#93;;
				u32 ModeCurId;
				u32 ModeCurOffs;
				u32 ModeCurExId;
				u32 ModeTableNum = padInfoMode&#40;port, 0, PAD_MODETABLE, -1&#41;;

				printf&#40;"Controller &#40;%i&#41; connected\n", port&#41;;

				/* Check if dualshock and if so, activate analog mode */
				for&#40;i = 0; i < ModeTableNum; i++&#41;
					mTable&#91;i&#93; = padInfoMode&#40;port, 0, PAD_MODETABLE, i&#41;;

				/* Works for dualshock2 */
				if&#40;&#40;mTable&#91;0&#93; == 4&#41; && &#40;mTable&#91;1&#93; == 7&#41; && &#40;ModeTableNum == 2&#41;&#41;
					dualshock&#91;port&#93; = 1;

				/* Active and lock analog mode */
				if&#40;dualshock&#91;port&#93; == 1&#41;
				&#123;
					padSetMainMode&#40;port, 0, PAD_MMODE_DUALSHOCK, PAD_MMODE_LOCK&#41;;
					padWait&#40;port&#41;;
				&#125;

				ModeCurId = padInfoMode&#40;port, 0, PAD_MODECURID, 0&#41;;
				ModeCurOffs = padInfoMode&#40;port, 0, PAD_MODECUROFFS, 0&#41;;
				ModeCurExId = padInfoMode&#40;port, 0, PAD_MODECUREXID, 0&#41;;
				ModeTableNum = padInfoMode&#40;port, 0, PAD_MODETABLE, -1&#41;;
				acts&#91;port&#93; = padInfoAct&#40;port, 0, -1, 0&#41;;

				printf&#40;"  ModeCurId      &#58; %i &#40;%s&#41;\n", &#40;int&#41;ModeCurId, padTypeStr&#91;ModeCurId&#93;&#41;;
				printf&#40;"  ModeCurExId    &#58; %i\n", &#40;int&#41;ModeCurExId&#41;;
				printf&#40;"  ModeTable      &#58; "&#41;;

				for&#40;i = 0; i < ModeTableNum; i++&#41;
				&#123;
					mTable&#91;i&#93; = padInfoMode&#40;port, 0, PAD_MODETABLE, i&#41;;
					printf&#40;"%i ", &#40;int&#41;mTable&#91;i&#93;&#41;;
				&#125;

				printf&#40;"\n"&#41;;
				printf&#40;"  ModeTableNum   &#58; %i\n", &#40;int&#41;ModeTableNum&#41;;
				printf&#40;"  ModeCurOffs    &#58; %i\n", &#40;int&#41;ModeCurOffs&#41;;
				printf&#40;"  NumOfAct       &#58; %i\n", &#40;int&#41;acts&#91;port&#93;&#41;;
				printf&#40;"  PressMode      &#58; %i\n", &#40;int&#41;padInfoPressMode&#40;port, 0&#41;&#41;;


				if&#40;acts&#91;port&#93; > 0&#41;
				&#123;
					u8 actAlign&#91;6&#93; = &#123; 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF&#125;;
					u32 i;

					/* Set offsets for motor parameters for SetActDirect. */
					for&#40;i=0; i < acts&#91;port&#93;; i++&#41;
						actAlign&#91;i&#93; = i;

					padSetActAlign&#40;port, 0, actAlign&#41;;
					padWait&#40;port&#41;;
				&#125;

				printf&#40;"  EnterPressMode &#58; %i\n", &#40;int&#41;padEnterPressMode&#40;port, 0&#41;&#41;;
				padWait&#40;port&#41;;

				printf&#40;"Ready\n"&#41;;

				portConnected&#91;port&#93; = 1;
			&#125;

			if&#40;&#40;state == PAD_STATE_DISCONN&#41; && &#40;portConnected&#91;port&#93; == 1&#41;&#41;
			&#123;
				printf&#40;"Controller &#40;%i&#41; disconnected\n", port&#41;;
				portConnected&#91;port&#93; = 0;
			&#125;

			if&#40;portConnected&#91;port&#93; == 1&#41;
			&#123;
				s32 ret = padRead&#40;port, 0, &buttons&#41;;

				if&#40;ret != 0&#41;
				&#123;
					paddata&#91;port&#93; = 0xffff ^ buttons.btns;

					new_pad&#91;port&#93; = paddata&#91;port&#93; & ~old_pad&#91;port&#93;;
					old_pad&#91;port&#93; = paddata&#91;port&#93;;

                        if&#40;new_pad&#91;0&#93; & PAD_UP&#41;&#123;
                            printrequest = 1;
                            if&#40;selected>0&#41; selected--;
                        &#125;
    if&#40;new_pad&#91;0&#93; & PAD_DOWN&#41;&#123;
        printrequest = 1;
        if&#40;selected<numfiles-1&#41; selected++;
    &#125;
    if&#40;new_pad&#91;0&#93; & PAD_RIGHT&#41;
    &#123;


        if&#40;EntryList&#91;selected&#93;&#91;0&#93; == '/'&#41;&#123;
        request = 1; printrequest = 1;
        strncat&#40;pathname, TocEntryList&#91;selected&#93;.filename, 32&#41;;
        selected = 0;
        &#125;
        else&#123;

            if&#40;strlen&#40;pathname&#41; > 1&#41;
            strncat&#40;pathname, "/", 32&#41;;
            strncat&#40;pathname, TocEntryList&#91;selected&#93;.filename, 32&#41;;
            sprintf&#40;path, "cdfs&#58;%s", pathname&#41;;




            return 1;
        &#125;



    &#125;
    if&#40;new_pad&#91;0&#93; & PAD_LEFT&#41;
    &#123;
        request = 1; printrequest = 1;
        int position = strlen&#40;pathname&#41;;
        while&#40;pathname&#91;position&#93; != '/'&#41; position--;
        memset&#40;&pathname&#91;position&#93;, 0, strlen&#40;pathname&#41;&#41;;
        if&#40;strlen&#40;pathname&#41; == 1&#41;
            end = 1;


    &#125;

					&#125;

			&#125;
		&#125;
		gsKit_queue_exec&#40;gsGlobal&#41;;
        gsKit_sync_flip&#40;gsGlobal&#41;;

    &#125; //end



    return 0;
&#125;

int main&#40;&#41;&#123;
    resetIop&#40;&#41;;


    SifInitRpc&#40;0&#41;;
    s32 rv;

    SifExecModuleBuffer&#40;cdvd, size_cdvd, 0, NULL, &rv&#41;;
    loadmodules&#40;1&#41;;

    padInit&#40;0&#41;;
    padBuf&#91;0&#93; = memalign&#40;64, 256&#41;;
	padBuf&#91;1&#93; = memalign&#40;64, 256&#41;;

	old_pad&#91;0&#93; = 0;
	old_pad&#91;1&#93; = 0;

	portConnected&#91;0&#93; = 0;
	portConnected&#91;1&#93; = 0;

	dualshock&#91;0&#93; = 0;
	dualshock&#91;1&#93; = 0;

	acts&#91;0&#93; = 0;
	acts&#91;1&#93; = 0;

	padPortOpen&#40;0, 0, padBuf&#91;0&#93;&#41;;
	padPortOpen&#40;1, 0, padBuf&#91;1&#93;&#41;;
	initScreen&#40;&#41;;
    CDVD_Init&#40;&#41;;
    CDVD_DiskReady&#40;CdBlock&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 350, 80, 5, 0.5f, WhiteFont, "Teste"&#41;; //For testing purposes
    gsKit_mode_switch&#40;gsGlobal, GS_ONESHOT&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 20, 20, 5, 0.5f, WhiteFont, "Teste2"&#41;;
    gsKit_queue_exec&#40;gsGlobal&#41;;
    gsKit_sync_flip&#40;gsGlobal&#41;;


    char teste&#91;64&#93;;
    if&#40;getCdvdPath&#40;teste&#41;&#41;&#123;//if 1 show part of the file on the screen
        gsKit_mode_switch&#40;gsGlobal, GS_PERSISTENT&#41;;


        gsKit_font_print_scaled&#40;gsGlobal, gsFont, 50, 350, 5, 0.5f, WhiteFont, "O usuario escolheu&#58; "&#41;;
        gsKit_font_print_scaled&#40;gsGlobal, gsFont, 50, 365, 5, 0.5f, WhiteFont, teste&#41;;

        FILE * pFile;
        pFile = fopen &#40; teste , "r" &#41;;
  long lSize;
  char * buffer;
  size_t result;


  if &#40;pFile==NULL&#41; &#123;fputs &#40;"File error",stderr&#41;; exit &#40;1&#41;;&#125;

  // obtain file size&#58;
  fseek &#40;pFile , 0 , SEEK_END&#41;;
  lSize = ftell &#40;pFile&#41;;
  rewind &#40;pFile&#41;;

  // allocate memory to contain the whole file&#58;
  buffer = &#40;char*&#41; malloc &#40;sizeof&#40;char&#41;*lSize&#41;;
  if &#40;buffer == NULL&#41; &#123;fputs &#40;"Memory error",stderr&#41;; exit &#40;2&#41;;&#125;

  // copy the file into the buffer&#58;
  result = fread &#40;buffer,1,lSize,pFile&#41;;
  if &#40;result != lSize&#41; &#123;fputs &#40;"Reading error",stderr&#41;; exit &#40;3&#41;;&#125;

  // the whole file is now loaded in the memory buffer.
  int a;

  for&#40;a=0; a<400; a+=25&#41;&#123;
  char buffer2&#91;50&#93;;
  memset&#40;buffer2, 0, sizeof&#40;buffer2&#41;&#41;;
  memcpy&#40;buffer2, &buffer&#91;a&#93;, 25&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 0, a, 5, 0.5f, WhiteFont, buffer2&#41;;
    gsKit_queue_exec&#40;gsGlobal&#41;;
    gsKit_sync_flip&#40;gsGlobal&#41;;
  &#125;
  // terminate
  //fclose &#40;pFile&#41;;
  //free &#40;buffer&#41;;


        &#125;
        else&#123;
            gsKit_mode_switch&#40;gsGlobal, GS_PERSISTENT&#41;;
        gsKit_clear&#40;gsGlobal, Black&#41;;
        gsKit_queue_exec&#40;gsGlobal&#41;;
        gsKit_sync_flip&#40;gsGlobal&#41;;
        gsKit_clear&#40;gsGlobal, Black&#41;;
        gsKit_font_print_scaled&#40;gsGlobal, gsFont, 100, 100, 5, 0.5f, WhiteFont, "O usuário não escolheu nada!!!\n"&#41;;&#125;






    while&#40;1&#41;&#123;
        gsKit_queue_exec&#40;gsGlobal&#41;;
        gsKit_sync_flip&#40;gsGlobal&#41;;
        &#125;
    return 0;
&#125;


&#125;

Here's the Makefile:

Code: Select all

CDVD = $&#40;PS2DEV&#41;/libcdvd

EE_BIN = Path.elf
EE_OBJS = PathGet.o

EE_LDFLAGS += -L$&#40;CDVD&#41;/lib
EE_LIBS += -lkernel -lcdvdfs -ldebug -lpadx -lgskit
EE_INCS += -I $&#40;CDVD&#41;/ee

all&#58; $&#40;EE_BIN&#41;

clean&#58;
	rm -f *.elf *.o *.a

include $&#40;PS2SDK&#41;/samples/Makefile.pref
include $&#40;PS2SDK&#41;/samples/Makefile.eeglobal
# Include the GsKit Makefile.global, thai I modified
include Makefile.global
I am using the freepad.irx module because it's free and because I need multitap-compatibility on all of my programs.

Someone can hekp me?
Thanks!

ps.: I am using the latest fully compiled GSHI-ps2sdk, which comes with the gsKit and the libcdvdfs.
Last edited by methos3 on Tue Jan 06, 2009 2:13 am, edited 1 time in total.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Post by methos3 »

Ok, I tested the same program in debug mode (scr_printf), and the little file browser worker perfectly on my ps2!
It's something with the gsKit?
I used the same initScreen() function with another rpogram that I made one week ago (a cool virtual keyboard :D ), and it works, but... mixed with the cdvdlib, the screen craches! Blank rectangles apear from the bottom to the midle of the screen (6 or 7 rectangles, everytime they appear in the same position!), and nothing else will show up on the screen.
I've tryed NTSC and PAL modes (my ps2 is connected to the TV via Component AV cable, so the color system doesn't matter).

Thx again to those who could help me.
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

methos3 wrote:but... mixed with the cdvdlib, the screen craches
Did you compiled the cdvdlib or used an already compiled version?
If the latter case, if compiled against an older version of ps2sdk than your, then the weird issues may be justified.
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Post by methos3 »

Mmm, I downloaded the newest cdvdlib from the website and the newest gsKit from the svn, compiled, and applied this to my project, but... Looks like the cdvdlib needs the ps2lib to be compiled, not the ps2sdk.
But I will test on my ps2 later and post the results.
Cya!

[edit]
Worked!!!!
I re-downloaded and compiled the gsKit and the libcdvd, then put the program to run, and the screen weren't "crashed" anymore -just black this time :D - and I spent some time, putting debug messages in the persistent mode to se why this black screen, and discovered that the ps2 hangs when hit this block:

Code: Select all

char mensagem&#91;64&#93;;
    sprintf&#40;mensagem, "Número de arquivos e pastas&#58; %d", numfiles&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 0, y, 5, 0.5f,  WhiteFont, mensagem&#41;; 
I probably besause the var mensagem[64] was being declared in a while() loop.
I removed these damm lines and now the program works, thanks!!
Now I can continue my little project.

ps.: here goes a translation:

Code: Select all

char message&#91;64&#93;;
sprintf&#40;mensagem, "Number of fils and dirs&#58; %d", numfiles&#41;;
    gsKit_font_print_scaled&#40;gsGlobal, gsFont, 0, y, 5, 0.5f,  WhiteFont, message&#41;;
cosmito
Posts: 307
Joined: Sun Mar 04, 2007 4:26 am
Location: Portugal
Contact:

Post by cosmito »

Nice to hear that. By the way :
methos3 wrote:I used the same initScreen() function with another rpogram that I made one week ago (a cool virtual keyboard :D )
I've got curious about your virtual keyboard... Can you give some details about it? Was it done to be re-usable? There are some nice v.keyboards for the PSP but as far I can remember, the only one I've seen for the PS2 was the one implemented into PS2VICE.

Can you give us a binary built example of it? Or the source if you are willing to?
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Post by methos3 »

Mmm...
I made it for personal use, I didn't think that there weren't anything better.
Yes, I made it to be used in all of my programs, but with minor changes it can be used with any other programs.
I used the freepad.irx module, and the iop have to be reseted in order to use it.
I am still developing a better version, with good graph effects, and a button to switch between upper and lower case.

The keyboard is based on this function:
int getString(char* String, int mode);
where mode can be 0 for normal and 1 for numeric mode.

For now I am working on another part of my project (cdvd/usb mass readings), and will improve the keyboard later, just wait two or three days until I finish everything.

By the way, do you know if I can use that usbhdfsd.irx module in place of that usb_mass.irx? I saw on the readme file:
"This project is based directly off the original "USB_MASS" project. I've removed the PC testing stuff like VFAT, etc
and some of the debugging things. I've also removed the RPC server. In addition I split some files up into
more files and renamed other files."
What's this RPC server?
methos3
Posts: 89
Joined: Fri Feb 01, 2008 3:21 am

Post by methos3 »

Hey, my keybard is ready for commercial use ;)
But...
I couldn't make a function to print the actual string on the screen with line breaks, the better that I could do was a a function that return -1 some of its words (words, no t the thole string) surpass the max char number per line.
But... if you use a max char number (per line) of 40 or more it won't give much trouble.

Unless if you have a good sugestion to do this.
Post Reply