|
Post by Jonathan Cauldwell on Dec 4, 2020 18:24:26 GMT
I've created Spectrum and CPC user routines that will merge another screen on top of the existing one to help create a wider variety of unique and more complex screens without using lots of extra memory. Essentially the idea is to call USER S where S is the screen number to merge on top of the one the player is in. Zero blocks will be ignored, any other blocks on the merged screen will be drawn. To use it, you need to use a variable to indicate when the screen has been redrawn, then check if it has been set in the Main loop 1 event. For example, you could use M to indicate a merged screen. In the Restart screen event you'd need this line adding: LET M = 1
Then in Main loop 1 you could have something like this: IF M = 1 RESTORE READ M ; read first base screen. WHILE M < SCREEN READ M ; skip merged screen. READ M ; get next base screen. ENDWHILE IF M = SCREEN ; does this screen need a merged screen? READ M ; get screen to merge in. USER M ; merge in new screen. ENDIF LET M = 0 ; don't do this again until screen is redrawn. ENDIF
; Table of rooms (in ascending order) followed by merged screens. DATA 0,6,2,6,255 ; merge screen 6 into screens 0 and 2.
Files are here, I'll also include them in the next release: MergeRoom.asm (1.72 KB) MergeRoomCPC.asm (1.64 KB)
|
|
|
Post by jltursan on Dec 8, 2020 14:57:35 GMT
Cool!, saving memory tricks are always welcome! Btw, do you know about metablocks?, some of the engines have this feature implemented and using 16x16 blocks you can save quite some RAM. As an example, ROBOT - The Impossible Mission uses it...
|
|