forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[PS2] Updates, bugfixes, plus new libfont

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions
View previous topic :: View next topic  
Author Message
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Wed Mar 24, 2010 2:06 am    Post subject: [PS2] Updates, bugfixes, plus new libfont Reply with quote

Changes

libdma:
Added a dma_tags.h header for easy dmatag creation
Now supports normal/chain/ucab normal/ucab chain transfers
Supports enabling/using cpcond0 dma fast waits

libpacket:
Handles only allocating/freeing packet data.
Redesigned to use only a 128-bit QWORD type
Supports UCAB & SPR packets
Appending data uses packing macros available in other headers

libdraw:
Handles only making GIF packets.
PATH2/PATH3 compatible
New 2d primitives including outline/arc primitives
New primitive start/end system, similar to OpenGL's Begin()/End() blocks
Texture uploading support, including textures with cluts
Drawing Environment headers and settings are now defined
Supports alpha blending and transparent pixels by default
Libdraw functions take and return QWORD* pointers for easier queue management.

    For example:
    Qwords can be used/reserved prior to drawing something (vifcodes for path2, or dmatags for dmachains).
    Easier to calculate qword counts for dmatags in dmachains without having to keep track of how many qwords were used.
    Drawing small static animations or non-changing queues, similar to gsKit's persistent queue, without having to rerender it all.
    Allows using multiple packets to doublebuffer dma sends.

libgraph:
Only modifies GS privileged registers and handles vram.
Flicker filter support when using interlacing with a single hi-res framebuffer
Scales small framebuffers for modes with large resolutions
Small resolutions such as 256x224 are now supported
Vsync handler support
Vram allocator was added, allows freeing in FIFO order, and total clearing of vram.

libfont:
Supports FONTX2 type fonts and printing in ASCII(JISX201) or Shift-JIS
Supports rom0:KROM fontx2 type font, as well, thanks to nika of LbFn
Supports FontStudio 4.1 bitmap fonts with kerning information and scaling
FontStudio printing supports UTF-8 strings up to character U+FFEF
(U+FFF0,U+FFF1,U+FFF2 are reserved for the implementation)
Sample shows how to load/unload each type of font as well as printing.

Headers:
New QWORD type in tamtypes.h, used for packing 128-bit data
Separated the GIF/GS registers
Added new vifcode/VIF register headers
Added various VIF/GIF/DMA packing macros to each of their headers.
Fixed the timer registers to be u32* not u64*

Samples:
All of the samples for libdraw/libgraph/libmpeg samples have been updated
Some samples have been enhanced
A new libfont sample has been added

Etc:
I've fixed all the compiler warnings and added a bugfix here or there.
The libpacket/libgraph/libdma libraries have no dependencies.
The libdraw library has a dependency on libmf or libm for the arc primitives.

Patching

Added:
I've added about ~30 new files and one new directory, I have a list in case it's needed.

Removed:
The only file that needs to be removed is ee/graph/include/graph_registers.h

Here's the patch:
http://pastebin.com/0Jw3mx4z
http://www.mediafire.com/file/onzmmi1mjt5/ps2sdk-patches.tar.gz

FontStudio

Homepage:
http://www.nitrogen.za.org/projectinfo.asp?id=12

Mirror for the program if the site isn't working:
FontStudio 4.12


Last edited by ragnarok2040 on Wed Jun 23, 2010 7:22 am; edited 2 times in total
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Mar 25, 2010 9:03 am    Post subject: Reply with quote

SVN isn't working right now, but I'm having trouble with this patch anyway, it looks damaged. for example:
Code:

$ wget -q -O ps2.patch http://pastebin.com/download.php?i=0Jw3mx4z
$ patch -p 1 < ps2.patch
(Stripping trailing CRs from patch.)
patching file common/include/gif_registers.h
....
(Stripping trailing CRs from patch.)
patching file ee/libgs/samples/libgs_doublebuffer/Makefile
patch: **** malformed patch at line 75225:

$

This patch is big enough to be pretty unmanageable at nearly 1MB.. can you break it up smaller by any chance? Either way, please upload a copy to a site that will deliver it without mangling (ie. some file sharing host instead of pastebin)
Back to top
View user's profile Send private message
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Thu Mar 25, 2010 4:37 pm    Post subject: Reply with quote

I was using Codeblocks to work on the whole ps2sdk source, which is why I made a single diff, heh. I was actually planning on breaking it up, but I forgot in the rush to get it out somewhere. I've been antsy since I had a rm command go wild early last year.

I can use a script or something to break the patch down to individual patches, then make patchsets for their individual purpose. I've done it before when I was looking at the toolchain patches.

I think 8 patchsets might do it:
libdraw
libgraph
libpacket
libdma
libfont
libmpeg
additional headers
misc. bugfixes

I'll put them in a tarball and upload them somewhere, :D.

Edit:
Here they are. I just did it by hand rather than go to the bother of using a script or shell command. The patches were pretty much grouped together already in the unified diff so it took ~15 minutes.

http://www.mediafire.com/file/onzmmi1mjt5/ps2sdk-patches.tar.gz
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Mar 27, 2010 3:14 am    Post subject: Reply with quote

Thanks. SVN is still down but remind me when it's back up and I'll apply.
Back to top
View user's profile Send private message
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Sat Mar 27, 2010 3:38 am    Post subject: Reply with quote

Will do, :D.
Back to top
View user's profile Send private message
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Mon Mar 29, 2010 4:13 am    Post subject: Reply with quote

SVN is working again, :D.

I uploaded another patch to fix the netfs module. It adds compatibility for block devices, like "hdd:".

http://www.mediafire.com/file/vzooqyoxjy3/netfs-patch.tar.gz
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Mar 30, 2010 2:43 am    Post subject: Reply with quote

All applied, thanks.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Mar 30, 2010 12:59 pm    Post subject: Reply with quote

Wow, that's a lot of interesting stuff.
Back to top
View user's profile Send private message Visit poster's website
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Wed Mar 31, 2010 3:58 am    Post subject: Reply with quote

Yep, :D. I remember you mentioned somewhere that you were trying to get the teapot sample to display more than one teapot, but were getting artifacts.

I'm not exactly sure what causes the problem, but flipping the framebuffer outside of the rendering packets seems to fix it. It's the same method gsKit uses for gsKit_sync_flip(). I modified the teapot sample to render 4 at once, which is about ~40,000 vertices. I doublebuffered the dma sends as well, but that was before adding the buffer flipping, which waits for the prior dma send to finish, and probably removes the usefulness of using two packets, heh.

Jim, it looks like the patches that included new files didn't have the new files committed to the svn repository.

I made a list using 'diff -bur'. I'm not sure if a 'svn add -R' might work for everything or if you'll have to do it manually for each of them.

Code:

Only in ps2sdk/common/include: gif_registers.h
Only in ps2sdk/common/include: gif_tags.h
Only in ps2sdk/common/include: gs_gp.h
Only in ps2sdk/common/include: gs_privileged.h
Only in ps2sdk/common/include: gs_psm.h
Only in ps2sdk/common/include: vif_codes.h
Only in ps2sdk/common/include: vif_registers.h
Only in ps2sdk/ee/dma/include: dma_tags.h
Only in ps2sdk/ee/draw/include: draw2d.h
Only in ps2sdk/ee/draw/include: draw3d.h
Only in ps2sdk/ee/draw/include: draw_blending.h
Only in ps2sdk/ee/draw/include: draw_buffers.h
Only in ps2sdk/ee/draw/include: draw_dithering.h
Only in ps2sdk/ee/draw/include: draw_fog.h
Only in ps2sdk/ee/draw/include: draw_masking.h
Only in ps2sdk/ee/draw/include: draw_primitives.h
Only in ps2sdk/ee/draw/include: draw_sampling.h
Only in ps2sdk/ee/draw/include: draw_tests.h
Only in ps2sdk/ee/draw/include: draw_types.h
Only in ps2sdk/ee/draw/src: draw2d.c
Only in ps2sdk/ee/draw/src: draw3d.c
Only in ps2sdk/ee/draw/src: draw_environment.c
Only in ps2sdk/ee/graph/include: graph_config.h
Only in ps2sdk/ee/graph/include: graph_registers.h
Only in ps2sdk/ee/graph/include: graph_vram.h
Only in ps2sdk/ee/graph/src: graph_config.c
Only in ps2sdk/ee/graph/src: graph_mode.c
Only in ps2sdk/ee/graph/src: graph_vram.c

Only in ps2sdk/ee: font


Here's the list of files in the font directory, though a 'svn add -R ee/font' should work since the entire directory is new.
Code:

ee/font/include/fontx.h
ee/font/include/fsfont.h
ee/font/Makefile
ee/font/samples/font.c
ee/font/samples/impress.c
ee/font/samples/Makefile
ee/font/samples/Makefile.sample
ee/font/src/erl-support.c
ee/font/src/fontx.c
ee/font/src/fsfont.c


Here's the patch.
http://www.mediafire.com/file/5wcm2bnnght/ps2sdk-fix.tar.gz

Sorry about the tedium if you end up having to do it per file, :S.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Mar 31, 2010 4:55 am    Post subject: Reply with quote

Sorry, forgot to add them (svn is a pain!). Should be fixed now, hopefully. No tedium, just a quick
Code:
svn add $(svn st | grep ^? | awk "{print $2}")
:)
Back to top
View user's profile Send private message
ragnarok2040



Joined: 09 Aug 2006
Posts: 230

PostPosted: Wed Mar 31, 2010 5:30 am    Post subject: Reply with quote

Nice, it compiles fine now.

I did some redundant #include purging prior to making the patches, and somehow removed or forgot to #include packet.h into the libdraw samples.

This small patch fixes that, and that should be everything, :D.

http://www.mediafire.com/file/4nytybozvub/samples.tar.gz
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Mar 31, 2010 8:10 am    Post subject: Reply with quote

Got it, thanks
Back to top
View user's profile Send private message
misfire



Joined: 06 Sep 2004
Posts: 120
Location: Germany

PostPosted: Mon Apr 26, 2010 6:18 pm    Post subject: Reply with quote

I noticed that some header files have the executable property set.

To fix it:
Code:
$ svn propdel svn:executable common/include/sys/time.h common/include/sys/select.h
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Apr 29, 2010 6:35 am    Post subject: Reply with quote

fixed, thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> Patch Submissions All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group