News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

BASIC programming tips

Started by arnoldemu, 14:23, 22 May 09

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Manuel3D

thanks for your answer. I thought there might be a simple way that I didn't know about but I see that the solution is not easy. I have tried to put the image and call it from basic with a &call BB18 but as soon as I touch a letter on the keyboard the image disappears from the screen making its use impossible. I have seen on the internet that it can also be done using a library to program games from basic called 8BP. I have to find out more about the subject.


BSC

Let's see, if my memory still works well enough then this might do the trick if you have the image as a raw screen dump:

10 memory &3fff
20 load "[name of your image here]",&4000
30 for i=0 to 11:read k:poke &af00+i,k:next:end
40 data &21,0,&40,&11,0,&c0,1,&ff,&3f,&ed,&b0,&c9
50 call &af00

Then, after running the listing once, you can do GOTO 50 whenever you need to restore the image.
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments **
Other music **  More music on scenestream (former nectarine) **  Some shaders **
Some Soundtrakker tunes

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

Manuel3D

#152
Your idea works. Now I will have to adapt the program a little to reduce the memory used since it had already reached a good size but I think it can work  thanks to your help.

:)

McArti0

BUT WHY ASM?  ;D   OUT &BC00,12:OUT &BD00,&10: POKE &b7c6,&40

Manuel3D. Have you read PM?

Maybe write this in a new topic.

You can use two screens to draw.
Visible when you set POKE b7c6,&C0
or invisible when you set POKE &b7c6,&40.
In this case you need to limit BASIC to 16kB by MEMORY &3FFF.
With these settings you can draw twice. Once you draw on the background in the visible part. Once on the invisible part where there is no background.
If you want to see the invisible screen, you do OUT &BC00,12:OUT &BD00,&10.
If you want to see the main screen again, you do OUT &BC00,12:OUT &BD00,&30
CPC 6128, Whole 6128 and Only 6128, with ........
TYPICAL :) TV Funai 22FL532/10 with VGA-RGB-in.

Jean-Marie

You can use the firmware for this:
CALL &BC06,&40
then
CALL &BC06,&C0

Manuel3D

#155
Thank you McArti0 and Jean-Mary I will try this too.

Manuel3D

Quote from: Manuel3D on 21:02, 17 October 23Thank you McArti0 and Jean-Mary I will try this too.
Sorry because I'm also new to this forum and I'm not used to how it works yet. Now for example, I wanted to quote you and it didn't work out. On the other hand, I see that this page works very slowly for me and often hangs and loads automatically.

skylas

Hi all!

If i remember well there was a command in BASIC for screen shaking.
Do I remember correct? I could not find it although I looked at the manual
Web: https://amstradsakis.blogspot.com
Twitter: https://twitter.com/AmstradSakis
My programs (only BASIC):
RETRO-LOADSHEET ON AMSTRAD CPC!
PENALTY KICKS!
CAPITAL QUIZ!
CAPITAL QUIZ 2! (Reverse edition)
HEADS OR TAILS (ΚΟΡΩΝΑ/ΓΡΑΜΜΑΤΑ)
HEART CHASER 1,2,3!
BARBOUTI!
STROOPIE!
BUDRUMI!
ART WAR!
BATTLE OF LENINGRAD!
AMSTABOO!
RODOLFO SKYLARRIENTE!


skylas

Web: https://amstradsakis.blogspot.com
Twitter: https://twitter.com/AmstradSakis
My programs (only BASIC):
RETRO-LOADSHEET ON AMSTRAD CPC!
PENALTY KICKS!
CAPITAL QUIZ!
CAPITAL QUIZ 2! (Reverse edition)
HEADS OR TAILS (ΚΟΡΩΝΑ/ΓΡΑΜΜΑΤΑ)
HEART CHASER 1,2,3!
BARBOUTI!
STROOPIE!
BUDRUMI!
ART WAR!
BATTLE OF LENINGRAD!
AMSTABOO!
RODOLFO SKYLARRIENTE!

BSC

Quote from: Manuel3D on 01:14, 17 October 23Your idea works. Now I will have to adapt the program a little to reduce the memory used since it had already reached a good size but I think it can work  thanks to your help.

:)
If you are short on memory, you can change that little listing so that the screen is loaded to &6000 instead of &4000. I guess you can figure out what you have to change by yourself. Homework time! :D
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments **
Other music **  More music on scenestream (former nectarine) **  Some shaders **
Some Soundtrakker tunes

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

dodogildo

Here's a PDF of an ages old book with Peeks and Pokes and other tips on Basic. Still holds tons of useful information.
(PEEKS et POKES du CPC - 1985)
https://shorturl.at/pCIM9

Powered by SMFPacks Menu Editor Mod