- Top Stats

Top Posters Top Topic Starters Top Topics
AMSDOS 1288
arnoldemu 1128
TFM 1124
ervin 745
ronaldo 403
AMSDOS 55
arnoldemu 51
ervin 42
EgoTrip 35
Arnaud 33
FutureOS corner - 70703 Views TFM/FS 07:12, 01 October 10
Example Z80 as... - 66073 Views arnoldemu 10:59, 04 April 10
#CPCtelera 1.4... - 33000 Views ronaldo 13:59, 11 May 15
BASIC programm... - 30917 Views arnoldemu 16:23, 22 May 09
CHAMP Assemble... - 24974 Views Bruce Abbo... 12:59, 16 January 14


Author Topic: OUT and INK commands  (Read 618 times)

0 Members and 1 Guest are viewing this topic.

Offline billamu

  • CPC464
  • **
  • Posts: 7
  • Country: nz
  • Liked: 4
OUT and INK commands
« on: 04:17, 10 February 19 »
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.
Code: [Select]
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?

Online roudoudou

  • 6128 Plus
  • ******
  • Posts: 616
  • Country: fr
    • urban exploration
  • Liked: 819
Re: OUT and INK commands
« Reply #1 on: 10:57, 10 February 19 »
the system updates colors every frames, you need to disable this part of the system
Code: [Select]
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
use RASM, the best assembler ever made :p

I will survive

Offline GOB

  • Supporter
  • CPC664
  • *
  • Posts: 147
  • Country: fr
  • Liked: 144
Re: OUT and INK commands
« Reply #2 on: 13: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...

Offline Ast

  • 6128 Plus
  • ******
  • Posts: 954
  • Country: fr
    • Amstrad cpc Website of Ast/iMPACT
  • Liked: 690
Re: OUT and INK commands
« Reply #3 on: 13:52, 11 February 19 »
the system updates colors every frames, you need to disable this part of the system
Code: [Select]
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"


Amstrad Plus French Forum

All friends are welcomed !

Offline GOB

  • Supporter
  • CPC664
  • *
  • Posts: 147
  • Country: fr
  • Liked: 144
Re: OUT and INK commands
« Reply #4 on: 14:35, 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.

Offline billamu

  • CPC464
  • **
  • Posts: 7
  • Country: nz
  • Liked: 4
Re: OUT and INK commands
« Reply #5 on: 04:14, 12 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:
Code: [Select]
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.
 

Offline billamu

  • CPC464
  • **
  • Posts: 7
  • Country: nz
  • Liked: 4
Re: OUT and INK commands
« Reply #6 on: 10:31, 14 February 19 »
For anyone still interested in this problem, I worked it "OUT" (hehe).
No, literally! Use the OUT command to force a palette swap:
Code: [Select]
OUT &7f00,pen:OUT &7f00,inkMind you, pen and ink are using hardware values.

« Last Edit: 10:51, 14 February 19 by billamu »

Offline GOB

  • Supporter
  • CPC664
  • *
  • Posts: 147
  • Country: fr
  • Liked: 144
Re: OUT and INK commands
« Reply #7 on: 23:25, 21 February 19 »
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...

Offline billamu

  • CPC464
  • **
  • Posts: 7
  • Country: nz
  • Liked: 4
Re: OUT and INK commands
« Reply #8 on: 11:48, 25 February 19 »
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:
Code: [Select]
i=&7f00:FOR j=0 TO 15:OUT i,j:OUT i,c(j):NEXT

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.587
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 852
Re: OUT and INK commands
« Reply #9 on: 07:03, 27 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 some of the hardly used Amstrad compilers :D
* I use Firmware in my Assembly code :P
* Have interpreted some BASIC 1.1 programs for BASIC 1.0. :)

Offline billamu

  • CPC464
  • **
  • Posts: 7
  • Country: nz
  • Liked: 4
Re: OUT and INK commands
« Reply #10 on: 08:43, 27 February 19 »
Quote
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.
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!