screen 0 inverted characters question (Development MSX Fora)MSX Resource Center MSXdev 2008 - MSX1 development bonanza!           
            
English Nederlands Español Português Russian         
 Nieuws
   Voorpagina
  Nieuws archief
  Nieuws onderwerpen

 Informatie
   MSX Fora
  Artikelen
  Recensies
  Beursverslagen
  Fotoreportages
  Beurzen en meetings
  Enquêtes
  Links
  Zoek

 Software
   Downloads
  Webshop

 MRC
   Wie we zijn
  Kom bij ons team
  Doneren
  Policies
  Contact met het MRC
  Link naar Ons
  Statistieken

 Zoek
 
  

  

 Login
 

Gebruikersnaam

Wachtwoord




Ben je nog niet lid? Klik hier en word MSX vriend!


 Statistieken
 

Er zijn 45 gasten en 1 MSX vriend online

Je bent een anonieme bezoeker.
 

MSX Fora


MSX Fora

Development - screen 0 inverted characters question

Ga naar pagina ( 1 | 2 Volgende pagina )
Schrijver

screen 0 inverted characters question

Mafcase
msx freak
Berichten: 153
Geplaatst: 09 Maart 2006, 09:35   
Hi!

I would like to know how to make characters inverted in Basic > screen 0.

Example:

With the color setting 15,4,4 you get white characters on an blue screen,
I would like to know how some characters can turn blue with a white background.

I know it can be done, but I don't remember how...

Anybody??
GhostwriterP
msx addict
Berichten: 312
Geplaatst: 09 Maart 2006, 09:45   
Redefine, xor 255.
[D-Tail]

msx guru
Berichten: 3017
Geplaatst: 09 Maart 2006, 09:47   
Mafcase: redefining is an option, but when redefining the letter A, all As become blue/white. It might be better to use screen 1 instead - you can change colors for every 8 characters.
pitpan
msx master
Berichten: 1379
Geplaatst: 09 Maart 2006, 11:07   
Copy the ASCII chars 0-127 into 128-255 and XOR this second set. Then you will have a "normal set" and an "inverted set" to be used at the same time in SCREEN 0. I think that this is the best solution, at least for MSX1, SCREEN 0.

To "invert" parts of the screen, it will be enough to XOR 80h the requiered positions in the VRAM NAME TABLE. Easy enough?
NYYRIKKI
msx master
Berichten: 1509
Geplaatst: 09 Maart 2006, 12:24   
Because "Redefine, xor 255." does not help everyone...

To invert ALL characters:
FORI=BASE(2)TOBASE(2)+2047:VPOKEI,VPEEK(I)XOR255:NEXT

To invert 7bit ASCII characters to characters 128-255
FORI=BASE(2)TOBASE(2)+1023:VPOKEI+1024,VPEEK(I)XOR255:NEXT

Here is another method for inverting all characters, but this works only in MSX2 and up.
WIDTH80:FORI=BASE(1)TOBASE(1)+240:VPOKEI,255:NEXT:VDP(13)=PEEK(&HF3E9)+PEEK(&HF3EA)*16:VDP(14)=16


pitpan
msx master
Berichten: 1379
Geplaatst: 09 Maart 2006, 13:04   
Instead of using VPEEKs, you can always grab the data from the font characters present in ROM, that you can easily read with PEEK, that I guess would be slightly faster.
AuroraMSX

msx master
Berichten: 1248
Geplaatst: 09 Maart 2006, 13:05   
How about the trick dvik & joyrex used in the end part of the 'MSX Unleashed' demo?

ARTRAG
msx master
Berichten: 1685
Geplaatst: 09 Maart 2006, 13:33   
AFAIK there should be some VDP register to do that!
It should be a feature of scr0 at 80 columns,
look at the blinking registers, maybe they do what you
need
pitpan
msx master
Berichten: 1379
Geplaatst: 09 Maart 2006, 15:48   
Not many registers for good 'n old TMS9918!
NYYRIKKI
msx master
Berichten: 1509
Geplaatst: 09 Maart 2006, 16:26   
Quote:

Instead of using VPEEKs, you can always grab the data from the font characters present in ROM, that you can easily read with PEEK, that I guess would be slightly faster.



Instead of using BASIC , you can always use assembler, that would be quite a lot faster. In theory you are anyway right...

FA=PEEK(&HF920)+PEEK(&HF921)*256:FORI=0TO1023:VPOKEI+BASE(2),PEEK(FA+I)XOR255:NEXT


Quote:

AFAIK there should be some VDP register to do that!
It should be a feature of scr0 at 80 columns,
look at the blinking registers, maybe they do what you
need


That was the 3rd example...

AuroraMSX

msx master
Berichten: 1248
Geplaatst: 09 Maart 2006, 21:27   
And if you combine the "redefine characters 128-255 to the inverted forms of 0-127" with the VDP(13)/VDP(14) trick you'll have 4 color combinations to play with:

- ForegroundColor 1 / BackgroundColor 1
- BackgroundColor 1 / ForegroundColor 1
- ForegroundColor 2 / BackgroundColor 2
- BackgroundColor 2 / ForegroundColor 2

(Combining e.g. ForegroundColor 1 and BackgroundColor 2 is not an option unfortunately)


BiFi
msx guru
Berichten: 3142
Geplaatst: 10 Maart 2006, 12:21   
why not? there's always the palette

and you don't have 4 color combinations then, just 4 simultaneous colors.
pitpan
msx master
Berichten: 1379
Geplaatst: 10 Maart 2006, 12:52   
Theoretically, some interesting colour effects could be implemented too in MSX(1) using dirty out-of-blank VDP register manipulations. Main issue here will be timing, of course. But the bonus part of the UNLEASHED demo showed how this could be done. Again, a notorious separation between one colour and other would be a good idea.
AuroraMSX

msx master
Berichten: 1248
Geplaatst: 10 Maart 2006, 12:57   
(snip)

AuroraMSX

msx master
Berichten: 1248
Geplaatst: 10 Maart 2006, 12:59   
Quote:

why not? there's always the palette

and you don't have 4 color combinations then, just 4 simultaneous colors.



Then, dear Beefmaster, enlighten me:
Assuming
    color 1,2,2
    vdp(13)=&h34


how would I get one single character on the screen with foreground color 1 and backdrop color 4, hm?


 
Ga naar pagina ( 1 | 2 Volgende pagina )
 







(c) 1994 - 2008 Stichting MSX Resource Center. MSX is een trademark van MSX Licensing Corporation.