Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manage +2A ramdisc with ZXBasic, is possible ?
#1
Hola,
Estoy haciendo una demo y necesito tener acceso al disco ram del +2a para almacenar una gran cantidad de imágenes comprimidas para un animación.
He intentado hacer ésto de la manera tradicional como se haría en Sinclair Basic con <save "m: block1" code xxxxx, xxxx>, pero no funciona.
Tampoco si lo intento como si fuera un +2 con <save ! "block1" code xxxxx, xxxxx> (en este caso ni me deja compilar)
¿Es posible manejar el disco ram del 128k desde el ZX Basic de alguna otra manera ?
Muchas gracias por la ayuda !


Hello,
I'm doing a demo and i need access to 128k +2A ramdisc disk to store a lot of compressed pictures for an animation
I tried it as i did in Sinclair Basic in a 128k + 2A with <save "m: block1" code xxxxx, xxxx> but does'nt work.
Either as a 128k / + 2 with <save ! "block1" code xxxxx, xxxxx>
It is possible to manage the 128k ram disc with ZX basic?
Thank you very much and sorry for my poor english
Reply
#2
Eqx Wrote:Hola,
Estoy haciendo una demo y necesito tener acceso al disco ram del +2a para almacenar una gran cantidad de imágenes comprimidas para un animación.
He intentado hacer ésto de la manera tradicional como se haría en Sinclair Basic con <save "m: block1" code xxxxx, xxxx>, pero no funciona.
Tampoco si lo intento como si fuera un +2 con <save ! "block1" code xxxxx, xxxxx> (en este caso ni me deja compilar)
¿Es posible manejar el disco ram del 128k desde el ZX Basic de alguna otra manera ?
Muchas gracias por la ayuda !


Hello,
I'm doing a demo and i need access to 128k +2A ramdisc disk to store a lot of compressed pictures for an animation
I tried it as i did in Sinclair Basic in a 128k + 2A with <save "m: block1" code xxxxx, xxxx> but does'nt work.
Either as a 128k / + 2 with <save ! "block1" code xxxxx, xxxxx>
It is possible to manage the 128k ram disc with ZX basic?
Thank you very much and sorry for my poor english

Unfortunately not. You have to use ASM or better a Library.
Not sure if someone has done it already.
Reply
#3
I did only Bank switching. Anyway: Spectrum +2 and +2A have different RAMDisc syntaxes, so Program for +2A will not run on 128+ or +2.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#4
hello LCD,

How to use bank switching in zx basic? My ASM skills are very limited Sad
Main problem for me is that I need more than 48k for a demo, and I don't know how to use paged memory with ZX Basic and ramdisc can't be used.

Sure, call to ram disc is different in 128/+2 / + 2A, i know, but I don't care if that solves my problem. In this case It would be an exclusive demo for + 2A / + 3 or +2.

Any help will be very welcome Smile

Thank you very much
Reply
#5
I have the Bankswitching routines somewhere on my developemwnt machine ...
No need for assembler, just remember that all coder over address 49152 will be paged out, so stay below with your program (data can be paged out without problems), and RAMTOP (CLEAR command).
OUT 32765,16=normal (Bank0)
OUT 32765,17=Bank 1
OUT 32765,19=Bank 2
OUT 32765,20=Bank 3
OUT 32765,22=Bank 4
OUT 32765,23=Bank 5 (second screen)+10 kb free RAM which usually stores RAMDISC Filesystem.
Poke 23388 with same value, or the BASIC will switch your bank back at the next interrupt occur.
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
Reply
#6
Thanks for the guidance. I will try later, in next demo or game. Now, for this demo. my first job for Zx spectrum, I have "fixed" memory limit using ZX7-RCS compression for music and images and discarding something. But next time I'll investigate based on your suggestion.
Mainly my need is for data. Music and images. Another drawback is that each bank is contained memory depending on whether it is a 128k +2 or a + 2A.
Thanks for answer LCD
Reply
#7
Tested loading images in different banks and works fine, but i have a issue, i don't know what are the best banks for both 128 +2 and +2a of no contended memory for fast execution, for example for playing ay music with interrupts enabled ?
Thx in advance LCD



edited
(*) in a +2 doesn't works, only in a +2A works fine

stupid sample Smile only works fine in +2A mode
Code:
OUT 32765,16
load "" code 49152

out 32765,17
load "" code 49152

repeat:

Poke 23388,17
ASM HALT
       CALL 49152
END ASM
pause 0

Poke 23388,16
ASM HALT
       CALL 49152
END ASM

pause 0

go to repeat
Reply
#8
Sorry, I forgot to specify out 32765, xx and poke on every memory page change.
Now it works on a 128k +2 too, but, ...
My damm problem Undecided is that the demo starts at address 32768, no contended memory, and because it has some text strings and the heap is quite large, the code part goes from 49152 ....
I would need to take the 32 ks up to 65536 (or less) for code, and make use of paged memory for images and music.
Is this possible ?
IMHO, ZX Basic is great, but handles the strings in a very dark way and eat a lot of memory with strings. It should allow strings of fixed size and be able to dispense with the heap. Randomly the program got out of memory in debug mode and that's because I have to test with larger size for the heap. It's a hell !!

I'm sorry, it's the first time I work with a spectrum and I don't know very well certain hardware issues
Thx very much in advance
Reply
#9
Sorry, I completely overlook this post!
ZXBasic uses the heap, but you can limit the heap size with a compiler option, --heap-size. The default is all the available memory after the code.
You can use --heap-size=256 (only 256 bytes) and that will be enough for many cases.

You can also change the ORG (ORiGin) of your compiled program, with the --org command line option.
The default is 32768, but you can change to any other position. (e.g. --org 26000)
Hope this help.

You can find more information about the command line options here:
<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Zxb#Command_Line_Options">http://www.boriel.com/wiki/en/index.php ... ne_Options</a><!-- m -->

For more info, please, tell me. :roll:
Reply
#10
Thanks Boriel.
I send a mp but is still in outbox not in sent. Is a final demo with ZX Basic with an explanation :wink:
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)