diff --git a/gba/Makefile b/gba/Makefile index 7cb84fb..25d73e3 100644 --- a/gba/Makefile +++ b/gba/Makefile @@ -92,7 +92,7 @@ CFILES := \ CPPFILES := SFILES := \ posprintf.s \ - bggfx_chr.s spritegfx_chr.s linearity_chr.s sharpness_chr.s \ + bggfx_chr.s spritegfx_chr.s monoscope_chr.s sharpness_chr.s \ stopwatchface_chr.s stopwatchhand_chr.s stopwatchdigits_chr.s \ kikimap_chr.s kikitiles_chr.s greenhillzone_chr.s hepsie_chr.s \ Gus_portrait_chr.s convergence_chr.s pluge_shark_6color_chr.s \ diff --git a/gba/src/global.h b/gba/src/global.h index ff2cc3a..aeea1f9 100644 --- a/gba/src/global.h +++ b/gba/src/global.h @@ -46,14 +46,13 @@ void draw_barslist(const BarsListEntry *rects); extern const unsigned short gray4pal[4]; extern const unsigned short invgray4pal[4]; -void activity_linearity(void); +void activity_monoscope(void); void activity_sharpness(void); void activity_smpte(void); void activity_601bars(void); void activity_pluge(void); void activity_gcbars(void); void activity_gray_ramp(void); -void activity_cps_grid(void); void activity_full_stripes(void); void activity_color_bleed(void); void activity_solid_color(void); diff --git a/gba/src/helppages.txt b/gba/src/helppages.txt index dde775d..afc2b59 100644 --- a/gba/src/helppages.txt +++ b/gba/src/helppages.txt @@ -5,8 +5,7 @@ Gradient color bars SMPTE color bars Color bars on gray Color bleed -Grid -Linearity +Monoscope Convergence Gray ramp Solid color screen @@ -69,33 +68,48 @@ other consoles. For more info, visit http://junkerhq.net/240p -== Grid == +== Monoscope == -This grid uses the screen's -full 240x160 pixel resolution. -Use it to verify that the -entire picture is visible, -including the red border, -with no distortion. +Contains elements to +calibrate multiple aspects +of a CRT. Read your TV's +service manual to learn how. -Select: Invert grays - -== Linearity == - -This pattern shows five -circles at the square pixel -aspect ratio of the GBA -screen. The circles should -have the same diameter in -all directions. - -Use it to verify the horizontal -to vertical size ratio setting -of a display or scaler or to -measure distortion on a CRT. +Convergence: +Use the center crosshair +to check static (center +of screen) convergence. +Use the patterns at the +sides to check dynamic +(edge) convergence. -A: Hide or show grid -Select: Invert grays +↑↓: Change brightness +---- +Adjust convergence at low +brightness. An overly bright +pattern causes bloom that +masks convergence issues. + +Corners: +After setting center and +edge convergence, use +magnets to adjust corner +purity and geometry. +---- +Size and aspect ratio: +After setting horizontal +size, use a tape measure to +adjust vertical size until +the red squares are square. + +Linearity: +The squares in each corner +should get you started. +Confirm your adjustment +using the scroll tests. + +Pattern by khmr33; adapted +to GBA by Lorenzoone == Convergence == diff --git a/gba/src/main.c b/gba/src/main.c index 42465e5..9d4a2bc 100644 --- a/gba/src/main.c +++ b/gba/src/main.c @@ -55,8 +55,7 @@ static const activity_func page_one_handlers[] = { activity_smpte, activity_601bars, activity_color_bleed, - activity_cps_grid, - activity_linearity, + activity_monoscope, activity_convergence, activity_gray_ramp, activity_solid_color, diff --git a/gba/src/stills.c b/gba/src/stills.c index cae6464..5f096e1 100644 --- a/gba/src/stills.c +++ b/gba/src/stills.c @@ -33,8 +33,7 @@ extern const unsigned char helpsect_gradient_color_bars[]; extern const unsigned char helpsect_smpte_color_bars[]; extern const unsigned char helpsect_color_bars_on_gray[]; extern const unsigned char helpsect_color_bleed[]; -extern const unsigned char helpsect_grid[]; -extern const unsigned char helpsect_linearity[]; +extern const unsigned char helpsect_monoscope[]; extern const unsigned char helpsect_convergence[]; extern const unsigned char helpsect_gray_ramp[]; extern const unsigned char helpsect_sharpness[]; @@ -45,8 +44,8 @@ extern const unsigned char helpsect_full_screen_stripes[]; #define PFMAP 23 #define PFOVERLAY 22 -extern const VBTILE linearity_chrTiles[27]; -extern const unsigned int linearity_chrMap[]; +extern const VBTILE monoscope_chrTiles[32]; +extern const unsigned int monoscope_chrMap[]; extern const VBTILE sharpness_chrTiles[48]; extern const unsigned int sharpness_chrMap[]; extern const VBTILE convergence_chrTiles[5]; @@ -134,37 +133,32 @@ static const uint32_t brickstile[8] = { 0x11111122, }; -void activity_linearity(void) { - unsigned int inverted = 0; - unsigned int lcdc_value = MODE_0 | BG1_ON; +static const uint16_t monoscope_whites[] = { + RGB5( 0, 0, 0),RGB5(13,13,13),RGB5(22,22,22),RGB5(31,31,31),RGB5(31,31,31) +}; + +void activity_monoscope(void) { + unsigned int brightness = 1; - bitunpack2(PATRAM4(0, 0), linearity_chrTiles, sizeof(linearity_chrTiles)); - RLUnCompVram(linearity_chrMap, MAP[PFMAP]); - dma_memset16(MAP[PFOVERLAY], 0x01, 32*20*2); + bitunpack2(PATRAM4(0, 0), monoscope_chrTiles, sizeof(monoscope_chrTiles)); + RLUnCompVram(monoscope_chrMap, MAP[PFMAP]); + BG_COLORS[1] = RGB5(31, 0, 0); while (1) { - read_pad_help_check(helpsect_linearity); - if (new_keys & KEY_SELECT) { - inverted = !inverted; + read_pad_help_check(helpsect_monoscope); + if (new_keys & KEY_UP) { + if (++brightness >= 5) brightness = 0; } - if (new_keys & KEY_A) { - lcdc_value ^= BG0_ON; - } - if (new_keys & KEY_B) { - REG_BLDCNT = 0; - return; + if (new_keys & KEY_DOWN) { + if (!brightness--) brightness = 4; } - // This uses blending. VBlankIntrWait(); - BGCTRL[1] = BG_16_COLOR|BG_WID_32|BG_HT_32|CHAR_BASE(0)|SCREEN_BASE(PFMAP); - BGCTRL[0] = BG_16_COLOR|BG_WID_32|BG_HT_32|CHAR_BASE(0)|SCREEN_BASE(PFOVERLAY); - BG_OFFSET[1].x = BG_OFFSET[0].x = BG_OFFSET[0].y = 0; - BG_OFFSET[1].y = 8; - dmaCopy(inverted ? invgray4pal : gray4pal, BG_COLORS+0x00, sizeof(gray4pal)); - REG_DISPCNT = lcdc_value; - REG_BLDCNT = 0x2241; // sub is bg1 and backdrop; main is bg0; function is alpha blend - REG_BLDALPHA = 0x040C; // alpha levels: 4/16*sub + 12/16*main + BGCTRL[0] = BG_16_COLOR|BG_WID_32|BG_HT_32|CHAR_BASE(0)|SCREEN_BASE(PFMAP); + BG_OFFSET[0].x = BG_OFFSET[0].y = 0; + BG_COLORS[0] = (brightness >= 4) ? RGB5(13,13,13) : 0; + BG_COLORS[2] = monoscope_whites[brightness]; + REG_DISPCNT = MODE_0 | BG0_ON; } } @@ -518,46 +512,6 @@ void activity_gray_ramp(void) { } } -void activity_cps_grid(void) { - unsigned int bright = 0; - - load_common_bg_tiles(); - - // Draw grid map - for (unsigned int y = 0; y < 20; ++y) { - unsigned short *row = MAP[PFMAP][y]; - unsigned int basetile = (y & 1) ? 0x0821 : 0x0021; // Xflip - if (y < 2 || y >= 18) basetile |= 0x1000; - - row[0] = basetile | 0x1000; - row[1] = basetile | 0x1400; - for (unsigned int x = 2; x < 28; ++x) { - row[x] = basetile; - basetile ^= 0x0400; - } - row[28] = basetile | 0x1000; - row[29] = basetile | 0x1400; - } - - while (1) { - read_pad_help_check(helpsect_grid); - if (new_keys & KEY_SELECT) { - bright = !bright; - } - if (new_keys & KEY_B) { - return; - } - - VBlankIntrWait(); - BGCTRL[0] = BG_16_COLOR|BG_WID_32|BG_HT_32|CHAR_BASE(0)|SCREEN_BASE(PFMAP); - BG_OFFSET[0].x = BG_OFFSET[0].y = 0; - BG_COLORS[0] = bright ? RGB5(31, 31, 31) : RGB5(0, 0, 0); - BG_COLORS[1] = bright ? RGB5(0, 0, 0) : RGB5(31, 31, 31); - BG_COLORS[17] = RGB5(31, 0, 0); - REG_DISPCNT = MODE_0 | BG0_ON; - } -} - static const uint32_t full_stripes_patterns[3][2] = { {0x11111111,0x22222222}, {0x12121212,0x12121212}, diff --git a/gba/tilesets/monoscope.grit b/gba/tilesets/monoscope.grit new file mode 100644 index 0000000..b641438 --- /dev/null +++ b/gba/tilesets/monoscope.grit @@ -0,0 +1 @@ +-p! -gB2 -mRtpf -mLs -mzr diff --git a/gba/tilesets/monoscope.png b/gba/tilesets/monoscope.png new file mode 100644 index 0000000..4d2779c Binary files /dev/null and b/gba/tilesets/monoscope.png differ