1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

8x8を2倍角に変換して遊ぶ

Last updated at Posted at 2025-05-04

いろいろ、注意

  • UNOでの予定は、未定

プログラム

オンラインコンパイラ paiza


#include <iostream>
using namespace std;
int main(void){
    // Your code here!

    unsigned char font[] = {
        0x80,
        0x40,
        0x20,
        0x10,
        
        0x08,
        0x04,
        0x02,
        0x01
    };

    unsigned char font2[16*2];

    for(int i=0;i<8;i++){
    
        int s = 0;
        int al = font[i];
        s = s |(0b1000000000000000 & (al<<8));
        s = s |(0b0010000000000000 & (al<<7));
        s = s |(0b0000100000000000 & (al<<6));
        s = s |(0b0000001000000000 & (al<<5));
        s = s |(0b0000000010000000 & (al<<4));
        s = s |(0b0000000000100000 & (al<<3));
        s = s |(0b0000000000001000 & (al<<2));
        s = s |(0b0000000000000010 & (al<<1));
        s = s | (s>>1);
        
        
        font2[i*4+0] = s >> 8; 
        font2[i*4+1] = s & 0xff; 
        font2[i*4+2] = font2[i*4+0]; 
        font2[i*4+3] = font2[i*4+1]; 

        printf("[%02x],[%02x]\n",font2[i*4+0],font2[i*4+1]);
        printf("[%02x],[%02x]\n",font2[i*4+2],font2[i*4+3]);

    }//for
    
}



[c0],[00]
[c0],[00]
[30],[00]
[30],[00]
[0c],[00]
[0c],[00]
[03],[00]
[03],[00]
[00],[c0]
[00],[c0]
[00],[30]
[00],[30]
[00],[0c]
[00],[0c]
[00],[03]
[00],[03]

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?