Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

oded8bit/AsmBMP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AsmBMP

For more projects, click here

A 16-bits x86 DOS Assembly library for displaying bitmap files on VGA (320x200, 256 colors) displays.

Note The library was developed and tested using TASM 4.1 and DosBox

How to use

See included sample program

Follow these steps:

  1. You must use the .486 directive at the beginning of the program
.486
IDEAL
MODEL small
STACK 256
  1. First, include the graph file before your DATASEG section
    include "graph.asm"                            ; Include Bitmap definitions
DATASEG
    ; Your variables

Drawing a Bitmap

  1. Create a bitmap struct in your DATASEG and initialize it with the file path (may include directories)
DATASEG
    ; This is the Bitmap that we are going to draw. Note how it is initialized
    ; with the file path (path should be up to BMP_PATH_LENGHTH bytes)
    Image          Bitmap    {ImagePath="img\\b1.bmp"}
  1. Switch display to VGA mode (see gr_set_video_mode_vga macro in sample program)
  2. To draw the bitmap use:
    ; Draw the image
    mov si, offset Image
    DisplayBmp si, 10,20

where Image is the bitmap struct and the values are x and y coordinates on the screen

General graphics utilities

Switch video mode

Paint a Pixel

Check if coordinates are in the screen

Copy screen into buffer

Copy buffer to screen

Erase area on the screen

About

Assembly library for displaying bitmap file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published