flat assembler
Message board for the users of flat assembler.

Index > Main > vesa example

Author
Thread Post new topic Reply to topic
estrose



Joined: 12 Aug 2005
Posts: 5
Location: Estonia
estrose 27 Sep 2005, 09:55
Hello.
My post is not very concrete but i would ask the following.
I'd like to see a source code in assembler that's asks if vesa is supported, then wil lset up a vesa mode, then will draw a line on screen using "memory windows" mentioned in vesa spec. That's all. If you feel it's homework or not worth to be unswered topic, then let it be. But if you really would write such code i would be very appreciated. I could enhance this code to show a cube, maybe rotating, and would sent the code back as "payment" if you would like to:) Just help with start, i am asking.

Thanks,
estrose.
Post 27 Sep 2005, 09:55
View user's profile Send private message MSN Messenger Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 27 Sep 2005, 11:31
I don't know if it helps but MenuetOS uses VESA - maybe a peek in the source-code can help?
http://menuetos.org/download.html - kernel sources
An example 256-byte invaders in TASM:
http://www.users.globalnet.co.uk/~jchap/tvproins.htm
Post 27 Sep 2005, 11:31
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
bogdanontanu



Joined: 07 Jan 2004
Posts: 403
Location: Sol. Earth. Europe. Romania. Bucuresti
bogdanontanu 27 Sep 2005, 17:29
I do not think this is related to WIndows.
Windows uses either GDI, or DirectX (DirectDraw or Direct3D) to setup video mode and draw smething on screen... VESA is not relevant for Windows environment...
Post 27 Sep 2005, 17:29
View user's profile Send private message Visit poster's website Reply with quote
estrose



Joined: 12 Aug 2005
Posts: 5
Location: Estonia
estrose 29 Sep 2005, 06:54
Alright then. I thought this forum could be more helpful. But maybe i'm myself too lazy, who knows. Anyway i will search with google some example, i havent find yet. I have found some kind of not-vesa way programming examples, but the example i need and described above, i havent found.
Post 29 Sep 2005, 06:54
View user's profile Send private message MSN Messenger Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 29 Sep 2005, 11:09
also look at tomasz "kelvar" engine, search forum for it
Post 29 Sep 2005, 11:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Rohan



Joined: 14 Jul 2005
Posts: 13
Rohan 30 Sep 2005, 12:43
Can I use Vesa2 when I programing in Windows?
Post 30 Sep 2005, 12:43
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 30 Sep 2005, 13:15
Of course, but then Windows emulates console application for you. command.com in Windows 9x/ME and cmd.exe in Windows NT/2K/XP
Post 30 Sep 2005, 13:15
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 01 Oct 2005, 16:41
The code you need is here: http://board.flatassembler.net/topic.php?t=4118
Look for the post by "Dex4u", to draw the line you just add this code:
Code:
mov   [color],0xffffffff
mov   edi,[ModeInfo_PhysBasePtr]     
add   edi,640*10  ;Draw the line 10 lines down
mov   eax,[color]  ;color
cld
mov   ecx,20  ;size of line, this will be times by 4.
rep   stosd    


Note: the code is bootable and to be run from a floppy.
Post 01 Oct 2005, 16:41
View user's profile Send private message Reply with quote
forsaken



Joined: 29 Sep 2005
Posts: 17
forsaken 10 Oct 2005, 15:57
ummm, correct me if im wrong but aint that color value invalid? whats the last 2 255's (FF's) for?
Post 10 Oct 2005, 15:57
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 10 Oct 2005, 17:15
i whould say first 2 ff, but depends on from lsb or msb,
AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB
msb => lsb
this is the structure of argb 32 bit video mode 8:8:8:8
in 24 bit vesa mode you also ahve the alpha that does not much ... but is there
Post 10 Oct 2005, 17:15
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 10 Oct 2005, 19:14
I will correct you, this is a valid number.
Here is why, the code is for vesa mode 640 x 480 8bpp, so each byte is a color, but instead of moving 1 byte at a time, i moved 4 bytes (as they have the same color)
as in "rep stosd" so the line is 80 pixel long.
Why do 80 stosb, when you can do 20 stosd ? Wink.
Post 10 Oct 2005, 19:14
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.