11-15-2021, 11:02 PM
(10-05-2021, 07:43 PM)maeloterkim Wrote:(10-05-2021, 06:58 PM)boriel Wrote: Yes, I was referring to DEF ADD.
It seems you wanted to copy memory from one place to another.
You could do it with:
Code:FOR i = 1 to 128
POKE 16384 + i , PEEK 25000 + i
NEXT i
Not sure if this would be fast enough, but compiling with -O3 or -O4 and measuring the speed will give you a hint.
DEF ADD cannot be used because variables are static, not dynamic in compiled BASIC and this var is not used at all.
But probably there's a workaround that can be admitted in the contest.![]()
Also, please, please,I'd like to add DEFCC compatibility in PRINT (not sure if you read my private msg?).
If you could tell me more about it (I couldn't find much info), I'll be gratetul.
Sorry but I did not look at the private message I just saw it now![]()
The only thing I know about the DEFCC is what I told you
In principle, this variable is updated every time a print is made with the first memory address of the X Y coordinates of the next position.
for example if you do in the original zx spectrum print at 0,0;
the variable will have the value 16384 that corresponds to the address of the first byte of the character that we would print in 0,0
If you do print at 0,0; "A"
the variable has the value of 16416 which is the same that if you had made print at 1,0;
that is, it is the first address of the next byte where the cursor is because there is no coma ( ; ) the end of the print go to next line
the variable points to the next first address of the down char
If you do it with any other address, it updates the same.
The variable will point to the first address where it will start printing next time you print
In this link https://skoolkid.github.io/rom/
you have all zx spectrum dissasembly with a lot of explanations
And in this link https://skoolkid.github.io/rom/asm/5C84.html
you have more info about this variable and the routines that updates it
You must only go to the last link and follow the links PO_FETCH that reads the variable
and PO_STORE THAT UPDATES IT
The thing is I don't want to use the ROM (but a flag will be available to do so).
Can you try this version, please?
http://www.boriel.com/files/zxb/zxbasic-...ta5.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...-beta5.zip
http://www.boriel.com/files/zxb/zxbasic-...-win32.zip
http://www.boriel.com/files/zxb/zxbasic-...x64.tar.gz
http://www.boriel.com/files/zxb/zxbasic-...cos.tar.gz
It should be faster, and update DFCC correctly (without calling PO_FETCH and PO_STORE).
Sorry for the delay (I know the contest is over).
![Sad Sad](https://www.boriel.com/forum/images/smilies/sad.png)