..and about the use of a new character table. If you only need a quick & dirty hack to print some texts in graphic modes and don't want to waste such amount of memory, you can use the ROM provided char table. The table is usually located at $1BBF; but the right address is found doing :

Código:

print hex$(peek(4)+peek(5)*256)

So, if you change PTTRN1 by the address found above you'll save 4 Kb (of course the font will be a bit dull; but it's only to do some tests, isn't it? ).

the solution Robsy sent me didn't work (afaik - recall i still very newbie, and that time i were much more... )

on one hand, simple solutions are very interesting and useful, and on another hand, some snippets here exploring mathpack would be very interesting too (for math calculations seems to be much more complicated doing in 'pure' assember (afaik))

Right, if you need to do some calculations it's a good solution to use the BIOS calls; but remember that they are overpowered and returns (I can't remember the exact number) a lot of decimals; so they're terribly slow. You can't use them to realtime animate a game, maybe one like "scorched earth", no more .

Citar

for math calculations seems to be much more complicated doing in 'pure' assember (afaik)

Not really. Usually you don't need a lot of precision, so have you think about the use of a 16 bit register to hold a number with an integer 8 bit half (high byte) and a decimal 8 bit half (low byte)...?. It's lightning fast...

what i think is, afaik, call 0x2BDF is the rnd function, using the 14 character mantissa (8 bytes, 7 for mantissa and 1 for signal and float point position), and... (the meaning point) call 0x2F8A converts this 8 byte numerical value into a 2 byte integer - of course there are lots of performance lost converting 2byte values to 8byte dac values and vice-versa :-( - not as fast as using 'pure' asm, but seems to be a bit better than interpreted msx-basic btw... (performance and coding laziness compromise...)

Citar

..and about the use of a new character table. If you only need a quick & dirty hack to print some texts in graphic modes and don't want to waste such amount of memory, you can use the ROM provided char table. The table is usually located at $1BBF; but the right address is found doing :Código:print hex$(peek(4)+peek(5)*256)So, if you change PTTRN1 by the address found above you'll save 4 Kb (of course the font will be a bit dull; but it's only to do some tests, isn't it? Smiley).

the first point were i didn't knew about 20kb text code posting limit... (that's why i hurried to split the code to at least having all there instead of editing the code to fit just in time) - laziness and intuition mixed...

i knew about the rom char table - all asm code i have are patch over a template i use for all examples i coded, and the 4kb custom char table were on all there - i have to optimize all my code to use both ways without much brain effort needed... (my laziness is always annoying guyver800 too, ehehehehe ;-) ) - about char table, the idea from Konami using the characters 0x00 to 0x15 for empty char blocks with colours 0x00 to 0x15 i adopted as excellent (unless we really need all 256 characters)

otherwise, the zxspectrum char table is 768 bytes long (characters 0x20 to 0x7F), maybe no bad idea at all using it instead...