C API and graphics library for Next layer 2 screen

If you like transforming your statements into code, this is the place for you

Moderator: Programming Moderators

Stefan123
Posts: 102
Joined: Mon Jun 05, 2017 9:38 pm

Re: C API and graphics library for Next layer 2 screen

Post by Stefan123 » Tue Sep 19, 2017 7:32 pm

Update

The C layer 2 graphics library has been updated with support for and documentation on the layer 2 shadow screen. The new way of setting layer priorities and the global transparency colour is also supported. I have also added several examples on using the layer 2 shadow screen and double buffering.

https://github.com/stefanbylund/zxnext_layer2
https://github.com/stefanbylund/zxnext_layer2_demo

Note that there are several issues when using the latest layer 2 features in ZEsarUX. They are described on the zxnext_layer2 GitHub page. I will inform Cesar about these issues.

User avatar
chernandezba
Posts: 229
Joined: Mon May 29, 2017 8:14 pm

Re: C API and graphics library for Next layer 2 screen

Post by chernandezba » Wed Sep 20, 2017 9:24 am

Thanks. But in order to emulate all these on ZEsarUX I need official documentation. Much of the information now is mixed on some random messages on Facebook. About hardware scrolling... I tested with a demo from Fabio and it worked on ZEsarUX. Other features are not well documented, and for example this "Paging the main layer 2 screen to the top 16K RAM" feature I didn't know how to do that....

So I need official documentation for all these, if not, I spend more hours searching for documentation than programming these features :(
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux

User avatar
varmfskii
Posts: 186
Joined: Fri Jun 23, 2017 1:13 pm
Location: Albuquerque, NM USA

Re: C API and graphics library for Next layer 2 screen

Post by varmfskii » Wed Sep 20, 2017 2:36 pm

chernandezba
I feel your pain.
Backer #2741 - TS2068, Byte, ZX Evolution

Stefan123
Posts: 102
Joined: Mon Jun 05, 2017 9:38 pm

Re: C API and graphics library for Next layer 2 screen

Post by Stefan123 » Wed Sep 20, 2017 8:22 pm

César, I share your frustration for the lack of official documentation.

gskronn
Posts: 12
Joined: Wed Sep 13, 2017 1:14 pm

Re: C API and graphics library for Next layer 2 screen

Post by gskronn » Thu Sep 21, 2017 2:38 pm

Stefan123 wrote:
Wed Sep 20, 2017 8:22 pm
César, I share your frustration for the lack of official documentation.
Seconded.

Stefan123
Posts: 102
Joined: Mon Jun 05, 2017 9:38 pm

Re: C API and graphics library for Next layer 2 screen

Post by Stefan123 » Thu Oct 05, 2017 6:18 pm

Update

The C layer 2 graphics library has been updated with two specialized blit functions for blitting new partial rows and columns in diagonal scrolling. I have also added an example on diagonal scrolling between multiple layer 2 screens.

https://github.com/stefanbylund/zxnext_layer2
https://github.com/stefanbylund/zxnext_layer2_demo

Diagonal scrolling is a bit more complicated and CPU-intensive than pure horizontal and vertical scrolling since you have to keep track of three off-screen buffers; the next screens in the X and Y directions and the corner screen between them. When blitting new columns, one part of the new column comes from the next screen in the X direction and the other part from the corner screen. Analogously, when blitting new rows, one part of the new row comes from the next screen in the Y direction and the other part from the corner screen.

Stefan123
Posts: 102
Joined: Mon Jun 05, 2017 9:38 pm

Re: C API and graphics library for Next layer 2 screen

Post by Stefan123 » Tue Jan 23, 2018 10:02 am

Update

The C layer 2 graphics library has been updated with support for the new 9-bit RGB333 layer 2 palette. I have also added an example on loading an image file with a custom 9-bit palette.

https://github.com/stefanbylund/zxnext_layer2
https://github.com/stefanbylund/zxnext_layer2_demo

Post Reply