Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add more library functions
#1
Cool stuff.

I've added it as a code patch to the wiki library section. Are there any others in there, like LCD's proportional print routine or the nascent maths library section that you think are worth calling part of the include pack?
Reply
#2
Yes, but like in this topic, we *must* intensively check them before including them into the library.
I've been quite busy these last months hence the delay, but I'm started to manage automatic testing, so things should go much faster from now onwards.

By the way, I think print64 is well tested enough, so I will include them in the library.
Also would like to include many other libraries (Mojon's codes in a /mj/ directory, and your fourspriter version among others) :wink:

BTW, there's a function called setattr(x, y, value) in ATTR.BAS library.
Programming an attrAddr function is also straighforward as this function is already defined in library-asm/attr.asm
I thing the routine in there is much faster an shorter (need more testing).
Reply
#3
Thanks, Boriel.

Part of the duplication issue is lack of documentation - not knowing what's out there as a callable function.

Think that should be in library routines? I suppose knowing what's available in what include is going to help a lot
Reply
#4
britlion Wrote:Thanks, Boriel.

Part of the duplication issue is lack of documentation - not knowing what's out there as a callable function.

Think that should be in library routines? I suppose knowing what's available in what include is going to help a lot
E.g. the print42 library is buggy. It contains the following code:
Code:
newline:
        LD DE,(63536)
        CALL nxtline       ; move to next line
        LD (63536),DE     ; and go on to next character
        JR nextChar
This is a bug for sure: you're writing at a fixed position (65356) which is the memory heap for temporary work, so you're corrupting it. Besides, I don't understand very well what these lines do? :?:
Reply
#5
I completely agree I need other people to test these. I didn't write the original code, just reworked it from well known sources into shape; which means there are likely to be bugs.

I'll look into this one after work today.
Reply
#6
britlion Wrote:I completely agree I need other people to test these. I didn't write the original code, just reworked it from well known sources into shape; which means there are likely to be bugs.

I'll look into this one after work today.
Ok, I will later. :wink:
Ah, I forgot: please, put the URL or whatever of the original code (based upon: bla bla bla). Not only gives them credit, but also we can blame on them in case of a bug, like this! :mrgreen:
Reply
#7
britlion Wrote:I completely agree I need other people to test these. I didn't write the original code, just reworked it from well known sources into shape; which means there are likely to be bugs.

I'll look into this one after work today.
I've made some changes to your routine. Please download and compare.

Some corrections:
  • Removed the LD DE,(XXXX) block. It's useless and might corrupt the HEAP
  • Check if HL==0 (NULL) at the beginning of the asm code, and return if so (this can happen if not enough memory)
  • Remove the FASTCALL and, instead of returning immediately, jump to the end of subroutine whenever required. The string ByVal parameters must be freed upon return, or there will be a memory leak (yes, the same that happened with print64 Tongue)
  • Make as much labels as possible LOCAL, so it won't pollute namespace and won't collide with other routines. E.g. nextchar label could be used in many other routines (e.g. print64).
Have a look at this file, please and tell me (it works ok to me). Also, if you notice something to fix up, please do so and post it back.


Attached Files
.bas   print42.bas (Size: 15.68 KB / Downloads: 168)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)