News:

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

SVGA or VGA initialization

Started by nrdev, May 24, 2009, 02:25:46 PM

Previous topic - Next topic

nrdev

How can I use SVGA or VGA graphics in the msam, I don't see that he have any dos graphic libraries?

dedndave

i think what you want to research is "direct-x"

nrdev

that's not it, I want to use one of SVGA, or VGA graphics in my console app, but I don't know how to do that.

dedndave

well - you communicate with the video system by way of the operating system
newer operating systems do not allow direct manipulation of hardware (they may emulate it for you)
i do have one program i wrote several years ago, however, that uses 320x200 256 color mode (mode 8 i think)
that program seems to run under windows XP, but it goes full-screen (emulated)
as i am new to writing for 32-bit code myself, i haven't played with graphics much yet
but, console mode is really intended for text apps
if you are talking about ways to move the cursor and that sort of thing, windows API gives you some functions

btw - welcome to masm32 forum

nrdev

So how can I make my program ot use 320x200x16 screen resoultion in fullscreen mode? That is the thing that I currently want ot do in my program.

dedndave

i am not sure about 16 color mode - 256 colors works better, though - and it's easier to program
because each pixel takes a single byte
i looked it up...
320 x 200 16-color is mode 0Dh
320 x 256 256-color is mode 13h
this page has a nice tutorial....
http://www.brackeen.com/vga/basics.html

EDIT:
to set the video mode to 13h.....


        mov     ax,13h
        int       10h

UtillMasm

Windows 32-bit Console Application?
FullScreen?

what you mean?

###

Title: Command Prompt
Body: This system does not support fullscreen mode.

nrdev

I tried to use this code

mov     ax,13h
int       10h

but hte program crashes.

I want ot make  fullscreen 16-bit application

dedndave

lol
well - console mode as in - i wrote this program for DOS years ago
it works in that one mode (13h) - i doubt windows will support too many other modes
mode 13h was one that was supported by all vga's - the same way - for years
but - it runs from a console window

dedndave

Quote
but hte program crashes.

I want ot make  fullscreen 16-bit application

crashes ? - does it go blank ?
does it assemble ok ?
let me put my old program up.......
(see attached zip)

EDIT
use Exc to exit
cursor keys to move around on the map


[attachment deleted by admin]

UtillMasm

sorry, i misread the 'DOS'.
:wink

nrdev

what code will do this correctly? I think on the fullscreen and part that interests me.

dedndave

well, for starters, it was written as a 16-bit app
if you want to write a 16-bit program, it is a little different than a 32-bit program
you have to use a 16-bit linker, too - not the 32-bit one that comes with the masm32 package
but - for video mode 13h, you set the mode - fill the palette registers and start placing bytes in the video buffer
i used that mode because it is so easy to program for and because it will run on any VGA
the link i gave you should tell you about the video mode


nrdev

ok, I think we can't totally understand each other so, here is my code:

include \masm32\include\masm32rt.inc                    ;   main masm32 INC file

.586
.code

ConsoleName equ "Console"                               ;   declaration of the console title

start:                                                  ;   start of the main loop of the program
cls

mov ax,13h
int 10h

invoke SetConsoleTitle,chr$(ConsoleName)                ;   implementation of console title

inkey                                                   ;   wait for the key to be pressed
ret

end start                                               ;   end of the main program loop


So, what I need to do to make this program run in the fullscreen in resolution 320x200x16

dedndave

ok - that is set up as a 32-bit program
you want to write a 16-bit program
they are written differently and link differently
in many respects, 16-bit code is much simpler to write, but does not allow all the neat windows abilities
if you want to learn to write 16-bit code, i suggest the art of assembly site i sent you in your PM box
although, Kip Irvine gives some 16-bit stuff, as well

EDIT
here is where to download the 16-bit LINK.EXE
ftp://ftp.microsoft.com/softlib/mslfiles/lnk563.exe

we should move this topic to the 16-bit forum
also, you will find many tips in there - better than i can give you (i am set up for 32-bit code)