flat assembler
Message board for the users of flat assembler.

Index > DOS > My small, mode 13h GUI library

Author
Thread Post new topic Reply to topic
me239



Joined: 06 Jan 2011
Posts: 200
me239
Hello! Here is my new extremely limited library that uses mode 13h to three different gui functions: button/pressed button, window, and title bar. Here is an example of how you can use it
Code:
mov ax, $13
int 10h
mov si, main
call draw_window
int 20h
main WINDOW, 10, 20, 70, 90, 07h, 01h
    

This code/syntax was inspired by a calculator written on this forum. I can't remember the author, but it was under the DOS FAQ under the FPU tab.
the WINDOW syntax goes as the following:
x1, y1, x2, y2, color, titlebar color
button: x1, y1, x2, y2, color
the pressed button routine uses the same syntax as button
image: http://farm6.static.flickr.com/5203/5379941423_2b6932d698.jpg
Download Below


Description: Example program. Replace code inside start to make your own program.
Download
Filename: vga.asm
Filesize: 3.33 KB
Downloaded: 166 Time(s)



Last edited by me239 on 24 Jan 2011, 21:48; edited 1 time in total
Post 23 Jan 2011, 09:49
View user's profile Send private message Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 764
Location: Massachusetts, USA
bitshifter
You may want to consider 80*25 text mode (int 10h, AX=03h)
It use 640*480 resolution so the font is nice and small.
The idea is to choose which ASCII characters to build window.
Also there are characters to make shadows around the border.
As an added bonus you get multiple pages of display memory.
Post 23 Jan 2011, 18:35
View user's profile Send private message Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
bitshifter wrote:
You may want to consider 80*25 text mode (int 10h, AX=03h)
It use 640*480 resolution so the font is nice and small.
The idea is to choose which ASCII characters to build window.
Also there are characters to make shadows around the border.
As an added bonus you get multiple pages of display memory.

I also have one like that, but I wanted shading and light. I'm going to try to make it a mode 12h or vesa soon.
Post 23 Jan 2011, 18:44
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
very good result.

before vesa, try it with mode 13h + protected mode Smile
Post 23 Jan 2011, 19:08
View user's profile Send private message Visit poster's website Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
edfed wrote:
very good result.

before vesa, try it with mode 13h + protected mode Smile
It should work. All comunication is done directly with the video memory(excluding the ah=0 int 10h for mode 13h). How do I switch to mode 13h without the BIOS?
Post 23 Jan 2011, 19:53
View user's profile Send private message Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
bitshifter wrote:
You may want to consider 80*25 text mode (int 10h, AX=03h)
It use 640*480 resolution so the font is nice and small.
The idea is to choose which ASCII characters to build window.
Also there are characters to make shadows around the border.
As an added bonus you get multiple pages of display memory.

I said in my last post that I've already made a text mode interface, but I wanted to use pixels instead of characters. That's why I want to use mode 12h because it is graphics mode, but also has readable font.
edit: My browser didn't refresh so I thought you were the last post.


Last edited by me239 on 23 Jan 2011, 21:29; edited 1 time in total
Post 23 Jan 2011, 21:21
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
do you know my project FOOL?
your first code looks a lot like my very first approach for grapghic programming.
Post 23 Jan 2011, 21:23
View user's profile Send private message Visit poster's website Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
edfed wrote:
do you know my project FOOL?
your first code looks a lot like my very first approach for grapghic programming.
thanks and yes I've heard of FOOL. I downloaded it, but could never figure out how to use and it seemed like an attempt to replace assembly. I could be wrong though.
Post 23 Jan 2011, 21:28
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
me239 wrote:
How do I switch to mode 13h without the BIOS?

You don't. Mode-setting is hardware dependent and quite difficult compared to the simple real mode BIOS-based method. You better switch to mode 0x13 and then enable protected mode.
Post 23 Jan 2011, 21:53
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
Actually, setting mode 13h by directly poking the VGA registers is not so much hardware-dependent (unless you want the MCGA compatibility, but then you'd just need to add a MCGA subroutine), it is relatively simple to do and it will work on anything that is VGA-compatible. I had such code (and also the routine to get back 80x25 text mode) in the late version of my old Titan OS project. unfortunately it is the version that was then lost.
Post 23 Jan 2011, 23:14
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Here is some code from 'BOS' for doing that.


Description:
Download
Filename: vga.inc
Filesize: 12.48 KB
Downloaded: 135 Time(s)

Post 24 Jan 2011, 03:35
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
I stand corrected. Even though I've played with those registers many times in the past, I didn't recall mode-setting was possible in the same way. It's not that complex after all and I've seen a lot "worse". Smile
Post 24 Jan 2011, 10:00
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto
bitshifter wrote:
You may want to consider 80*25 text mode (int 10h, AX=03h)
It use 640*480 resolution so the font is nice and small.
.

Did you mean 720x400 Wink

_________________
Nil Volentibus Arduum Razz
Post 24 Jan 2011, 11:36
View user's profile Send private message Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4237
Location: 2018
edfed
need a vga mode switch for pm (with same interface than int 10h of course), after, bios will be far away!!!!
Post 24 Jan 2011, 12:09
View user's profile Send private message Visit poster's website Reply with quote
me239



Joined: 06 Jan 2011
Posts: 200
me239
edfed wrote:
need a vga mode switch for pm (with same interface than int 10h of course), after, bios will be far away!!!!

Hey, couldn't I just save the int 10h handler and call it later on whilst I'm in protected mode?
Post 25 Jan 2011, 04:33
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17271
Location: In your JS exploiting you and your system
revolution
me239 wrote:
edfed wrote:
need a vga mode switch for pm (with same interface than int 10h of course), after, bios will be far away!!!!

Hey, couldn't I just save the int 10h handler and call it later on whilst I'm in protected mode?
Only if you also switch to 16-bit code, and enable segments to be RM compatible, and set all the IO ports to be open, and ... oh, too much trouble, just switch to RM and do the INT 10 from there or write some direct PM code.
Post 25 Jan 2011, 04:37
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar.

Powered by rwasa.