MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / lcd_process_pixel

Function lcd_process_pixel

core/lcd.c:174–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174static uint32_t lcd_process_pixel(uint32_t ticks, uint16_t bgr565) {
175 uint32_t v;
176 ticks += lcd.PCD * 2;
177 if (likely(lcd.curRow < lcd.LPP)) {
178 if (!likely(lcd.curCol)) {
179 if (!likely(lcd.curRow)) {
180 panel_clock_porch(lcd.HSW + lcd.HBP + lcd.CPL + lcd.HFP);
181 for (v = (lcd.VSW - 1) + lcd.VBP; v; v--) {
182 if (!panel_hsync()) {
183 break;
184 }
185 panel_clock_porch(lcd.HSW + lcd.HBP + lcd.CPL + lcd.HFP);
186 }
187 }
188 panel_hsync();
189 panel_clock_porch(lcd.HSW + lcd.HBP);
190 }
191
192 if (unlikely(sched_active(SCHED_PANEL))) {
193 panel_scan_until(sched_ticks_remaining_relative(SCHED_PANEL, SCHED_LCD_DMA, ticks));
194 }
195 assert(lcd.curCol < lcd.PPL);
196 panel.clock_pixel(bgr565);
197
198 if (unlikely(++lcd.curCol >= lcd.PPL)) {
199 panel_clock_porch(lcd.HFP);
200 lcd.curCol = 0;
201 lcd.curRow++;
202 if (unlikely(lcd.curRow >= lcd.LPP)) {
203 for (v = lcd.VFP; v; v--) {
204 if (!panel_hsync()) {
205 break;
206 }
207 panel_clock_porch(lcd.HSW + lcd.HBP + lcd.CPL + lcd.HFP);
208 }
209 }
210 ticks += (lcd.HFP + lcd.HSW + lcd.HBP) * lcd.PCD * 2;
211 }
212 }
213 return ticks;
214}
215
216static inline void lcd_fill_bytes(uint8_t bytes) {
217 assert((bytes % sizeof(uint32_t)) == 0);

Callers 1

lcd_wordsFunction · 0.85

Calls 5

panel_clock_porchFunction · 0.85
panel_hsyncFunction · 0.85
sched_activeFunction · 0.85
panel_scan_untilFunction · 0.85

Tested by

no test coverage detected