BINbump converts binary screen dumps of the IBM PC graphic and BIOS text mode characters, and CGA, EGA, and VGA colors into a HTML fragment for use in a template or webpage.
See the reference documentation for usage, and examples, including changing the character sets and the color palette.
BINbump was created for and is in use on the website archive Defacto2, home to thousands of ANSI and binary texts and artworks that are now rendered in HTML.
package main
import (
"log"
"os"
"github.com/bengarrett/binbump"
)
func main() {
file, _ := os.Open("file.bin")
defer file.Close()
_, _ = binbump.WriteTo(file, os.Stdout)
}BINbump will output a <div> "content division" element containing colors, styles, newlines, and text.
- The div element should be used within a
<pre>"preformatted text" element. - Most ANSI text will want a custom monospaced font, Cascadia Mono handles all the CodePage 437 characters.
- Or use the IBM VGA font for a more authentic recreation,
either font will require a CSS
@font-facerule andfont-familyproperty.
<html>
<head>
<title>Quick usage</title>
</head>
<style>
@font-face {
font-family: cascadia-mono;
src: url(CascadiaMono.woff2) format("woff2");
}
pre {
font-family: cascadia-mono, monospace, serif;
}
</style>
<body>
<pre><!--- binbump output ---><div><span style="color:#aaa;background-color:#000;"> </span><span style="color:#a50;background-color:#0a0;">HI‼︎</span><span style="color:#aaa;background-color:#000;"> </span></div>
</pre>
</body>
</html>- XBIN
BINbump doesn't parse any SAUCE metadata, however this can be done with a separate bengarrett/sauce package.
- Deark is a utility that can output BIN to HTML or an image.
- Ansilove is a collection of tools to convert BIN to images.
- Ultimate Oldschool PC Font Pack offers various retro DOS and PC fonts.