MyMPx.org

MyMPx.org (http://mympx.org/forum/)
-   General Discussion (http://mympx.org/forum/general-discussion/)
-   -   Hooray!!! Rockchip SDK! (http://mympx.org/forum/general-discussion/43348-hooray-rockchip-sdk.html)

flasher86 29th Apr 2010 5:18 am

Quote:

Originally Posted by knob (Post 286131)
Never had the memory hack problem myself.
Someone here has fixed a Rockchip memory hack:-
http://mympx.org/forum/support-how/4...4-players.html
but not sure which version it refers too.

Hm, I tried that, and it didn't work. Mainly because its not a hack right now, but broken chip which is being detected during firmware upgrade. At some point during FW update, it gets into Rock USB mode and there information about partitions are being transmitted.

Quote:

Originally Posted by knob (Post 286131)
btw have you had issues with do,while() and printf() with the rk26xx Sdk/Gdk?
I've been looking at porting again and had some problems with bugs in the SDK.

I am using while() all the time. Also sometimes sprintf (for converting decimals to strings) but printf doesn't work for me. I am curious how sig11 is using printf (have you introduced some nice console?).

Though whole SDK is very buggy. btw sprintf doesn't support long data type. This function acts like it was signed int then.

sig11 29th Apr 2010 10:25 am

Quote:

Originally Posted by flasher86 (Post 286132)
I am using while() all the time. Also sometimes sprintf (for converting decimals to strings) but printf doesn't work for me. I am curious how sig11 is using printf (have you introduced some nice console?).

Though whole SDK is very buggy. btw sprintf doesn't support long data type. This function acts like it was signed int then.

You should to implement two functions fputc() and fwrite(). After this your prinf() will be work.

int fputc(int ch,int handle)
{
if ( ch & 0xFF )
outch1(ch & 0xFF);
if ( ch >> 8 )
outch1(ch >> 8);
return 1;
}

int fwrite(const char* buff,int isize,int count,int handle)
{
int i;
int j = count;
while ( j > 0 ) {
for ( i = 0; i < isize; i++ ) {
int ch = *buff;
outch1(ch & 0xFF);
outch1(ch >> 8);
buff++;
}
j--;
}
return count;
}

where outch1() is your function for output of one char.

My console driver is not ready yet ( cursor is missing, 8x16 font only, CP866 only, no UTF8 support e.t.c. )

knob 29th Apr 2010 10:49 am

That great! thanks.
I have been trying to emulate the conio.h functions like clrscr(), gotoxy() getch()to make game porting easier.

I was having problems making a while loop work for a getch() to emulate an operation like "press any key" I'll give it another try.:)

tried this instead of while:-

int KeyVal;
KeyVal=(*GetKeyVal)();
KeyVal=KeyVal&0x1FFF;

for ( ; ; )
{
if (KeyVal==KEY_VAL_PLAY)
break;
}
player just locks up, got something to do with detecting the keypress.

sig11 29th Apr 2010 1:23 pm

Quote:

Originally Posted by knob (Post 286136)
That great! thanks.
I have been trying to emulate the conio.h functions like clrscr(), gotoxy() getch()to make game porting easier.

I was having problems making a while loop work for a getch() to emulate an operation like "press any key" I'll give it another try.:)

tried this instead of while:-

int KeyVal;
KeyVal=(*GetKeyVal)();
KeyVal=KeyVal&0x1FFF;

for ( ; ; )
{
if (KeyVal==KEY_VAL_PLAY)
break;
}
player just locks up, got something to do with detecting the keypress.

Use this instead of (*GetKeyVal)();

#define KEY_PORT GPIO_PDAT0
unsigned int getKey()
{
unsigned int KeyTemp;
KeyTemp = read_mem(KEY_PORT);
KeyTemp = ((~KeyTemp) & 0x3f) | (KeyTemp & 0x40);
return (KeyTemp);
}

Alis 29th Apr 2010 1:28 pm

(Sorry for my bad English)
Does this means that we are going to be able to run an app that can read files from FLASH ???

flasher86 29th Apr 2010 5:24 pm

Quote:

Originally Posted by knob (Post 286136)
That great! thanks.
I have been trying to emulate the conio.h functions like clrscr(), gotoxy() getch()to make game porting easier.

I was having problems making a while loop work for a getch() to emulate an operation like "press any key" I'll give it another try.:)

tried this instead of while:-

int KeyVal;
KeyVal=(*GetKeyVal)();
KeyVal=KeyVal&0x1FFF;

for ( ; ; )
{
if (KeyVal==KEY_VAL_PLAY)
break;
}
player just locks up, got something to do with detecting the keypress.

it looks up because it causes an infinite loop because variable KeyVal doesn't change no matter what happes with (*GetKeyVal)() as the result of this function is assigned to KeyVal before the loop. You should use (*GetKeyVal)() inside the loop.

Another problem with that is that if a one cycle of main() function tooks too much time, it locks up no matter how properly it is designed. In my case it keep hanging after about 2 seconds of executing main(), so this function must hang. Try to do this using multiply main() function variable dependent loop which will work for sure. Its because main function is executed directly by FW code every single time, and between those calls to this function it does some necessary operations (not sure what exactly though). For instance screen doesn't get refreshed before one cycle of main() is executed. If we draw a bitmap, it will be displayed only after main() function is ended.

But normal use of "getch()" or "repeat until keypressed" (pascal) is as far as I know impossible to implement. We must follow tricks to do that, because to be honest, when I first met RKP platform I was surprised by the way its all running (infinite loop of main function - in opposite to normal console app where main is executed once and thats it.

Quote:

Originally Posted by Alis (Post 286139)
(Sorry for my bad English)
Does this means that we are going to be able to run an app that can read files from FLASH ???

For now we can only read RAW data of flash memory, but implementing filesystem is possible, so probably yes - it will be possible to read files from flash - not sure about writing though, but who knows

SIG11. But isn't your function reading values only from standard button input? I got touchpad, so most probably (*GetKeyVal)() is something that should be left original way because it may be written differently - depends on used input keyboard driver in a particular rk26 model player.

knob 30th Apr 2010 8:42 am

Quote:

Originally Posted by flasher86 (Post 286144)
Another problem with that is that if a one cycle of main() function tooks too much time, it locks up no matter how properly it is designed. In my case it keep hanging after about 2 seconds of executing main(), so this function must hang. Try to do this using multiply main() function variable dependent loop which will work for sure. Its because main function is executed directly by FW code every single time, and between those calls to this function it does some necessary operations (not sure what exactly though). For instance screen doesn't get refreshed before one cycle of main() is executed. If we draw a bitmap, it will be displayed only after main() function is ended.

That makes perfect sense, it is exactly the problem I have had, nothing gets displayed on screen, when logically it should.

Keeping this in mind, I will have another go at this, thanks again, flasher. ;)

flasher86 30th Apr 2010 10:06 am

Quote:

Originally Posted by knob (Post 286154)
nothing gets displayed on screen, when logically it should.

yeah no problem. I discovered that thing while doing some animation. I was going nutts figuring out why it gets displayed only last frame of animation (as it refreshes screen after main function). About this refreshing screen, it can be done inside our code manually. I even started to wonder whether it will be more effective and optimal to display everything at low level (uploading display buffer directly to the screen driver memory, but I havent given a shot yet).

BTW. Open Dialog is almost done. Going into directories works, as well as coming back up level, also I introduced icons (in the sd card there must be icons folder in which icons in bmp format are stored and named like extentions of files ex. txt.bmp, gif.bmp and so on). Now I am trying to make scrolling of the filenames longer than possible to display in a row. Next will be filtering filelist only to files that we are interested in, and its done.

sig11 30th Apr 2010 11:38 am

1 Attachment(s)
Quote:

Originally Posted by flasher86 (Post 286144)
it looks up because it causes an infinite loop because variable KeyVal doesn't change no matter what happes with (*GetKeyVal)() as the result of this function is assigned to KeyVal before the loop. You should use (*GetKeyVal)() inside the loop.

Another problem with that is that if a one cycle of main() function tooks too much time, it locks up no matter how properly it is designed. In my case it keep hanging after about 2 seconds of executing main(), so this function must hang. Try to do this using multiply main() function variable dependent loop which will work for sure. Its because main function is executed directly by FW code every single time, and between those calls to this function it does some necessary operations (not sure what exactly though). For instance screen doesn't get refreshed before one cycle of main() is executed. If we draw a bitmap, it will be displayed only after main() function is ended.

But normal use of "getch()" or "repeat until keypressed" (pascal) is as far as I know impossible to implement. We must follow tricks to do that, because to be honest, when I first met RKP platform I was surprised by the way its all running (infinite loop of main function - in opposite to normal console app where main is executed once and thats it.


For now we can only read RAW data of flash memory, but implementing filesystem is possible, so probably yes - it will be possible to read files from flash - not sure about writing though, but who knows

SIG11. But isn't your function reading values only from standard button input? I got touchpad, so most probably (*GetKeyVal)() is something that should be left original way because it may be written differently - depends on used input keyboard driver in a particular rk26 model player.

Try attachment.
Does it work on your player?

flasher86 30th Apr 2010 3:42 pm

It shows START...
I press some key and it shows some number just below it (66 or 64?), then there are some messages and "Press any key to continue" text. After that nothing.

I don't know if this suppose to continue after some key is pressed but it stucks here(no quit possible). Also I noticed that backlight of my touchpad is always turned on in your application, while by default it turns on when I hit the button and turns off about a sec later. So I don't think that it should be used - it interfere custom input driver.

Beside that, its amazing how your console works. I like it!

EDIT:
I downloaded file manager from your repository, and it doesn't get stuck before init, but keyboard isn't working on my player. It acts like it was always the same button. Waiting for a new version so I can test it. It looks nice.


All times are GMT -7. The time now is 8:38 pm.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 RC 2