I did a bit more on the custom mp3 player:-
http://i203.photobucket.com/albums/a...a/P1010067.jpg Created a space for album art, need to figure out how to read a .jpg or .bmp from the flash and display it, pity, I'm not very good at C, anyone any ideas? Would like to convert this at some point into a .rkp to give RK2608 owners a chance to try it out :-) |
You need to use FileOpen to get handle of the file. Then you use FileRead to get data, next you convert it to 16bit bitmap raw data. And use one of the functions to display that data.
It is quite easy to get it work if you are editing the firmware. But if you are trying to do this inside RKP file it is more complicated. Currently I am trying to link FileOpen to the RKP platform, so I would have access to the external files, while RKP platform provides functions only for processing data from the RKP resources. Have anyone idea how to introduce FileOpen to the platform for RKP? As far as I know we need to make the correct link script file for this, but its a black magic for me. Maybe someone has already got access to the files stored in flash using some other way? If that so, please share it with us. |
There is some code in Platform.c which would launch rkp games from this RK2606 firmware.
Tried to use the code which extracts a .bmp icon from the rkp file to load album art, but it crashed! This code is not included in the build but is there as an option to build in a rkp loader. PlatformProtect(1); LoadPicFromFlash(BMP_BROWSER_BK, &BrowserBKPic, BMP_BROWSER_BK_XSIZE, BMP_BROWSER_BK_YSIZE); LoadPicFromFlash(BMP_BROWSER_SELECT, &SelectBKPIC, BMP_BROWSER_SELECT_XSIZE, BMP_BROWSER_SELECT_YSIZE); for(i=0;i<7;i++) LoadPicFromFlash(BMP_FILEDEFAULT, &IconPIC[i], BMP_FILEDEFAULT_XSIZE, BMP_FILEDEFAULT_YSIZE); LoadPicFromFlash(BMP_FOLDER, &IconPIC[7], BMP_FOLDER_XSIZE, BMP_FOLDER_YSIZE); PlatformMsgArray[0]=BROWSE_INIT; Fun2MsgArray[1]=PLATFORM_FUN_WINDOW; CurrentDrawPicBase=SDRAM_LOGICSCREEN_BASE; PlatformPicType=0; WindOutCnt=0; } /************************************************** **************** *º¯ÊýÃû :GameExit *¹¦ÄÜÃèÊö :Í˳öÓÎÏ· *²ÎÊý²ÎÊý :ÎÞ *Êä³ö²ÎÊý :ÎÞ *°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢ * ÂÞÄþ 11/11/2006 Ô*°æ ************************************************** ****************/ PLATFORM_CODE void GameExit(){ int i; Fun2MsgArray[1]=PLATFORM_FUN_WINDOW; PlatformMsgArray[0]=BROWSE_DISP; WindowSet[0]=0; WindowSet[1]=0; WindowSet[2]=219; WindowSet[3]=175; PlatformProtect(1); Platform_MusicOff(); FileClose(ProgramFile); FileClose(MusicHandle); ScreenWide=SYS_XSIZE; ScreenHigh=SYS_YSIZE; PicLoad_SdramAdd=SDRAM_RESOURCE_BASE; LoadPicFromFlash(BMP_BROWSER_BK, &BrowserBKPic, BMP_BROWSER_BK_XSIZE, BMP_BROWSER_BK_YSIZE); LoadPicFromFlash(BMP_BROWSER_SELECT, &SelectBKPIC, BMP_BROWSER_SELECT_XSIZE, BMP_BROWSER_SELECT_YSIZE); for(i=0;i<7;i++) LoadPicFromFlash(BMP_FILEDEFAULT, &IconPIC[i], BMP_FILEDEFAULT_XSIZE, BMP_FILEDEFAULT_YSIZE); LoadPicFromFlash(BMP_FOLDER, &IconPIC[7], BMP_FOLDER_XSIZE, BMP_FOLDER_YSIZE); Platform_Browse_FileInit(); while(DmaStateFlag&0x0002); PlatformPicType=0; DMA_LcdJpegInitX(); } /************************************************** **************** *º¯ÊýÃû :PlatformVolDown *¹¦ÄÜÃèÊö :ÒôÁ¿¼õСһ¸ö¿Ì¶È *²ÎÊý²ÎÊý :ÎÞ *Êä³ö²ÎÊý :ÎÞ *°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢ * ÂÞÄþ 11/11/2006 Ô*°æ ************************************************** ****************/ PLATFORM_CODE void PlatformVolDown(){ if(GameVolValue<0x1f){ GameVolValue++; Platform_VolumeSet(GameVolValue); } } /************************************************** **************** *º¯ÊýÃû :PlatformVolUp *¹¦ÄÜÃèÊö :ÒôÁ¿Ôö´óÒ»¸ö¿Ì¶È *²ÎÊý²ÎÊý :ÎÞ *Êä³ö²ÎÊý :ÎÞ *°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢ * ÂÞÄþ 11/11/2006 Ô*°æ ************************************************** ****************/ PLATFORM_CODE void PlatformVolUp(){ if(GameVolValue>0){ GameVolValue--; Platform_VolumeSet(GameVolValue); } } /************************************************** **************** *º¯ÊýÃû :Platform_Browse_SysInit *¹¦ÄÜÃèÊö :ä¯ÀÀÆ÷³õʼ»¯º¯Êý *²ÎÊý²ÎÊý :ÎÞ *Êä³ö²ÎÊý :ÎÞ *°æ±¾ËµÃ÷ :×÷Õß Ê±¼ä ±¸×¢ * ÂÞÄþ 11/11/2006 Ô*°æ ************************************************** ****************/ PLATFORM_CODE void Platform_Browse_SysInit(){ int i; PlatformBrowseInfo.DirDeep=0; PlatformBrowseInfo.PathBuff[0]='\\'; PlatformBrowseInfo.PathBuff[1]='\0'; PlatformBrowseInfo.CurPickFileType[0]='R'; PlatformBrowseInfo.CurPickFileType[1]='K'; PlatformBrowseInfo.CurPickFileType[2]='P'; PlatformBrowseInfo.CurPickFileType[3]='\0'; } |
First of all, try to display res file as album art. It is a format which doesn't have to be converted before displaying so it is the best solution for testing.
To do this, use this: Code:
AlbumArt = FileOpen(filepath, "R");If you manage to display it, you may try to use other filetypes with convertion. But this is something you have to do at first. BTW. I am working on improving game platform, and today I managed to increase the Sample Rate of the Audio resource (default is 11025hz which is awful). To make it 22050hz use the following code: at the beginning of the source code file: Code:
#define write_mem(address, value) (*((unsigned int volatile*)(address)) = (value))Code:
write_mem(IC_DATA_CMD,P_ADD_CCR); |
Had another go at displaying the pic in the music player screen
using this:- FILE *ArtFile; ArtFile = FileOpen("U:\\", "FOLDER.RES","R"); DisplayPicFromFile(1,20,ArtFile, 0, vinyl_XSIZE,vinyl_YSIZE, NULL, Normal, 220);//actual album art The player just crashed, dunno whats wrong, this should work. |
You re making mistake with this function.
At first, FileOpen supports handle data type (you can use char too coz its the same), not as array (like this *file). Secondable, the second parameter of the FileOpen suppose to be the path to the folder, just without the filename. Use these lines instead: PHP Code:
char Filepath[12]; char Dirpath[12]; Filepath[0] = 'U'; Filepath[1] = ':' Filepath[2] = '\' ... and so on so on. Filepath[9?] = '\0' - remember to set the last array with this value, it defines ending of the string. and then call FileOpen(Filepath, Dirpath, "R"); I would test it out but I cant compile working firmware for my player. I have Rockchip 2606A 320x240 and the screen is not supported so far :( |
Got this now:-
HANDLE ArtFile; ArtFile = FileOpen("U:\\FOLDER.RES","U:\\","R"); DisplayPicFromFile(1,20,ArtFile, 0, vinyl_XSIZE,vinyl_YSIZE, NULL, Normal, 220);//actual album art FileClose(ArtFile); and I got FOLDER.RES in the root, it still crashes just the same as before :-( Strange they use "U" as the drive in Rk26xx, Rk2706 uses "D" but I have tried "C" and "D" and the crash is just the same. I'll have a go at using a char string next to store the file params. |
Its hard to give you advice while I didn't tried such things by myself. My only next clue would be that we cant open more than 2 files at a time(or use more than two handles). The whole fimware has only two Vars hMainFile and hSlaveFile. Maybe you can try to use this:
hSlaveFile = FileOpen... without predefining hSlaveFile as it is already defined. |
hey knob, I will try to manipulate the sdk for my 320x240 screen but I have problems with compiling 2606A, it gets a lot of errors in FWTools 2.6.1.0 and I cant compile it.
How do you compile your 2608 firmware? |
Here is a download to my build:-
Send big files the easy way. Files too large for email attachments? No problem! there is a high chance it would make your player dead, so you would need to do a hard reset and have a working backup. you need to use firmware tools v3.0.29.02 and load in RK2606_MLC_Player.ini and hit build. I had already stripped out a lot of the other functions like video, game and FM radio, it's just a music player to keep the build small. all the bmps are 220x176 of course. I had to play around in "LCD_NEW_M_205.c" a lot to make the screen work. |
| All times are GMT -7. The time now is 7:34 am. |
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0 RC 2