b-em icon indicating copy to clipboard operation
b-em copied to clipboard

Implement Video NuLA Spectrum attributes

Open SteveFosdick opened this issue 6 years ago • 1 comments

From Hoglet in the comments on Issue#50:

Hi Guys,

I'm sure you are aware of this, but VideoNuLA now implements three different attribute based modes:

normal attribute mode (reg 6 = 1, reg 7 = 0) text attribute mode (reg 6 = 1, reg 7 = 1) spectrum attribute mode (reg 6 = 2, reg 7 = don't care I think) It looks like the B-Em emulates normal and text attribute mode, but not the spectrum attribute mode.

Probably we should create a separate issue to track this.

Dave

So this is the separate issue.

SteveFosdick avatar Mar 15 '18 23:03 SteveFosdick

This is now implemented. Also see this test program:

   10 REM > SPECCY2
   20 DIM C$(8)
   30 C$(0)="black"
   40 C$(1)="blue"
   50 C$(2)="red"
   60 C$(3)="magenta"
   70 C$(4)="green"
   80 C$(5)="cyan"
   90 C$(6)="yellow"
  100 C$(7)="white"
  110 MODE 0
  120 REM Make the non-bright colours less saturated.
  130 PROCpalette(0,7,7,7)
  140 PROCpalette(1,15,7,7)
  150 PROCpalette(2,7,15,7)
  160 PROCpalette(3,15,15,7)
  170 PROCpalette(4,7,7,15)
  180 PROCpalette(5,15,7,15)
  190 PROCpalette(6,7,15,15)
  200 PROCpalette(7,12,12,12)
  210 A%=7
  220 VDU23,255,A%,A%,A%,A%,A%,A%,A%,A%
  230 *FX151,34,98
  240 PROCcolours("Spectrum Mode - Normal",0,0)
  250 PROCcolours("Spectrum Mode - Flashing",0,1)
  260 PROCcolours("Spectrum Mode - Bright",1,0)
  270 *FX151,34,99
  280 PROCcolours("Thomosn Mode - Normal",0,0)
  290 PROCcolours("Thomson Mode - Flashing",0,1)
  300 PROCcolours("Thomson Mode - Bright FG",1,0)
  310 *FX9,0
  320 PROCcolours("Thomson Mode - Bright BG",0,1)
  340 *FX151,34,96
  350 MODE 3
  360 *BE
  370 END
  380 DEFPROCpalette(L%,R%,G%,B%)
  390 LOCALA%,X%,Y%
  400 A%=&97
  410 X%=&23
  420 Y%=L%*16+R%
  430 CALL &FFF4
  440 Y%=G%*16+B%
  450 CALL &FFF4
  460 ENDPROC
  470 DEFPROCcolours(T$,B%,F%)
  480 CLS
  490 PROCshow(255,T$)
  500 B%=B%*64+F%*128
  510 R%=1
  520 C%=0
  530 FORI%=0TO7
  540   D$=C$(I%)
  550   PROCtest(B%+I%,D$+" on black")
  560   PROCtest(B%+I%+56,D$+" on white")
  570 NEXT
  580 R%=1
  590 C%=40
  600 FORN%=0TO7
  610   D$=C$(N%)
  620   P%=N%*8
  630   PROCtest(B%+P%,"black on "+D$)
  640   PROCtest(B%+P%+7,"white on "+D$)
  650 NEXT
  660 PROCshow(255, "Press a key to continue...")
  670 G%=GET
  680 ENDPROC
  690 DEFPROCtest(A%,T$)
  700 S$=STR$~(A%)
  710 IFLENS$<2THENS$=" "+S$+" " ELSE S$=S$+" "
  720 PRINTTAB(C%,R%);
  730 R%=R%+1
  740 PROCshow(255,S$)
  750 VDU23,254,A%,A%,A%,A%,A%,A%,A%,A%
  760 PROCshow(254,T$)
  770 PRINT
  780 ENDPROC
  790 DEFPROCshow(A%,T$)
  800 FORS%=1TOLEN(T$)
  810   VDUA%
  820   PRINTMID$(T$,S%,1);
  830 NEXT
  840 ENDPROC

SteveFosdick avatar Aug 28 '22 17:08 SteveFosdick