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:
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.
x16lib - Library for BASIC and Assembly
Re: x16lib - Library for BASIC and Assembly
Hi good afternoon.
the demos here from asm are wonderful.
Which assembler are they written for?
acme is not.
Thanks.
greeting
the demos here from asm are wonderful.
Which assembler are they written for?
acme is not.
Thanks.
greeting
Re: x16lib - Library for BASIC and Assembly
They are written for ca65.
Re: x16lib - Library for BASIC and Assembly
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.
I would like to add them to the Pascal unit.
ATARI
- Jakebullet70
- Posts: 15
- Joined: Sat Nov 21, 2020 8:18 pm
Re: x16lib - Library for BASIC and Assembly
Really like this. Would like to see it work with BASLOAD as that is how I am writing all my code now.
As a new feature would like to see:
Save and restore parts of a screen. That way you could save part of screen, show a messagebox and then just restore the part that was overwriten.
Really nice work.
As a new feature would like to see:
Save and restore parts of a screen. That way you could save part of screen, show a messagebox and then just restore the part that was overwriten.
Really nice work.
If you do not see any flak... Your not on target!
Re: x16lib - Library for BASIC and Assembly
I already have a solution for basload, however implementing is a bit complex and timeconsuming. It is on my list of of todo's, but that list is not very short at the moment As soon as I've made the changes, I'll post it here, so if you subscribe to this topic, you'll know asap.Jakebullet70 wrote: ↑Fri May 31, 2024 4:07 pm Really like this. Would like to see it work with BASLOAD as that is how I am writing all my code now.
As a new feature would like to see:
Save and restore parts of a screen. That way you could save part of screen, show a messagebox and then just restore the part that was overwriten.
Really nice work.
You suggestion is also noted
- Jakebullet70
- Posts: 15
- Joined: Sat Nov 21, 2020 8:18 pm
Re: x16lib - Library for BASIC and Assembly
Good deal. I have subscribed. Looking forward to seeing new features.
If you do not see any flak... Your not on target!
- Jakebullet70
- Posts: 15
- Joined: Sat Nov 21, 2020 8:18 pm
Re: x16lib - Library for BASIC and Assembly
How about a way to run (chain / load) to a new PRG while being able to still see the STRINGS in HIGHRAM memory.
I have been looking at the HANGMAN PRG on the SDCARD and the author wrote out VAR's to an INI file before he ran another program.
---> My brain is in overdrive as I am writing code.
I have been looking at the HANGMAN PRG on the SDCARD and the author wrote out VAR's to an INI file before he ran another program.
---> My brain is in overdrive as I am writing code.
Last edited by Jakebullet70 on Sun Jun 02, 2024 7:59 pm, edited 1 time in total.
If you do not see any flak... Your not on target!
Re: x16lib - Library for BASIC and Assembly
If you use the highram routines from x16lib, they will persist when chaining basic programs.