Skip to content

embedded-graphics: How to properly use the framebuffer #108

Answered by ProfElements
TheTechRobo asked this question in Q&A
Discussion options

You must be logged in to vote

On Pal it does extend to 528 lines.

To get the preferred format you would need to do something like this

fn get_video_format() -> String {
   if let Ok(fd) = ios::open(c"/title/00000001/00000002/data/setting.txt", Mode::Read) {
       const GET_FILE_STATS: i32 = 11;
       let mut out_buf = [0u8; 8];
       let (size, _seek_pos) = if ios::ioctl(fd, GET_FILE_STATS, &[], &mut out_buf).is_ok() {
           (
               usize::try_from(u32::from_be_bytes(out_buf[0..4].try_into().unwrap())).unwrap(),
               usize::try_from(u32::from_be_bytes(out_buf[4..8].try_into().unwrap())).unwrap(),
           )
       } else {
           (0usize, 0usize)
       };

       let mut bytes = vec![0u8

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TheTechRobo
Comment options

@ProfElements
Comment options

Answer selected by TheTechRobo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants