palette settings as in the  rainbow (General discussion Foros MSX)MSX Resource Center            
                       
English Nederlands Espa�ol Portugu�s Russian                  
 Noticias
   Página principal
  Almacén de noticias
  Temas de noticias

 Recursos
   Foros MSX
  Artículos
  Analisis
  Informe de ferias/RUs
  Álbum de fotos
  Ferias y encuentros
  Encuestas
  Enlaces
  Buscar

 Software
   Descargas
  Tienda Online

 MRC
   Quiénes somos
  Únete a nuestro equipo
  Donar
  Políticas
  Contacta con nosotros
  Enlázanos
  Estadísticas

 Buscar
 
  

  

 Login
 

Login

Contraseña




¿Aún no tienes una cuenta? ¡Conviértete en miembro del MSX Resource Center! ¡Únete a nosotros!.


 Estadísticas
 

Hay 49 invitados y 4 miembros en línea

Eres un usuario anónimo.
 

Foros MSX


Foros MSX

General discussion - palette settings as in the rainbow

Autor

palette settings as in the rainbow

monant
msx user
Mensajes: 33
Publicado: Febrero 01 2006, 21:32   
hallo, Could anybody tell me the palette settings (in screen 5 512 colors)

(B R G byte 1 and byte 2) to form rainbow colors.I wanted to see the effect..because.I coded a program to change palette each scanline using interrupt mode 2 ,it's quite steady but not perfect,
i think accetable.

thanks



wolf_

msx legend
Mensajes: 4780
Publicado: Febrero 01 2006, 21:50   
Screen 5 has 16 colors out of 512, just for completeness

Typically you just shift colors gradually accross the RGB components. (a.k.a. HUE shift)

in RGB format:

7 0 0 red
7 7 0 yellow
0 7 0 green
0 7 7 lightblue
0 0 7 blue
7 0 7 purple

And ofcourse, more smoothly for all the in-between colors, like red-orange-yellow-green would be

7 0 0 red
7 4 0 orange
7 7 0 yellow
4 7 0 yellow-green
0 7 0 green
etc.
BiFi
msx guru
Mensajes: 3142
Publicado: Febrero 01 2006, 21:51   
the VDP want its palette values in RB 0G format:

red: 70 00
orange: 70 04
yellow: 70 07
green: 00 07
cyan: 07 07
blue: 07 00
magenta: 77 00

you can smooth things by increasing or decreasing values each step
monant
msx user
Mensajes: 33
Publicado: Febrero 02 2006, 21:10   
thanks, now it's clearer to me how it works.
As I told yesterday I have some bordering effects (from left border to display line) on my real msx2 nms8245 ,but on blue msx there is not .

this is the asm code (I used wbass2)
the v9938 manual says that the hint occurs just after a displayed line
but when does exactly is it set between borders?
INTH:      ORG   &HD1D1
                OUTI
	OUTI
	IN    A,(&H99)        ;read status 1
                INC   D               ;set next int  reg 19
                LD    A,D
                OUT   (&H99),A
                LD    A,E
                OUT   (&H99),A
                INC   B
                JP    Z,AFTER
FUORI:     EI
               RET
AFTER:   LD    A,(LUN)         ;presets
              LD    B,A
              LD    A,(LINE)
              LD    HL,&HD300
              LD    D,A
             OUT   (&H99),A
             LD    A,E
        OUT   (&H99),A
        XOR   A
        OUT   (&H9B),A
        CALL  &HB7            ;ctrl/stop?
        JP    C,BASIC
        JP    FUORI
BASIC:  LD    C,&H99
        LD    A,(&HF3DF)
        RES   4,A             ;disable h.int
        OUT   (C),A
        LD    A,0+128
        OUT   (C),A           ;write reg.0
        LD    A,(&HF3E0)
        SET   5,A             ;enable v.int
        OUT   (C),A
        LD    A,1+128
        OUT   (C),A           ;write reg.1
        XOR   A               ;select status reg.0
        OUT   (C),A
        LD    A,15+128
        OUT   (C),A           ;write reg.15
        IM    1
        POP   IX
        EI
        RET                   ;basic
SETUP:  EI
        HALT
        DI
        IN    A,(&H99)        ;clear pending vint
        LD    HL,&HD000
        LD    DE,&HD001
        LD    (HL),&HD1
        LD    BC,&H0101
        LDIR
        LD    A,&HD0
        LD    I,A
        IM    2               ;interrupt mode2 every interrupt will call &hd1d1
        LD    C,&H99
        LD    A,(LINE)
        LD    D,A
        LD    E,19+128
        LD    A,(&HF3E0)
        RES   5,A             ;disable v.int
        OUT   (C),A
        LD    A,1+128
        OUT   (C),A
        LD    A,1             ;select status reg1
        OUT   (C),A
        LD    A,15+128
        OUT   (C),A
        NOP
        IN    A,(C)           ;clear pending hint
        OUT   (C),D           ;set interrupt line
        OUT   (C),E
        LD    A,16+128        ;indirect access to reg16
        OUT   (C),A
        LD    A,17+128
        OUT   (C),A
        LD    HL,&HD300       ;data pointer
        LD    A,(&HF3DF)
        SET   4,A             ;enable hint
        OUT   (C),A
        LD    A,0+128
        OUT   (C),A
        LD    C,&H9A          ;palette
        LD    A,(LUN)
        LD    B,A
        XOR   A               ;palette color reg0
        OUT   (&H9B),A
        EI                    ;!!
        HALT
LOOP:   JP    LOOP
LINE:   DB    0
LUN:    DB    212
this is the basic
10 REM setup &hd225
20 REM palette1.asm
30 DEFUSR=&HD225
40 POKE&HD283,0:POKE&HD284,212
50 VDP(19)=0:VDP(10)=VDP(10)OR2:VDP(9)=VDP(9)OR&B00100000
60 SCREEN5
70 COLOR15,0,15:CLS
80 FORI=0  TO211:LINE(0,I)-(255,I),QMOD16:Q=Q+1:NEXT
90 CALLTURBOON
100 FORI=0TO511:POKE&HD300+I,0:NEXTI
110 CALLTURBOOFF
120 RESTORE140:FORI=0TO49:READA,B:POKE&HD300+K,A:POKE&HD301+K,B:K=K+2:NEXT
130 A=USR(0)
data ..................

{mod: did some (code) work }
wolf_

msx legend
Mensajes: 4780
Publicado: Febrero 02 2006, 21:48   
To get rid of those penguins (some ppl think these penguins are in fact monkeys)
(code)
place your code here, between those codes.. :)

(/code)

replace () with []


mars2000you
msx master
Mensajes: 1723
Publicado: Febrero 02 2006, 22:06   
Quote:

some ppl think these penguins are in fact monkeys



Monkey Academy ?
 
 







(c) 1994 - 2008 Fundación MSX Resource Center. MSX es una marca registrada de MSX Licensing Corporation