FAQ  •  Register  •  Login

Manage +2A ramdisc with ZXBasic, is possible ?

<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Sun Nov 06, 2016 12:30 pm

Manage +2A ramdisc with ZXBasic, is possible ?

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
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Wed Nov 09, 2016 4:34 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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.
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Fri Nov 11, 2016 5:52 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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!
<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Sun Nov 13, 2016 6:49 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

hello LCD,

How to use bank switching in zx basic? My ASM skills are very limited :(
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 :)

Thank you very much
<<

LCD

Posts: 596

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Mon Nov 28, 2016 2:41 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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!
<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Wed Nov 30, 2016 7:40 am

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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
<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Sat Dec 03, 2016 4:04 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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 :) 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


<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Sat Dec 03, 2016 6:34 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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 :-/ 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
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Mon Dec 12, 2016 9:25 am

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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:
http://www.boriel.com/wiki/en/index.php ... ne_Options

For more info, please, tell me. :roll:
<<

Eqx

Posts: 11

Joined: Sat Oct 29, 2016 3:41 am

Post Tue Dec 13, 2016 8:17 pm

Re: Manage +2A ramdisc with ZXBasic, is possible ?

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:

Return to Help & Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO