x16lib - Library for BASIC and Assembly

For posting library code and examples.
Post Reply
unartic
Posts: 63
Joined: Sat Oct 28, 2023 3:26 pm

x16lib - Library for BASIC and Assembly

Post by unartic »

In order to make developing for x16 as easy and convenient as possible, I've started working on a library that goes far beyond what the kernal currently offers. It sits in a rambank of choice and offers the programmer easy to use functions for common tasks.

For BASIC it taps directly into the BASIC variable space to ensure maximum performance.

x16lib is fully documented and with ready to use examples.

The current version offers only a few functions. I would like the community to suggest functions that needs to be in this library. So if you have idea's please post them below.

Please download here:
x16lib.zip
(171.24 KiB) Downloaded 36 times
userguide.pdf
(192.25 KiB) Downloaded 60 times


The current version of x16lib has the following functions:

Printcenter
Print a string in the center of the screen on a specific line

Swapveralayers
Swap the z-order of layer0 and layer1 of vera

Highmem functions
Quickly and easily save and read strings in/from any highram rambank.

Fading
Fades out the screen to all black and fade the screen back to normal operatingmode

String functions
Several well know string functions: trim, ltrim, rtrim, tally, instr and split

Custom keyboard handler
Custom keyboard handler which enables to get the state of individual keys and therefor can work with simultanious keypresses.


NOTE: As the ROM-version of BASLOAD remaps all variable names, BASIC programs loaded via the ROM-version of BASLOAD will not be compatible with x16lib at this moment.
funkheld
Posts: 268
Joined: Mon Feb 26, 2024 11:11 am

Re: x16lib - Library for BASIC and Assembly

Post by funkheld »

Hi good afternoon.

the demos here from asm are wonderful.

Which assembler are they written for?
acme is not.

Thanks.
greeting
unartic
Posts: 63
Joined: Sat Oct 28, 2023 3:26 pm

Re: x16lib - Library for BASIC and Assembly

Post by unartic »

They are written for ca65.
User avatar
MADRAFi
Posts: 4
Joined: Thu Apr 13, 2023 9:10 am

Re: x16lib - Library for BASIC and Assembly

Post by MADRAFi »

Can you share source code for the lib? If someone wants to use these procedures in higher level languages, it would be better to wrap them in native procedures executing assembly, instead loading a binary and call the function.
I would like to add them to the Pascal unit.
ATARI
Post Reply