"ps2mc-browser" Shader Code Analysis

How do we render the vertices and textures of polygons into a colorful scene? This is where OpenGL shaders come into play. Today, we’ll discuss the shaders of ps2mc-browser. To briefly introduce, ps2mc-browser is a PS2 memory card viewer capable of parsing vertex and texture data from 3D icons within PS2 memory card files and rendering them using OpenGL. In the following content, I’ll dissect the six OpenGL shaders used...

2023-12-20 · caol64

"ps2mc-browser" New Feature Release

ps2mc-browser is a PS2 memory card file viewer that utilizes an OpenGL canvas to display 3D dynamic icons from the memory card. It relies on the following dependencies: Python3 WxPython Numpy ModernGL PyGlm You can find the GitHub repository here. New Features Some PS2 game memory card files contain three sets of different animated icons, corresponding to three different operations: “browse,” “copy,” and “delete.” The newly released feature allows the ps2mc-browser interface not only to display animated icons but also to interact with users and respond to mouse operations....

2023-11-20 · caol64

PS2 Texture Image Encoding Algorithm "A1B5G5R5"

In the previous article, we discussed the RLE image compression algorithm used in PS2. This time, let’s delve into its texture mapping encoding algorithm—A1B5G5R5. Introduction For textures, common image encoding formats like jpg or png are not suitable. This is because images are read and rendered by the GPU. You wouldn’t want to send a jpg image over and have the GPU decode the entire image just to read one pixel, right?...

2023-10-20 · caol64

The Application of the RLE Algorithm in PS2

Introduction to RLE Algorithm The RLE (Run Length Encoding) algorithm is a compression method that represents file content in the form of “number of repetitions x data.” For example: given the data AAAAAABBCDDEEEEEF, by appending the number of consecutive occurrences after each character, it can be represented as 6A2B1C2D5E1F. It can be observed that the original data is 17 bytes, while the encoded data is 12 bytes, thus achieving successful...

2023-10-16 · caol64

Rendering PS2 Savegame 3D Icons using Python and OpenGL

After a series of previous articles laying the groundwork, the files for PS2 savegame 3D icons have all been parsed. In this article, we will begin to explore how to render the 3D icons using the following tools, aiming to achieve a rendering as close as possible to the original effect on the PS2 console. Python3 PyGame Numpy ModernGL PyGLM 01 Initialize PyGame and ModernGL The first step is to initialize PyGame, setting the window size to 640x480 and the FPS to 60....

2023-10-09 · caol64

Exporting Save Files From a PS2 Memory Card

In the previous article, we analyzed the file system of the PS2 memory card. This time, we’ll dive straight into practice and write Python code to export specific game saves. The complete code for this article can be found at: ps2mc-browser. 01 Parsing the SuperBlock The structure of the SuperBlock is as follows, with a size of 340 bytes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 struct SuperBlock { char magic[28]; char version[12]; uint16 page_size; uint16 pages_per_cluster; uint16 pages_per_block; uint16 unknown; // ignore uint32 clusters_per_card; uint32 alloc_offset; uint32 alloc_end; uint32 rootdir_cluster; uint32 backup_block1; // ignore uint32 backup_block2; // ignore uint32 unknown[2]; // ignore uint32 ifc_list[32]; uint32 bad_block_list[32]; // ignore byte card_type; byte card_flags; byte unknown; // ignore byte unknown; // ignore }; Use struct....

2023-09-29 · caol64