flat assembler
Message board for the users of flat assembler.
Index
> Main > VBE study Goto page Previous 1, 2, 3, 4 Next |
Author |
|
baldr 25 Jun 2010, 05:54
Teehee,
If you're going to stay in RM, you'd have to use something like les. |
|||
25 Jun 2010, 05:54 |
|
Teehee 26 Jun 2010, 14:36
oh.. hehe, i read the manual
VideoModePtr is a vbeFarPtr, and in RM it is a segment:offset value... so: Code: mov eax, [VbeInfoBlock.VideoModePtr] movzx ecx, ax ; store offset ror eax, 16 ; get segment mov es, ax ; set it mov ax, word[es:ecx] ; get first mode! movzx eax, ax mov ebx, 16 mov esi, buf+4 call String.eax2str works [edit] i was thinking mov ax, [es:ecx] was equal to mov ax,[ecx] bc it would assume 'es' automaticaly (i mean, the segment).. but it doesn't o.o' [edit2] however, there is some undocumented mode numbers, like 17Ah.. why? (see img)
_________________ Sorry if bad english. |
||||||||||
26 Jun 2010, 14:36 |
|
Teehee 27 Jun 2010, 19:28
I'm doing some tests with VGA mode 13h... and i made a proc to draw a rectangle.. but my function seems too dumb... i mean, there is should exist a smart/better way to draw a rectangle. See my code below.
Code: org 100h mov ax,13h int 10h mov ax,0xA000 mov es,ax ; background mov al,79 call clearscr mov cl,105 mov ax,10 mov bx,15 mov bp,310 mov dx,190 call rect mov ah,01h int 21h int 20h clearscr: ; + AL -> color xor di,di mov cx,320*200 rep stosb ret putpixel: ; + AX -> y ; + BX -> x ; + CL -> color push ax dx ; (width*y+x) mov dx,320 mul dx add ax,bx mov di,ax mov byte[es:di],cl pop dx ax ret rect: ; + AX -> y ; + BX -> x ; + BP -> width absolute ; + DX -> height absolute ; + CL -> color push bx @@: call putpixel inc bx cmp bx,bp jg .nextrow jmp @b .nextrow: pop bx inc ax cmp ax,dx jg @f push bx jmp @b @@: ret I was wondering, if video memory is linear and my monitor doens't, so how it know that in a position it should back in next line and draw a pixel there, and so on? So i was wondering if there is a way of to do a 'window' rectangle and only pass the first and the last address and draw a exactly rectangle, like we make in a clear screen function (see 'clearscr' above) (i hope you understood ) _________________ Sorry if bad english. |
|||
27 Jun 2010, 19:28 |
|
bitshifter 28 Jun 2010, 01:28
This is how i did it...
http://board.flatassembler.net/topic.php?p=108398#108398 |
|||
28 Jun 2010, 01:28 |
|
cod3b453 28 Jun 2010, 09:07
Teehee wrote: ... |
|||
28 Jun 2010, 09:07 |
|
janequorzar 22 Sep 2010, 02:46
I posted the difference between PRE-VGA ( VESA ) and VGA ( VESA ) modes when it comes to printing text. It goes for all pixels you look at on a screen in VESA modes.
http://board.flatassembler.net/topic.php?p=119489#119489 You see the issue is not that you cannot print it to the screen, its the matter of WHAT mode your in and what your video card supports. So you must GET the info of what your VESA starting point is. IF VESA is even supported at all. |
|||
22 Sep 2010, 02:46 |
|
Teehee 25 Feb 2011, 23:00
help me with Linear Frame Buffer:
i got the modeinfo and set the mode: Code: ; -- VBE mov ax, ModeInfoBlock mov es, ax mov di, ModeInfoBlock mov ax, 0x4F01 mov cx, 0x011B int 10h mov ax, 0x4F02 mov bx, 0x011B or bx, 0100'0000'0000'0000b ; set LFB int 10h Next i load the GDT and change to PM. Then: Code: mov edi, [ModeInfoBlock.PhysBasePtr] mov dword[edi+1280*50+50],0xFFFFFFFF but cant see any pixel _________________ Sorry if bad english. |
|||
25 Feb 2011, 23:00 |
|
Teehee 26 Feb 2011, 00:41
nvm.. i did!
edit: hm.. why the buffer its not 32 bits? i have 3 bytes color. i cant to do dword loop How do i get 32bit colors? |
|||
26 Feb 2011, 00:41 |
|
Madis731 26 Feb 2011, 16:52
I've discovered that QEMU doesn't support more than 24bpp, but VirtualBox and Bochs do. Most modern videocards can handle 32bpp. Maybe that is the problem.
|
|||
26 Feb 2011, 16:52 |
|
Teehee 26 Feb 2011, 17:00
im using Bochs.
|
|||
26 Feb 2011, 17:00 |
|
Dex4u 26 Feb 2011, 18:50
You will need to enable A20 line
|
|||
26 Feb 2011, 18:50 |
|
Teehee 26 Feb 2011, 19:47
Dex4u wrote: You will need to enable A20 line i did _________________ Sorry if bad english. |
|||
26 Feb 2011, 19:47 |
|
Dex4u 26 Feb 2011, 20:16
If it does not work when you set A20 line, it could you need to try different A20 code.
To test if it is A20 line, try putting pixels at the very start of address. Also make sure A20 has a delay after it. |
|||
26 Feb 2011, 20:16 |
|
Teehee 26 Feb 2011, 20:48
My A20 is ok. i dunno what it has to do with 32bit video buffer.
Code: cmp byte[ModeInfoBlock.BitsPerPixel],32 je $ ; never equal : its 24. |
|||
26 Feb 2011, 20:48 |
|
Dex4u 26 Feb 2011, 21:21
Teehee wrote: My A20 is ok. i dunno what it has to do with 32bit video buffer. For the mode you want you can have 32bpp or 24bpp, you need to test which the card users. As when you write buffer to screen you need to do 00RRGGBB00RRGGBB for 32bits or RRGGBBRRGGBB.. for 24bits And try Code: cmp byte[ModeInfoBlock.BitsPerPixel],32 jne $ ; never equal : its 24. |
|||
26 Feb 2011, 21:21 |
|
Teehee 27 Feb 2011, 12:42
i didnt understand you, Dex.
|
|||
27 Feb 2011, 12:42 |
|
Teehee 28 Feb 2011, 00:19
please help me implement a 32bit video buffer, i'm a little bit lost, help
|
|||
28 Feb 2011, 00:19 |
|
Madis731 28 Feb 2011, 20:19
Code: ;Simple 32-bit video buffer for 800x600 screen: 32bpp_buffer rd 800*600 Now putpixel(x,y): Code: ;putpixel(0,0) WHITE mov edi,32bpp_buffer mov [edi],0FFFFFFh ;putpixel(799,599) BLUE mov [edi+599*800*4+799*4],0FFh When you want to copy that buffer to screen Code: mov esi,[LFB] ; your *real* screen i.e. @ A0000h mov edi,32bpp_buffer mov ecx,800*600*4 / 4 ; 800*600 DWORDs rep movsd ;move 4 bytes at a time |
|||
28 Feb 2011, 20:19 |
|
Teehee 01 Mar 2011, 00:39
this is what i got:
_________________ Sorry if bad english. |
||||||||||
01 Mar 2011, 00:39 |
|
Goto page Previous 1, 2, 3, 4 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.