; Photo probe: the first hi-res half-dot of a line (U9). ; ; In mode 5 a line is 512 half-dots, alternately the sub screen's and the main ; screen's: sub 0, main 0, sub 1, main 1, ... The leftmost one is the sub ; screen's. ares 9408cb4 (ISC) sfc/ppu/dac.cpp makes it transparent ("the ; first hires pixel of each scanline is transparent", not confirmed on ; hardware); krom's published higan pictures show it at full colour. (Other ; emulator attributions struck: they rested on reading GPL source.) A photo of a picture cannot ; settle that by position, so this screen is black with six thin white ; vertical lines, each one half-dot wide, and the photo compares their ; brightness instead: ; ; x = 0 sub screen, the very left edge <- the one in question ; x = 64 sub screen reference ; x = 129 main screen reference ; x = 256 sub screen reference ; x = 385 main screen reference ; x = 511 main screen, the very right edge ; ; If the left-edge line matches the references, the console draws that ; half-dot in full; if it is dimmer, at part strength; if it is missing, ; black. BG1 (4bpp, 16-wide tiles in mode 5) is on both screens, so every ; half-dot is the tile's own pixel; colour 1 is white, the backdrop black. .include "common.inc" BGMODE5 = $05 tmp_addr = $10 ; 16-bit TS_ = TS .segment "CODE" Reset: ProbeStart stz BGMODE lda #$80 sta VMAIN rep #$20 .a16 stz VMADD ; clear VRAM ldx #$8000 : stz VMDATA dex bne :- ; tiles (4bpp, 16 words each): 2 = pixel 0 white, 4 = pixel 1 white, ; 7 = pixel 7 white (the right half of the pair 6/7) lda #2 * 16 jsr WhiteColumn lda #$0080 jsr PlaneRows lda #4 * 16 jsr WhiteColumn lda #$0040 jsr PlaneRows lda #7 * 16 jsr WhiteColumn lda #$0001 jsr PlaneRows ; map at word $0400: tile 0 everywhere, then the line columns on every row ldx #$0000 @row: txa asl a asl a asl a asl a asl a clc adc #$0400 sta tmp_addr ldy #$0000 @col: lda tmp_addr sta VMADD lda #$0000 cpy #0 bne :+ lda #2 ; column 0: x = 0 : cpy #4 bne :+ lda #2 ; x = 64 : cpy #8 bne :+ lda #4 ; x = 129 : cpy #16 bne :+ lda #2 ; x = 256 : cpy #24 bne :+ lda #4 ; x = 385 : cpy #31 bne :+ lda #6 ; x = 511 (tile 7 is the pair's right half) : sta VMDATA inc tmp_addr iny cpy #32 bne @col inx cpx #32 bne @row sep #$20 .a8 stz CGADD ; colour 0 black, colour 1 white stz CGDATA stz CGDATA lda #$FF sta CGDATA lda #$7F sta CGDATA lda #BGMODE5 sta BGMODE lda #(MAP >> 10) << 2 sta BG1SC stz BG12NBA stz BG1HOFS stz BG1HOFS stz BG1VOFS stz BG1VOFS lda #$01 sta TM sta TS_ stz SETINI stz CGWSEL stz CGADSUB lda #$0F sta INIDISP : bra :- ; A = word address of a tile; leaves VMADD there (16-bit A). WhiteColumn: .a16 sta VMADD rts ; A = the plane 0 byte for all 8 rows (plane 1 zero): colour 1 in one column. PlaneRows: .a16 ldx #8 : sta VMDATA dex bne :- rts .segment "RODATA" ProbeTail "SNES PHOTO HIRES EDGE"