News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

drawing

Started by nrdev, May 25, 2009, 04:51:58 PM

Previous topic - Next topic

nrdev

what functions should I use for drawing?

FORTRANS

Hi,

   Not sure exactly what you want, but here goes.  the BIOS INT 10H
functions control the video.  Function 0 (zero) sets the video mode.
Function 0CH is the one that sets a pixel to a given value.


   This will start a graphics program.

        MOV     AH,0    ; Set Mode
        MOV     AL,13H  ; 320 x 200 x 256 colors
        INT     10H     ; Video interrupt.

   Or try.

        MOV     AL,12H  ; 640 x 480 x 16 colors

   This will set a pixel.

        MOV     AH,0CH          ; Set pixel function.
        MOV     AL,[Color]      ; Pixel value or color
        MOV     BH,0            ; Page for some modes.
        MOV     CX,[Column]     ; X-coordinate
        MOV     DX,[Row]        ; Y-coordinate
        INT     10H

   This will reset to text at the end.

        MOV     AH,0    ; Set Video mode
        MOV     AL,3    ; = Standard video mode 3
        INT     10H

HTH,

Steve N.

nrdev

I meant on what functions, or what should I do to draw point, line, rectangle, and filled rectangle.
By the way third part of code that you have posted needs some more codding.

dedndave

lol
FORTRANS wasn't posting entire programs - they are snippets
that is all the code required to set video mode 3
in fact, this works...

        mov     ax,3
        int     10h

as for drawing lines and circles, that is up to you to code
assembler does not give you these functions natively like basic or c might
for circles, you have to write a routine that does math, and plots points
simple verticle and horizontal lines are not too difficult to plot
start there, then work your way up to diagonal lines, that require simple math

Jimg

nrdev-

I must have missed your original introduction.  What is you goal here?  Are you indeed trying to write stand-alone dos programs that you won't try to run in windows XP?

nrdev

I want to make stand-alone dos program that can be run under win XP and look equally good like programs that look like doom 1 configuration application

dedndave

you need to learn VESA i think - or DirectX
also - 32-bit code
you have your work cut out for you

Jimg

You want to write a program that can run under the old 16-bit dos operating system, i.e. ms-dos 6.0, and have the same program run under XP?  I don't think that is possible.  The DLL you would need to run directly to the hardware in XP would not run in dos, and vice-versa.  Who do you know that is still running DOS as their operating system?
I'm not familiar with Doom 1, but I doubt the same program runs under both operating systems.  On Windows 98, perhaps, but not any of the NT variants directly.  At the minimum, the XP user would also have to start up some DOS emulator first, if one exists.

dedndave

he is refering to 16-bit console mode apps under XP

nrdev

for your information it runs on my very new win xp. Programs like that one you have on tones. For example installation program for the game that is made in 1994 like doom. Why it is not possible to do it nowadays. It was possibble then.

Jimg

I stand corrected.  (And confused).

dedndave

it is possible
but it is not easy
i suspect doom was written in C
if you want to write in assembler, the code can be faster, but you have a learning curve ahead of you
something you might want to look at is code posted by Farabi
he does some interesting game-related graphics - there are others in here, as well
he uses OpenGL for much of his work
you can click on his name to bring up his profile - then look at his posts
you will see pictures and code of stuff he works on

Jimg

Where can I download this 1994 version of Doom to try and see what you are talking about?  Is it still copyrighted and sold, or is it availble for free?

nrdev

go on google and search for doom or doom ultimate edition, after all this years it is now free and more-less open source.

nrdev

When you were doing an 16 bit dos application it is very possible that is has graphics in it, so what have you done to make that.