utils
This commit is contained in:
parent
e35cfe5cc6
commit
a749f77037
@ -32,13 +32,19 @@ int main(int argc, char** argv) {
|
||||
// depth = 2;
|
||||
// 4->2
|
||||
|
||||
pixperbyte = 1;
|
||||
mask_shift = 0;
|
||||
mask = 0xff;
|
||||
depth = 8;
|
||||
pixperbyte = 2;
|
||||
mask_shift = 4;
|
||||
mask = 0x0f;
|
||||
depth = 4;
|
||||
// 4->4?
|
||||
|
||||
// pixperbyte = 1;
|
||||
// mask_shift = 0;
|
||||
// mask = 0xff;
|
||||
// depth = 8;
|
||||
// 8->8
|
||||
|
||||
dsize = fsize / pixperbyte;
|
||||
dsize = fsize * depth / (8/pixperbyte);
|
||||
uint16_t *obuf;
|
||||
|
||||
if((obuf=malloc(dsize))==NULL) {
|
||||
|
||||
@ -2,20 +2,20 @@
|
||||
#include <stdint.h>
|
||||
|
||||
int main(void) {
|
||||
uint16_t tile=64;
|
||||
uint16_t pad=0xa+64;
|
||||
uint16_t tile=256;
|
||||
uint16_t pad=0xa+256;
|
||||
int i,j;
|
||||
FILE *out;
|
||||
if((out=fopen("tilemap", "wb"))==NULL) {
|
||||
perror("Could not open output file 'tilemap'");
|
||||
return 1;
|
||||
}
|
||||
for(i=0; i<12; i++) {
|
||||
for(j=0; j<25; j++) {
|
||||
for(i=0; i<10; i++) {
|
||||
for(j=0; j<21; j++) {
|
||||
fwrite(&tile, 2, 1, out);
|
||||
tile++;
|
||||
}
|
||||
for(j=25; j<32; j++) {
|
||||
for(j=21; j<32; j++) {
|
||||
fwrite(&pad, 2, 1, out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,8 +18,8 @@ int main(int argc, char **argv) {
|
||||
while(1) {
|
||||
uint8_t c=fgetc(in);
|
||||
if(feof(in))break;
|
||||
if(c>=1 && c<=43) {
|
||||
c+=212;
|
||||
if(c>=1 && c<=48) {
|
||||
c+=207;
|
||||
}
|
||||
fputc(c, out);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user