MSXgl – A new C game library for MSX

Page 17/21
10 | 11 | 12 | 13 | 14 | 15 | 16 | | 18 | 19 | 20 | 21

By wimpie3

Champion (426)

wimpie3's picture

28-08-2022, 10:51

Book? There is no book on MSXgl as far as I know. Aren't you talking about Fusion-C?

By aoineko

Paladin (706)

aoineko's picture

28-08-2022, 12:09

janghang wrote:

I bought the book from Amazon.

I don't sell books. I think you are confusing with Fusion-C. :)

janghang wrote:

Compared to other assembly-based codes, how's performance or speed of the game created with MSXgl?

It's hard to answer. We would have to redo the same program with different game libraries to be able to compare.
All I can say is that I pay a lot of attention to performance and that the all optimizations I find (on MRC, MAP or in the technical docs) are integrated in MSXgl at some point. For example, the library has built-in fast memory copy functions using 16x unrolled out loops.

janghang wrote:

Using MSXgl, can we create a game running at speed similar to machine codes?

The obvious answer is no. If we are talking about a well thought-out and optimized assembly program, no C program will never be able to compete with its performance.
That said, the most expensive parts (like the VRAM copies) being written in assembler in MSXgl, their performance is close to a well optimized assembler program.
In fact, what can really make the performance of the program decrease is the gameplay code. And it's up to the programmer to be careful with. In C, you can quickly create a slow code without necessarily realizing it. On the other hand, I personally think that it is sometimes easier to write complex algorithms to gain performance in C than in assembler (at least I think that even assembler gurus will admit that C offers a much better code readability).

If I had to summarize, I would say that if you are able to write an optimized assembler code, need 100% performance and are familiar with MSX hardware, there is no debate: do assembler.
Otherwise, I think MSXgl is a good alternative to easily create games on MSX with very good performance.

By Arsenikum

Supporter (6)

Arsenikum's picture

17-09-2022, 19:28

Hello! Can you give me an advice, what am I doing wrong?
Suppose, I have this code:

const c8* test = "Hello MSX World";
struct InvestPic
{
const c8* Name;
};
const struct InvestPic g_InvestPics[] =
{
{test},
};

If I write in main program
Print_DrawText(g_InvestPics[0].Name);
then compile would be ok, but the screen would show a total mess instead "Hello MSX World".
"const c8* test" part is mandatory, supposed that it will be in another h. file.

Thank you!

By aoineko

Paladin (706)

aoineko's picture

17-09-2022, 20:07

I tested your code in the s_hello sample and the text displays fine.
Is your font initialized correctly?

Both Print_DrawText(g_InvestPics[0].Name); and Print_DrawText(test); display "Hello MSX World".

If you want to have a more direct help, you can contact me on Discord: https://discord.gg/pMeadGfv8E

By Arsenikum

Supporter (6)

Arsenikum's picture

17-09-2022, 20:30

Thank you, joined to Discord channel.

By Arsenikum

Supporter (6)

Arsenikum's picture

17-09-2022, 21:33

This works:
Using const c8 test[] = "Hello MSX World";
instead of const c8* test = "Hello MSX World";
Thanks aoineko!

By aoineko

Paladin (706)

aoineko's picture

15-10-2022, 01:11

Hi all,

A new official version of MSXgl is available on GitHub: MSXgl v0.5.18 Alpha.

Main changes:
- [V9990] P1 and P2 modes are now fully functional (tiles on 2 layers and 125 sprites). The module also supports: Scrolling, Palette, Status and Interrupt (screen split). Commands and Bitmap modes WIP. A sample programe (s_v9990) show case the use of P1 and P2. You can test the sample online: https://webmsx.org/?PRESETS=V9990&ROM=https://github.com/aoi...

- [NinjaTap] Added support for Ninja Tap device to allows to connect up to 8 joysticks on MSX! Module include detection and reading joysticks state. A sample programe (s_ntap) show case how to use it. A driver for BASIC is also available (see s_usr sample) to manage the device with USR() function.
- [VDP] Optimization of many functions by defining unused registers to prevent the compiler to save registers unnecessarily. Added function to set screen offset using X and Y coordinate, and Graphic Mode 2 helper functions.
- [Memory] Added dynamic allocator feature (malloc style function). See s_sys sample for a use case.
- [Print] Added functions to draw string with FX in 2-pass to prevent character effect overlap. Added vertical text drawing helper function. Optimized Print_DrawBin8() function.
- [Crt0] Optimized custom ISR. Added support for Basic USR target and sample program (s_usr).
- [Doc] Updated source code documentation.

Thanks to all MSXgl users on Discord for their valuable feedback, and MRC users for kindly sharing your knowledge.

As always, I'm available here or on Discord to answer all your questions or help you get started with MSXgl.

Let's program!

By ToriHino

Paladin (807)

ToriHino's picture

15-10-2022, 12:23

That is getting quite a library, good work Cool

By ARTRAG

Enlighted (6890)

ARTRAG's picture

15-10-2022, 23:25

@aoineko
If you want to include my LoFi speech player for the PSG let me know I can support you and release an ad hoc version of the encoder

By aoineko

Paladin (706)

aoineko's picture

16-10-2022, 01:44

@ARTRAG I had it on my to-do list but I have so much on it that I haven't gotten to it yet. It is possible to do it now.
Can you please (re)point me to the info for its integration.

Page 17/21
10 | 11 | 12 | 13 | 14 | 15 | 16 | | 18 | 19 | 20 | 21