ZX0 decompression examples - Printable Version +- Forum (https://www.boriel.com/forum) +-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://www.boriel.com/forum/forumdisplay.php?fid=16) +---- Thread: ZX0 decompression examples (/showthread.php?tid=1061) |
ZX0 decompression examples - RandomiserUsr - 03-31-2021 Hi I have been looking into the ZX0 library Having created a compress file by running this "zx0 testscreen.scr" And to us this file this is a test file I created t.bas #include "zx0.bas" 10 dzx0Standard(@testscreen1, 16384) 20 GOTO 20 testscreen1: asm incbin "testscreen.scr.zx0" end asm When compiled and run it indeed does display the image on screen. Some questions:- Q1.I have been able to convert some artwork (PNG) to .SCR and compress this and then load it on screen BUT (newbie alert) I am running out of memory/program crashes/resets Emulator. So the question is, can I do this and if so HOW? (A) load from a M: drive (emulator allowing) and/or (B) use the 128K Mode and then use the memory banks for images and leave the '48K' for the main game? Q2. How can I display the SCR file but only print it to the top half of the screen? 1/3 or 2/3rds is okay as well? Is there any code examples (ASM/ZXB) Q3. Next to the text, I want to next compress text files that contain a description of a game room. Looking at an example I tried this (don't laugh!) :- dzx0Standard(@Text1, 50000) Text1: asm incbin "location1.txt.zx00" end asm Text2: asm incbin "location2.txt.zx00" end asm But this does nothing but load it to the address of 50000 but I want the routine to return a STRING containing the decompressed text? Quote:UPDATE 4th April 2021: I have worked how to do Q3 in a standalone test.bas file but when I do this in my main program it crashes the app soon after starting it up? Lots of questions but hopefully some kind person can help? :-) thanks RE: ZX0 decompression examples - RandomiserUsr - 04-10-2021 Still trying to work out why the above code is crashing ? RE: ZX0 decompression examples - emook - 05-17-2021 I would ensure you have at least 4 zero bytes after every zx0 compressed block or zx0 could continue through the next block. Code: Text1: RE: ZX0 decompression examples - RandomiserUsr - 05-19-2021 (05-17-2021, 07:25 AM)emook Wrote: I would ensure you have at least 4 zero bytes after every zx0 compressed block or zx0 could continue through the next block. Thanks Emook I will try this out :-) |