CPCWiki forum

General Category => Programming => Topic started by: Trewdbal on 21:23, 26 January 16

Title: [cpctelera]cpct_px2byte & cpct_clearScreen
Post by: Trewdbal on 21:23, 26 January 16
Hi Folks !

I try to fill up the screen with a colour other than black.

My attemps like :

    cpct_clearScreen_f64 (cpct_px2byteM0(9,9));


give screens with patterns.

Moreover, what about filling the screen with a colour in mode 2 ?

Anyway, i'm a bit confused with the arguments of px2byteM0 or px2byteM1. At the beginning of the code, I applied a palette using :

    cpct_fw2hw(palette, 16);
    cpct_setPalette(palette, 16);

After that, does the arguments of cpct_px2byte are the indice of the palette array ? Or directly a color code ?

Thank you for you assistance.
Title: Re: [cpctelera]cpct_px2byte & cpct_clearScreen
Post by: ronaldo on 14:19, 27 January 16
Quote from: Trewdbal on 21:23, 26 January 16
Hi Folks !

I try to fill up the screen with a colour other than black.

My attemps like :

    cpct_clearScreen_f64 (cpct_px2byteM0(9,9));


give screens with patterns.

Moreover, what about filling the screen with a colour in mode 2 ?

Anyway, i'm a bit confused with the arguments of px2byteM0 or px2byteM1. At the beginning of the code, I applied a palette using :

    cpct_fw2hw(palette, 16);
    cpct_setPalette(palette, 16);

After that, does the arguments of cpct_px2byte are the indice of the palette array ? Or directly a color code ?

Thank you for you assistance.

I'll try to answer to all your doubts:
Hope this helps. With this doubts, it will be very helpful if you read the documentation paying attention to details, in order to help me know which parts of it are difficult to understand. That will help many people solving your same doubts :).
Title: Re: [cpctelera]cpct_px2byte & cpct_clearScreen
Post by: Trewdbal on 19:30, 27 January 16
Thank you for your speedy assistance. Things are more clear now.

Indeed, the "firmware" value in the doc of cpct_px2byteM0 and cpct_px2byteM1 are confusing at the beginning.

On the cpct_cleanScreen page, maybe an 1-line example showing a call to the function would be helpful (short examples would be helpful on the other pages too, but I understand that's a lot of work...). Moreover, in the src examples provided with CPCTelera, cpct_clearScreen is always used with "0" as argument.

While talking about the doc : on the cpct_memset (http://lronaldo.github.io/cpctelera/files/memutils/cpct_memset-asm.html) page, the input parameters are not listed in the right order : it should be array, value, size (instead of array, size, value), to respect the order of the arguments of the function, as well as the convention you applied on the other pages. It's a detail, but I've been tricked while reading the doc too quickly !
Title: Re: [cpctelera]cpct_px2byte & cpct_clearScreen
Post by: ronaldo on 22:05, 28 January 16
@Trewdbal (http://www.cpcwiki.eu/forum/index.php?action=profile;u=1642): You're welcome :).

Thank you very much for suggestions to improve documentation. I'm taking notes of all of them to make improvements :).

Another thing you may do, if you have enough time and want to, is directly making modifications to the documentation and sending pull requests. You may do it on github, either by forking the project and sending propper pull requests or by creating them using github's editor. Documentation for function is in code files and gets extracted from them. For instance, if you wanted to modify cpct_memset documentation, you could do it by editing this file: cpct_memset.asm (https://github.com/lronaldo/cpctelera/blob/master/cpctelera/src/memutils/cpct_memset.asm)

Thank you very much for collaboration :D.
Powered by SMFPacks Menu Editor Mod