Fix testdisplay after video scanner upheaval

This commit is contained in:
Aaron Culliney 2018-11-17 10:39:28 -08:00
parent fb44420713
commit 05d3d884b9
3 changed files with 87 additions and 211 deletions

Binary file not shown.

View File

@ -424,9 +424,6 @@ static void _plot_oldschool(color_mode_t mode, uint16_t bits14, unsigned int col
static unsigned int last_col_shift[6] = { 0, 0, 0, 0, 0, 1 };
unsigned int count = 3 + (((shift >> 1) & 0x1) << last_col_shift[(col + 1) >> 3]);
assert(count == 3 || count == 4 || count == 5);
if (count == 5) {
assert(true);
}
for (unsigned int i=0; i<count; i++) {
uint16_t idx = (scanbits32 >> (4 * i)) & 0xFFF;
@ -446,7 +443,7 @@ static void _plot_oldschool(color_mode_t mode, uint16_t bits14, unsigned int col
ntsc_signal_bits = ((bits14 >> shift) & mask);
}
static void _plot_direct(color_mode_t mode, uint16_t bits14, unsigned int col, uint32_t *colors16, unsigned int fb_off) {
static void _plot_ntsc(color_mode_t mode, uint16_t bits14, unsigned int col, uint32_t *colors16, unsigned int fb_off) {
(void)col;
(void)colors16;
PIXEL_TYPE *fb_ptr = (&fbFull[0]) + fb_off;
@ -1028,12 +1025,12 @@ static void _init_interface(void) {
LOG("Initializing display subsystem");
_initialize_display();
plot[COLOR_MODE_MONO] = _plot_direct;
plot[COLOR_MODE_MONO] = _plot_ntsc;
plot[COLOR_MODE_COLOR] = _plot_oldschool;
plot[COLOR_MODE_INTERP] = _plot_oldschool;
plot[COLOR_MODE_COLOR_MONITOR] = _plot_direct;
plot[COLOR_MODE_MONO_TV] = _plot_direct;
plot[COLOR_MODE_COLOR_TV] = _plot_direct;
plot[COLOR_MODE_COLOR_MONITOR] = _plot_ntsc;
plot[COLOR_MODE_MONO_TV] = _plot_ntsc;
plot[COLOR_MODE_COLOR_TV] = _plot_ntsc;
// scanline filtering
for (unsigned int i=0; i<5; i++) {

View File

@ -12,7 +12,6 @@
#include "testcommon.h"
static bool test_thread_running = false;
static color_mode_t test_color_mode = COLOR_MODE_COLOR;
extern pthread_mutex_t interface_mutex; // TODO FIXME : raw access to CPU mutex because stepping debugger ...
@ -25,12 +24,9 @@ static void testdisplay_setup(void *arg) {
if (test_do_reboot) {
cpu65_interrupt(ResetSig);
}
prefs_setLongValue(PREF_DOMAIN_VIDEO, PREF_COLOR_MODE, test_color_mode);
prefs_sync(PREF_DOMAIN_VIDEO);
}
static void testdisplay_teardown(void *arg) {
test_color_mode = COLOR_MODE_COLOR;
test_do_reboot = true;
}
@ -39,6 +35,7 @@ static void testdisplay_teardown(void *arg) {
#if VIDEO_TRACING
#if 0
# define EXPECTED_BOOT_VIDEO_TRACE_FILE_SIZE 1484244660
# define EXPECTED_BOOT_VIDEO_TRACE_FILE_SHA "26b9e21914d4047e6b190fb4f6fcb6854a4eaa25"
// NOTE that CONFORMANT_TRACKS codepaths will change the output of this tracing (just like cpu tracing)
@ -88,6 +85,7 @@ TEST test_boot_video_trace(void) {
# endif
# undef EXPECTED_BOOT_VIDEO_TRACE_FILE_SIZE
# undef EXPECTED_BOOT_VIDEO_TRACE_FILE_SHA
#endif // 0
# define EXPECTED_TRACE_40COL_FILE_SIZ 698230
# define EXPECTED_TRACE_40COL_FILE_SHA "2B8C050F84776A78F73A7AE803A474820E11B3C1"
@ -221,7 +219,7 @@ TEST test_40col_normal() {
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
ASSERT_SHA("51E5960115380C64351ED00A2ACAB0EB67970249");
WAIT_FOR_FB_SHA("D676FAFEF4FE5B31832EF875285B7E3A87E47689");
PASS();
}
@ -234,7 +232,7 @@ TEST test_80col_normal() {
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
ASSERT_SHA("ED9CE59F41A51A5ABB1617383A411455677A78E3");
WAIT_FOR_FB_SHA("BB63B7206CD8741270791872CCD5B77C08169850");
PASS();
}
@ -247,7 +245,7 @@ TEST test_40col_inverse() {
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
ASSERT_SHA("20957B960C3C0DE0ABEE0058A08C0DDA24AB31D8");
WAIT_FOR_FB_SHA("137B1F840ACC1BD23F9636153AAD93CD0FB60E97");
PASS();
}
@ -260,7 +258,7 @@ TEST test_80col_inverse() {
c_debugger_go();
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
ASSERT_SHA("037798F4BCF740D0A7CBF7CDF5FC5D1B0B3C77A2");
WAIT_FOR_FB_SHA("CDAB6BCA6DA883049AF1431EF408F8994615B24A");
PASS();
}
@ -279,14 +277,7 @@ TEST test_lores_with_80col() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("DED166782E9C529B6D7DB2EEBFF5877AD49C4C1F");
} else {
#if !CONFORMANT_TRACKS
ASSERT_SHA("7B642FF04DE03142A2CE1062C28A4D92E492EDDC");
#endif
WAIT_FOR_FB_SHA("09C732B37F9E482C8CBE38DA97C99EE640EB8913");
}
WAIT_FOR_FB_SHA("22867871D3E9F26DAB99286724CD24114D185930");
PASS();
}
@ -301,13 +292,7 @@ TEST test_lores_with_40col() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("270B44B639E062B1DC7C2EB2E561051130F5F790");
} else {
ASSERT_SHA_OLD("D7DC78F5718B4CF8716614E79ADABCAB919FCE5D");
WAIT_FOR_FB_SHA("36287232F7FD4574AA5E05F1C6CACB598C9C2903");
ASSERT_SHA ("36287232F7FD4574AA5E05F1C6CACB598C9C2903"); // stable through next frame
}
WAIT_FOR_FB_SHA("89CB9CAB3EAFC24CB3995B2B3846DF7E62C2106F");
PASS();
}
@ -322,11 +307,7 @@ TEST test_lores_with_40col_2() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("A3D5F5DF7A2DF15DDDF7E82F83B756827CD142D3");
} else {
WAIT_FOR_FB_SHA("D7CC29D2030230258FAFF3772C8F9AD2B318D190");
}
WAIT_FOR_FB_SHA("0CE19F2C173A7EBAC293198CF0E15A8BE495C9FA");
PASS();
}
@ -341,14 +322,7 @@ TEST test_lores_40colmix_normal() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("373799861AFCA845826C27571D2FFF7F1CB69BD6");
} else {
#if !CONFORMANT_TRACKS
ASSERT_SHA("9097A6AE967E4501B40C7CD7EEE115B8C478B345");
#endif
WAIT_FOR_FB_SHA("B460804F69A416D78462818493933BA2FFEB70C8");
}
WAIT_FOR_FB_SHA("C0D1C54E3CD4D8D39B5174AFCB4E1815F3749614");
PASS();
}
@ -363,13 +337,7 @@ TEST test_lores_40colmix_inverse() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("F9F4757BB751AD47D975D45DC75B3C93C9F2C6C8");
} else {
ASSERT_SHA_OLD("5256E8B96CB04F48324B587ECCCF8A435077B5DE");
WAIT_FOR_FB_SHA("C2ADD78885B65F7D2FA84F999B06CB32D25EF8A0");
ASSERT_SHA ("C2ADD78885B65F7D2FA84F999B06CB32D25EF8A0"); // stable through next frame
}
WAIT_FOR_FB_SHA("F2332A32E34F6CF61A69C0C278105F348870E5C6");
PASS();
}
@ -384,13 +352,7 @@ TEST test_lores_80colmix_normal() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("DD2A3A05EA38652A86D144FFB5BD98CB24A82FF6");
} else {
ASSERT_SHA_OLD("9D5D5382B0A18A71DC135CAD51BEA2665ADB5FB2");
WAIT_FOR_FB_SHA("610E61D466AAE88CF694B3E1029D3D4C28D1D820");
ASSERT_SHA ("610E61D466AAE88CF694B3E1029D3D4C28D1D820"); // stable through next frame
}
WAIT_FOR_FB_SHA("EC819006C66EFE5CFF45BADC7B2ECA078268B1D3");
PASS();
}
@ -405,13 +367,7 @@ TEST test_lores_80colmix_inverse() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("0D51D6A375820FE36E4D95127F0E7A8F71495F4A");
} else {
ASSERT_SHA_OLD("7936E87BE1F920AACD43268DB288746528E89959");
WAIT_FOR_FB_SHA("CBAEE8961F20079BF45CD197878F1111A6E89E26");
ASSERT_SHA ("CBAEE8961F20079BF45CD197878F1111A6E89E26"); // stable through next frame
}
WAIT_FOR_FB_SHA("8681289778AB74083712DFF225A2CADADAE9C6DA");
PASS();
}
@ -420,8 +376,7 @@ TEST test_lores_80colmix_inverse() {
// HIRES
//
#define MOIRE_SHA "1A5DD96B7E3538C2C3625A37653E013E3998F825"
#define MOIRE_SHA_BW "DCB2BADC290A9E0A1DF0DEC45D3A653A40AF8B6B"
#define MOIRE_SHA_BW "04C6F5968C56A07FE19B9AB010B052C6218C8E79"
TEST test_hires_with_80col() {
BOOT_TO_DOS();
@ -433,11 +388,7 @@ TEST test_hires_with_80col() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA(MOIRE_SHA_BW);
} else {
ASSERT_SHA(MOIRE_SHA);
}
WAIT_FOR_FB_SHA(MOIRE_SHA_BW);
PASS();
}
@ -451,11 +402,7 @@ TEST test_hires_with_40col() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA(MOIRE_SHA_BW);
} else {
ASSERT_SHA(MOIRE_SHA);
}
WAIT_FOR_FB_SHA(MOIRE_SHA_BW);
PASS();
}
@ -469,11 +416,7 @@ TEST test_hires_with_40col_page2() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA(MOIRE_SHA_BW);
} else {
WAIT_FOR_FB_SHA(MOIRE_SHA);
}
WAIT_FOR_FB_SHA(MOIRE_SHA_BW);
PASS();
}
@ -487,11 +430,7 @@ TEST test_hires_40colmix_normal() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA("9611721C0F70C5F1FE0172534EC15B977CB099D4");
} else {
ASSERT_SHA("37F41F74EB23F8812498F732E6DA34A0EBC4D68A");
}
WAIT_FOR_FB_SHA("EEA7E0FBE38543CEAC0C9B599977C414D32F453C");
PASS();
}
@ -505,11 +444,7 @@ TEST test_hires_40colmix_inverse() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA("5CFA5789735AD09FAB8CC7B6EE44CE22CF64A70D");
} else {
ASSERT_SHA("253D1823F5DAC0300B46B3D49C04CD59CC70076F");
}
WAIT_FOR_FB_SHA("29EE37FF777100486AE0706E1ACAE233F74A8C26");
PASS();
}
@ -523,11 +458,7 @@ TEST test_hires_80colmix_normal() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("4069102016E4E6AA860A32C6BAC5E4A6C6A45B72");
} else {
WAIT_FOR_FB_SHA("8D02F9A7CFC7A7E6D836B01862389F55E877E4E6");
}
WAIT_FOR_FB_SHA("BE548CA56A0194580637B488D7376D8DBCBC71C8");
PASS();
}
@ -541,14 +472,7 @@ TEST test_hires_80colmix_inverse() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
WAIT_FOR_FB_SHA("C3C19FB3258E7A58F81BC3DC51C2AEDFFC836285");
} else {
#if !CONFORMANT_TRACKS
ASSERT_SHA("FAFBB65013DA3D5173487C3F434C36A7C04DE92E");
#endif
WAIT_FOR_FB_SHA("30C0329061781FD1BFE214940F9D5EDFA5FA5F08");
}
WAIT_FOR_FB_SHA("7B1F9B4BDDE9E0AAA8895B5D9CC9D9126A612244");
PASS();
}
@ -566,11 +490,7 @@ TEST test_80col_lores() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA("D8238DC3ACC1A0E191CEC06F505A159993C2EBFA");
} else {
ASSERT_SHA("5BFF6721FB90B3A6AF88D9021A013C007C4AF23A");
}
WAIT_FOR_FB_SHA("4565AB42DDDEB0FC49A5E868BDE4513BD407F84B");
PASS();
}
@ -584,11 +504,7 @@ TEST test_80col_lores_2() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA("5B99DE77F81AD8718FCFB735215A37F7B5ED5DE7");
} else {
ASSERT_SHA("98BB7C04854594D9E709302EF29905D2A89F1D34");
}
WAIT_FOR_FB_SHA("55ECD4261611E1209915AB4052FFA3203C075EF1");
PASS();
}
@ -602,11 +518,7 @@ TEST test_80col_hires() {
ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED);
if (test_color_mode == COLOR_MODE_MONO) {
ASSERT_SHA("647F3A377513486121C7609E3F53E97DC6FC456D");
} else {
ASSERT_SHA("919EBCBABEA57E932F84E9864B2C35F57F8909B4");
}
WAIT_FOR_FB_SHA("0BBBDB9EB3D68C54E4791F78CA9865214B879118");
PASS();
}
@ -619,18 +531,6 @@ GREATEST_SUITE(test_suite_display) {
test_thread_running = true;
typedef struct parms_t {
color_mode_t mode;
bool doReboot;
} parms_t;
static parms_t parmsArray[] = {
{ COLOR_MODE_COLOR, true },
{ COLOR_MODE_COLOR, false },
{ COLOR_MODE_MONO, true },
{ COLOR_MODE_MONO, false },
};
unsigned int count = sizeof(parmsArray)/sizeof(parmsArray[0]);
GREATEST_SET_SETUP_CB(testdisplay_setup, NULL);
GREATEST_SET_TEARDOWN_CB(testdisplay_teardown, NULL);
GREATEST_SET_BREAKPOINT_CB(test_breakpoint, NULL);
@ -638,11 +538,10 @@ GREATEST_SUITE(test_suite_display) {
// TESTS --------------------------
#if VIDEO_TRACING && CONFORMANT_TRACKS
RUN_TESTp(test_boot_video_trace);
RUN_TESTp(test_video_trace_40col);
//RUN_TESTp(test_boot_video_trace); -- Not valid presently
//RUN_TESTp(test_video_trace_40col); -- Need more stable test : disk is settled and cursor flashing ...
RUN_TESTp(test_video_trace_liltexwin);
#endif
// text modes
RUN_TESTp(test_40col_normal);
test_do_reboot = false;
@ -666,104 +565,84 @@ GREATEST_SUITE(test_suite_display) {
// lores
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_with_80col);
}
test_do_reboot = true;
RUN_TEST(test_lores_with_80col);
test_do_reboot = false;
RUN_TEST(test_lores_with_80col);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_with_40col);
}
test_do_reboot = true;
RUN_TEST(test_lores_with_40col);
test_do_reboot = false;
RUN_TEST(test_lores_with_40col);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_with_40col_2);
}
test_do_reboot = true;
RUN_TEST(test_lores_with_40col_2);
test_do_reboot = false;
RUN_TEST(test_lores_with_40col_2);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_40colmix_normal);
}
test_do_reboot = true;
RUN_TEST(test_lores_40colmix_normal);
test_do_reboot = false;
RUN_TEST(test_lores_40colmix_normal);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_40colmix_inverse);
}
test_do_reboot = true;
RUN_TEST(test_lores_40colmix_inverse);
test_do_reboot = false;
RUN_TEST(test_lores_40colmix_inverse);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_80colmix_normal);
}
test_do_reboot = true;
RUN_TEST(test_lores_80colmix_normal);
test_do_reboot = false;
RUN_TEST(test_lores_80colmix_normal);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_lores_80colmix_inverse);
}
test_do_reboot = true;
RUN_TEST(test_lores_80colmix_inverse);
test_do_reboot = false;
RUN_TEST(test_lores_80colmix_inverse);
// hires
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_with_80col);
}
test_do_reboot = true;
RUN_TEST(test_hires_with_80col);
test_do_reboot = false;
RUN_TEST(test_hires_with_80col);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_with_40col);
}
test_do_reboot = true;
RUN_TEST(test_hires_with_40col);
test_do_reboot = false;
RUN_TEST(test_hires_with_40col);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_with_40col_page2);
}
test_do_reboot = true;
RUN_TEST(test_hires_with_40col_page2);
test_do_reboot = false;
RUN_TEST(test_hires_with_40col_page2);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_40colmix_normal);
}
test_do_reboot = true;
RUN_TEST(test_hires_40colmix_normal);
test_do_reboot = false;
RUN_TEST(test_hires_40colmix_normal);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_40colmix_inverse);
}
test_do_reboot = true;
RUN_TEST(test_hires_40colmix_inverse);
test_do_reboot = false;
RUN_TEST(test_hires_40colmix_inverse);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_80colmix_normal);
}
test_do_reboot = true;
RUN_TEST(test_hires_80colmix_normal);
test_do_reboot = false;
RUN_TEST(test_hires_80colmix_normal);
for (unsigned int i=0; i<count; i++) {
test_do_reboot = parmsArray[i].doReboot;
test_color_mode = parmsArray[i].mode;
RUN_TEST(test_hires_80colmix_inverse);
}
test_do_reboot = true;
RUN_TEST(test_hires_80colmix_inverse);
test_do_reboot = false;
RUN_TEST(test_hires_80colmix_inverse);
// double-lo/hi
RUN_TEST(test_80col_lores);
test_color_mode = COLOR_MODE_MONO;
RUN_TEST(test_80col_lores);
RUN_TEST(test_80col_lores_2);
test_color_mode = COLOR_MODE_MONO;
RUN_TEST(test_80col_lores_2);
RUN_TEST(test_80col_hires);
test_color_mode = COLOR_MODE_MONO;
RUN_TEST(test_80col_hires);
// ...