News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Arnaud

How load overscan image and run program in basic loader

Started by Arnaud, 20:40, 23 April 17

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Arnaud

Hello, i open once again this subject  ;D ,
but i haven't found how load a overscan image (192x272 mode 0) then run a program from a basic loader.

With convimgcpc i have generated and displayed a .scr, but when i press a key the CPC reset and my program is not launched.

Same problem with cpctelera, my image is displayed but when i exit my introduction program, the cpc reset.

Here my attempt in basic.

10 mode 0
20 border 0
30 bc = &bc00:bd = &bd00
40 out bc,1:out bd,48
50 out bc,2:out bd,50
60 out bc,6:out bd,34
70 out bc,7:out bd,35
80 out bc,12:out bd,12
90 out bc,13:out bd,&D0
100 load"intro.scr",&D0


What i was thinking, configure CRTC to set video (R12) from 0 to 0x3FFF. Apply a offset 0xD0 (R13) in order to not overwrite basic and load the picture at this memory address.

Thanks for help.

robcfg

By looking at the MC6845 datasheet, I see that registers 12 and 13 form the address from which to read the data shown on screen.


In that case, your error is that you are loading the data in the wrong place.


80 out bc,12:out bd,12
90 out bc,13:out bd,&D0



This sets the address to &CD0 (12 is &C in hex)


So line 100 should be:


100 load"intro.scr",&CD0


Maybe you were trying to load it at &12D0, in which case your code would be:
80 out bc,12:out bd,&12
90 out bc,13:out bd,&D0
100 load"intro.scr",&12D0



Hope this helps!

andycadley



Register 12 doesn't quite map directly to an address like that. If you wanted a 32K screen starting at &D0, you'd need to program a value of &0C into R12 and &68 into R13. This is because the upper bits of the address don't map directly into the upper two bits of R12  but instead into bits 12 & 13, and you also need to set bits 10 & 11 to 1 in order to cause an address overflow (necessary to get a 32K screen buffer). And you have to remember the entire offset is measured in 2 byte chunks (which is why everything scrolls in Mode 1 characters).


Edit: third time mathematically lucky (hopefully!)



tastefulmrship

Quote from: Arnaud on 20:40, 23 April 17
Hello, i open once again this subject  ;D ,
but i haven't found how load a overscan image (192x272 mode 0) then run a program from a basic loader.
Could you post the overscan screen and program here (or via PM)?

Morri

Also try:

10 OPENOUT"D":MEMORY &1FF:LOAD"FILE.SCR":CALL &811


Edit: Not my own code - got it from this thread
Keeping it Kiwi since 1977

Arnaud

Quote from: Morri on 20:08, 24 April 17
Also try:

10 OPENOUT"D":MEMORY &1FF:LOAD"FILE.SCR":CALL &811


It's near to work, the picture is displayed but when i press a key the picture disappeared before loading my program. I'd like to have the picture displayed while loading, but i'm not sure if it's possible.
Quote from: SuTeKH/Epyteor on 20:06, 24 April 17
Could you post the overscan screen and program here (or via PM)?
Here my disk with the basic loader, overscan screen and program to load.

The basic loader :
10 OPENOUT"D":MEMORY &1FF:LOAD"YENEFER.SCR":CALL &811
20 RUN"LOADER


I found another solution with an old utility but it's more complicated to do.

http://www.cpc-power.com/index.php?page=detail&num=5177



tastefulmrship

Quote from: Arnaud on 10:23, 25 April 17
Here my disk with the basic loader, overscan screen and program to load.

Attached is an updated version of your loader. It loads the screen to &0200, CALLs &0800 and then RUNs the CPCtelera program.

However, there are a number of issues you will need to overcome going forward;
-1. The CPCtelera program needs to reset the &C000 screen correctly!
-2. The CPCtelera program is currently set to memory address &4000 which is half-way through the loading screen. You can just see the code appear as it loads. Moving it to &8000 will fix this!
-3. Because an overscan screen takes up 32k of memory, it limits the amount of data you can load in. I recommend compacting everything and then expanding it to the required memory location once loaded.

NOTE: The overscan screen now uses a different "viewer" to Markus's original code.

Arnaud

Thanks @SuTeKH/Epyteor.

Quote from: SuTeKH/Epyteor on 18:40, 25 April 17
-3. Because an overscan screen takes up 32k of memory, it limits the amount of data you can load in. I recommend compacting everything and then expanding it to the required memory location once loaded.

Effectively, i understand why there're not so many loading overscan screen in games. I think i have to use only 16ko screen to my loading screen.



tastefulmrship

#8
Quote from: Arnaud on 18:52, 25 April 17
Effectively, i understand why there're not so many loading overscan screen in games. I think i have to use only 16ko screen to my loading screen.

You can still use an overscan loading screen (basically because they look so dang good on a real monitor), but I recommend using Exomizer or BITBuster to compress the "game code", LOAD it to &8000-&A500 or even to &C000-&FFFF, decompress it to the required memory address and then CALL the start address as normal.

Also, you have to remember that an overscan screen is actually ~24k in size, but fits in ~32k... so you have an extra ~8k to hide "game code". For example, if you look at the CPC-Wiki remix of ZYNAPS, you will see that a compressed version of the game fits in the upper screen bank (&C000-&FFFF) and within the blank lines of the amazing overscan screen by TotO. It took a lot of LDIR commands to move the data around, but the screen, music, cheats and game fit in a single ~22k file. Unpacked it's about 90k in total!

Arnaud

Quote from: SuTeKH/Epyteor on 19:26, 25 April 17
I recommend using Exomizer or BITBuster to compress the "game code", LOAD it to &8000-&A500 or even to &C000-&FFFF, decompress it to the required memory address and then CALL the start address as normal.

How decompress with exomizer from Basic ? The asm unexo code must be included in basic listing ?

tastefulmrship

Quote from: Arnaud on 20:54, 25 April 17
How decompress with exomizer from Basic ? The asm unexo code must be included in basic listing ?
It would be easier to have the decompressor as part of the game-code. If you want the overscan screen compressed as well, then find an unused area in memory to store the decompressor code, decompress the screen, LOAD the game-code, decompress it with the same decompressor routine and CALL the start address.

Arnaud

Quote from: SuTeKH/Epyteor on 04:47, 26 April 17
It would be easier to have the decompressor as part of the game-code. If you want the overscan screen compressed as well, then find an unused area in memory to store the decompressor code, decompress the screen, LOAD the game-code, decompress it with the same decompressor routine and CALL the start address.

But in this case, all is loaded in the same time, overscan screen and game. This is not a waiting loading screen.
Or i have to load the game code separatly, but for moment there's no file load and save with CPCTelera, i have to use firmware et no memory left to use it.

Interesting discussion in all case.

NiNxPe

In the same idea, I'm looking for a loader for pictures made with Perfect Pix  :D

tastefulmrship

Quote from: Arnaud on 07:47, 26 April 17
But in this case, all is loaded in the same time, overscan screen and game. This is not a waiting loading screen.
Or i have to load the game code separatly, but for moment there's no file load and save with CPCTelera, i have to use firmware et no memory left to use it.
I have an upcoming TAPE-only musicdisk that has an overscan loading screen (&01A0-&7FFF). The main code is then loaded into &C000-7FFF and &9000-&A500 as separate files. From there, I move all the code to &0100- and CALL the start address from there. All in all, the main-code loading time is about 4 minutes; enough to get used (and bored with) the loading screen! ^_^

Firmware is still intact with this method (until I initialise some rasters)!

Ast

Quote from: Arnaud on 20:40, 23 April 17
Hello, i open once again this subject  ;D ,
but i haven't found how load a overscan image (192x272 mode 0) then run a program from a basic loader.

With convimgcpc i have generated and displayed a .scr, but when i press a key the CPC reset and my program is not launched.

Same problem with cpctelera, my image is displayed but when i exit my introduction program, the cpc reset.

Here my attempt in basic.

10 mode 0
20 border 0
30 bc = &bc00:bd = &bd00
40 out bc,1:out bd,48
50 out bc,2:out bd,50
60 out bc,6:out bd,34
70 out bc,7:out bd,35
80 out bc,12:out bd,12
90 out bc,13:out bd,&D0
100 load"intro.scr",&D0


What i was thinking, configure CRTC to set video (R12) from 0 to 0x3FFF. Apply a offset 0xD0 (R13) in order to not overwrite basic and load the picture at this memory address.

Thanks for help.


Have you ever used IMPdraw who allows you to Load full screen screen using a simple Load or Run ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Arnaud

Quote from: Ast on 11:35, 26 April 17

Have you ever used IMPdraw who allows you to Load full screen screen using a simple Load or Run ?

Yes i tried but i have problem with it (lite v1.132) on emulator :

[attach=2]

The screen is moving.

demoniak

With an overscan image made by ConvImgCpc, before CALL &811, you can do a POKE &830,&C3

This will let the picture display on screen after pressing a key.

(Or do a POKE &830,&C9 to not wait for a key)

Ast


Quote from: Arnaud on 12:31, 26 April 17
Yes i tried but i have problem with it (lite v1.132) on emulator :

[attach=2]

The screen is moving.
iMPdraw only works on Crtc 1 or 3 (Cpc Plus).
Use Ctrl+1 for crtc 1
or Ctrl+3 for Crtc 3
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Ast

_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Arnaud


Ast


Did you find all you wanted ?


You could find the lastest iMPdraw v1.2 version here!
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Arnaud

Quote from: Ast on 11:25, 27 April 17
You could find the lastest iMPdraw v1.2 version here!

The v1.2 contains interesting functionnality, but i'm not sure if it solves my problem, namely displaying a overscan image while loading my code.

My current problem is the loading data erase the memory location of image.



Ast


Quote from: Arnaud on 12:40, 27 April 17
The v1.2 contains interesting functionnality, but i'm not sure if it solves my problem, namely displaying a overscan image while loading my code.

My current problem is the loading data erase the memory location of image.
@Arnaud : Chat ?
_____________________

Ast/iMP4CT. "By the power of Grayskull, i've the power"

http://amstradplus.forumforever.com/index.php
http://impdos.wikidot.com/
http://impdraw.wikidot.com/

All friends are welcome !

Powered by SMFPacks Menu Editor Mod