Thanks aoineko!
Well, even with it it doesn't seem to work in my code. I'm generating the header this way: wine $(tools)/MSXtk/bin/MSXimg.exe assets/ship_spr.png -name ship_spr -trans 0xff00ff -pal msx1 -size 16 16 -mode sprt -i16 0 0 1 1 -out assets/ship_spr.h || true
If I call directly VDP_LoadSpritePattern(src, index, 4);
the order is wrong. That's why I wrote this other function:
void VDP_LoadSpritePattern16_fix(const u8* src, u8 index) { u16 low = g_SpritePatternLow + 8*index; u8 offsets_src[] = {8*0, 8*2, 8*3, 8*1}; u8 offsets_low[] = {8*0, 8*1, 8*3, 8*2}; for(u8 i = 0; i < 4; i++) { VDP_WriteVRAM(src + offsets_src[i], low + offsets_low[i], g_SpritePatternHigh, 8); } }
I'll investigate more, since there must be any detail I'm skipping. If the example you wrote works well, then I'm doing something different... I'll compare with the example.
Thanks aoineko!
Well, even with it it doesn't seem to work in my code. I'm generating the header this way: wine $(tools)/MSXtk/bin/MSXimg.exe assets/ship_spr.png -name ship_spr -trans 0xff00ff -pal msx1 -size 16 16 -mode sprt -i16 0 0 1 1 -out assets/ship_spr.h || true
If you don't mind me asking, why are you using windows binaries inside Linux if MSXgl has the Linux ones available?
[If you don't mind me asking, why are you using windows binaries inside Linux if MSXgl has the Linux ones available?
For MSXimg there's only MSXimg.exe for Windows.
Although the source code is available, I couldn't compile it because the file "tchar.h" is not found in my system. Yes, I could find which is the package which provides that header, but I since I wanted to start my project ASAP, I just used wine for the moment.
To reach the last position at MSXDev'03 XD
MSXimg is standalone tool to convert image to use in MSX application. It's the last one of my tools I didn't converted yet to Linux. I'll do it one day but I'm a one man army and I have other battle to lead first.
I think you forgot the sprite color in your command Line
-i16 0 0 1 1 0xFFFFFF
With i16
(i=include) only the provided color will be exported.
With e16
(e=exclude) all the colors but the provided one will be exported.
It could seem complex but it's usefull to export multi layer sprites like in my Example sample or in my game Final Smash.
MSXimg is standalone tool to convert image to use in MSX application. It's the last one of my tools I didn't converted yet to Linux. I'll do it one day but I'm a one man army and I have other battle to lead first.
Haha yes, when I saw that the binary was missing I imagined that it'd would require some effort to get the source Linux-compilable. Well, for the moment with wine it works really well.
By the way, now magically my 16x16 sprites show well!
Well, not really magic... they started to work well after pulling this change: "[MSXimg] Autodetect 16x16 sprite size + Don't export layout table when bGM2Unique is true".
Before, even if you specify the size (and the color I was missing), the tool produced the wrong order. Now it works nicely, thanks!
Happy birthday MSXgl!
The library have been officially released just 1 year ago.
A lot of things have changed since 1 year (multi-platform support, new audio format, optimization, new devices, etc.).
But there is one thing that hasn't changed, it's my game projects that don't progress much. ^^
Congratulations on its first birthday . You put already a lot of effort in it and it keeps on growing and getting better. Also great to see you're very supportive to users (and even non-users). I used already some parts of the libray as an example or inspiration for my own projects. Maybe one of the next ones I will fully base on this library.
Thanks ToriHino. If you see anything to improve, don't hesitate to tell me.
Beyond the fact that creating this library is fun for me, all this work will really make sense when MSXgl will have helped new MSX games or tools to be released. Hopefully in 2023.
Happy birthday (+1 day)!
It's quite a nice lib. And having all the sources available it's great.