PDA

View Full Version : Programming


Pages : [1] 2

EEUG
08-21-2005, 10:17 AM
...Let's structure our forum a bit :). Please, use this thread ONLY for questions/issues due to programming. Thank you...

paulodeleo
08-27-2005, 03:51 AM
Well, nobody else? So, here we go...

I don't like to just ask for new features and bug corrections all the time, and would like to try contribute in the development in some way.

I work as a web developer and have a little (very little) experience with C, but I can't setup the ps2dev enviroment correctly to even compile the hello world... :( Have tried about 3 different ways (from the ps2dev forums) to install the ps2sdk in my XP box and aways give up after hours trying.

What is the simpler way to setup the ps2sdk enviroment? Any real fully automated install package? What other programs do you use (compilers, text editors) to program?

So, any hints to start?

Thank you...

EEUG
08-27-2005, 04:52 AM
...OK, sorry, I've uploaded it HERE. (http://rapidshare.de/files/9756682/ps2dev_bin.rar.html)
Just get the archive and extract it somewhere (just note that path used for extraction does not contain spaces). There's ps2dev.bat file in the root of extracted directory. Change lines #2 and #3 in accordance to the extracted path. Save the file. Launch it from the explorer. Command window will open. Type 'make'<enter> in it. If following line will appear:

make: *** No targets specified and no makefile found. Stop.

then changes were correct and ps2dev environment is ready for use. Go to the SMS root folder. Type 'make clean'<enter>. Then 'make'<enter>. After some time and a lot of cryptic things 'bin' directory will contain 'SMS.elf' :). It will be 'starting point'...

P.S. Thanks to 'emcepl' for convicing me to use 'rapidshare' :)

emcepl
08-27-2005, 06:56 AM
Why don't you upp it to rapidshare.de? 50MB file limit, high-speed downloads, FREE!

paulodeleo
08-27-2005, 12:38 PM
Thank's for the file and guidelines EEUG! Gonna try it!

sstorch629
08-27-2005, 04:04 PM
then changes were correct and ps2dev environment is ready for use. Go to the SMS root folder. Type 'make clean'<enter>. Then 'make'<enter>. After some time and a lot of cryptic things 'bin' directory will contain 'SMS.elf' :). It will be 'starting point'...



Im having trouble finding the SMS root folder your talking about, Ive got everything before that to work fine, Im just having trouble finding this folder.

paulodeleo
08-27-2005, 06:23 PM
With the help of EEUG and Mr. Worm, I finally compiled my first elf! :D
Why no one made a simple guide like this to setup the ps2dev enviroment??? I really lost a lot of time trying other complicated methods recommended at the ps2dev forums.

@sstorch629:
The SMS source is not included in the file from EEUG. You have to donwload tortoisesvn from http://tortoisesvn.tigris.org/ and install. Create or choose a empty folder to store the SMS sources. Right click the folder, go to the TortoiseSVN submenu and choose Export. Paste svn://svn.ps2dev.org/ps2ware/trunk/SMS and the source will be downloaded. And follow the rest of the instrictions from EEUG. :)

sstorch629
08-27-2005, 07:09 PM
Thanks for the help, Im new to programming for ps2 (and in general) so this was a huge help. Thanks


Edit: I have everything setup, but what Im stuck at now is how to compile the make file into an elf. If someone would help it would be great. Thanks

mastaalien
08-27-2005, 08:16 PM
http://rapidshare.de/files/4443351/error.JPG.html
edit: mirror (http://www.amoklauf.ch/error.jpg)

sadly i get this error if i trying to compile sms

any advice?

Mr. Worm~~
08-27-2005, 08:30 PM
http://rapidshare.de/files/4443351/error.JPG.html
edit: mirror (http://www.amoklauf.ch/error.jpg)

sadly i get this error if i trying to compile sms

any advice?

Move cygwin1.dll from Windows/system32 directory, I had this error once and solve it in that way, then if you need an app that requieres it put it again :banghead:

jackielo
08-27-2005, 09:06 PM
OH!!!

I make my first ELF! Thanks a lot!

But why I can't compile LaunchELF?

mastaalien
08-27-2005, 09:33 PM
Move cygwin1.dll from Windows/system32 directory, I had this error once and solve it in that way, then if you need an app that requieres it put it again :banghead:

oh how stupid from me, thanks mate, just compiled sms sucessfully :dance:

sstorch629
08-28-2005, 10:46 AM
Im still getting this error after moving cygwin1.dll out of the windows/system32 folder.
Picture (http://img284.imageshack.us/img284/5277/error11zn.jpg)

Edit: Also I got it to work once with compiling sms, so I deleted the elf and tried again and it didnt work... When I got it to work I put cygwin1.dll into the windows/system32 folder.

Npl
08-29-2005, 02:05 PM
The README states that you actually debug code using MSVC, do you have a framework for running SMS in some form on Win32 ? (Or is this for stepping though algorithms)
Also, a thread of WIP would be nice, not only to keep peple informed, but to avoid having 2 people work on the same feature. (Im actually planning to get AVI-Playback more robust, currently just stops at unknown chunks)

los93sol
08-30-2005, 12:10 AM
If I may make a suggestion, it would be a great idea to put together a tutorial for compiling this and setting up a project on SourceForge.net Also, if anyone has any web space, a site for the project would certainly go a LONG way. I'm still new to the PS2 homebrew scene, but have been around the Xbox scene for ages and there is a definite difference in the structure of the two scenes. I've been following/helping out with XBMC whenever I can even though I am not a programmer there are lots of things non-programmers can do to help a project. Anyway, my point it I am very excited to see this coming together and would love to see this fly and pick up the kind of dev support XBMC has, they now have over 50 developers, it would be great if all dev's were as motivated to get a project kicked off as those working on SMS. You guys have come a long way in a short amount of time. Keep it up, if there is anything I can do to help out as far as project management, please let me know. I have pretty much assumed the PM role for the Linksboks integration to XBMC for those of you who know about the Xbox homebrew scene. I am well qualified to handle this kind of support.

Another suggestion I would have is to setup an IRC channel for the project so users can start hanging out together and getting to know eachother a bit better and sharing their knowledge/helping new users who are just getting to know it. This helps get the community following the project involved a bit, the key is to keep the channel moderated. I'm sure you all know all of that already, just thought I would put it out on the table.

Regards,
Los93soL

EEUG
08-30-2005, 02:40 AM
@Npl: yes, I'm using MSVC6.0 for "stepping though algorithms". Video part of SMS is fully functional on Win32 (you'll need one extra application (DDrawSrv.exe) do display SMS's output. I wrote this application myself, so if anyone wants to use it I can share it somewhere). OK, I'll make WIP thread here :).

@Los93soL: my personal opinion is that programming for the Station is rather different from XBox's one (which, I think, is almost the same as PC's programming), that's why I was so curious about it. The possible tutorial would require writing a lot about PS2 programming methods themselves first (which is quite a work). I've got my knowledge mainly from PS2 Linux Kit documentation and ps2dev's forums. About sourceforge etc.: I'll be really glad if someone will take care about it, since I don't have that much time to hang at IRCs. If there're questions - use e-mail, I'll try to give everybody an answer. Thank you for unserstanding ;)...

Riddik
08-30-2005, 04:44 AM
I'm a graphician and web designer... Can I help you? Just contact me!

EEUG
08-30-2005, 04:57 AM
@Riddik: help with what? :)

Riddik
08-30-2005, 04:59 AM
Designing graphical interfaces for your SMS and web-designing for a possible Official SMS website...
Regards!

EEUG
08-30-2005, 05:19 AM
...for me personally ps2-scene and ps2dev is more than enough, really. About graphical interfaces: well, it would be really nice. Just take into account the fact that Station has only 32MB of RAM (badly needed for video/audio processing algorithms), so presence of nice pictures, sounds and other "gadgets" in the interface should be avoided at all costs (for example, one 48x48 icon (that used in the "Available media" menu) takes 9KB, and 32x32 icon takes 4KB). That SMS animation and gradient backgroud uses 1 32x32 icon, 1 rectange (4 vertices and 2 colors ~100 bytes) and one text string (font is taken from PS2's ROM, so its free of charge :)). It sucks, I know, but main goal of SMS is play movies, not advertisement of Toyota cars :). Thank you for having interest in it...

Riddik
08-30-2005, 05:22 AM
No problema!!! :)
Regards

HypERSoniC
08-31-2005, 11:07 AM
it is important to have a nice looking interface. it think the current interface is great, but it isnt perfect.

Mr. Worm~~
08-31-2005, 11:57 AM
Designing graphical interfaces for your SMS and web-designing for a possible Official SMS website...

it is important to have a nice looking interface. it think the current interface is great, but it isnt perfect.

Fell free to put your ideas in "images", then will see how to implement it and minimize impact to the player itself or maybe as an external option... :D
Every contribution is considered!!! :dance:

Pd. A thread is open to post skins, etc...so... ;)

Npl
08-31-2005, 02:57 PM
@Npl: yes, I'm using MSVC6.0 for "stepping though algorithms". Video part of SMS is fully functional on Win32 (you'll need one extra application (DDrawSrv.exe) do display SMS's output. I wrote this application myself, so if anyone wants to use it I can share it somewhere). OK, I'll make WIP thread here :).

Wow, I`m quite impressed how far you got with that kind of "debugging", especially in terms of performance. ;)
Would like to have DDrawSrv.exe, but the biggest prob (,aside from having to understand the sources,) Im having ATM is that I wont easily get debug Output from the PS2. Only if I compile SMS with RESETIOP=0 and NOHOSTSUPPORT I get something after sending it through PS2Link, but apparently there are clashes of the different module-versions as browsing the HDD results in Garbage displayed (CD Playback has no apparent probs).

Riddik
08-31-2005, 04:23 PM
Fell free to put your ideas in "images", then will see how to implement it and minimize impact to the player itself or maybe as an external option... :D
Every contribution is considered!!! :dance:

Pd. A thread is open to post skins, etc...so... ;)

...Rendering in progress... :cool:

suram884
09-08-2005, 05:28 PM
How many lines of code are there for SMS??? I looked at a couple source files and there were around 3000 lines!

I would help out but I don't know anything about video programming or ps2 programming. Plus I'm a full time student with a lot of work. I don't know, maybe when school is over I will be able to study some SMS code and see if I can help.

Good work so far.

Ex-Cyber
10-20-2005, 10:32 PM
How many lines of code are there for SMS??? I looked at a couple source files and there were around 3000 lines!A simple run of wc shows about 57K for the whole src/ directory, but that's rather inflated because Config_Data.c, GUI_Data.c, and SMS_Data.c (about half of the linecount) are not actually source, and much of the rest is in decoder code adapted from ffmpeg et. al. which contains a lot of tables and is arguably closer to statically-linked libraries than part of the player itself.

Speaking of SMS_Data.c, can someone clarify the license situation with it? I get the feeling that it is not really under AFL...

EEUG
10-21-2005, 02:46 AM
@ Ex-Cyber: source code and license information of modules from SMS_Data.c can be found here (http://svn.ps2dev.org/). The only exception is iomanX module which was taken from ps2link's distribution (I-don't-know-which-version). I think that that iomanX module is a part of older 'ps2lib' library (its information can be found here (http://ps2dev.sourceforge.net/ps2lib.html) ;))

Ex-Cyber
10-21-2005, 08:52 PM
Thanks... looking at it again it looks like I may have just hosed my checkouts somehow and/or got the sources mixed up with old stuff...

paulodeleo
10-25-2005, 09:42 PM
I'm using MSVC6.0 for "stepping though algorithms". Video part of SMS is fully functional on Win32 (you'll need one extra application (DDrawSrv.exe) do display SMS's output. I wrote this application myself, so if anyone wants to use it I can share it somewhere).

This DDrawSrv.exe works only together with MSVC6.0? I would like to test it.

Also, can you believe even making a hello.elf is problematic here? Using that ps2dev enviroment you provided, at the ps2sdk\samples\hello\ using justa a 'make' outputs hello.o and hello.erl, but no hello.elf. The teapot sample creates the elf normally, but I can't do the same to the hello sample, even altering the Makefile to be like the teapot sample. I know this is more related to C and not to SMS, but what is that .erl file?

EEUG
10-26-2005, 03:39 AM
...".erl" is something like ".dll"/".so". "Pixel" knows much more about it (refer ps2dev site). I won't be available for some time (got ill)...

Bixente
11-25-2005, 01:49 PM
Hi,

@EEUG, where the text SMS Version 1.4 (rev.8) is draw, cause i didn't find it.

Thanks ;)

Bix

EEUG
11-25-2005, 02:06 PM
...it's present only in my "official" version (refer README for explanations) :). I have my "private" GUI_Stub.c where it all happens (including blue balls)...

Bixente
11-25-2005, 02:57 PM
Ho, i saw "Mister" have his "private" code. :cool: (Joke;) )

Bye

Bix

paulodeleo
11-25-2005, 11:12 PM
I'm working on building a VGA cable to ps2 and it's near perfect now ( http://www.ps2-scene.org/forums/showthread.php?t=24593 ) .
Just wondered if it would be possible to start SMS in VGA mode (same as ps2 linux) or 480p mode (Progressive Scan), just like NTSC or PAL is done. Both VGA or 480p ar compatible with the cable. Is this level of control available for homebrew authors?

From http://www.oopo.net/consoledev/files/ps2-doublebuffer.txt :

typedef struct {
int width, height, fbp, zbp, tbp, mode, interlace, fbw; u64 display;
} GS_MODE;

GS_MODE gs_mode[4] = {
{ 640, 448, 70, 140, 210, 0x02, 0x01, 10, 0x001DF9FF01832278 }, // NTSC
{ 640, 512, 80, 160, 240, 0x03, 0x01, 10, 0x0023F9FF0184828C }, // PAL
{ 720, 480, 90, 180, 270, 0x50, 0x00, 12, 0x001DF59F008230E8 }, // HDTV 480p
{ 640, 480, 80, 160, 240, 0x1A, 0x00, 10, 0x001DF4FF00822114 }, // VGA 640x480
};


This kind of text is too mutch technical for me, even to make a "Hello world, from VGA!", but maybe easy for others?

I would be happy to test any test elf/sms version with my cable, as just a few people have one of this cables.

JuddMan
11-26-2005, 01:28 AM
What is the diference between the PS2SDK you provide here and the windows installer on the PS2Dev site?

the PS2Dev site version gave me some error about not finding some include files when i type make in SMS folder.

i was downloading this version of PS2Dev, and it gets to exactly 30 megs downloaded then dies... trying again now.
Edit: i think the site hosting it went down for a minute... second attempt worked fine. got SMS, and compiled it... now to work through the tutorials and get to know some of this stuff better.

I noticed i can use the ls command with this version... very handy, cause i always type it instead of 'dir'... derr...

EEUG
11-26-2005, 02:39 AM
@paulodeleo: I have official Sony's VGA cable and Sync-on-Green monitor, so I think it's possible to run SMS in VGA mode (all code is there, it just wasn't tested at all). The problem is that I'm too lazy to fiddle with monitors etc. Maybe I'll try it one day...

paulodeleo
11-26-2005, 07:30 AM
OK EEUG, nice to see that you have the right station to test this kind of thing!
Hi have posted the same request at uLaunchelf forum. Maybe if the launcher enables VGA mode, then all elfs that are loaded later would be already at that mode...

EEUG
11-26-2005, 11:04 AM
@paulodeleo: no, it must be set in SMS :). It just needs to be tested. i.e. I must must take the monitor from one PC, bring it to the other room, connect it to the PS2 (finding the place to put that monitor and free power supply socket (all are busy at the moment), then all that cabling stuff (Sony provides just short (~20cm) one). It will happen one day, just be patient ;);

@JuddMan: I don't know the difference at the moment. By using the version I've shared we can be sure that we use same environment, so we narrow the search area for possible bugs/errors. But for v1.5 a new one must be used in the future (so, I'll probably share it in the same way (though I have plans to take ps2sdk stuff used by SMS and make SMS independent of ps2sdk (this will reduce .elf size also))...

JuddMan
11-26-2005, 12:30 PM
i've found a small bug in the saving of the config file where the active partition may not be active any longer. if you open a partition, then navigate back to the global HDD partitions list, then saving the config file will cause the 'active partition' to be the last one used. this means that you can never start off in the global HDD partition list without either deleting the config file, or renaming/deleting the remembered partition so it doesn't exist anymore, because there will always be an 'active partition' regardless of where you are in the browser...

i've been looking at the code... pretty new at this... and noticed the line
strncpy ( g_Config.m_Partition, s_MenuCtx.m_pBrowserCtx -> m_pActivePartition, 255 );
i believe this is where the 'active partition' is saved to the config file... it seems when the browser exits the active partition the value of m_pActivePartition is not reset... i've tried various ways to reset it, mainly putting things like

s_BrowserCtx.m_pActivePartition = "\0";

in locations where i think that the browser is exiting or not in an active partition... but really, i'm just guessing stuff and not getting anywhere with it...

any hints? like... what function is called to display the global partition list...?

edit: from a fresh config, if you have never opened a partition, you can edit the settings and save them just fine and no partition will be opened on starting SMS... but if you ever open a partition THEN save the config, you always have to start in a partition.

EEUG
11-26-2005, 01:29 PM
@JuddMan:
- open Browser.c;
- look for the line:

strncpy ( g_Config.m_Partition, s_BrowserCtx.m_pActivePartition, 255 );
- replace it by:

if ( s_BrowserCtx.m_HDDPD != -1 )
strncpy ( g_Config.m_Partition, s_BrowserCtx.m_pActivePartition, 255 );
else g_Config.m_Partition[ 0 ] = '\x00';
Thank you for the remark. The fix will appear in V1.5. I really apologize for the very bad code in GUI.c and Browser.c :). I wrote it as demo in short period since I could not imagine that things will turn up like they are today.

Bixente
11-30-2005, 01:39 PM
Hello,

Cause nobody answer me for display time when pause, i implemented it. :D

First i've added:
void PlayerControl_DisplayTime ( SMS_Player*, int, uint64_t, int );
to SMS_PlayerControl.h.


Twice i've added:
case 2: lpSrc = "Pause"; break;
to SMS_PlayerControl.c in PlayerControl_DisplayTime fonction.


Third i've added:
int64_t lTime = s_Player.m_VideoTime;
lpPacket = s_Player.m_pCont -> NewPacket ( s_Player.m_pCont );

PlayerControl_DisplayTime ( &s_Player, 2, lpPacket -> m_PTS, 0 );
PlayerControl_DisplayTime ( &s_Player, 2, lTime, 1 );
to SMS_Player.c in _sms_play fonction, just below:
if ( lButtons & PAD_SELECT ) {


and to finish i've removed:
_draw_text ( "Pause" );
from SMS_Player.c and _sms_video_renderer fonction.



Here the 3 modified files:
http://www.fileshack.us/files/131/Display_Pause_Time.rar

So, EEUG, take a look at my modification and see if that ok for you. ;)

Next step scrolling bar with R3 + Right or Left. :)

Bye

Bixente

EEUG
11-30-2005, 04:58 PM
@Bixente: well, you were too fast :). Though your changes are OK, I've already implemented realtime OSD for time (activated by "cross" button) showing played, total and remained time while playing the movie. I'm really sorry that I've probably forgotten to mention it in "WIP" thread. But for "scrollbar" it's OK, I don't have any plans to implement it, so go ahead. And I really would advise you to start with a test program (taking only few files from SMS such as GUI/DMA etc.) to make drawings. It will be faster and easier to do. As your code will produce GS packet with drawing comands (IT MUST BE SENT VIA Path2/VIF1) then it will be really easy to put just that piece of code to SMS and use PQueuePacket function from IPUContext to display generated GS packet.
Best regards
Eugene

Bixente
11-30-2005, 05:26 PM
OK, thanks for answer. ;)

I'll keep this version for me ,waiting for your.

I'll start my little sroll bar drawing progam, and take your councils (path2/VIF1).

Thanks again. ;)

Bye

Bixente
12-01-2005, 06:36 AM
@EEUG:

What do you think of making something like GUI_Progress drawing?
Work with VIF1 isn't it?

Or something like PlayerControl_AdjustVolume drawing with 50 points and horizontaly?
Work with VIF_DIRECT isn't it?

Bye

EEUG
12-01-2005, 07:20 AM
@Bixente: GUI_Progress (and all drawing functions from GS.c (except text output)) won't work, since it uses Path3/GIF (used by IPU.c), and an attempt to use Path3 while displaying a movie can cause a crash (since extra interrupts will be generated by GIF in that case). If you want to make a simple "scrollbar" you can use PlayerControl_AdjustVolume as is (rotating it by 90 degrees and possibly increasing its scale). Or you can try to make more fancier one by using more complex shape(s) with texture mapping etc. (possibly employing VU1 unit :)). Ther're several approaches, so choose your favorite one :). Don't forget to stop decoder/renderer threads and clear quieues while scrolling, otherwise it will crash instantly...

Mr. Worm~~
12-01-2005, 07:21 AM
Maybe something like the progress bar a little thinner, when loading indexes just before plays the movie, then resolution can be handled...;)

Bixente
12-01-2005, 07:57 AM
@EEUG: OK, i'll try to use PlayerControl_AdjustVolume as is, thanks. ;)

@Mr. Worm~~: I know that gone a be nicer, but no GS drawing when playing. :(

Bye

Bixente
12-02-2005, 06:38 AM
@EEUG: Iv'created a PlayerControl_ScrollBar call by R1, L1 (for testing, i know you use it in v1.5) ;)

I've succesfully rotated and reversed bar, increase is ok but decrease not.
I've got problem with placement, erase and increase scale. ( bit manipulation ) :cry:

Save me. :cry:

How that work exactly ?

Thanks

EEUG
12-02-2005, 07:19 AM
@Bixente: well, volume control is in fact a sequence of "green sprites" (24 in total). Each of them is drawn using Z buffer, so, there's no need to paint it each frame. GS packet for drawing it is generated dynamically and stored in 's_VCPaint' array. As the volume is adjusted, we have to reset Z buffer values to erase it before drawing the next volume status. Here GS packet stored in 's_VCErase' is in charge. It is generated only once since it erases the whole area of volume control. All you have to do is check sprite's coordinates once again and very carefully. I think, there's no need to manipulate bits. Just determine first how many discrete values it will contain (50, 100, 200 etc.) (for volume control I've chosen 24). Than having movie duration time you can determine how long your step will be (i.e movie duration divided by amount of discrete values you choose).
Best regards
Eugene

Bixente
12-02-2005, 07:34 AM
OK, thanks

Bixente
12-02-2005, 12:50 PM
Hello,

I've increased number of "discrete value" to 96, position is ok, drawing is ok, but i've got some problem with erase ( lot of black line on movie ).

EEUG
12-02-2005, 01:09 PM
@Bixente: you can use e-mail for questions/help, so we won't pollute the forum :)...

EEUG
12-11-2005, 07:43 AM
@paulodeleo: finally I've managed to fiddle with VGA modes :). 2 modes will be supported: 640x480@60Hz and 640x480@75Hz...

dave_t
12-22-2005, 03:24 AM
@EEUG: I've tried using the PAD.c you sent me - it works well, but only with rom0:PADMAN, not rom1:PADMAN or the PADMAN.IRX from the Sony DVD Player 2.10 disc. - perhaps i'm doing something wrong... Anyway, if you are using rom1:PADMAN + rom1:SIO2MAN, and get the pads to work, that's great because it'll be dead easy for me to integrate the remote control support code i've been testing, as that depends on rom1:SIO2MAN. I'll get to work on that after Christmas when the new version of SMS is in SVN.

EEUG
12-22-2005, 03:57 AM
@dave_t: I'll try this this stuff again with rom1 (maybe I also did something wrong (it was in August, I think, when I tried rom1 stuff)). Verify also that you've loaded SIO2MAN from rom1...

EEUG
12-24-2005, 11:26 AM
...those who wants to compile SMS version 1.5 have to update development environment (otherwise there will be linker error). I've updated download link (rapidshare.de again) on the first page of this thread (3rd post)...

paulodeleo
12-24-2005, 11:43 AM
@paulodeleo: finally I've managed to fiddle with VGA modes :). 2 modes will be supported: 640x480@60Hz and 640x480@75Hz...
I've lost this post! Thank's EEUG! :)

Thank's for the updated ps2dev again! :)

hip203
12-29-2005, 11:24 PM
EEug.
I found a line of code ..found on Ps2 bios doucumentation that state.....ps2 bios contain an item call FontM..that will have all the font character that u need for all languages ...Perhaps subtitle option can direct feed from font of ps2 Bios.
Attach files.
Documentation:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx
Description of file format for 'FONTM' from the PS2 BIOS.
---------------------------------------------------------
adresd 2003.

Intro
-----
The FONTM file contains a PS2 Font, in a format which allows access to individual characters without having to upload a big font bitmap. As each character is stored seperately.
The font contains over 4000 characters, of all types and languages, and non-textual characters as well.
This allows flexible use and the characters to be used any way in which the programmer wishes.

The FONTM file is packed, the depack algorithm and example code have been provided by [RO]man on the site: http://ps2dev.pgamers.com/ in the file 'unpack.zip'.
Rather than duplicate it here, grab from there.
[Quick greet to [RO]man and the good work he has done ]
This should be used to depack the file before trying to use the supplied extractor test program, or using it as reference to this document.

After hearing many people wonder about the format of these files and using them, as they quite like the fonts, I decided to write this short doc and example code.
I hope this is of some use to someone.

The fonts in the files I examined were all 4bit CLUT.
The CLUT does not seem to be included in here, and is probably elsewhere.
That does not matter too much as it seems an intensity based CLUT, so creating one will not be hard.

One thing to note, it has been pointed out that this file may not be consistent across ALL ps2 models, and may be a different format or missing on some models.
I do not have details of this, but until it is verified take this into consideration.

I've tested it on my SCPH-10000 (japanese) and SCPH-30003R (pal) machines.
It's also been tested on a SCPH-50000 (japanese) and SCPH-35001 (US).

Data Format
-----------
In this doc, uint32 means: 4 bytes, A,B,C,D
value = (A) + (B<<8) + (C<<16) + (D<<24)

The file contains a basic header
--------------------------------
4 ascii bytes 'FBJ2'
4 bytes, uint32, version
4 bytes, uint32, bitsize of file
4 bytes, uint32, baseoffset
4 bytes, uint32, num entries in the file
4 bytes, uint32, end of file position

Then follows the offset table
-----------------------------
Each entry is 4 bytes (uint32), making up an offset.
Take this offset add this to the baseoffset from the header, this gives the absolute offset in the file.
There are 'num entries' offsets in a list.

The size of each entry can be taken from the difference between offsets, and seems to be the same for all entries in the file. So calculate difference between first and second entries, and that will give the size.

Then follows the actual data for each character
-----------------------------------------------
This is 4bit CLUT data.
A line of the font graphic is 13 bytes.
each byte represents two pixels, so for 0x43 pixel 1 is color 4, pixel 2 is color 3.

This means each pixel can have one of 16 values, 0x0 -> 0xf

An example of a character is given below (NOTE:this is not from the actual file, but a madeup one).
This is shown in HEX notation, as it makes it really easy to view.
----
00000000000000000000000000
01111111111111111111111110
01200000000000000000000310
01020000000000000000003010
01002000000000000000030010
01000200000000000000300010
01000020000000000003000010
01000002000000000030000010
01000000200000000300000010
01000000020000003000000010
01000000002FFFF30000000010
0100000000F2EE3F0000000010
01FFFFFFFFFE23EFFFFFFFFF10
01FFFFFFFFFE32EFFFFFFFFF10
0100000000F3EE2F0000000010
01000000003FFFF20000000010
01000000030000002000000010
01000000300000000200000010
01000003000000000020000010
01000030000000000002000010
01000300000000000000200010
01003000000000000000020010
01030000000000000000002010
01300000000000000000000210
01111111111111111111111110
00000000000000000000000000

The example exporter/dump program
---------------------------------
I have included a program, which will dump out the characters from the font file to a ascii version. You can set in the code which chars to dump out, or all of them.
The ascii output is easy to view and I wanted to keep the src clean and easy to understand.

I leave it as a simple exercise for the reader to write these out as bitmaps.
Or to use the same format for similar data, and create new fonts.

Thats all folks,
adresd

EEUG
12-30-2005, 03:21 AM
@hip203: in previous versions of SMS where FONTM was used I also used this file :). Here're my explanations: FONTM "file" contains exactly 4416 symbols (at least in my PS2). It does not contain "all symbols for all languages" (at least I didn't found there such a symbols like ÓĂçě etc.). Characters there are not arranged to conform any codepage (it's just a one big chunk of compressed bitmaps), so, it's necessary to create extra translation tables "by hand", which is almost impossible task for me in case of Chinese, Corean etc. languages. That's why "MTK font" solution was choosen. Next thing is MBCS. While it's possible to implement it, the amount of work is quite big. At the first place string manipulation functions (strcpy, strtok, sscanf etc.) from ps2sdk must be rewritten and tested. Then new symbol drawing routines should be implemented since all these "thousands" of eastern symbols won't fit in the GS memory (which is also required for images from movies). Then come subtitles themselves: file parsing routines, distinguishing between SBCS and MBCS files etc. should be reimplemented. It's just a boring work for me that will take huge amount of time. Time to establish "Eastern Subsidiary of SMS" to implement this and I'll provide any help I can. Thank you for understanding :)...

hip203
12-31-2005, 04:41 PM
@hip203: in previous versions of SMS where FONTM was used I also used this file :). Here're my explanations: FONTM "file" contains exactly 4416 symbols (at least in my PS2). It does not contain "all symbols for all languages" (at least I didn't found there such a symbols like ÓĂçě etc.). Characters there are not arranged to conform any codepage (it's just a one big chunk of compressed bitmaps), so, it's necessary to create extra translation tables "by hand", which is almost impossible task for me in case of Chinese, Corean etc. languages. That's why "MTK font" solution was choosen. Next thing is MBCS. While it's possible to implement it, the amount of work is quite big. At the first place string manipulation functions (strcpy, strtok, sscanf etc.) from ps2sdk must be rewritten and tested. Then new symbol drawing routines should be implemented since all these "thousands" of eastern symbols won't fit in the GS memory (which is also required for images from movies). Then come subtitles themselves: file parsing routines, distinguishing between SBCS and MBCS files etc. should be reimplemented. It's just a boring work for me that will take huge amount of time. Time to establish "Eastern Subsidiary of SMS" to implement this and I'll provide any help I can. Thank you for understanding :)...

Thank you for the explanation.......:D
I was just doing some researching on ps2 bios ..Then I see this article on FontM example........I'm curios and was just wondering whether we could pipe in the FontM since remark says "all language"..........:lol: .................:banghead: ..........

user112
04-11-2006, 12:06 PM
"using VUs for decoding": VUs are not designed for decoding. IPU is. Alas, only for MPEG1/2-compatible bitstreams. SMS uses IPU just to perform asynchronous YUV->RGB conversion. Maybe I'll try to implement MPEG support one day. It's interesting though to use VU1 for YUV->RGB stuff and for the postprocessing (is 16KB of VU1 memory enough for that?);

I must admit that I know nothing about VUs and the way MPEG4 is decoded (and lazy to check it out right now), but aren't there any repetitive simple tasks that could be uploaded there?

EEUG
04-11-2006, 12:36 PM
@user112: ...there's one thing that can really improve performance yet further using VU, namely: IDCT for P and B frames in VU's micro mode. Here IDCT can be computed by VU in parallel (micro mode) with main CPU (this one will be busy at this time with motion compensation). It's just an idea (maybe wrong one :))...

user112
04-11-2006, 01:06 PM
Is there any information about VUs, in particular what instructions they support and the way they communicate with the CPU? But beware, as I've said I don't understand a heck in assembler, so I'm not promising anything.

EEUG
04-11-2006, 01:10 PM
...yes, using Google it's possible to find official Sony's VU manuals (and not only VU ;))...

Edit: ...if you want you can try to make iDCT function for 8x8 block in pure C but only using floats and no shifts and logical operators. Then I can try to translate it into VU assembler...

user112
04-11-2006, 02:08 PM
So, right now, both VUs are idling? Does sending and retrieving data to/from VUs cost anything? Have you changed anything in ffmpeg libraries or it's a direct port?

That would be rather interesting, have you already tried anything?

EEUG
04-11-2006, 02:44 PM
...in SMS case there're no ffmpeg "libraries" anymore. I've changed everything including variable naming etc. Now it's strictly PS2 related and not compatible with anything (except my private Win32 test projects). VUs are not used now. They can perform only floating point SIMD stuff and some limited 16-bit operations for loop counters and array indices. That's why it's quite hard to employ them in the decoding process. I can only imaging asynchronous idct calculations for P/B frames. Data transfer is "free", i.e. it's performed by DMA/VIF units and results can be read back directly accessing VU memory. So, it's probably possible to load microprograms into VU for iDCT calculations (unquantize/iDCT) at startup and trigger them before motion compensation caclulations, so when these calculations are completed by main CPU, VU will deliver its results of iDCT, saving a lot of cycles :). But I've never programmed for VU, so I'm not 100% sure (I'll definitely try (no promises and no estimations here :)). Enough for today. See you ;)...

user112
04-11-2006, 03:41 PM
Enlighten me about whole this DDrawSrv.exe stuff.

yot
04-11-2006, 06:05 PM
quick question
how to icnclude sms cdvd support in other homebrews f.e. in ulaunchelf or maybe how to include ulaunchelf in sms to have possibility launching programs from dvd disks without knife trick
i mean to launch some emu and this emu read roms from the same source, and this source is burnt on dvd(cd) made like a movie disc for sms
yot

EEUG
04-12-2006, 03:01 AM
@user112: ..it's a quick and dirty way to test video decoder. While SMS can't be compiled "as is" on Win32 platform, it's core can. DDrawSrv performs YUV->RGB conversion (not, actually DDrawSrv, but video driver) and displays decoded picture. So, if you've bult test executable (I don't use it anymore, since now I know almost every part of SMS by heart :D), sou can launch DDrawSrv first, then test executable and...enjoy the show;

@yot: ...source code of the driver is in the SVN at ps2dev.org. SMS is an example of its usage. It's the same driver as in uLaunchElf + UDF and dopen/dread/dclose support added and some stuff removed (file date/time support etc.) since it is not used in SMS...

user112
04-12-2006, 04:09 AM
If you want me to help you with VUs, explain how to get that compiled under Win32 and how those test applications interact, i.e. be more specific.

EEUG
04-12-2006, 05:09 AM
...here's my test project which runs on Win32 (MSVC6 environment). While it's a bit outdated (I just don't have newer one) it contains all necessary stuff for debugging. The process looks like this: modify main.c to change input filename. Compile the project. Launch DDrawSrv (note that your video card/driver must support YUV->RGB conversion). Launch the test and enjoy the show :). For IDCT stuff 2 functions from SMS_DSP.c are used: IDCT_Add and IDCT_Put. They are exactly the same, but IDCT_Add performs extra step by adding decoded block to the predicted block. For VU port it would be great to have them operating with "float" data type (now they are dealing with short/int) without any shift and logical operations (VUs don't have them). You can use short -> float conversion however. VUs are best in floating point SIMD (4 operations per instruction, like Intel's SSE). Multiply-add, Multiply-substract and other vector operations are available. Note also that DCT coefficients are permutated (reordered) in PS2 mode, so, first step would be to change aforementioned routines to deal with PS2 permutation. I would also try to simulate VU instructions in C to make life a lot easier. Try to look at the routines that perform dequantization of DCT coefficients (SMS_H263.c/SMS_MPEG.c) as they can also (or can not?) be peformed at VU side. Feel free to ask :). If you don't like it - f**k it :badpc: . No obligations here.

user112
04-13-2006, 05:21 AM
Some observations?
I have simply excluded those two functions IDCT_Add and IDCT_Put, and it gave a ~10% speedup on a 720x384 DX50 encoded movie. Could you perform some tests on PS2? Would that be enough? What are the most CPU intensive functions (my MSVC lacks the profiler)?

EEUG
04-13-2006, 08:09 AM
@user112: ...this project is only for testing and understanding algorithms :). Performance results on PC say nothing as the whole code is PS2 oriented (I can explain more, if you want). "most CPU intensive functions" are: IDCT calculations, motion compensation calculations and DCT coefficients unquantizations. All of them (except MPEG type unquantization which is used quite rarely in XviD) are optimized to the maximum in SMS. There's also bitstream parsing stuff which takes quite a lot of time, but there's nothing to optimize there (countless if/else/case statements). The only opportunity I see to gain some more performance is to use VU for the task I've described earlier. For MPEG1/2 video PS2's IPU can perform all these tasks except motion compensation that's why it's possible to watch DVDs without any lag. For MPEG4 everything (except colorspace conversion) is performed inside main CPU...

user112
04-13-2006, 08:26 AM
Could you perform some tests on PS2?
So, that is what I'm asking, what gains originate from excluding IDCT_Add and IDCT_Put functions on PS2. This will directly show is it worth it or not.

P.S. It seems that there is a lot of misunderstanding, should we shift to russian?

EEUG
04-13-2006, 08:41 AM
@user112: "should we shift to russian": definitely :D. Use e-mail/PM then. I'm at work, so PS2 is only available for me for a limited period of time in the evening. Btw., ~80% of SMS I've written on PC/MSVC :)...

user112
04-14-2006, 02:02 AM
Just kidding, lets keep that public, maybe somebody would like to join.
So, got any results?

EEUG
04-14-2006, 02:34 AM
@user112: ...yes, I've played with it yesterday a bit. Rather funny, if I disable all motion compensation routines there's ~5-10% gain, same for IDCT with motion compensation, if both are disabled then it's about 90% :). So, it's rather difficult to judge...

user112
04-14-2006, 04:16 AM
Where those motion compensation calculations happen?
Could you give me a general overview of how data flows through your player? Cause I'm now looking into the source-code, and it's rather cryptic.
Is the latest SVN version still compatible with this test application?

EEUG
04-14-2006, 04:37 AM
@user112: ...decoding process is a process of macroblock decoding. Macroblock is 16x16px picture element. First macroblock information is decoded from the bitstream (_mpeg4_decode_mb). Based on that information actual 16x16px picture element is calculated (SMS_MPEG_DecodeMB). Intra macroblocks use only IDCT. Others use information from reference picture first (actual motion compensation (_MPEG_Motion)) then IDCT is calculated and results of motion compensation are added to the results of IDCT to make final picture element. For B-Frames motion compensation is calculated twice, for I-Frames - once.
"Is the latest SVN version still compatible with this test application?" - I don't know. Principle is not changed there, maybe some details...

Edit: ...general dataflow is simple: avi file is demuxed and audio and video packets are put into queues. Video and audio decoders get their packets, decode them and put decoded data into output queues. Video and audio renderers get decoded data and render it...

user112
04-16-2006, 08:29 AM
Could you give me a general overview of how data flows through your player?
I mean the video decoding process - from demuxing the streams to the rendering. Just the way you described, but with little more depth. Cause stepping through the code isn't the most interesting thing out there.

Got any progress in using VUs?

...yes, I've played with it yesterday a bit. Rather funny, if I disable all motion compensation routines there's ~5-10% gain, same for IDCT with motion compensation, if both are disabled then it's about 90% . So, it's rather difficult to judge...
Any explanations?

nevalabs
04-16-2006, 12:17 PM
Dear EEUG,

First of all, thanks for making SMS, and specially, for realeasing it's source code!

I'm a total newbie, and I was trying to compile SMS with the windows toolchain. It worked perfectly, thanks! Now I've just tried to compile on Linux, and there was error in including file SMS_GUICons.h . It's just a capitalization problem, the file is named SMS_GUIcons.h instead of SMS_GUICons.h (the C is capital). Just renaming the file solved the problem.

Again, thanks for everything!

Regards from Brazil,
Claudio Neves

EEUG
04-16-2006, 01:15 PM
@user112: ...SMS_ContainerXXX stuff performs demuxing. "_sms_play" function picks data packets delivered by "countainers" and based upon packet type puts them into appropriate packet queue. Then we have 2 decoder threads: one for audio and one for video (only .avi is concerned here, for mp3 it differs a bit). Decoder thread picks data packet and performs actual decoding. For video it happens "MPEG4_Decode" (for DivX/XviD)function. It checks some things, and invokes "_mpeg4_decode_slice" function, which, in turn, parses input data packet, macroblock by macroblock, and invokes "SMS_MPEG_DecodeMB" function which calculates (based upon macroblock type) 16x16 YUV image. "MPEG4_Decode" returns a pointer to the decoded picture. That pointer is put to the other queue. There're also 2 threads for rendering. Video renderer thread picks picture pointer, performs rather primitive A/V sync and submits the picture for YUV->RGB decoding and display (performed by IPU and interrupt handlers), so, decoding and rendereing goes in parallel. That's it.
"Got any progress in using VUs?": I did nothing these days except some "research" about implementation of mpeg1/2 playback using IPU. I'll probably start actual implementation from scratch using official specs and some reference code from MPEG since that IPU thing is quite specific. There're, of course, other (maybe a lot quicker) ways, like hacking official DVD player to decode a single file instead of disk, or using some illegal copy of the official SDK but that's not interesting for me.
"Any explanations?": probably mem->CPU->mem data traffic is a bottleneck here. I've got another idea: probably we can use mem->SPR DMA channel to transfer reference image block to the SPR performing IDCT by main CPU as it is right now while DMA transfers (and also rearranges) data. Then we do motion compensation taking data from SPR. This will require changing of all motion compensation routines (they are rewritten in assembler now), but these routines will have less branches, so it should go faster. PS2 is not a PC, so programming for it is not an easy task :).

@nevalabs: ...this is known issue for me and SVN for SMS 1.7+ will contain fixed stuff (though the difference between 1.6 (Rev.6) and 1.7+ is only video decoder, so if you'll implement something useful then it won't be a problem to put your stuff to the future versions). Thank you...

user112
04-16-2006, 03:03 PM
I've got another idea: probably we can use mem->SPR DMA
That should be it! Because, right now, I have come here to post the same idea.

I did nothing these days except some "research" about implementation of mpeg1/2 playback using IPU.
Why not using libps2mpeg2?

PS2 is not a PC, so programming for it is not an easy task
But, in fact, SMS Payer is written much like a PC application. No offence, just kidding.

EEUG
04-16-2006, 03:46 PM
@user112: ...video decoding is the same on every platform, so, there's no sence to invent another bike. There're 2 main differences from the original ffmpeg stuff here: switching from planar to packed (macroblock based) image format and interrupt driven YUV->RGB which mainly contribute to performance as it is right now. Doublebuffered SPR -> mem DMA transfer is also used. Time to try last option :). For me it will take another ~1 month with no warranty at all that it will really improve things :)...

user112
04-16-2006, 04:02 PM
...video decoding is the same on every platform, so, there's no sence to invent another bike.
I mean that CPU shouldn't access main memory at all. All transfers must be performed by DMAC.
Btw, are SPR to VU memory transfers as efficient as transfers from main memory?

EEUG
04-17-2006, 02:10 AM
"CPU shouldn't access main memory at all": SPR is only 16KB, so CPU will access main memory anyway (for stack, local variables etc.). But I'll try to implement this "last option" anyway (mpeg1/2 and other stuff will wait then);

"SPR to VU memory transfers as efficient as transfers from main memory": I have no idea, since I've never used VUs...

oksky022
04-17-2006, 06:39 AM
plz korean font..

plz

EEUG
04-17-2006, 09:08 AM
@user112: "Why not using libps2mpeg2?": have you ever seen it in action? Though, I've got some examples from its creator, I've never managed to get anything except some "splash" screens. Moreover it's not an open-source and the author don't want to release it. This library dosn't fit SMS architecture either. Just try it yourself, it you would like to ;);

@oksky022: ...without someone's assistance (I don't know a "sign" from this alphabet) - no way, sorry :)...

user112
04-17-2006, 03:55 PM
for stack, local variables etc
Wouldn't they fit in the cache?

But I'll try to implement this "last option" anyway (mpeg1/2 and other stuff will wait then);
But leave there a possibility to use VUs for IDCT, I'm looking into it.

EEUG
04-18-2006, 02:42 AM
@user112: "Wouldn't they fit in the cache?": probably yes, but there's also bitstream data and audio decoding...

"But leave there a possibility to use VUs for IDCT, I'm looking into it.": sure

EEUG
04-19-2006, 12:09 PM
@user112: ...well, the idea doesn't work. It's ~25% slower, so 1.7 stuff is the fastest one. So, I'm giving up with it...

Serdna
04-21-2006, 05:33 AM
Hi there!

First of all, thank you EEUG for your very impressive work in SMS! It is going to be some months before I am in any position to experiment with SMS code, if at all (my two little daughters don't let me much spare time :), and my experience in assembler is just a little of 68040 programming several years ago). But it is certainly quite interesting all the issues related to programming the Emotion Engine, and I don't think the PS2 is going to die on November this year (I am not going to purchase any new console in some years). I have just installed a HD to my PS2 two months ago, and soon after discovered that it is possible to program the PS2 without the Linux kit. So nowadays, I am digging up several web sites just getting acquainted with the possibilities. I hope to install the development environment and your sources soon (my first attempt failed). Nevertheless, since you are talking about some performance issues, I would like to know if you have just given some of them a thought.

It's ~25% slower, so 1.7 stuff is the fastest one. So, I'm giving up with it...Are you talking about the VUs for IDCT? Perhaps is my ignorance, but is it not possible to program VU0 as a coprocessor interleaving its instructions with those of the CPU? Certainly, the program would be much less legible, but it should improve performance, even needing to transform between integer and floating point (there are FPU instructions to this purpose, aren't they?), since at first glance all the divisions seem avoidable. Sorry if this idea is stupid, I haven't read the source code yet ;).

Another idea, that I don't know if it is possible with the free development environment, would be to flow data through the two VUs (both in VLIW mode) and come back to the CPU (I don't know if it is possible yet) in order to perform the IDCT; meanwhile the CPU could be doing something else. At least the source code of your test example (this one I have seen already), seemed quite well structured for a similar approach. At least _idctRowCondDC seems quite fit for VU's SIMD instructions. Regarding _idctSparseColPut, well, I will have to understand what it is doing first :chinscrat.

Finally, just to make myself clear, I am not asking you to make anything but sharing your thoughts :D.

EEUG
04-21-2006, 06:01 AM
@Serdna: ...no, I didn't tried VUs yet (busy with MP3 related stuff). I've just tried to transfer and rearrange macroblocks to scratchpad RAM using DMA controller while computing IDCT by main CPU. Well, IDCT computation was quite fast, so, CPU has to wait each time for DMA controller to finish data transfer. Actually, it would improve performance if macroblock address is known in advance, so we can initialte data transfer long before it needed. But in MPEG4 case there're 6 possible scenarios of macroblock motion (see _MPEG_Motion function), so, it's rather difficult to calculate that address in advance. We can try to use VU0 in micro mode to perform IDCT (and maybe unquantization also) (only for motion compensation case), so the process will look like that: transfer DCT coefficients from SPR to VU0 memory using DMA controller and VIF0, launch IDCT microprogram, and continue with motion compensation. In this case both CPU and VU0 will operate in parallel, so, this can improve performance. Other option would be to use VU1 to perform YUV->RGB conversion, but that's just for possible mpeg1/2 decoding, because now that conversion is performed by IPU quite fast...

Edit: ...btw., my personal situation with time etc. is much like yours :D...

Serdna
04-21-2006, 07:19 AM
@EEUG: Thanks! I will keep studying/searching and I will come back later :D.

jfassad
04-27-2006, 03:30 PM
I play my videos over the network using ps2client/radhost , unfortunately the higher quality ones tend to break up a lot.

I'd like to play a bit with the stream buffering logic. Can anyone point me in the right direction ? There is quite a lot of code :-)

EEUG
04-27-2006, 03:44 PM
@jfassad: ...it's all inside FileContext.c (STIO_xxx routines for "standard" I/O and CDDA_xxx ones for CDDAFS disks). My pesonal opinion is that there're limitations of either IOP itself or network driver. But maybe I'm wrong...

jfassad
04-27-2006, 04:00 PM
Should be a network driver issue. The same videos play OK from my PS2 HDD.

jfassad
04-27-2006, 04:10 PM
just did a svn checkout and the compilation now fails with the following error:

make: *** No rule to make target `obj/SMS_Utils.o', needed by `bin/SMS.elf'. Stop.

there is no SMS_Utils in the source.

EEUG
04-27-2006, 05:08 PM
...I forgot to add it. Now it's there...

thesnaker
05-02-2006, 04:31 PM
Hi, I'm trying to compile the SMS in Win32, so I can alter one behaviour (no subtitles are loaded if the extension of the movie is mpg rather than avi) and produce a version that load subs for both extensions.
The problem is that I can't get the compiler work in 3 different WinXP computers.
When I type 'make clean' in the SMS source folder (or in any of the samples folders), it ends up in the following error (after some drwtsn32 appearing in the task manager during the run...):

"make: *** [clean] Error -2147483641"

Thanks in advance if you can help me to make the compiler work,

EEUG
05-03-2006, 02:40 AM
@thesnaker: ...maybe there's a problem with toolchain (that error code means "Operation aborted" :)). Which toolchain do you have? Refer first page of this thread for instructions (I've got it working on both Win2000 and WinXPro)...

thesnaker
05-03-2006, 08:17 AM
@eeug: ... I'm already using the toolchain of this thread... I'll try to do another OS install, whithout patches, antivirus, etc. to see if it works. In the debugging file of drwtsn32, I see that one call to ntdll failed in the three systems (ntdll!KiFastSystemCallRet)

Thanks for your help,

magusneo
05-03-2006, 10:16 AM
Hello,EEUG!First,thanks your greart work of SMS. I had never thought Ps2 can play xvid movies in such a good framerate. But it seems SMS doesn't support multibyte characters presently?I have checked the source,the _load_srt() seems doesn't do any multibyte characters check.Is it difficult to add the support in this data structure?
Please forgive my ignorance if I missed something. I wondered which is the easiest way to add some chinese support?I have little C experience of KeilC51 and WinAvr,I will do some learning if i can.

thesnaker
05-03-2006, 10:30 AM
@eeug: Update: It works flawlessly with a clean W2K pro OS install...Thanks for this really great piece of software!!

PS: Why my compiled ELF takes about 975K of size while the official takes only 442K?

EEUG
05-03-2006, 10:47 AM
@thesnaker: ...it's compressed by Pixel's "ps2packer" utility...

mojojojo
05-06-2006, 11:20 PM
Hi EEUG,

I followed your instructions and I installed the ps2dev kit. I was peeking at the code, because i wanted to change the minimum vertical width. I tried to change g_Config.m_DispH to something like 398 in the file SMS_Config.c. I was able to compile sms, but it didn´t reduce the vertical width. Can you point me some directions? :D

EEUG
05-07-2006, 02:08 AM
@mojojojo: ...constants in SMS_Config.c are default values for the case of missing configuration file. They are overrided by saved settings. Try to eject your memory card in slot 0. But I would advice you to use SMS menu (Display Settings -> Advanced Settings). There's a check, however in '_disph_handler' (SMS_GUIMenuSMS.c) function, so, range of display heights for PAL is 480-512 and for NTSC is 416-448. if you need wider validation range then change following constants:


static int lMin[ 2 ] __attribute__( ( section( ".data" ) ) ) = { 416, 448 };
static int lMax[ 2 ] __attribute__( ( section( ".data" ) ) ) = { 480, 576 };

newentry79
05-07-2006, 06:53 AM
Hi EEUG,
I need a little size version of SMS player, so I try to erase same functions as network, usb support ( I don't need it). When I compile the original source on my pc the .elf file is bigger ( about 950k) than your compiled SMS 1.7 rev2 (about 470k) and, of course, when I modifiy the source and recompile it, the size is very very big. Do you use any kind of "tricks" when you compile to have a .elf file half than mine??

Newentry79

Stefy2
05-07-2006, 07:03 AM
ee-strip+ps2packer

newentry79
05-07-2006, 07:27 AM
ee-strip+ps2packer

I'm sorry I don't read very well the previus post :banghead: :banghead:

BTW, thank you for the help!!

Serdna
05-07-2006, 12:36 PM
@newentry79: ee-strip = it deletes unnecessary information from the elf; ps2packer = it compresses the executable elf and adds a little code for self-uncompressing.

newentry79
05-08-2006, 05:35 AM
@Serdna: very good explanation, thank you!!!

I've another little question: on file SMS_Data.c there are various section (about network, hdd, usb) but I don't understand some.

SMS_AUDSRV --> driver audio
SMS_IDCT_CONST --> what is???
SMS_IOMANX --> what is???
SMS_FILEXIO --> what is???
SMS_PS2DEV9 --> what is???
SMS_PS2ATAD --> what is???
SMS_PS2HDD --> hdd driver
SMS_PS2FS --> ps2 file system specification
SMS_POWEROFF --> turn off ps2 by software
SMS_USB_MASS --> something about usb
SMS_CDVD --> cd/dvd driver
SMS_PS2IP --> something about network
SMS_PS2SMAP --> what is???
SMS_PS2HOST --> what is???
SMS_USBD -->something about usb

Can anyone help me to complete the list??? :-pray: :-pray: :-pray:

EEUG
05-08-2006, 05:40 AM
@newentry79:
SMS_IDCT_CONST --> constants used for inverse discrete cosine transform;
SMS_IOMANX --> yet another I/O driver needed for HDD (refer ps2dev site);
SMS_FILEXIO --> yet another I/O driver needed for HDD (refer ps2dev site);
SMS_PS2DEV9 --> expansion bay driver (lowest level driver for net/hdd);
SMS_PS2ATAD --> ATA device driver;
SMS_PS2SMAP --> network card driver;
SMS_PS2HOST --> "host:" filesystem driver;

newentry79
05-08-2006, 06:10 AM
Perfect!! thank you very much EEUG!!!

So if need only cd/dvd and usb support I can delete:

SMS_PS2HDD --> hdd driver
SMS_PS2IP --> something about network
SMS_IOMANX --> yet another I/O driver needed for HDD (refer ps2dev site);
SMS_FILEXIO --> yet another I/O driver needed for HDD (refer ps2dev site);
SMS_PS2DEV9 --> expansion bay driver (lowest level driver for net/hdd);
SMS_PS2SMAP --> network card driver;
SMS_PS2HOST --> "host:" filesystem driver;

Another question:

SMS_PS2ATAD --> ATA device driver is needed also for cd/dvd??

Thanks

EEUG
05-08-2006, 06:12 AM
@newentry79: ...no...

newentry79
05-08-2006, 06:18 AM
@newentry79: ...no...

is referred to SMS_PS2ATAD --> ATA device driver is needed also for cd/dvd?? :confused: :confused:

EEUG
05-08-2006, 07:26 AM
@newentry79: ...I meant ATA devices connected to expansion bay socket (like HDD, for example). This driver is not needed for internal CD/DVD drive...

newentry79
05-08-2006, 07:55 AM
Ok, I understand...:D

magusneo
05-10-2006, 12:49 AM
I have made some progress:It can load & display subtitle file of .srt format in GB2312-8 character sets.Fonts are experimental and not complete though.
http://wildarms.xfvip.net/temp/TV2006050900181400.jpg

dlanor
05-10-2006, 01:09 AM
I have made some progress:It can load & display subtitle file of .srt format in GB2312-8 character sets.Fonts are experimental and not complete though.
http://wildarms.xfvip.net/temp/TV2006050900181400.jpg
Looks good (though I can't read the language ;)), but I'm not sure if I understand your comment about its 'experimental' nature properly.

Surely you don't expect EEUG to add in support for a font system that does not exist elsewhere, as an established standard ? That is the kind of solution you should aim for here, adopting an already established international font standard for use in SMS.

Not only should this give access to a larger set of available fonts, but it could even save a lot of time by allowing EEUG (and you) the possibility of studying other C/C++ code examples for that font standard.

Perhaps I misunderstood you though...?

Anyway, good luck in you experiments!
Best regards: dlanor

hip203
05-10-2006, 03:29 PM
I have made some progress:It can load & display subtitle file of .srt format in GB2312-8 character sets.Fonts are experimental and not complete though.
http://wildarms.xfvip.net/temp/TV2006050900181400.jpg

Great man !!!.looking forward for chinese Character sub at last!!!!:dance: :banghead: :-pray:

magusneo
05-12-2006, 12:56 AM
Thanks your advice and your great work about ulaunchelf,dlanor.
Your understanding is right."experimental" means I have made only about 50 chinese character fonts for testing program and they looks ugly.Making fonts is exactly the problem.It seems MtkFontCreator can only produce correct chinese character fonts file by importing from "formatted" BMP.GB2312 contains 7000+ chinese characters,It's a huge work.Maybe I need to find a tool.

EEUG
05-12-2006, 01:11 AM
@magusneo: ...well, MtkFontCreator makes fonts based upon .ini file, where characters referred by "unicode codes", so if you have Windows font with your characters, then you have to do just a lot of typework (or, write a small program which generates .ini file). I'm not sure, however, if it can handle 7000+ characters, but, you can probably split it into several parts. The real problem is that GS memory won't fit such a number of font bitmaps (current font implementation uploads these bitmaps to ths GS memory only once), so, a new code which dynamically uploads these bitmaps for each string to be displayed has to be implemented. If you want, I can create some routines for you (I can't do everything, since I'm not an eastern language expert :))...

jacky401
05-12-2006, 11:08 AM
@magusneo:

I just hope soon will have chinese either BIG5 or GB2312 support in SMS!!.Thanks magusneo !!!

If you don't mind,can i have your SMS version that support GB2312?

dlanor
05-12-2006, 11:19 AM
@magusneo:

I just hope soon will have chinese either BIG5 or GB2312 support in SMS!!.Thanks magusneo !!!

If you don't mind,can i have your SMS version that support GB2312?
Maybe you didn't read his post in sufficient detail. He doesn't have such a version completed.

What he has is a version which supports about 50 characters, whereas the full set of that standard is over 7000 characters, so he only has less than 1% of what you want (sort of)...

So at this stage it's more of an experimental demo, not something that will really work for your average movies.

If that is what you want (the demo), then you should ask again, because that was not clear from your last post. (At least not to me.)

Best regards: dlanor

jacky401
05-12-2006, 11:44 AM
I just want one day he can fully implement for movie playback with chinese subtitle :)

dlanor
05-12-2006, 12:08 PM
I just want one day he can fully implement for movie playback with chinese subtitle :)
We all wish him success in that, but it is a mighty big job...

Best regards: dlanor

EEUG
05-12-2006, 12:33 PM
@jacky401: ...you can participate to the development process as well. No programming skills are required. Just try to make some research like this:
- determine which encoding for Chineese language do you want to use (it's much easier for you to do that then for "us" (I mean people like me who knows nothing about it) :));
- determine exact number of characters in the selected encoding (phrases like "around 8000" are useless);
- make a list with numbers in ascending order. Each number is a code that corresponds to the character in so called "unicode" notation. For example, for latin letter 'A' it is 65, for arabic letter ڲ it is 1714, for this one 帽 (I have no idea to which language it belongs) it's 24125. So, for your selected encoding it would be a list with just "around 8000" numbers. Having that list is 50% of work, really ;);

oksky022
05-12-2006, 10:36 PM
korean language plz

EEUG
05-13-2006, 01:21 AM
@oksky022: ...no problem, actually, but first I would like to have "the list" I've described in the post #129. Without it I will not do anything :)...

jacky401
05-13-2006, 12:34 PM
@EEUG

- Chinese Traditional (Big 5)
- 13051 distinct character

I just know it is code page 950 but i don't know how to construct the code page of total 13051 character ,may be magusneo can help . However ,I will still try to search on the net ,hope i can help .

hip203
05-13-2006, 03:33 PM
@jacky401: ...you can participate to the development process as well. No programming skills are required. Just try to make some research like this:
- determine which encoding for Chineese language do you want to use (it's much easier for you to do that then for "us" (I mean people like me who knows nothing about it) :));
- determine exact number of characters in the selected encoding (phrases like "around 8000" are useless);
- make a list with numbers in ascending order. Each number is a code that corresponds to the character in so called "unicode" notation. For example, for latin letter 'A' it is 65, for arabic letter ڲ it is 1714, for this one 帽 (I have no idea to which language it belongs) it's 24125. So, for your selected encoding it would be a list with just "around 8000" numbers. Having that list is 50% of work, really ;);

here the list for unicode notion,
simplified chinese:
http://www.microsoft.com/globaldev/reference/dbcs/936.mspx

here the list for
traditional chinese:
http://www.microsoft.com/globaldev/reference/dbcs/950.mspx

here the list for
korean
http://www.microsoft.com/globaldev/reference/dbcs/949.mspx

What do we have to do next? :chinscrat
pls adv Eeug....now we have the 50% done?

EEUG
05-13-2006, 04:59 PM
@hip203:...actually, I understand nothing in the bitmaps pointed by these links. Where the hell thousands of symbols there? :)...

hip203
05-13-2006, 11:02 PM
unicode chinese character that is identified on the bitmap
8140 = U+4E02

This is just one of character ....so for chinese character there is really thousand of character......And we actually need all the character

This is the table chinese
http://www.microsoft.com/globaldev/reference/dbcs/936.mspx

Every sublist there is a table for another huge table of chinese character .......

So all of these need to intrepreted in unicode/and all the charcter drawing need to be intrepreted in bitmap?

EEUG
05-14-2006, 03:43 AM
@hip203: OK, I see. Thank you. In which form subtitle files are stored in most cases for Eastern languages? Is it unicode or MBCS (like stated at aforementioned tables?) Actually, 2 things should happen:
- font creation by MtkFontCreator utility (here I need the list I've mentioned earlier to make .ini file for this utility in order to produce font bitmaps). Having the information from links you provided is just 50/<number of characters+overhead>% of work :), since the list (just a text file with numbers) must be created by someone;
- if subtitle files use MBCS, then another list or table (or algorithm, I'm not sure yet) which maps MBCS codes to unicode has to be created;
Now you can imagine how much time would it cost to make such a lists. Someone must just sit, look at the Microsoft's page, and type numbers very carefully, since it would be quite problematic to find a mistake in such a huge lists. Actual programming becomes easiest part of the whole process, I think :). Another issue is memory requirements. Each character takes 512 bytes of memory in uncompressed state. For 8000 characters there will be ~4MB, which is still acceptable, I think, but it depends on movie's resolution. For some hi-res movies there could be a problem...

hip203
05-15-2006, 10:39 PM
hi eugene,
This dat file I got from a chinese program
http://www.icycloud.tk/

It has all the unicode code ....
need some time to do adjustment to the file to create a .ini file

redtiger
05-16-2006, 12:34 AM
hope this help abit:)
BIG5 to Unicode table
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT

it seem MtkFontCreator only able to handle 4940 big5 characters

EEUG
05-16-2006, 02:36 AM
@hip203:
@redtiger: ...that's what I needed in the first place. Thank you. @'hip203': no need to make further adjustments, I'll do that, no problem. @both of you: what's the difference between 'pinyin.zip' and 'MTK_big5.zip'? Which one shall be chosen? About priorities: as you probably know, I'm a professional programmer, so first priority will be given to the job I paid for :). According to the poll results SMS development shall go for the new formats (I'm busy with mpeg, but I won't be able to compete it in the near future). So, I can't promise you quick Eastern subs implementation, but I'll definitely pay my attention at it, so, first I'll try to scratch some routines which performs just text drawing, then, we will see, OK? ;)...

redtiger
05-16-2006, 07:31 AM
@hip203:
@redtiger: ...that's what I needed in the first place. Thank you. @'hip203': no need to make further adjustments, I'll do that, no problem. @both of you: what's the difference between 'pinyin.zip' and 'MTK_big5.zip'? Which one shall be chosen? About priorities: as you probably know, I'm a professional programmer, so first priority will be given to the job I paid for :). According to the poll results SMS development shall go for the new formats (I'm busy with mpeg, but I won't be able to compete it in the near future). So, I can't promise you quick Eastern subs implementation, but I'll definitely pay my attention at it, so, first I'll try to scratch some routines which performs just text drawing, then, we will see, OK? ;)...

:chinscrat im not sure, the pinyin.dat is a file show you how to pronounce chinese word, for example 帽=mao4 , mean hat in english

MTK_big5.zip is .INI file for MtkFontCreator , but it is not complete yet, does not include all the important/common characters use in chinese language (MtkFontCreator only handle about 5000 characters, more than that MtkFontCreator will crash:( ), i will try make better .INI later

hehe, mpeg support will be great!
and thanks for this great player:D

EEUG
05-16-2006, 07:59 AM
@redtiger: ...I played with MTKFontCreator stuff a bit. Yes, it crashed indeed, so creation of unicode font is really a problem. The other solution would be another font management system, no problems to create one, just a matter of time :)...

magusneo
05-16-2006, 08:38 AM
Thanks EEUG,Thanks dlanor,Thanks everyone!
I found a tricky way to solve the fonts problem.I had got 4000+ chinese character embeded into SMS.
I think cheap Chinese support is almost done.
http://wildarms.xfvip.net/temp/TV2006051620350200.jpg
http://wildarms.xfvip.net/temp/TV2006051620351600.jpg
http://wildarms.xfvip.net/temp/TV2006051620350500.jpg

redtiger
05-16-2006, 08:55 AM
wow, magusneo, this is awesome!!! :dance:
btw, what is the file size of the modified SMS?

magusneo
05-16-2006, 09:04 AM
currently 1.23M(unpacked).
Can MtkFontCreator produce better looking fonts?I can only get this looking fonts by that tricky way.

EEUG
05-16-2006, 09:09 AM
@magusneo: ...cool, so I'm stopping my research about it :D, thank you...

Edit: ...this "creator" just makes bitmaps from Windows's fonts. You can try to add outline to it ( you can also try to make it bold), so it will look better, I think...

redtiger
05-16-2006, 09:15 AM
yep, EEUG is right, just increase the font size abit and willl be perfect
MingLiu font should be ok:D

magusneo
05-16-2006, 10:48 AM
Thank you.Fonts ever worried me some days.
My work is primitive,I modified the source casually.It's "cheap" chinese support,so it has some restrictions and sure has many glitches(I have found some).I don't know if i can fix those problems.EEUG,Please continue your research about multibyte character support if you have the intention.

EEUG
05-16-2006, 01:44 PM
@magusneo: ...I just have in mind to get rid of MTK fonts (as there's no source code for that utility, so no way to fix it) and write new font management system (including PC application to make fonts) from scratch in attempt to make SMS fully unicode based (so character bitmaps will be decompressed "on the fly" and uploaded to the GS memory just before drawing). I don't know how long will it take...

jacky401
05-17-2006, 01:16 AM
@EEUG

I will wait for the new unicode font system .Thanks

@magusneo

Could you mind sharing your version that now contain over 4000+ chinese character with us? (I understand it is still in primitive stage but i would like to test with it) Thanks a lot.

magusneo
05-17-2006, 08:44 AM
EEUG,I see.It's a huge work.I think MtkFontCreator is also a good utility for some embeded system.I even want to know the exact decompress arithmetic.

jacky401
05-17-2006, 11:15 AM
@magusneo

Just tested some movie with simplified chinese subtitle,i only can say it is EXCELLENT,Is it possible to support Traditional chinese(big5) ? and if bigger font would be great !!! Thanks a lot.

And i found two bugs,

One: now can't load english subtitle anymore but simplified character is ok.
Two: background skin can't load.

magusneo
05-17-2006, 12:11 PM
Sorry,I uploaded the wrong sms(cant load english substitle),please try again.
It is possible to support other doublebyte character set,needs a adressing formula and fonts.But I always got some problems in producing fonts file by MtkFontCreator.Even using redtiger's MTK_big5.zip.

redtiger
05-18-2006, 12:00 AM
@magusneo
try change the "Primary Font" to MingLiu font first, then load big5.ini
(if you load the big5.ini first, this will cause MtkFontCreator run out of memory or crash)
btw, can you upload your .INI for GB2312 ? thanks:D

magusneo
05-18-2006, 12:13 AM
Thank you,It works.Are all big5 characters here?
I don't use something like GB2312.INI,current fonts are imported from formated BMP.

redtiger
05-18-2006, 02:23 AM
@magusneo
yes, there are big5 characters
im still doing some adjustment so that it can include the most commonly used chinese characters

http://www.zein.se/patrick/3000char.html
http://www.zein.se/patrick/3000en.html

btw, you can use my big5.ini and change it to simplified characters, just change the "Primary Font" to SimSun or SimHei font, i have check unicode table, both looks the same, i might be wrong, but still doing some research

chinese simplified unicode table
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/CNS11643.TXT

redtiger
05-18-2006, 04:01 AM
almost complete :D , this .INI include 3270 commonly used chinese charaters
i think it is compatible with BIG5 or GB2312

please inform me if you found any errors

magusneo
05-18-2006, 06:28 AM
Thank you.
But I got a question:Is the sequence of these characters in big5.ini the same as it in standard big5 character set?If not,there may be some difficulties to addressing them.

redtiger
05-18-2006, 08:34 AM
@magusneo
sorry, i forget about the mapping/addressing issue
so i need to follow the sequence exactly like in these table ?

http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT
http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/CNS11643.TXT

but how about the characters that is not included?
the INI only contain the font address and UNICODE, should i create a file so that i can link BIG5/GB2312 code to each character in the INI ?

SMS read BIG5 <-> new file with BIG5 and MTK font address <-> MtkFontCreator INI

need a little help on this:chinscrat

jacky401
05-18-2006, 08:45 AM
@redtiger

i tried to use your big5 ini to build a mtk font to load with SMS but failed.Can you teach me how to do it correctly? or can you share yours with me ? thx

@magusneo

i tried your new version ,now can load the english subtitle font and simplified chinese as well.

redtiger
05-18-2006, 09:55 AM
@ jacky401
big5.ini and chinese_common01.zip still not working with SMS yet, sorry:(
need a little detail how to map those fonts to big5 or GB code

magusneo
05-18-2006, 10:26 PM
redtiger,have you tried to use EXCEL?Maybe it can do some help.
I found it is possible to add some cheap unicode support because of SMS's good program structure.Just testing.

redtiger
05-19-2006, 03:04 AM
@magusneo
ok, i will try to put most of the useful data on excel file, big5/gb code, unicode, characters and other useful info
but it will take a little bit more time:D

magusneo
05-19-2006, 03:34 AM
I thought if SMS can recognize unicode subtitle file,we don't need to do some mapping between big5 and unicode(including MTK INI address).Just save big5 code subtitle file as unicode before playing.Do you think is it practical?

oksky022
05-19-2006, 06:13 AM
korean font plz TT....

redtiger
05-19-2006, 06:32 AM
@magusneo
good idea, this maybe a quick solution, but im sure some user will lazy to do the conversion :)

@oksky022
we are still doing test on unicode character support, only handle some chinese characters, still long way to go
if you can find some korean character detail like codepage, unicode table, fontname, we might able to help you

UPDATE:
@magusneo, i have attach the excel file
it contain,
chinese BIG5,
chinese GB2312,
japanese SHIFTJIS,
korean KSC5601 (is it same as CP939? anyone know?)
and a table with commonly used characters

hope it can give you some help:)

jacky401
05-20-2006, 12:29 PM
@magusneo

Just checked your new version again now the chinese fonts have been aligned with the english one .Thanks a lot.Now i can watch my movie with chinese subtutke. If you have time,could you mind making a SMS version support BIG5?

And,do u have the problem loading background skin since i used your modified SMS program,i am unable to load the background skin again (SMS will hang and black screen)

EEUG
05-20-2006, 02:37 PM
@jacky401:
@magusneo: ..just hold on with skin stuff, since I'll release another "cosmetic" update soon, where I've changed image management routines in order to perform image decompression by IPU, so, there will be new code, smaller SMS.elf, new skin generator and new skin format :)...

jacky401
05-20-2006, 03:34 PM
@EEUG

Thanks.A new revision will come out !

magusneo
05-20-2006, 10:03 PM
@redtiger,It's great.Big5 subtitle file support may be soon.

@jacky401,Sorry,I have no idea about skin issues.

@EEUG,Thanks for new version.Since I know nothing about ps2's DMA,IPU part(I can't find any useful technology information about them),I'm afraid I don't have the ability to fix the problem jacky401 mentioned.Can you help us?I will post modified source lately.

EEUG
05-21-2006, 02:41 AM
@magusneo: ...yes, sure. Just wait a couple of days till I'll finish this new image processing stuff (it's actually finished, but "Mr.Worm~~" reported that he has a problem with it (it crashes sometimes if movie is stopped by "triangle", though here I didn't manage to reproduce this behaviour))...

magusneo
05-21-2006, 11:42 AM
@EEUG,Thank you very much.


@redtiger,
@jacky401,Please check the following file.
Big5 character set contains so many characters.I just finished about 9000 characters.Hope ps2's memory can handle the full set.
update......

jacky401
05-21-2006, 04:00 PM
@magusneo

Thanks for the BIG5 implementation ,BIG5 have so many characters about 13000
.I found one bug is the big5 text is not centered and shifted to the right .(GB2312 text have the correct aligment in the SMSc.elf)

redtiger
05-21-2006, 11:23 PM
@magusneo
hehe, thanks!!! i will try it:D
btw, how you produce these fonts and embed into SMS? using MtkFontCreator?:chinscrat

magusneo
05-22-2006, 12:03 AM
Updated the file.

@redtiger,yes,I use the MtkFontCreator,divided the characters into several arrays,each contains 128 characters.

redtiger
05-22-2006, 12:36 AM
@magusneo
if BIG5 is 13000+ characters, thats mean you need to create about 102 MTK fonts INI ?!:wow:
if you need help, i can try to generate these INI for you:)

magusneo
05-22-2006, 01:24 AM
It's OK by using Word+VB Macro.Copy these mtf data and paste into the source is really boring though.


edit:You reminded me,It's a stupid idea.It's not necessary to divide characters into so many arrays. :chinscrat

redtiger
05-22-2006, 08:57 AM
@magusneo
already tested your SMS big5 version, it works! well done!!!:D :lol:
i have try to play XVID 800x432 video(AC3 audio) using USB drive, i notice there is abit performance drop, about 2 to 3% i think:chinscrat , but it is not a problem:)
hahaha, im going enjoy my video now...this is great
thank you!

jacky401
05-22-2006, 11:42 AM
@magusneo

Your updated big5 version is great.I seen your new version have a
'New Times Roman' english font for the GUI,i like it very much.Is it u hard-coded it inside the SMS?

magusneo
05-22-2006, 07:01 PM
I'm using "Lucida Sans Unicode" fonts as defaults.Maybe you can change it by adding mc0:SMS/ascii.mtf.
I have put all big5 charachter fonts into SMS,but SMS will hang during playing a movie with big5 subtitle.It seems ps2's memory can't handle it.

btw,It's interesting that the same SMS works on PCSX2.

guyspy
05-25-2006, 06:01 AM
why arabic subtitles not loaded
please help!

magusneo
05-25-2006, 08:08 AM
I found some codes in my previous modification are not necessary. :(
If I had known more about ps2's DMA IPU.... :banghead:

Anyway,
@EEUG,if you have some free time,please check the following file.
Mainly modified SMS_SubtitleContext.c.SMS_GS_2.c was little changed.
I'm sorry for the poor codes and some silly methods being used because of lacking programming experience.

EEUG
05-25-2006, 08:20 AM
@magusneo: ...I'll take a look at it, no problem (just not today :))...

Edit: ...well, it's rain again, so, I've took a look at the code. Yes, you did a great work here, really. If your code doesn't work with latest version then this is because IPU code crashes when you try to upload character bitmaps to the GS. DMAC generates an interrupt on GS channel each time it finishes data transfer, but IPU code that performs colorspace conversion and display is interrupt driven, so any interrupt on GS DMA channel that was caused by "external" code causes problems (I've changed the code in the latest release, that's why it worked before). I can suggest 2 things:
- before uploading character bitmaps try to call "Suspend" method of
IPUContext and call "Resume" method when you finish uploading;

OR

- use Path2 (VIF1) for the data transfer (look at new
IPU_InitLoadImage/IPU_LoadImage functions for example of bitmap uploading
via Path2). In this case you can modify "produce_packets" function in order
to embed bitmap uploading code into display code. Doing so will improve
performance, as in "Display" method of "SubtitleContext" you won't produce
DMA packets and perform only bitmap decompression (though, I'm not sure
about memory requirements, try to check that). Btw., I've changed bitmap
decompression code (_swap_nibbles/_swap_bytes) functions, so
decompression should go a bit faster);

magusneo
05-25-2006, 11:06 AM
@EEUG,Thank you very much!
So interrupt matters.I will try to fix it as your suggestion.

edit:It seems I can't search out IPU_InitLoadImage/IPU_LoadImage function in source. :rolleyes:

EEUG
05-25-2006, 02:16 PM
@magusneo: ...they are inside "SMS_IPU_1.c"...

magusneo
05-26-2006, 06:24 AM
Sorry,I didn't notice there is a new version of SMS then.
I have downloaded the new source,when I try to compile it I got an error:
"smsmake: *** No rule to make target `obj/SMS_GUIFileCtxMenu.o' "
But there is no SMS_GUIFileCtxMenu.c file in the source.Did I miss something?

chihyg
05-26-2006, 06:25 AM
Hi~
korean caption...
please~

EEUG
05-26-2006, 06:56 AM
@magusneo: ...my fault, I forgot to add the file. Now it's there.
@chihyg: ...perhaps you can cooperate with "magusneo" since I'm out of business there :)...

jacky401
05-26-2006, 12:59 PM
@magusneo

Hope to get your new verison 1.7 rev4 SMS with BIG5/GB2312 chinese character support soon!

i seen u source code,is it now able to display both BIG5 and GB2312 chararcter in the same SMS program?

magusneo
05-27-2006, 12:43 AM
@EEUG,Would you mind tell me,where is the function prototype of GS_LoadImage() & GS_InitLoadImage()?

@chihyg,Sorry,I don't know korean either.

@jacky401,I was trying to modify the new version of SMS.
I also think ps2's memory can't handle the full big5 character set currently.

EEUG
05-27-2006, 02:49 AM
@magusneo: ...it's in SMS_GS.h...

magusneo
05-27-2006, 07:03 AM
@EEUG,Sorry for my poor english,I should ask "where is the function definition of GS_LoadImage() & GS_InitLoadImage()".
I have tried the Suspend/Resume methods,seems it works great,I noticed there is some performance improvement in new version of SMS even in this way.

@jacky401,I have updated the GB2312 version...

guyspy
05-27-2006, 11:10 AM
what about arabic fonts from right to left direction?
and unseparated letters.

jacky401
05-27-2006, 12:43 PM
@magusneo

just checked your new version .everything is great .the background loading issue is gone and character alignment is also great as well .Thanks


@EEUG

Is there any possible solution to handle full set of BIG5(13051 chararcters) in PS2 memory ? becasue GB2312 is working fine as magusneo stated,now only BIG5 have memory limitations.

broodje
05-27-2006, 12:55 PM
here we go, Dutch translation for SMS 1.7 Rev.4.

hope this is the right thread...

EEUG
05-27-2006, 01:49 PM
@broodje: ...I've updated the archive, thank you...
@jacky401: ...it's possible to change character's dimenstions from 32x32 to 16x16, for example, and enlarge it during display (the same way as resizeable subtitles). It will look more ugly, I think, but it will consume at least twice less memory...
@guyspy: ...I think someone (namely "rami1") is trying to do that already, so make a contact with him about it...

hip203
05-27-2006, 09:39 PM
Hi,
I' dont have a network ps2 to try on this....
but all you need to have is avisynth,virtualdubmob(To create avs script) and this smalll Makeavi application to make a dummy avi.;Sound are decoded into pcm/video on raw(yuv12/yuv2) video signal on your pc side.

With this virtually all video format can be played ....I enclose this application .....anyone with network playstation 2 could try with it ..Let me know whether it works..
:dance:RM,RMVB,OGM,AVI/OGG,MP4...MPEG
So basically I'm saying there is no need on codec implimention on SMS at all...decoding is done on PC side ,video feed/audio feed is AVI Standard ..

Readme
1.)On the documention It state the application must be able to read avi stream which SMS complies..perhaps someone could try whether it works.
http://www.avisynth.org/Section+2:+A...d+frameserving

2.)Subtitle decoding will be done on pc side ...hardcoded to the video stream......so it's any subtitle language could be displayed
.

magusneo
05-28-2006, 12:08 AM
@jacky401,I think it's also a way of getting rid of those seldom used characters in MtkFontCreator.ini,but this work must be done manually.

@EEUG,If I use functions like IPU_InitLoadImage/IPU_LoadImage for bitmap uploading via VIF1 Path,but don't modify "produce_packets" function,will it be faster than using GS_LoadImage/GS_InitLoadImage for bitmap uploading via GIF Path?

jacky401
05-28-2006, 12:33 AM
@magusneo

it is a good idea.May be you can give me the ini so i can try for it .

and now how many big5 characters that ps2 memory can handle without going full? 9000?

EEUG
05-28-2006, 02:28 AM
@magusneo: ...no, I don't think it will go any faster, since amount of calculations will be roughly the same. What you can try to do, however, is use ScratchPad for 'lCharBuf' in the '_load_hzbmp' and for 'lLoadImage' in the 'Display', so DRAM access overhead will be eliminated. It will be fastest end easiest way to gain some performance (I agree, that embedding uploading code into display code is quite a difficult task), though, I'm not sure if GS_LoadImage can accept ScratchPad addresses, most probably "yes", but I'm not sure (just remember, that for CPU ScratchPad address range is 0x7000000-0x70003FFF and for DMA operations it's 0x80000000-0x80003FFF). There's a global variable 'g_SPRTop' which points at the free position in the ScratchPad, so, you can use it freely...

magusneo
05-28-2006, 10:03 AM
@jacky401,if you have some free time,try to set those seldom used characters's unicode value to 0x3000 which means space,it should save memory.The amout of characters which ps2's memory can handle depend on font set and visual effect(width,height,bold,outline etc..).I think it will be safe for most case if the total memory(mtf size) which all character sets possess don't exceed 900K.

@EEUG,thanks your detailed hints.I just want to know a little more.
Actually,Based your recent source,I think current performance is good enough to watch most movies.
Another problem about my modified SMS:Sometimes,there is a random character repeat phenomena on the screen.
For example,there is a string "quest"(each letter means a chinese character) to be displayed.But when it actually got showed on the screen,sometimes,it will be "uuest" or "qeest" or "qusst" or "quett".It's random.Do you have any idea about this?
btw,all chinese characters have same width.

EEUG
05-29-2006, 04:10 AM
@magusneo: ...well, if performance is satisfactory then just forget about further improvements :). Concerning these "random" characters: did you noticed such an event in the "original" version? If yes, then there's a bug somewhere (probably in string splitting, or in the subtitle parser). Otherwise just check your code again :)...

oksky022
05-29-2006, 06:00 AM
magusneo ...

you good

korean subtitle plz

plz

jacky401
05-29-2006, 08:42 AM
@magusneo

i tried to load the ini in mtkfontcreator,it is really quite difficult to get rid of those uncommon big5 characters ,sorry...:)

i don't know it is good as EEUG suggested to try to use 16x16 or 24x24 font size so less memory will be used.

magusneo
05-29-2006, 08:48 AM
@EEUG,I haven't found the problem in the original version,I'll check my code again,Thanks!

@oksky022,I would like to help you.But I don't know korean and can't find addressing formula to korean character set(it names "KSC"?).Perhaps,you should ask a korean knowing a little c language.

@jacky401,16x16 or 24x24 fonts will be ugly like those fonts I first used.

redtiger
05-29-2006, 08:48 AM
update unicode map (excel format)
added 7072 commonly used chinese traditional characters,
not fully complete yet,
maybe i will add macro to generate MtkFontCreator .INI file later:chinscrat

edit: the common chinese 2 table is not good enough, alot of common characters is missing, i have to find another source:(
edit: the old unicode table is removed

macrojohn
05-29-2006, 08:55 AM
how many korean characters are there in all?

jacky401
05-29-2006, 08:58 AM
@magusneo

Hi ,is it possible to use redtiger 7072 commonly used big5 character ? may be i can see a film to see whether it is really common big5 character ;)

redtiger
05-29-2006, 09:03 AM
how many korean characters are there in all?
about 11000 korean characters, if including chinese characters ( korean use some chinese characters) it will be around 16000 character!
commonly used korean characters is still unknown

macrojohn
05-29-2006, 09:45 AM
that's a great deal,even more than traditional chinese characters...
probably sb should delete at least a half characters which's uncommonly used then to get a runable version...

magusneo
05-29-2006, 10:29 AM
@redtiger,How does those characters arrange in the "chinese common2" table?Why the first character is 0x7684(unicode value)?

redtiger
05-29-2006, 11:08 AM
@magusneo
column #1 and 2 is not really important, the table is sort by unicode, yes, 0x7684 is unicode

redtiger
05-31-2006, 03:38 AM
unicode map with MTKFontCreator .INI generator

older excel file will be remove after 10 days

magusneo
05-31-2006, 04:44 AM
Well done,redtiger!Can you also make a MTK INI file in which each "Preset" contains 4096 characters?Because I can't edit macro in your excel file.

edit:Only 4381 common big5 characters?

jacky401
05-31-2006, 05:13 AM
@magusneo

I just seen redtiger updated with its unicode excel.Is it possible to make a workable big5 version of SMS using regtiger common big5 character table ?
i am still wish to get a big5 version from you .Thanks .

redtiger
05-31-2006, 07:46 AM
@magusneo & jacky401
yep, only 4381 for big5 common characters (maybe i need to get a better source, while gb2312 common char is much more easy to find, it is about 7000, the latest update i heard is about 8225,you can try google 常用字表)
thats why i need to join/compare both big5/gb2313 common table, so the new big5 common characters is about 6109
please tell me if you need any changes to the excel file, i will try to update it
and you can edit the macro, just goto "Tools->Macro->Visual Basic Editor"

by the way, happy "Duan Wu" festival to both of you, hehe:D

4096 characters INI attached

magusneo
05-31-2006, 10:24 AM
@redtiger,Thank you!
I still can't edit macro,because there is no macro I can edit("Tools->Macro->Visual Basic Editor") when I open the unicode_map_update.xls.


update,there still may be overlap if your subtitle contains uncommon characters.
You can change the fonts(such as adding uncommon characters fonts) by loading the following fonts file:
mc0:SMS/latin2.mtf - contains the first 4096 characters of BIG5
mc0:SMS/cyrillic.mtf - contains the second 4096 characters of BIG5
mc0:SMS/latin1.mtf - contains the third 4096 characters of BIG5
mc0:SMS/greek.mft - contains the rest characters of BIG5

jacky401
05-31-2006, 11:56 AM
@magusneo

Thank you . I checked the big5 version ,just one problem exist.Some big5 characters will overlap each other


@redtiger

Thank you for your big5 character table .

lo911
05-31-2006, 02:03 PM
about 11000 korean characters, if including chinese characters ( korean use some chinese characters) it will be around 16000 character!
commonly used korean characters is still unknown

not necessary to have all the Korean characters

Here Korean characters summarized and font unicode
korean2.ini.rar == ini for MtkFontCreator
gulim.part1.rar == unicode font korean
gulim.part2.rar


pd: comunmente que lo usa son total de 596 caracteres

redtiger
05-31-2006, 11:59 PM
@lo911
thank you! is that commonly used korean characters? i will try add it the INI generator

note : from now on, i will always update my post #212 here (http://www.ps2-scene.org/forums/showpost.php?p=331432&postcount=212), and attach the newest unicode map/ INI generator

jacky401
06-01-2006, 12:07 PM
@magusneo

i checked those overlap characters are common character .And the overlapping problem not exist in your first version based on rev.3 but only in rev.4 now.

magusneo
06-01-2006, 07:12 PM
@jacky401,you misunderstood it,please read post #216 again.
If you still have questions about overlap,P.M me...

FaberfoX
06-06-2006, 06:27 PM
EEUG, I've just installed the ps2dev env and got your latest sources. I set out to enable support for 16x9 TVs and got some success already. What I wanted to ask you is this: Do you know a way or can you point me in the right direction on how to read from the System Configuration the Screen Size? I'd like to add the feature to SMS and take the defaults from there. Also, do you know how to change the horizontal resolution so as not to get black bars on both sides? I was thinking on changing the screen adjust if width can be changed, from like it is now (left right up down) to left - width - top - height, using X to increase and O to decrease, what do you think about this?

EEUG
06-07-2006, 04:24 AM
@FaberfoX: "...Do you know a way...": try to look at osd_config.h/c files from ps2sdk;
"...do you know how to change the horizontal resolution...": 'm_PWidth' member variable of 'GSContext' holds "physical" horizontal resolution (see SMS_GS_1.c file). Currently it's hardcoded to 640 (horizontal resolution of usual TV). There's also m_Width variable which specifies "logical" horizontal resolution. I don't know how widescreen TVs work, so, try to play with these two variables. There's also some stuff in SMS_IPU.c which positions an image in accordance to movie's aspect ratio. So, if SMS browser has these "black bars on both sides" then try to change m_Width/m_PWidth. If only movies have "black bars on both sides" then SMS_IPU.c has to be adjusted. Again, I don't know how widescreen TVs work, so, maybe you have to adjust both GS and IPU stuff...

neiljames
06-07-2006, 04:53 AM
I was wondering if there would be any way to add a button command that would allow the playing of a CD1 CD2 video file instead of having to wait for one to end then go and play the other...(play CD2 automatically). I know that I'm bein' a lazy bastard and that it might be a litlle much but I think it would be pretty damn cool. Almost like the playlist for mp3 files within a folder.

dlanor
06-07-2006, 05:31 AM
I was wondering if there would be any way to add a button command that would allow the playing of a CD1 CD2 video file instead of having to wait for one to end then go and play the other...(play CD2 automatically). I know that I'm bein' a lazy bastard and that it might be a litlle much but I think it would be pretty damn cool. Almost like the playlist for mp3 files within a folder.
A better method would be to implement playlists for videos too.

After all, on other systems (well, in Windows anyway) you can use M3U files for video as well as audio.

Best regards: dlanor

tony111
06-07-2006, 11:32 AM
is it possible to resize videos height without loss off widht.
That would be a good uppdate

rathunter
06-07-2006, 12:59 PM
I don't understand what you mean. There is a function to make make videos taller? but this also makes them narrower?
does SMS menu:>Display settings...>Advanced settings...>Display height
work for you?
also, there is the fullscreen mode (push square 4 times).

<__>
06-07-2006, 01:27 PM
I see what he means,if you change the video size option you lose the sides of the picture,there is 1 setting where the video fills the screen with no loss but it makes everybody look very tall and skinny.
I have noticed that some of my avis look slightly squashed(people look fat) and I agree it would be nice to be able to stretch the image height until it looked right.

Maybe you should post this in the SMS feature requests thread :shhh:

jacky401
06-11-2006, 09:12 AM
@magusneo

I attached the full big5 ini for you

redtiger
06-12-2006, 08:50 AM
unicode map with MTKFontCreator .INI generator

if you wish to modify/enhance the macro, just goto "Tools->Macro->Visual Basic Editor", make sure you turn on "Project Explorer" under "View" menu, double click on a sheet, and you should able to see the macro vb code

update :
2006-jun-07 > include full korean / japanese INI generator (for testing only)
2006-jun-12 > include full BIG5 / GB2312 INI generator (for testing only! SMS now able to handle full set of these characters)

older excel file will be remove after 10 days

jacky401
06-12-2006, 09:08 AM
With help from magusneo and redtiger,we finally able to get the full big5 characters working with SMS ,

You can download here and remember those 4 mtf should be placed under mc0:/SMS/


Thanks magusneo for creating the excellent gb and big5 SMS version
Thanks redtiger for creating the excellent unicode map
Thanks EEUG for creating excellent SMS

@EEUG
Will the mpeg1/2 support in next version ? :)

magusneo
06-13-2006, 10:07 AM
Here is a SMS integered all big5 fonts,but there may be notable performance drop issue,check it yourself.:chinscrat

And a null_fonts version,it needs mc0:SMS/*.mtf(big5 fonts) to work.

source

chihyg
06-19-2006, 01:32 PM
please... korean version....

mojojojo
07-05-2006, 06:59 PM
Hi eeug,

I was browsing thru the sourcecode of SMS and I noticed that there´s some code to support progressive scan. I was trying to enable it, but without much success. :-/

I searched the forum and in another thread you said that 480p was disabled, because you are unable to test it and wanted to avoid confusion.

Would it be too much work for you to compile a version with this mode enabled? I can test it here.. :)

mojojojo
07-05-2006, 07:56 PM
oh yes, let me describe what I did in my failed attempt :( :

I tried to copy the parameters from mode "GSVideoMode_DTV_720x480P" into "GSVideoMode_NTSC" in the file SMS_GS_1.c, as the NTSC mode is enabled by default.
I also edited SMS_GUI.c, and copied the conf of lMode from 480p into the GSVideoMode_NTSC.

But unfortunately my tv does not detects the display as 480P. my tv says that the video output is 480i, and the screen gets all messed up.

EEUG
07-06-2006, 03:08 AM
...and what happens if you change
GSContext_Init ( g_Config.m_DisplayMode, GSZTest_Off, GSDoubleBuffer_On );
to
GSContext_Init ( GSVideoMode_DTV_720x480P, GSZTest_Off, GSDoubleBuffer_On );
in SMS_GUI.c leaving other files intact?

mojojojo
07-06-2006, 10:58 PM
Cool!! I did what you asked and the tv switched to progressive 480P in the gui. The gui is filling only the top half of the screen, but it did switch!
the video playback is still in 480i though... :(

mojojojo
07-06-2006, 11:33 PM
I also changed the line

GSContext_Init ( g_Config.m_DisplayMode, GSZTest_On, GSDoubleBuffer_Off );

to

GSContext_Init ( GSVideoMode_DTV_720x480P, GSZTest_On, GSDoubleBuffer_Off );

in the file SMS_Player.c, and the video played in 480P as well :) The video also only played in the top half of the screen as well.

EEUG
07-07-2006, 01:07 AM
@mojojojo: ...thank you for trying. After my vacations we'll try to shoot this issue. Btw., do you observe "full picture" "in the top half of the screen" or it's just a top half of the "full picture"? And what is "in the bottom half of the screen"? Maybe there's incorrect setting for screen height or pixel aspect ratio somewhere, I don't know at the moment...

mojojojo
07-07-2006, 06:30 AM
Sure, have a nice vacation, and thanks for the help.

I got a "full picture" in the top half of the screen. In the bottom I get a "blac screen with some noise" (looks similar to when a tv doesn't tune a channel correctly).

Also switching to pan-scan 1 and 2 doesn't change the height, but when I switched to pan-scan3 and fullscreen while a video was playing, it filled the whole screen.

EEUG
07-07-2006, 07:19 AM
@mojojojo: ...thank you. It appears that pixel aspect ratio or physical screen height is set incorrectly somewhere (not a big problem to fix, I think and the main thing is that all drawing code works correctly (you didn't noticed "broken lines" and other garbage in that "top half", did you? Everything is displayed correctly but it appears squeezed in vertical direction, right?). I'll come back to it after my vacations and we will start from the simple test program based on SMS code to get this video mode operational :)...

jacky401
07-11-2006, 09:42 AM
For magusneo ,please find the collected subtitle context source below

morphix
07-13-2006, 09:15 AM
erm.. i cant seem to find ps2dev? is ps2sdk ps2dev for *nix??

EEUG
07-23-2006, 09:51 AM
@mojojojo: in addition to your latest changes (with "half screen" image) try to locate following statements in SMS_GS_1.c:

case GSVideoMode_DTV_720x480P:
lIMode = GSInterlaceMode_Off;
g_GSCtx.m_PHeight = 480;
break;

change them to:

case GSVideoMode_DTV_720x480P:
g_GSCtx.m_PHeight = 480;
break;

Any changes?

mojojojo
07-23-2006, 05:38 PM
Hi EEUG,

I tried your changes, now SMS is displaying correctly in 480P !! it looks awesome :)

Do you intend to add this mode in future releases? :)

jacky401
07-23-2006, 08:18 PM
i tried as well,it works flawlessly !

EEUG
07-24-2006, 02:23 AM
@mojojojo:
@jacky401: ...thank you for trying. Yes, I'll try to add "official" support for this mode to the next release (in September, I think, after vacations)...

EEUG
07-25-2006, 09:14 AM
Here (http://rapidshare.de/files/26865844/SMS.elf.html) I've put "unofficial" 1.7 Rev.6 with DTV480P video mode settable via SMS menu, so, anyone who's got appropriate TV can test it and give a feedback. Language file must be updated (one string has to be added).

Robert de Clair
07-25-2006, 06:55 PM
Best Divix player ever :)
i have a three big wishes for next relases of sms and one smaller ;)

1 streaming from web a musicstations - like nectarine or shoutcast, with supported a internet stations editable list.
2 support for txt/doc/pdf files - just for reading - i mean ebooks and others
3 supprt for graphics files like bmp/jpg/png
4 support for mpg files (not nesessary but would be nice)

thank You guys, cold beer for wveryone.

bigfire
07-25-2006, 08:58 PM
For magusneo ,please find the collected subtitle context source below

I combined this source code to support GB2312 subtitle. And I created the fonts by MtkfontCreator_0.6.2. But the text is shown as garbage. Looks like the font format does not match the program. Anyone can give me some tips? Thanks a lot.