Extract the fonts to separate BMP files rather than combined BIN files #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These changes extract the fonts in the assets/font folder to separate BMP files rather than combined BIN files. The BMP files can then be individually viewed in a standard image viewing program, such as GIMP.
The raw 8-bit image data is extracted from the baserom.u.z64 file by the extract_baserom.u.sh file, using the offsets inserted into the filelist.u.csv file.
The extract_baserom.u.sh file then inserts a generic 8-bit greyscale BMP header file (font_bmp_header.bin) to the beginning of each image file using the 'sed' command, and then updates the image width and height values in the BMP header according to the values at the end of each filename.
The height is adjusted to a negative value, so that the bitmap will be displayed the correct way up. The filesize and imagesize fields of the BMP header are not modified (for simplicity) as GIMP seems to be able to open the images without them.
The BMP header data is ignored when assembling the image data, as the assets/font/font.s file contains instructions to ignore the first 1146 bytes of each BMP file.
The assets/font/font.s file also ensures that the 8 bytes of 'padding' data are added to the end of each 16-pixel-wide font. The padding data is only extracted once by the extract_baserom.u.sh file (instead of after each 16-pixel-wide image), as it appears to be identical in each subsequent 16-pixel-wide image.