News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_billamu

OUT and INK commands

Started by billamu, 03:17, 10 February 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billamu

So I was experimenting with a screen mode I saw in a game published here. It uses a bunch of OUT commands to lower the vertical resolution.
10 MODE 0:BORDER 0
20 OUT &BC00,0:OUT &BD00,127
30 OUT &BC00,4:OUT &BD00,18
40 OUT &BC00,5:OUT &BD00,15
50 OUT &BC00,6:OUT &BD00,15
60 OUT &BC00,7:OUT &BD00,17

The problem is that INK commands no longer work, and I want to change the palette while in this "MODE".
Does anyone understand why changing INKs doesn't work and how to fix it?

roudoudou

the system updates colors every frames, you need to disable this part of the system
10 MEMORY &8FFF:DATA 21,F9,B7,C3,DD,BC:FOR i=0 TO 5:READ A$:POKE &9000+i,VAL("&"+A$):NEXT:CALL &9000
My pronouns are RASM and ACE

GOB

But Roud, you kill refresh !!!
Problem is that int are double time with your R0=127.
So you got 3 int per Frame instead of 6.And Color refresh is done after 3rd int...

Ast

Quote from: roudoudou on 09:57, 10 February 19
the system updates colors every frames, you need to disable this part of the system
10 MEMORY &8FFF:DATA 21,F9,B7,C3,DD,BC:FOR i=0 TO 5:READ A$:POKE &9000+i,VAL("&"+A$):NEXT:CALL &9000


Well done and thanks to GOB for the tips !!!
_____________________

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 !

GOB

Quote from: Ast on 12:52, 11 February 19

Well done and thanks to GOB for the tips !!!
I don't think it's good. Billamu want the color refresh.Solution is to bring up color refresh on priority system int gestion.#BCD7 can be a solution.

billamu

Quote from: GOB on 12:18, 11 February 19
But Roud, you kill refresh !!!
Problem is that int are double time with your R0=127.
So you got 3 int per Frame instead of 6.And Color refresh is done after 3rd int...
Hi GOB & Roudoudou.
So I was tinkering with it, and found that I could still get the colour refresh as long as I didn't try to clip (shorten) the height of the screen (ie: OUT &BC00,4:OUT &BD00,x:OUT &BC00,5:OUT &BD00,x).
So what you're saying GOB is that by using these out commands, it clips the screen at the 3rd int, therefore it never reaches the colour refresh?
Am I crazy to think I could have my cake and eat it by clipping the display starting at the 4th int?
And to be up front, I'm trying to make something for the 10 LINER compo and I can't use M/C without it ending up in the WILD category.

billamu

#6
For anyone still interested in this problem, I worked it "OUT" (hehe).
No, literally! Use the OUT command to force a palette swap:
OUT &7f00,pen:OUT &7f00,ink

Mind you, pen and ink are using hardware values.


GOB

You can use #BCD7 System routine to change priority of refresh routine:
#BCD7 – INITIALISE ET DÉPOSE UN BLOC D'ÉVÈNEMENT DANS LA LISTE DES BLOCS A ACTIVER LORS D'UNE INTERRUPTION EN PROVENANCE DU CRT.
CE: HL contient l'adresse du bloc d'évènement.
         B contient la classe de l'évènement.
         bit 0 = 1 si routine dans RAM.
         bit 1-4 = priorité de l'évènement.
         bit 5 = toujours a 0.
         bit 6 = 1 si priorité + grande que les évènements conventionnels.
         bit 7 = 1 si la routine doit être exécutée immédiatement.
         C contient l'adresse de sélection de la ROM.
         DE contient l'adresse de la routine de l'évènement.
CS: AF, DE, HL sont modifiés.


Sorry in french...

billamu

Quote(Translated)#BCD7 - INITIALIZES AND DEPOSITS AN EVENT BLOCK IN THE LIST OF BLOCKS TO BE ACTIVATED DURING AN INTERRUPTION FROM THE CRT.
IN:     HL contains the address of the event block.         
          B contains the class of the event.
          bit 0 = 1 if routine in RAM.
          bit 1-4 = priority of the event.
          bit 5 = always 0.
          bit 6 = 1 if priority + large than conventional events.
          bit 7 = 1 if the routine should be executed immediately.
          C contains the selection address of the ROM.
          DE contains the address of the event routine.
OUT: AF, DE, HL are changed.

Sorry in french...
Google Translate: ç'est super chouette (it's fantastic)!
Also I've found the most comprehensive yet informal discussion online about the CPC's inner workings have been from French websites.

I did some experimenting in MC but no luck: The colours stay the same. Besides, I want to avoid using machine code (10 Line BASIC Competition).
That said, if I could get it working I would use control characters to change colours, reducing the size of the overall code. At this stage I would do all my colour changes like this:
i=&7f00:FOR j=0 TO 15:OUT i,j:OUT i,c(j):NEXT

AMSDOS

Quote from: billamu on 10:48, 25 February 19
I did some experimenting in MC but no luck: The colours stay the same. Besides, I want to avoid using machine code (10 Line BASIC Competition).


I sent "Red Meets the Grumpy Grumbles" to that BASIC 10 Liners Compo last year which had encoded in it David Hall's Ariom Sprites Driver and it was accepted.
The problem though is using some lines up just to have Sprites which is difficult when competing with computers which had Hardware Sprites as Standard.
The Atari machines make it tough vs Locomotive BASIC, since they have BASIC alternatives. Back in the day we probably had a BASIC which was complementary to theirs, but doesn't seem to be the case anymore since alternative BASICs have come onboard for them.


I was thinking about setting up a BASIC 10-Liner thread, but it probably wouldn't get much feedback.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

billamu

QuoteI sent "Red Meets the Grumpy Grumbles" to that BASIC 10 Liners Compo last year which had encoded in it David Hall's Ariom Sprites Driver and it was accepted.
Hello AMSDOS. I made Tubby Runner back in 2017 and the sprites in it were basically a ton of SYMBOL commands wrapped inside control codes. The DATA statements went on and on..!  :laugh:
I think I'll be sticking with my OUT commands for what I'm making this time... that's if it ultimately works!

Powered by SMFPacks Menu Editor Mod