News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

is pixel exact printing possible on the cpc 464 in basic?

Started by the777, Yesterday at 17:40

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

the777

ive had a look at google but cant find anything. i know it was possible on the zx spectrum but difficult. any ideas?

thanks for all your help btw

andycadley

Yes, use TAG to enable "Text at Graphics Cursor" mode and then MOVE to move the graphics cursor to the relevant pixel position. 

eto

Keep in mind that it's slower than the normal PRINT command. 

Btw: Locomotive BASIC is quite powerful but you will not find a lot of great examples with Google unfortunately. I would strongly suggest to read the Amstrad CPCs manual to get an overview of all its commands. It's really a great resource. 

https://www.cpcwiki.eu/manuals/AmstradCPC6128-hypertext-en-Sinewalker.pdf

MoteroV4

This is a modified example from the CPC6128 manual, to explain interruptions (DI command), but now (besides works in 464), moves a little sprite to the pixel. Hope it help you.
10 MODE 1:TAG
20 EVERY 50 GOSUB 140
30 x1=RND*320: x2=RND*320
40 y=200+RND*200
50 FOR x=320-x1 TO 320+x2 STEP 1
60 DI:'*** disable IRQs to print char
70 MOVE x,y
80 c$=CHR$(ROUND(RND(251)+248))
90 PRINT " ";c$;
100 CALL &BD19:'MC WAIT FLYBACK
110 EI:'*** enable IRQs
120 NEXT
130 GOTO 30
140 '******* sub print shoot
150 MOVE 320,0
160 DRAW x+8,y-16
170 RETURN
Released cpc games: Memtrainer, El Gerente (Remake)

the777

deleted

the777

Quote from: andycadley on Yesterday at 17:57Yes, use TAG to enable "Text at Graphics Cursor" mode and then MOVE to move the graphics cursor to the relevant pixel position.
this works but it leaves a couple of weird characters next to it

eto

Quote from: the777 on Yesterday at 19:05this works but it leaves a couple of weird characters next to it
add a semicolon at the end of the print statement

10 TAG
20 MOVE 325,202
30 PRINT "x";

the777

Quote from: eto on Yesterday at 19:17
Quote from: the777 on Yesterday at 19:05this works but it leaves a couple of weird characters next to it
add a semicolon at the end of the print statement

10 TAG
20 MOVE 325,202
30 PRI
i did, it still does it

https://postimg.cc/YvMQVqWf/56eb58d0

https://postimg.cc/WFzLTkdG/e93e9dd3

even if i use print "A"; at line 260

i think it may have something to do with the inkey command because depending on what 1 or 2 arrow key(s) i press, it changes the amount of characters

andycadley

Because line 280 is doing PRINT INKEY(0) without a semicolon, so it is printing new line characters (because TAG mode always prints the character) 

Powered by SMFPacks Menu Editor Mod