GithubHelp home page GithubHelp logo

chiogros / png512 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 13 KB

A bootsector rickroll, where you can display a (tiny) image.

Assembly 64.99% Makefile 2.03% Python 32.98%
bootsector rickroll image i386 nasm qemu

png512's Introduction

PNG512

A i386 bootsector rickroll.

A custom image can be displayed in place of the rickroll.

Space

You can use images with less than (approximatively) 812 pixels (512 - 106) * 2 = 812:

  • 512 bytes, size of bootsector
  • 106 bytes, size of code
  • 2 pixels / byte

Depending on the opcodes pixels create, there could be less space available.

Image can't be larger than 255 pixels.

How to use

  1. Craft your PNG with a paint like software, using the BIOS color palette
  2. Generate the bytecode of your image with png2hex.py
$ python png2hex.py rick.png
  1. Paste the bytecode in rick.asm, after setting width and height
img:
    .width     db    27
    .height    db    29
    .pixels    db    0xff,0xab,...
  1. Compile (you need the make package)
$ make
nasm -f bin rick.asm
  1. Run in a QEMU environment (you need qemu and qemu-system-i386 packages)
$ make run
qemu-system-i386 -display spice-app -fda rick

Color palette

When drawing your PNG, you need to use these colors:

Color Hex
Dark #000000
Blue #0000AA
Green #00AA00
Cyan #00AAAA
Red #AA0000
Magenta #AA00AA
Brown #AA5500
Light gray #AAAAAA
Dark gray #555555
Light blue #5555FF
Light green #55FF55
Light cyan #55FFFF
Light red #FF5555
Light magenta #FF55FF
Yellow #FFFF55
White #FFFFFF

Reference: BIOS color attributes

Images

Rickroll pixel art

Blurry due to the image zoom. Rickroll pixel art

Rickroll on i386 QEMU

Rickroll on x86-i386 QEMU

png512's People

Contributors

chiogros avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.