Uses the RP2040's Programmable IO to create a PAL colour video signal. It consists of the PIO program, some "driver" and tools code, a test program and a program for creating colour Look-up Tables (LUTs).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rppico-pio-pal/PAL_LUT_64_4b.h

280 lines
3.5 KiB

#ifndef PAL_COLOUR_LUT_H__
#define PAL_COLOUR_LUT_H__
#define N_BITS_PER_SAMPLE 4
#define N_SAMPLES 8
#define N_COLOUR_ENTRIES 64
#define WORDS_PER_COLOUR 1
#define R_BITS 2
#define G_BITS 2
#define B_BITS 2
#define PAL_LUT_MASK 0x0000003f
uint palLut[4][64] = {{
0x44444444,
0x45655433,
0x46775322,
0x47986312,
0x44567775,
0x45688764,
0x46898754,
0x47aa9643,
0x4468ab96,
0x457aba86,
0x469bca75,
0x57adca64,
0x547adec8,
0x558ceeb7,
0x56adfda6,
0x57bffd95,
0x76433456,
0x77654446,
0x78864335,
0x79985334,
0x76556788,
0x77777777,
0x78887766,
0x79aa8655,
0x76689ba9,
0x7789aa98,
0x789aba87,
0x79bcb987,
0x767adeda,
0x779bdec9,
0x78adedb9,
0x79ceeda8,
0x98532479,
0x99643368,
0x9a853357,
0x9ba74347,
0x9865579a,
0x99766789,
0xaa987679,
0xaba97668,
0xa8779acb,
0xa9889abb,
0xaaaaaaaa,
0xabbba999,
0xa879ceec,
0xa99acddc,
0xaabcddcb,
0xabcdedba,
0xc952148b,
0xca73237a,
0xcb85336a,
0xcca63359,
0xc96447ac,
0xca85579c,
0xcb97669b,
0xcdb8668a,
0xca768ade,
0xcb988acd,
0xcca99abc,
0xcdca99ab,
0xca88beff,
0xdb9abdee,
0xdcbbcded,
0xdddddddd
},
{
0x44444444,
0x34556543,
0x23577642,
0x13689742,
0x77765445,
0x67886544,
0x57898644,
0x469aa743,
0x9ba86446,
0x8aba7546,
0x7acb9645,
0x6acda754,
0xceda7458,
0xbeec8557,
0xadfda656,
0x9dffb755,
0x54334676,
0x44456776,
0x33468875,
0x33589974,
0x87655678,
0x77777777,
0x67788876,
0x568aa975,
0xab986679,
0x9aa98778,
0x8aba9877,
0x89bcb977,
0xdeda767a,
0xcedb9779,
0xbdeda879,
0xadeec978,
0x74235899,
0x63346998,
0x53358a97,
0x4347ab97,
0x9755689a,
0x87667999,
0x76789aa9,
0x6679aba8,
0xca9778ab,
0xba9889ab,
0xaaaaaaaa,
0x99abbba9,
0xeec978ac,
0xddca99ac,
0xcddcbaab,
0xbdedcbaa,
0x841259cb,
0x73237aca,
0x63358bca,
0x5336acc9,
0xa74469cc,
0x97558acc,
0x96679bcb,
0x8668bdca,
0xda867ace,
0xca889bcd,
0xba99accc,
0xa99acdcb,
0xfeb88acf,
0xedba9bde,
0xedcbbcdd,
0xdddddddd
},
{
0x44444444,
0x54334565,
0x53224677,
0x63124798,
0x77754456,
0x87644568,
0x87544689,
0x964347aa,
0xab964468,
0xba86457a,
0xca75469b,
0xca6457ad,
0xdec8547a,
0xeeb7558c,
0xfda656ad,
0xfd9557bf,
0x34567643,
0x44467765,
0x43357886,
0x53347998,
0x67887655,
0x77777777,
0x77667888,
0x865579aa,
0x9ba97668,
0xaa987789,
0xba87789a,
0xb98779bc,
0xdeda767a,
0xdec9779b,
0xedb978ad,
0xeda879ce,
0x24799853,
0x33689964,
0x33579a85,
0x43479ba7,
0x579a9865,
0x67899976,
0x7679aa98,
0x7668aba9,
0x9acba877,
0x9abba988,
0xaaaaaaaa,
0xa999abbb,
0xceeca879,
0xcddca99a,
0xddcbaabc,
0xedbaabcd,
0x148bc952,
0x237aca73,
0x336acb85,
0x3359cca6,
0x47acc964,
0x579cca85,
0x669bcb97,
0x668acdb8,
0x8adeca76,
0x8acdcb98,
0x9abccca9,
0x99abcdca,
0xbeffca88,
0xbdeedb9a,
0xcdeddcbb,
0xdddddddd
},
{
0x44444444,
0x65433455,
0x76422357,
0x97421368,
0x54457776,
0x65446788,
0x86445789,
0xa743469a,
0x64469ba8,
0x75468aba,
0x96457acb,
0xa7546acd,
0x7458ceda,
0x8557beec,
0xa656adfd,
0xb7559dff,
0x46765433,
0x67764445,
0x88753346,
0x99743358,
0x56788765,
0x77777777,
0x88766778,
0xa975568a,
0x6679ab98,
0x87789aa9,
0x98778aba,
0xb97789bc,
0x767adeda,
0x9779cedb,
0xa879bded,
0xc978adee,
0x58997423,
0x69986334,
0x8a975335,
0xab974347,
0x689a9755,
0x79998766,
0x9aa97678,
0xaba86679,
0x78abca97,
0x89abba98,
0xaaaaaaaa,
0xbba999ab,
0x78aceec9,
0x99acddca,
0xbaabcddc,
0xcbaabded,
0x59cb8412,
0x7aca7323,
0x8bca6335,
0xacc95336,
0x69cca744,
0x8acc9755,
0x9bcb9667,
0xbdca8668,
0x7aceda86,
0x9bcdca88,
0xacccba99,
0xcdcba99a,
0x8acffeb8,
0x9bdeedba,
0xbcddedcb,
0xdddddddd
}};
#endif