Welcome, Guest. Please login or register.


Author Topic: Q&A (Read 68136 times)

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: Q&A
« Reply #180 on: 2016.November.22. 08:50:50 »
some info for EC0-EC3 lead to error 404:
http://ep.lgb.hu/doc/Nick.html#FIXBIAS

how to define colors?

That site is only my "mirror" of some of the pages, missing other pages it links to ... But EC0-EC3 is not important for you anyway, it's about the bus expansion port, that there can be external hardware device, EC=External Colour. What is important for the BIAS from register 80h are the lower 5 bits.

Offline geco

  • Moderator
  • EP addict
  • *
  • Posts: 7218
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #181 on: 2016.November.22. 08:52:49 »
You can do it in the beginning of your code by the following EXOS call, until EXOS interrupt is active:
Code: [Select]
               LD BC,100H+28 ;B=1 write
;C=28 number of system variable (BIAS)
                LD D,0c0h ;new value
                EXOS 16 ;handling EXOS variable

If EXOS interrupt killed then:
Code: [Select]
        ld      a,color/8
         out   (80h),a

I wrote color/8, becuase EXOS call and direct write to BIAS register is different, BIAS is grouped by 8 colours,
0 th group: 0-7
1 st group: 8-0fh
2 nd group:10h-17h
...
31th group: f8h-ffh

You can use the colour numbers for EXOS BIAS call, but the bias will be the same when you select 0 or when you select 5.
When you enter BIAS directly by register you select the group identifiers, if you select 2 then last 8 color of the palette will be the following:
10h,11h,12h,13h,14h,15h,16h,17h

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14775
  • Country: hu
    • http://enterprise.iko.hu/
Re: Q&A
« Reply #182 on: 2016.November.22. 08:57:31 »
If not needed any fast BIAS changing trick in the program then I recommend using EXOS variable setting.
-you can use normal color code (which 8 colors block contain the selected color will be used)
-don't change the internal speaker state in Nick

Offline g0blinish

  • EP fan
  • *
  • Posts: 110
Re: Q&A
« Reply #183 on: 2016.November.22. 09:25:11 »
well, result isn't what i expected for :(

Offline ssr86

  • EP user
  • *
  • Posts: 355
  • Country: pl
Re: Q&A
« Reply #184 on: 2016.November.22. 10:22:48 »
Looking at your 16c.asm:
Code: [Select]
LPT:        DB -200 ;200 lines
            DB VRES+C16+PIXEL
;            DB VRES+C4+PIXEL;32H  ;0 01 1 001 0
                    ;VINT=0, no IRQ
                    ;Colour Mode=01, 4 colours mode
                    ;VRES=1, full vertical resolution
                    ;Video Mode=001, pixel graphics mode
                    ;Reload=0, LPT will continue

            DB 11   ;left margin=11
            DB 51   ;right margin=51
VIDCIM1:    DW 0    ;primary video address, address of pixel data
            DW 0    ;secondary videó address, not used in pixel graphics mode

PALETTE:;    DB 0,$34,$3A,$3d,0,0,0,0

;;;;;;;;;;;;;;;;;;;;;;;; db 0,1,2,3,4,5,6,7  

            DB -50,12H,63,0,0,0,0,0,0,0,0,0,0,0,0,0
               ;50 lines of border, this is the bottom margin,

            DB -3,16,63,0,0,0,0,0,0,0,0,0,0,0,0,0
               ;3 black lines, syncronization off

            DB -4,16,6,63,0,0,0,0,0,0,0,0,0,0,0,0
               ;4 lines, syncronization on

            DB -1,90H,63,32,0,0,0,0,0,0,0,0,0,0,0,0
               ;1 line, syncronization will switch off at half of line
               ;the NICK chip generate video IRQ at this line

            DB 252,12H,6,63,0,0,0,0,0,0,0,0,0,0,0,0
               ;4 black lines

            DB -50,13H,63,0,0,0,0,0,0,0,0,0,0,0,0,0
               ;50 lines of border, this is the top margin,
You should erase the line that I marked with ";;;;;;;;;;;;;;;;;;". Like the others already said - in the lpt you give only the first 8 colors. The other 8 are determined by a single write to the fixbias register ($80) and are not arbitrary but you choose a group of 8 colors from 32 possible combinations.
« Last Edit: 2016.November.22. 10:31:45 by ssr86 »

Offline IstvanV

  • EP addict
  • *
  • Posts: 4822
Re: Q&A
« Reply #185 on: 2016.November.22. 10:45:53 »
It is not related to the palette issue, but if you do not use double buffering, then it can be beneficial to generate the video interrupt at the beginning of the bottom border instead of at VSYNC, this way you get the most time to update the screen without flickering or other artifacts. Since the interrupt is triggered only after the LPB with the VINT bit set, in this particular case it would need to be set on the first (200 lines long) LPB.

You can do it in the beginning of your code by the following EXOS call, until EXOS interrupt is active:
Code: [Select]
                LD BC,100H+28 ;B=1 write
;C=28 number of system variable (BIAS)
                LD D,0c0h ;new value
                EXOS 16 ;handling EXOS variable

Also, if interrupts are disabled soon after this EXOS call, it is best to execute two HALT instructions after the EXOS 16 to make sure the new BIAS is really set.

If not needed any fast BIAS changing trick in the program then I recommend using EXOS variable setting.

Using EXOS variables does have one disadvantage: the new setting will remain in effect even after quitting the program, unless it is set to zero again in the reset routine. Programs that exit to the EP logo with a non-black border color can be annoying, BIAS is mostly an issue with some badly written games (old Spectrum conversions) that assume it is zero.

Offline SlashNet

  • EP addict
  • *
  • Posts: 1331
  • Country: ua
  • Enterprise 128K | Cubietruck
    • My old site about Enterprise

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14775
  • Country: hu
    • http://enterprise.iko.hu/
Re: Q&A
« Reply #187 on: 2016.November.26. 19:41:59 »
Great work, thanks!

Offline geco

  • Moderator
  • EP addict
  • *
  • Posts: 7218
  • Country: hu
    • Támogató Támogató
Re: Q&A
« Reply #188 on: 2016.November.26. 20:35:14 »
Cool, thank you very much. You were very fast :)