File: font-switch.pl

package info (click to toggle)
dosbox-x 2025.12.01%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 53,224 kB
  • sloc: cpp: 339,768; ansic: 165,257; sh: 1,455; makefile: 963; perl: 385; python: 106; asm: 57
file content (25 lines) | stat: -rwxr-xr-x 504 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/perl
use integer;
open (THEFILE,'>','../src/hardware/font-switch.h')
	or die "Can't open my file $!";

print THEFILE "switch (bit_mask) {\n";
for ($i = 0; $i < 256; $i++) {
	print THEFILE "\tcase $i:\n";
	$b=128;
	$add=0;
	do  {
		if ($i & $b) {
			print THEFILE "\t\t*(draw+$add)=fg;\n";
		} else {
			print THEFILE "\t\t*(draw+$add)=bg;\n";
		}
		$b=$b >> 1;
		$add=$add+1;
	} until ($b == 0);
	print THEFILE "\tbreak;\n";
} 
print THEFILE "}\n";


close (THEFILE);