How can I use SVGA or VGA graphics in the msam, I don't see that he have any dos graphic libraries?
i think what you want to research is "direct-x"
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.
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
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.
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
Windows 32-bit Console Application?
FullScreen?
what you mean?
###
Title: Command Prompt
Body: This system does not support fullscreen mode.
I tried to use this code
mov ax,13h
int 10h
but hte program crashes.
I want ot make fullscreen 16-bit application
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
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]
sorry, i misread the 'DOS'.
:wink
what code will do this correctly? I think on the fullscreen and part that interests me.
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
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
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)
how can I make my masm32 to compile a 16-bit app?
let me see
i did it once to see if i could....
first - get the 16-bit linker (LINK563.EXE) - place it in the masm32\bin folder
then make a little batch file to assemble 16-bit code - i named it a16.bat and placed it in the same folder
@echo off
if "x%1"=="x" goto ascusage
if exist %1.asm goto ascasm
:ascusage
echo Usage: a16 asmfile
echo "asmfile" = asmfile.asm
goto batchexit
:ascasm
if exist %1.obj del %1.obj
c:\masm32\bin\ml /c %1.asm >c:\masm32\bin\asmbl.txt
if errorlevel 1 goto showtxt
if exist %1.exe del %1.exe
c:\masm32\bin\Link563 %1.obj >>c:\masm32\bin\asmbl.txt
:showtxt
if exist %1.obj del %1.obj
type c:\masm32\bin\asmbl.txt
:batchexit
dir %1.*
then - to assemble a 16-bit program type (at the prompt)
a16 MyAsmFile (the batch file is written to assume .asm extension)
now - let me see if i can dig up an example 16-bit program for you
then - you should post in the 16-bit forum rather than here
ok
i had to modify one line in the batch file.... (added the semicolon)
c:\masm32\bin\ml /c %1.asm; >c:\masm32\bin\asmbl.txt
then - here is a program.....
.model small
.dosseg
.stack 512
.data
messag db 'Hello World',0Dh,0Ah,24h
.code
_main proc
mov ax,_data ;data segment
mov ds,ax
mov dx,offset messag
mov ah,9 ;function
int 21h ;DOS call
mov ax,4C00h ;terminate - exit code = 0
int 21h ;DOS call
_main endp
end _main
nope - that semicolon isn't working either
the assembler is looking for more filenames
give me a few minutes...
c:\masm32\bin\Link563 %1.obj >>c:\masm32\bin\asmbl.txt
in this line should be writen lnk563 instead of Link563. But in both ways it doesn't give any errors, and also don't give an exe file
i named the linker link563.exe - so it works - lol
also - it helps if c:\masm32\bin is in the PATH environment variable (mine is already set up like that)
try this batch file.....
@echo off
if "x%1"=="x" goto ascusage
if exist %1.asm goto ascasm
:ascusage
echo Usage: asc asmfile
echo "asmfile" = asmfile.asm
goto batchexit
:ascasm
if exist %1.obj del %1.obj
c:\masm32\bin\ml /c %1.asm >c:\masm32\bin\asmbl.txt
if errorlevel 1 goto showtxt
if exist %1.exe del %1.exe
c:\masm32\bin\Link563 %1.obj; >>c:\masm32\bin\asmbl.txt
:showtxt
if exist %1.obj del %1.obj
type c:\masm32\bin\asmbl.txt
:batchexit
dir %1.*
EDIT the semicolon was needed on the linker line - not the assembler line
if c:\masm32\bin is not in the PATH variable, type this at the command prompt...
\masm32\bin\a16 MyAsmFile
it still have the same effect, dosn't report any error, and doesn't make the exe file.
my paths are
D:\masm32\bin\
D:\projects\16bit\16bit.asm
ohhhhhhhhh - lol
then you will want d:\masm32\bin to be in the path (or use d:\masm32\bin\a16 MyAsmFile at the prompt)
and modify the batch file as follows....
@echo off
if "x%1"=="x" goto ascusage
if exist %1.asm goto ascasm
:ascusage
echo Usage: a16 asmfile
echo "asmfile" = asmfile.asm
goto batchexit
:ascasm
if exist %1.obj del %1.obj
d:\masm32\bin\ml /c %1.asm >d:\masm32\bin\asmbl.txt
if errorlevel 1 goto showtxt
if exist %1.exe del %1.exe
d:\masm32\bin\Link563 %1.obj; >>d:\masm32\bin\asmbl.txt
:showtxt
if exist %1.obj del %1.obj
type d:\masm32\bin\asmbl.txt
:batchexit
dir %1.*
the basic commands are....
ml /c MyAsmFile.asm
link563 MyAsmFile.obj;
you can do it without a batch file
still doesn't work. This time I have moved my *.asm file to my bin folder and, run command ml /c 16bit.asm, and get lots of errors, that I couldnt get when runing the batch file.
ouch
it runs on mine
can you copy/paste the errors in here ?
it may not be great form for 16-bit - lol
i am used to a much older assembler for 16-bit code
this was my first attempt at a 16-bit program for this assembler
it may be best if you refer to the 16-bit forum or one of the
sites for a better example of how to write a 16-bit program
but - like i say - it assembled on mine
here is the process and the errors
(http://img29.imageshack.us/img29/5605/console.th.jpg) (http://img29.imageshack.us/my.php?image=console.jpg)
let me find my glasses
here - let me send you the file.....
(see attached zip)
i got the full-size pic
it looks like you are missing a period before the word model
.model small
you also need it before
.dosseg
.data
.code
[attachment deleted by admin]
ok it compiled, but how can I make this program run in fullscreen?
turns out I didn't need lin563.exe becouse i had link16.exe to make it done.
this page does a good job of explaining video mode 13h
read the text - the code is in C - ignore that - let me look for an ASM example
http://www.brackeen.com/vga/basics.html
ok - this program fills the screen with red
press any key to exit
when it's done, the text mode is full-screen - type EXIT to close the console window
[attachment deleted by admin]
thats it, thanks, it was a lot of help.
i found a few more links for you to look at
http://www.codebreakers-journal.com/content/view/140/93/
http://digiassn.blogspot.com/2006/03/asm-working-with-video-palette.html
http://webpages.charter.net/danrollins/techhelp/0113.HTM
that last one tells about other int 10h functions
one of them you will be interested in is int 10h function 1002h
A few things:
1) look at this (http://www.masm32.com/board/index.php?topic=5001.msg37427#msg37427), it is a post of a tutorial that I translated about writing VGA graphics things using DOS under ASM nearly 3 years ago (actually how I learned ASM). Note that full screen is not usable under Vista, but you're OK so long as you're using XP or older.
2) take a peek at this (http://www.gamedev.net/reference/articles/article789.asp) - this is a fully working game using DirectX 6 and is still the best ASM game tutorial out there (IMHO).
3) have a good look at Scronty's site (http://scrontsoft.com/Scrontsoft.asp?pageID=2) for more up-to-date DirectX usage in ASM.
4) DOS is outdated and really much too hard to use... 32-bit Windows code is the way to go. Go for the Direct X versions.
All the best,
Ossa
[edit] Oh, if you want to know about interrupt codes, you need to look at Ralf Brown's Interrupt Listing (http://www.ctyme.com/rbrown.htm) i.e. for 10h, ax=1002h (http://www.ctyme.com/intr/rb-0116.htm) [/edit]
If you want somethings cool, search about VESA and protected mode since DOS will only give you 1 MB of total memory.