'RJA changed basepin on Chip's HDMI code in documentation for his first P1 board '******************************************** '* VGA 640 x 480 x 16bpp 5:6:5 RGB - HDMI * '******************************************** CON hdmi_base = 48'16 'must be a multiple of 8 _clkfreq=250_000_000 DAT org ' ' ' Setup ' hubset ##%1_000001_0000011000_1111_10_00 'config PLL, 20MHz/2*25*1 = 250MHz waitx ##20_000_000 / 200 'allow crystal+PLL 5ms to stabilize hubset ##%1_000001_0000011000_1111_10_11 'switch to PLL ' LUT mov x,#0 rdfast #0,##($1000-$400) 'load .bmp palette into lut rep @.end,#$100 rflong y 'mov y, ##$FF0000 shl y,#8 wrlut y,x add x,#1 .end rdfast ##640*480*2/64,##$1000 'set rdfast to wrap on bitmap setxfrq ##$0CCCCCCC+1 'set streamer freq to 1/10th clk setcmod #$100 'enable HDMI mode drvl #7<<6 + hdmi_base 'enable HDMI pins wrpin ##%100100_00_00000_0,#7<<6 + hdmi_base 'set 1mA drive on HDMI pins ' rdfast ##640*480/64,##$1000 ' Field loop ' field 'RJA adding rdfast here rdfast ##640*480/64,##$1000 'set rdfast to wrap on bitmap mov hsync0,sync_000 'vsync off mov hsync1,sync_001 callpa #33,#blank 'top blanks mov x,##480 'set visible lines line call #hsync 'do horizontal sync xcont m_rf,#1 'do visible line djnz x,#line 'another line? callpa #10,#blank 'bottom blanks mov hsync0,sync_222 'vsync on mov hsync1,sync_223 callpa #2,#blank 'vertical sync blanks jmp #field 'loop ' ' ' Subroutines ' blank call #hsync 'blank lines xcont m_vi,hsync0 _ret_ djnz pa,#blank hsync xcont m_bs,hsync0 'horizontal sync xzero m_sn,hsync1 _ret_ xcont m_bv,hsync0 ' ' ' Initialized data ' sync_000 long %1101010100_1101010100_1101010100_10 ' sync_001 long %1101010100_1101010100_0010101011_10 ' hsync sync_222 long %0101010100_0101010100_0101010100_10 'vsync sync_223 long %0101010100_0101010100_1010101011_10 'vsync + hsync m_bs long $70810000 + hdmi_base<<17 + 16 'before sync m_sn long $70810000 + hdmi_base<<17 + 96 'sync m_bv long $70810000 + hdmi_base<<17 + 48 'before visible m_vi long $70810000 + hdmi_base<<17 + 640 'visible 'm_rf long $B0850000 + hdmi_base<<17 + 640 'visible rfword rgb16 (5:6:5) m_rf long $70880000 + hdmi_base<<17 + 640 'visible rfword rgb16 (5:6:5) ' ' x long 0 y long 0 ' Uninitialized data ' hsync0 res 1 hsync1 res 1 ' ' ' Bitmap ' orgh $1000 - $436 'justify pixels at $1000, pallete at $1000-$400 file "bitmap2.bmp"'combined1.bmp" 'orgh $1000 - 70 'justify pixels at $1000 ' file "birds_16bpp.bmp" 'rayman's picture (640 x 350)