; Photo probe: the INIDISP brightness curve (U10). ; ; The console scales colour by the INIDISP brightness N in its analog video ; stage, so no register reads it back: fullsnes says c * (N+1) / 16, as does ; ares 9408cb4 (ISC) sfc/ppu/color.cpp PPU::color(); a c * N / 15 curve is ; the other candidate (its emulator attributions were struck: they rested on ; reading GPL source). A photo ; of a smooth ramp cannot give numbers (the TV and the camera add their own ; curves), so this screen compares the console with itself: ; ; 14 bands of 16 lines, N = 1 .. 14 from the top. In each band the top 8 ; lines are white (31, 31, 31) at brightness N; the bottom 8 lines are 32 ; grey blocks, levels 0 .. 31 from the left, at full brightness (15). ; ; The block that matches the strip above it is the console's white at ; brightness N, in its own colour units: the TV and camera treat both the ; same. fullsnes predicts block 31 * (N+1) / 16 (N = 7: 15.5), the other ; curve 31 * N / 15 (N = 7: 14.5). Mode 3 (BG1 8bpp): tiles 0-31 are solid colours ; 1-32 (grey 0-31), tile 32 solid colour 33 (white); HDMA writes INIDISP ; every 8 lines. .include "common.inc" BGMODE3 = $03 DMAP0 = $4300 BBAD0 = $4301 A1T0L = $4302 A1B0 = $4304 HDMAEN_ = $420C tile = $10 ; 16-bit row = $12 ; 16-bit tmp = $14 ; 16-bit .segment "CODE" Reset: ProbeStart stz BGMODE lda #$80 sta VMAIN rep #$20 .a16 stz VMADD ; clear VRAM ldx #$8000 : stz VMDATA dex bne :- ; 33 solid 8bpp tiles (32 words each): tile t is colour t + 1 stz VMADD stz tile @tile: lda tile inc a ; the colour index sta tmp ldy #$0000 ; plane pair 0-1, 2-3, 4-5, 6-7 @pair: lda #$0000 lsr tmp ; even plane bit bcc :+ ora #$00FF : lsr tmp ; odd plane bit bcc :+ ora #$FF00 : ldx #8 : sta VMDATA dex bne :- iny cpy #4 bne @pair inc tile lda tile cmp #33 bne @tile ; map at word $4000 (after 33 x 32 words): rows 2b = tile 32, rows 2b+1 = tiles 0-31 lda #$4000 sta VMADD stz row @row: ldx #$0000 @col: lda row and #$0001 bne :+ lda #32 bra :++ : txa : sta VMDATA inx cpx #32 bne @col inc row lda row cmp #32 bne @row sep #$20 .a8 ; CGRAM: colour 0 black, 1-32 grey 0-31, 33 white stz CGADD stz CGDATA stz CGDATA ldx #$0000 @grey: rep #$20 .a16 txa sta tmp asl a asl a asl a asl a asl a ora tmp asl a asl a asl a asl a asl a ora tmp ; g | g << 5 | g << 10 sep #$20 .a8 sta CGDATA xba sta CGDATA inx cpx #32 bne @grey lda #$FF sta CGDATA lda #$7F sta CGDATA lda #BGMODE3 sta BGMODE lda #($4000 >> 10) << 2 sta BG1SC stz BG12NBA stz BG1HOFS stz BG1HOFS stz BG1VOFS stz BG1VOFS lda #$01 sta TM stz TS stz CGWSEL stz CGADSUB stz SETINI ; HDMA ch0: INIDISP from the table, every 8 lines stz DMAP0 stz BBAD0 ldx #BrightTable stx A1T0L stz A1B0 jsr WaitVblankStart lda #$01 sta HDMAEN_ lda #$0F sta INIDISP : bra :- .segment "RODATA" BrightTable: .repeat 14, NN .byte 8, NN + 1 ; white strip at brightness N .byte 8, $0F ; grey blocks at full brightness .endrepeat .byte 0 ProbeTail "SNES PHOTO BRIGHTNESS"