|
Post by Packobilly on Nov 28, 2019 18:28:56 GMT
Hi everyone! Got this BASIC loader: 10 CLEAR 31031 - the AGD project its (31032) 26498 lenght 20 LOAD ""SCREEN$ - the compressed menu saved in 57800 (225 length) 30 LOAD ""CODE - the AGD project 40 BORDER 0: PAPER 0: INK 0: CLS 50 RANDOMIZE USR 57800 60 IF INKEY$="1" THEN BEEP .025, 20: POKE 32005, 0 70 IF... (...) 90 IF INKEY$="0" THEN BEEP .025, 20: RANDOMIZE USR 32000: GO TO 40 100 GO TO 60
Everything works fine. I mean, the game starts pressing 0 and so. But the trouble comes at the beginning, when the loading ends. It doesn't appear the screen$ with the menu. The whole screen is black.
If I only try this,
10 CLEAR 57799 20 LOAD ""CODE - the compressed menu saved in 57800 30 RANDOMIZE USR 57800
then the menu screen appears.
Im desperate with this. Someone knows? Thanks!!
|
|
|
Post by alessandro on Nov 29, 2019 15:39:44 GMT
If the menu screen is compressed you cannot load it with SCREEN$. SCREEN$ is short for CODE 16384,6912 which is the starting address and length of the Spectrum display file (see the ZX Spectrum BASIC Programming Manual, Chapter 20).
|
|
|
Post by Packobilly on Nov 29, 2019 17:16:08 GMT
Ah, ok. I´ve already read chapter 20, Alessandro. Thanks for answering. The compressed screen is a menu drawn with Melbourne Draw and then compressed with MikroPol Compressor Plus. Its located at 57800. Now, if instead of this
20 LOAD ""SCREEN$ - the compressed menu saved in 57800 (225 length)
I use this other line
20 LOAD ""CODE 57800- the compressed menu saved in 57800 (225 length)
at the end of the loading process everything is all right. Appears the menu and works all right. Until after the game over; at this point, instead going back to menu, the whole game crashes.
(Sorry for my English)
|
|
|
Post by alessandro on Nov 30, 2019 8:14:50 GMT
Could you please copy the whole BASIC management program here? The game should run again from address 32000 after returning to BASIC, unless you somehow overwrote the code, or the buffer space, i.e. the last 512 bytes of RAM and, in the case of effects specialization, the 300 bytes after the game code's end. Also, did you insert any call to external code in the end of game event(s) in the AGD script? Finally, I think you will be better off creating your screens, graphics etc. with ZX-Paintbrush - I haven't touched Melbourne Draw any more since 1987! - and compressing them with LetharGeek Kompakt 1.1. It's the most efficient screen compression utility I know of, and I've tried a lot of them
|
|
|
Post by Packobilly on Nov 30, 2019 18:19:11 GMT
This the final code. I made some changes to simplify the menu. 10 CLEAR 31031 - the AGD project its (31032) 26498 lenght; 57530 20 LOAD ""CODE 57800 - the compressed menu saved in 57800 (225 length) 30 LOAD ""CODE - the AGD project 40 BORDER 0: PAPER 0: INK 0: CLS 50 RANDOMIZE USR 57800 - calling the menu screen made with Melbourne 60 IF INKEY$="0" THEN BEEP .025, 20: RANDOMIZE USR 32000: GO TO 40 - starts the game, kill the player and then back to menu (that not happens) 100 GO TO 60 I don´t call external code in any game event. (Id rather do, but still don't know how; maybe soon I´ll be able to) Thanks a lot for the links and for allow us (the newbies) see the light!! P.S.: Some time ago, I tried to get ZX PaintBrush, but couldn't find it anywhere. The original page was out of service. Thanks again.
|
|
|
Post by alessandro on Dec 1, 2019 8:43:10 GMT
Try saving the compressed screen at an address lower than your game code. Since it starts at 31032, you could for instance memorize the screen data at 30800.
Of course you should modify the CLEAR instruction as CLEAR 30799.
|
|
|
Post by Packobilly on Dec 2, 2019 19:23:05 GMT
Thats it! Now everything is going on. The player spends the last life, and back to menu. Thank you very much, Alessandro.
|
|