britlion Wrote:I'm playing with some code for this - I think the font is going to come in handy.
What /would/ be nice, since it's a bit slow, is to be able to have my screen address tables in the compiler as a #include option. I need to be able to #include it, and have it align and #include once basically.
Boriel, if I send you code for this are you okay with adding it to the distribution? I think a standard 4k screen address and similar rotate tables would be fairly common; and I can re-use them for quite a few screen routines. If they are in as standard library routines, such that they are guaranteed to only be inserted once, I don't have to worry about code duplication happening - using any of the sprite/graphics routines would include the tables once and once only.
I'm much more recovered now. I will debug the compiler (to fix the above crash error), and start working on it.
I've missed many threads and feel a bit "out" of some discussions. Sorry for that; it's not I'm not interested, but I was resting instead.
After debugging this error, I would also check those routines you say they worked on previous compiler versions and now they don't. This is essential before adding new features, etc...
It was probably a case of cut n paste from here to the compiler puts spaces in front of # include.
This is two bugs:
1> Code in the forum copies/pastes with spaces in front of it for some reason.
2> (space)# include in the compiler generates an unhelpful error not at all related to the actual problem!
nitrofurano Wrote:btw, i checked my code by testing it in part, and the compiler bug seems to be related with a variable name i used - i replaced 'character$' with 'name$', and that error message dissapeared.
Code:
...
sub print64x32at(x2 as ubyte,y2 as ubyte,characters$ as string)
for i3=0 to len(characters$)-1
e3=code(character$(i3)) ' <<== BUG wrong (undeclared) variable
putchar64x32( (x2+i3) mod 64 ,y2 + int((x2+i3)/64), e3)
next i3
end sub
...
First of all, the above code has a bug: the parameter variable is characters$ whilst the inner variable is character$ (there is a missing -s at the end). They're different variables. The compiler crashed because it was not correctly managing this bug: when you use an undeclared alfanumeric VARIABLE$(Expression) it can mean be one of these 3 things:
VARIABLE$ is an array of Strings, and you want to get the i-th one (<expression>). This is discarded as undeclared arrays are not allowed (precisely to avoid this ambiguity)
VARIABLE$ is a function returning a string, and you want to get the result (<expression> is the parameter). This is also discarded, since ZX Basic requires you to use DECLARE to prototype functions in advance.
VARIABLE$ is a String, and you want the i-th character (string slicing). THIS is the meaning the compiler will get now since the other two are discarded.
2012-03-04, 01:24 PM (This post was last modified: 2021-02-01, 09:37 PM by boriel.
Edit Reason: Fix URL
)
Never enough time. Still. See attachment.
Doesn't do colour at the moment. (Not sure how it easily, can - the colour grid doesn't fit!)
Note that it's a print routine, so is coded to print(Y,X) format. 0<=Y<=31, 0<=X<=63
Also Uploaded as attachment, because I re-used the Screen Tables asm again. Which is enormous. This should only be ever loaded once - so If you use HRPRintFast, as well, for example, make sure screen and rotate tables only get included once.
This version also includes Block Graphics and UDG - there's a reference to @HiResPrintUdg embedded in the code so you can change these as you wish.
Edit: Slight bugfix in that it wasn't advancing print position correctly at end of string. Fixed
Edit2: Separated ScreenTables and RotateTables - Since I wasn't using rotate for this.
Britlion, don't worry about the colour (at least for now) - i think my version is "fast" enough for that, and i think wouldn't be a problem when 'applied' over that somehow (the method i used is the attribute value were applied over its area on each 'y=0' and 'y=5' pixel line of each character, i understand perfectly how hard is calculating it on assembly ) - only missed the trickest part you did very successfully, the bitmap part! - thanks again!