mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-01 17:04:54 -05:00
Multi screen support, with dyn alignment (#2801)
This commit is contained in:
parent
23cabb8b8a
commit
371b6b5079
161 changed files with 4042 additions and 4157 deletions
|
|
@ -34,6 +34,42 @@ using namespace lpc43xx;
|
|||
|
||||
namespace portapack {
|
||||
|
||||
DeviceType device_type = DEV_PORTAPACK;
|
||||
|
||||
void IO::lcd_read_bytes(uint8_t* byte, size_t byte_count) {
|
||||
if (portapack::device_type == portapack::DeviceType::DEV_PORTAPACK) {
|
||||
size_t word_count = byte_count / 2;
|
||||
while (word_count) {
|
||||
const auto word = lcd_read_data();
|
||||
*(byte++) = word >> 8;
|
||||
*(byte++) = word >> 0;
|
||||
word_count--;
|
||||
}
|
||||
if (byte_count & 1) {
|
||||
const auto word = lcd_read_data();
|
||||
*(byte++) = word >> 8;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// prf
|
||||
//--dummy read:
|
||||
dir_read();
|
||||
lcd_rd_assert();
|
||||
halPolledDelay(71);
|
||||
data_read();
|
||||
lcd_rd_deassert();
|
||||
size_t word_count = byte_count / 3;
|
||||
for (size_t i = 0; i < word_count; i++) {
|
||||
uint32_t word = lcd_read_data(); // reads 3 byte of data
|
||||
uint8_t r = ((word >> 16) & 0xff);
|
||||
uint8_t g = ((word >> 8) & 0xff);
|
||||
uint8_t b = ((word >> 0) & 0xff);
|
||||
*(byte++) = r;
|
||||
*(byte++) = g << 2;
|
||||
*(byte++) = b;
|
||||
}
|
||||
}
|
||||
|
||||
void IO::init() {
|
||||
data_mask_set();
|
||||
data_write_high(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue