MSXgl – A new C game library for MSX

Page 2/16
1 | | 3 | 4 | 5 | 6 | 7

By pizzapower

Expert (71)

pizzapower's picture

16-01-2022, 22:52

No tools to easily convert images to mode 2 sprites for MSX2 games in your SDK? Tongue

By Manuel

Ascended (18792)

Manuel's picture

16-01-2022, 22:55

I would keep things simple and only include the core: the libraries. All the tools are just sidetracking things and making it complicated (and harder to port to other host systems). Sure, the libraries are for a target-compiler and that's about all dependencies you'd want, I think...

By aoineko

Champion (448)

aoineko's picture

16-01-2022, 23:03

ARTRAG wrote:

SDCC seems much more convoluted on this subject, the manual does not include a large memory model for z80/z180 cpus. I hope that aoineko's tools will help me to understand how things work in this new enviroment.

Here is how I chose to manage the ROM mapper in MSXgl.

In the Build Tool, if you select a mapped ROM, the tool will:
- Build the first 32 KB as a plain ROM (at startup, those segments are selected),
- For the remaining segments (which depends on the size of a segment and the total size of the ROM), the tool will search for files with a particular nomenclature: _s_b.c
- If the file is found, it is compiled for use in the requested Bank, then the binary is concatenated to the ROM.
- If the file is not found, an empty block the size of a segment is added to the ROM.

Here is an example with a "mygame" project that targets the 128 KB ROM format with an ASCII-8 mapper.
The Build Tool will first compile "mygame.c" as a 32 KB plain ROM (which contains the first 4 segments, selected at startup), and then search the files for the remaining segments (4~15):
- mygame_s4_b?.c
- mygame_s5_b?.c
- ...
- mygame_s14_b?.c
- mygame_s15_b?.c
For example, if for segment number 10, the Build Tool finds a file "mygame_s10_b3.c", the file will be compiled the content to be used in bank #3 (address A000-BFFFh) and then added to the ROM.

Thus, to place data in a particular segment, you just need to create a file with the right name.
Then you have a function to select a given segment in a one of the bank.

"s_vgm" is example sample than use ROM mapper (128K ASCII-16 mapped ROM).

By aoineko

Champion (448)

aoineko's picture

16-01-2022, 23:17

pizzapower wrote:

No tools to easily convert images to mode 2 sprites for MSX2 games in your SDK? Tongue

You can found CMSXimg in MSXgl\Tools\CMSXtk\bin than can convert image in many MSX Format.
In the "s_sprite" sample, you can see example sprite data generated with this command-line:
CMSXimg.exe data.png -pos 0 80 -size 8 8 -num 12 4 -trans 0x8468a1 -bpc 1
where:
-pos: start position in the image x/y
-size: cell size x/y
-num: number of cells to export x/y
-trans: transparent color
-bpc: bit-per-color (1 for binary)

You can also export multiple sprite layers of a colored image.
See -l parameter.

By ARTRAG

Enlighted (6845)

ARTRAG's picture

17-01-2022, 08:25

@aoineko
thanks, I will try to make it work

By gdx

Enlighted (5508)

gdx's picture

17-01-2022, 09:04

Can we insert a raw data file wherever we want?
It doesn't seem possible with Fusion C.

By raymond

Hero (600)

raymond's picture

17-01-2022, 09:11

Oh, nice. I definitely will give this a try! Will make a vm ready to use and test this Big smile

By aoineko

Champion (448)

aoineko's picture

17-01-2022, 09:14

MSXgl have a tool (CMSXbin) that convert binary data into C header with an option to put it where you want (through the __at directive). I have no option to include a binary file directly into the final program binary.

I plan to allow that for ROM mapper when the Build Tool search for segment data. I search only for .C for now but I plan to add .ASM and .BIN. I also plan to allow data bigger than a segment to fill more than 1 segment at once.

By gdx

Enlighted (5508)

gdx's picture

17-01-2022, 09:44

It's just a binary include like on assemblers that i ask. It would be easier.

By ToriHino

Paladin (767)

ToriHino's picture

17-01-2022, 17:27

I see that the library also contains code for the Arkos Tracker. Is that already supported as well? Or still work in progress?

Page 2/16
1 | | 3 | 4 | 5 | 6 | 7