Commit graph

66 commits

Author SHA1 Message Date
Lephenixnoir
4c307af02b
fxconv: preliminary support for fonts in PythonExtra 2024-03-21 08:29:06 +01:00
Lephenixnoir
8030d6bdc6
fxconv: PythonExtra support for bopti-cg 2024-02-03 16:00:05 +01:00
Lephenixnoir
4a84bfdcd4
fxconv: fix stupid compact mode bug 2024-02-03 16:00:05 +01:00
Lephenixnoir
6e62fb7d6d
fxconv: PythonExtra support for bopti-fx 2024-02-01 17:48:45 +01:00
Lephenixnoir
975f29a471
fxconv: (fix indent) 2024-01-31 23:28:49 +01:00
Lephenixnoir
ecf04cb634
fxconv: make bopti-fx image data a pointer 2024-01-21 21:06:01 +01:00
Lephenixnoir
8f50f7694a
fxconv: fix c-c/c-v in range error messages 2023-10-17 21:56:38 +02:00
Lephenixnoir
88235041a3
fxconv: add i8/i16/i32, with range checks 2023-10-17 20:18:09 +02:00
Lephenixnoir
be8c1f0d94
fxconv: alignment parameter in fxconv.ptr() (default 4) 2023-08-20 10:41:53 +02:00
Lephenixnoir
11e3b614c2
fxconv: add an elf_multi() function to produce multiple variables 2023-08-15 21:59:17 +02:00
Lephenixnoir
cf3ab5d5e0
fxconv: copy elements in += ObjectData instead of referencing subobject
This way, after o1 += o2, when o1 is linked all the outer data of o2 is
linked alongside the outer data of o1, and the inner data remains
contiguous. This is important for arrays, where we don't want the outer
data of o2 to appear before the next inner field of o1.

With this commit, an update to o2 after o1 += o2 no longer updates o1.
This wasn't a feature in the first place.
2023-08-08 20:26:37 +02:00
Lephenixnoir
dc522072e7
fxconv: honor section setting for ASM conversions 2023-01-15 16:32:51 +01:00
Lephenixnoir
8c966821e8
fxconv: fix bad detection of fxconv-metadata.txt for relative paths 2022-11-05 18:44:33 +01:00
Lephenixnoir
4296ef0872
fxsdk: adjustment for #9 2022-08-03 21:52:58 +01:00
Lephenixnoir
6032ce38cf Merge pull request 'Added a specific charset (extascii) to get access to 256 characters of the ascii table' (#9) from Slyvtt/fxsdk:slyvtt-patch-1 into dev
Reviewed-on: https://gitea.planet-casio.com/Lephenixnoir/fxsdk/pulls/9
2022-08-03 22:51:13 +02:00
Sylvain PILLOT
2c0815077c Added a specific charset (extascii) to get access to 256 characters of the ascii table
Added the support of extended ascii table (char 128 and aboce up to 255).
2022-08-01 14:40:13 +02:00
Lephenixnoir
a7046966da
fxconv: fix double object file size for RGB565 images 2022-07-16 17:23:14 +01:00
Lephenixnoir
e4289f6c4c
fxconv: remove alpha field of images 2022-05-14 12:54:18 +01:00
Lephenixnoir
b29c494715
fxconv: rewrite image converter, forcing alpha value 2022-05-14 12:38:52 +01:00
Lephenixnoir
58cb14157d
fxconv: new image format (and libimg stride update) 2022-05-12 15:26:42 +01:00
Lephenixnoir
6fd943ea67
fxconv: simplify alpha assignment in P8/P4
* alpha is now the last color of the palette rather than always being 0.
* alpha is not materialized in the P8 palette.
* Fixed a bug where images with more than 32/256 colors being converted
  in P4/P8 with transparency would use all colors for opaque pixels,
  causing alpha to randomly land on a color index that is in use.
2022-05-07 17:54:20 +01:00
Lephenixnoir
6d2dcea900
fxconv: "p4" and "p8" now select best new format
Instead of p8 being the old p8 (which now doesn't display anymore!) and
p4 being p4_rgb565a.
2022-05-07 14:00:26 +01:00
Lephenixnoir
6788a7b5fe
fxsdk: round RGB16 images to even widths
This allows 4-alignment on the input to be preserved from line to line,
which is very valuable for rendering optimizations.
2022-05-04 17:16:33 +01:00
Lephenixnoir
90d5e723e0
fxconv: explicit error when no metadata is set for a file 2022-01-28 19:07:53 +01:00
Lephenixnoir
41c7ac0aec
fxconv: allow custom-type to work as type 2022-01-28 19:07:38 +01:00
Lephenixnoir
f17d741d54
fxconv: fix CLI which was broken since 4d46661d3 2022-01-26 20:54:40 +01:00
Lephenixnoir
bbf716b031
fxconv: resolve name_regex in the fxconv-metadata.txt API 2021-12-28 19:01:43 +01:00
Lephenixnoir
4d46661d3b
fxconv: expose fxconv-metadata.txt parsing functions in API 2021-12-28 18:37:40 +01:00
Lephenixnoir
6dae13007e
fxconv: "fix" palette remap with non-continous "P" image
Just take the holes and save less space
2021-12-23 21:14:41 +01:00
Lephenixnoir
cdeefa1de6
fxconv: fix conversion of char-spacing attribute 2021-11-04 14:46:40 +01:00
Lephenixnoir
317b82348f
fxconv: add support for {P4,P8}_{RGB565,RGB565A} for Azur 2021-10-23 16:45:58 +02:00
Lephenixnoir
68be7fe522
fxconv: allow section specification from fxconv-metadata.txt 2021-09-26 10:55:20 +02:00
Lephenixnoir
942c39be4e
fxconv: allow any tree of referencing structures 2021-08-25 22:14:41 +02:00
Lephenixnoir
bc7cd928f4
fxconv: add synonyms Structure=ObjectData and ptr=ref 2021-08-25 18:00:43 +02:00
Lephenixnoir
a17eaabbd8
fxconv: allow adding symbols and ObjectData to ObjectData 2021-06-10 00:04:55 +02:00
Lephenixnoir
fcc6f33f9b
fxconv: expose standard converters 2021-06-10 00:04:45 +02:00
Lephenixnoir
c53a3fcdec
fxconv: return data in standard conversions
Instead of generating the ELF file right away. This makes these
functions brilliantly reusable.
2021-06-09 19:01:06 +02:00
Lephenixnoir
0acea3baf6
fxconv: allow output with assembly but no data 2021-06-09 17:58:11 +02:00
Lephenixnoir
64ebb69f9b
fxconv: import specifically importlib.util 2021-06-02 10:12:03 +02:00
Lephenixnoir
ddf05cfadb
fxconv: allow adding bytearray to ObjectData 2021-06-02 09:21:54 +02:00
Lephenixnoir
ed10e727df
fxconv: enable custom types in the fxconv-metadata.txt system
Set the custom type with "custom-type: your_type_name" (instead of using
--custom on the command-line).

The converter.py in the current directory is still auto-detected as a
custom converter, but that won't work with CMake (which builds with the
build folder as current directory). Instead, a new option --converters=
with a semicolon-separated of Python files has been added. Use
fxconv_declare_converters() from the fxSDK-provided Fxconv module to
declare them programatically in CMake.
2021-05-04 17:38:28 +02:00
Lephenixnoir
8259e2dfc8
fxconv: add a generic name_regex parameter to simplify naming 2021-01-29 14:29:36 +01:00
Lephenixnoir
2596a53c6b
(irrelevant fixes) 2021-01-29 14:29:25 +01:00
Lephenixnoir
47504ff179
fxconv: replace _encode_{word,long} with u16, u32 2021-01-25 19:12:46 +01:00
Lephenixnoir
ee7c5d63ca
(small cleanup) 2021-01-12 18:53:32 +01:00
Lephenixnoir
42f2b5c175
fxconv: support metadata discovery in fxconv-metadata.txt
This change adds a new way for fxconv to discover metadata for file
conversions. This complements the existing mechanism of passing
parameters on the command-line.

The new mechanism activates when fxconv is called without a type
argument. Type information and metadata are searched in an
fxconv-metadata.txt file in the same folder as the resource. The
metadata file lists parameters, with some additional flexibility enabled
by the use of wildcards.

This way of declaring will replace command-line argument passing, which
currently read parameters from the unreadable and not-so-maitainable
project.cfg file. Both the GNU make and CMake build systems should use
it in the future. The current way is still supported only for older
projects and one-shot conversions outside of projects.
2021-01-11 19:21:04 +01:00
Lephenixnoir
f461c08a17
fxconv: introduce an ObjectData interface to avoid assembly
ObjectData is a stream-like object that accepts bytes, bytearrays,
references to external variables and references to other bundled data to
create structures with pointers without having to write assembly.

Internally ObjectData unfolds into static data and an assembly
instruction. Existing assembly support remains fully compatible.

* Added an ObjectData interface to ease reference generation
* Ported topti to ObjectData (instead of assembly)
* Ported libimg_fx and libimg_cg to ObjectData (idem)
2020-12-22 14:51:43 +01:00
Lephenixnoir
ee9c459c69
fxconv: add custom conversions
Custom conversions can be used by:
* Providing a converters.py in the main directory with a convert()
  function
* Specifying --custom on the fxconv command-line or using a subfolder or
  assets-{fx,cg} unused by standard fxconv
2020-10-23 13:05:50 +02:00
Lephenixnoir
e3af6a5d4b
fxconv: add character spacing in topti fonts
Adds a new parameter "char-spacing" (default: 1) to change character
spacing for fonts rendered with topti.
2020-10-05 16:12:34 +02:00
Lephenixnoir
66d88bef7a
fxconv: better support for indexed images
Indexed images don't have an alpha channel, so the detection of
transparent pixels in fxconv failed. This change forces a conversion of
indexed images to RGBA to properly handle this.
2020-07-16 15:42:23 +02:00