I would like to know if GUI interfaces can be created for 16 bit memory model and what are the major advantages of 32 bit memory model that better allows support for GUI interfaces?
Posted on 2012-01-25 08:17:20 by Snake4eva
Sounds like a homework question?
Let me ask you this: Did 16-bit Windows applications have GUIs?
Posted on 2012-01-25 08:42:28 by Scali
GUI Can be created on any memory models as long as you can access the Video Card. I did created my own GUI for syslinux.
Posted on 2012-01-31 17:10:41 by Farabi
How'd you do that, Farabi? Frame buffer device? Svga library? Diddle the ports? Can we see?

For Snake4eva, the main problem I see is the 64k segment limits. Anything "nicer" than mode 13h wants more than 64k, and involves bank-switching and multiple buffers in multiple segments. It can be done, but it's a heck of a lot easier with 4G segments and a linear frame buffer!

The other thing is that you'd need to manage the mouse yourself. In Windows (or Xwindows in Linux), the OS (or X server) watches the mouse for you and sends a "message" if anything interesting happens. (doesn't have to do with the memory model)

You can do it, but I doubt if you want to.

Do you actually remember 16-bit Windows, Scali? Fondly? :)

Best,
Frank

Posted on 2012-02-01 01:01:10 by fbkotler
For Snake4eva, the main problem I see is the 64k segment limits. Anything "nicer" than mode 13h wants more than 64k, and involves bank-switching and multiple buffers in multiple segments. It can be done, but it's a heck of a lot easier with 4G segments and a linear frame buffer!


Then again, hardware with linear framebuffer support did not exist until 32-bit OSes were reasonably common, in the early 90s.
In the 16-bit days, we were happy with just 640x480 or 800x600 in 16 colours, which would fit just fine in 64k... Or well, one bitplane would, and it was all planar anyway.

Do you actually remember 16-bit Windows, Scali? Fondly? :)

Yes. No.
Posted on 2012-02-01 01:49:50 by Scali

How'd you do that, Farabi? Frame buffer device? Svga library? Diddle the ports? Can we see?

For Snake4eva, the main problem I see is the 64k segment limits. Anything "nicer" than mode 13h wants more than 64k, and involves bank-switching and multiple buffers in multiple segments. It can be done, but it's a heck of a lot easier with 4G segments and a linear frame buffer!

The other thing is that you'd need to manage the mouse yourself. In Windows (or Xwindows in Linux), the OS (or X server) watches the mouse for you and sends a "message" if anything interesting happens. (doesn't have to do with the memory model)

You can do it, but I doubt if you want to.

Do you actually remember 16-bit Windows, Scali? Fondly? :)

Best,
Frank


Sure, you can see it, give me time a weeks, I'll rearrange the code so it was usable. I used int x10 to access the linier frame buffers. You also can use OpenGL for it.

And for the mouse, you need to know the "magic" byte in order to use it.
Posted on 2012-02-07 02:52:36 by Farabi
It should be easy to convert it to your need, this code is based on syslinux system framework, so you will need to adjust it.



TRUE equ 1

vesa_msg db "Komputer ini tidak mendukung Vesa",0dh,0ah,0
vesa_msg2 db "Komputer ini mendukung VESA",0dh,0ah,0
vesa_msg3 db "Komputer ini tidak mendukung Resolusi yang anda inginkan",0dh,0ah,0
vesa_msg4 db " Komputer ini mendukung Resolusi yang anda inginkan",0dh,0ah,0
vesa_msg5 db " Tidak Didukung",0dh,0ah,0
vesa_msg6 db "Maaf persiapan VESA dikomputer ini gagal. Coba lagi untuk mencari mode yang sesuai",0dh,0ah,0
buffer db "XXXXXXXXXXX",0
lfb dd 0
vmode dd 0

resx dd 0
resy dd 0
phys_addr dd 0
offs_mem dd 0
vmem dd 0
vbpp dd 0

segPerLine dd 0
acc_mode dd 0

VgaInfoBlock    STRUC
    VbeSignature        db 4 dup (?)    ; VBE Signature
    VbeVersion          dw 0200h        ; VBE Version
    OemStringPtr        dd ?            ; Pointer to OEM String
    Capabilities        db 4 dup (?)    ; Capabilities of graphics controller
    VideoModePtr        dd ?            ; Pointer to VideoModeList
    TotalMemory          dw ?            ; Number of 64kb memory blocks
                                          ; Added for VBE 2.0
    OemSoftwareRev      dw ?            ; VBE implementation Software revision
    OemVendorNamePtr    dd ?            ; Pointer to Vendor Name String
    OemProductNamePtr    dd ?            ; Pointer to Product Name String
    OemProductRevPtr    dd ?            ; Pointer to Product Revision String
    Reserved db 222      dup (?)          ; Reserved for VBE implementation scratch
                                          ;  area
    OemData db 256      dup (?)          ; Data Area for OEM Strings
VgaInfoBlock    ENDS

ModeInfoBlock  STRUC

; Mandatory information for all VBE revisions 

    ModeAttributes          dw ?        ; mode attributes
    WinAAttributes          db ?        ; window A attributes
    WinBAttributes          db ?        ; window B attributes
    WinGranularity          dw ?        ; window granularity
    WinSize                dw ?        ; window size
    WinASegment            dw ?        ; window A start segment
    WinBSegment            dw ?        ; window B start segment
    WinFuncPtr              dd ?        ; pointer to window function
    BytesPerScanLine        dw ?        ; bytes per scan line
     
            ; Mandatory information for VBE 1.2 and above 
    XResolution            dw ?        ; horizontal resolution in pixels or characters3
    YResolution            dw ?        ; vertical resolution in pixels or characters
    XCharSize              db ?        ; character cell width in pixels
    YCharSize              db ?        ; character cell height in pixels
    NumberOfPlanes          db ?        ; number of memory planes 
    BitsPerPixel            db ?        ; bits per pixel
    NumberOfBanks          db ?        ; number of banks
    MemoryModel            db ?        ; memory model type
    BankSize                db ?        ; bank size in KB
    NumberOfImagePages      db ?        ; number of images
    Reserved                db 1        ; reserved for page function
     
            ; Direct Color fields (required for direct/6 and YUV/7 memory models) 
    RedMaskSize            db ?        ; size of direct color red mask in bits
    RedFieldPosition        db ?        ; bit position of lsb of red mask
    GreenMaskSize          db ?        ; size of direct color green mask in bits
    GreenFieldPosition      db ?        ; bit position of lsb of green mask
    BlueMaskSize            db ?        ; size of direct color blue mask in bits
    BlueFieldPosition      db ?        ; bit position of lsb of blue mask
    RsvdMaskSize            db ?        ; size of direct color reserved mask in bits
    RsvdFieldPosition      db ?        ; bit position of lsb of reserved mask
    DirectColorModeInfo    db ?        ; direct color mode attributes

            ; Mandatory information for VBE 2.0 and above 
    PhysBasePtr            dd ?        ; physical address for flat memory frame buffer
    OffScreenMemOffset      dd ?        ; pointer to start of off screen memory
    OffScreenMemSize        dw ?        ; amount of off screen memory in 1k units
    _Reserved                db 206 dup (?)  ; remainder of ModeInfoBlock
ModeInfoBlock  ENDS

vga_info0 equ memory_layout + 1024
vga_info1 equ vga_info0 + 512

.code

VesaInit proc
LOCAL reg:com32sys_t

mov eax,vga_info0
mov byte ptr,"V"
mov byte ptr,"B"
mov byte ptr,"E"
mov byte ptr,"2"
mov ecx,eax
and ecx,0Fh
shr eax,4

mov reg.eax_,4f00h
mov reg.es_,ax
mov reg.edi_,ecx
invoke CallInterupt,addr reg,10h,addr reg

mov eax,reg.eax_
.if al!=4fh
invoke PrintRel,addr vesa_msg
xor eax,eax
ret
.else
push eax
invoke PrintRel,CADD("Komputer ini mendukung Vesa Status:")
pop eax
.if ah==00
invoke PrintRel,CADD("Sukses. Lanjutkan.")
invoke PrintRel,addr crg
.elseif ah==01
invoke PrintRel,CADD("Gagal menyetel Vesa")
invoke PrintRel,addr crg
xor eax,eax
ret
.elseif ah==2
invoke PrintRel,CADD("Tidak mendukung karena salah setel hardware")
invoke PrintRel,addr crg
xor eax,eax
ret
.elseif ah==3
invoke PrintRel,CADD("Fungsi tidak di video mode saat ini")
invoke PrintRel,addr crg
xor eax,eax
ret
.endif
.endif

mov ecx,vga_info0
invoke Println,ecx,4
mov ecx,vga_info0
movzx ecx,.VgaInfoBlock.VbeVersion
invoke dw2hex,ecx,base_buffer
invoke Print,base_buffer

invoke PrintRel,CADD(" OEM String: ")
mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemStringPtr
movzx edx,cx
shr ecx,12
add ecx,edx
invoke Print,ecx

mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemVendorNamePtr
.if ecx!=0
invoke PrintRel,CADD(" Vendor Name: ")
mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemVendorNamePtr
movzx edx,cx
shr ecx,12
add ecx,edx
invoke Print,ecx
.endif

mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemProductNamePtr
.if ecx!=0
invoke PrintRel,CADD(" OemProductNamePtr: ")
mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemProductNamePtr
movzx edx,cx
shr ecx,12
add ecx,edx
invoke Print,ecx
.endif

mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemProductRevPtr
.if ecx!=0
invoke PrintRel,CADD(" OemProductRevPtr: ")
mov ecx,vga_info0
mov ecx,.VgaInfoBlock.OemProductRevPtr
movzx edx,cx
shr ecx,12
add ecx,edx
invoke Print,ecx
.endif

invoke PrintRel,addr crg
mov ecx,vga_info0
mov eax,dword ptr.VgaInfoBlock.Capabilities
pushad
invoke PrintRel,CADD("Kemampuan:")
invoke PrintRel,addr crg
popad
pushad
bt eax,0
.if CARRY?
invoke PrintRel,CADD("DAC Bisa untuk di nyalakan kedalam 8-bit mode.")
invoke PrintRel,addr crg
.endif
popad
pushad
bt eax,1
.if CARRY?
invoke PrintRel,CADD("Tanpa VGA Controller.")
invoke PrintRel,addr crg
.endif
popad
pushad
bt eax,2
.if CARRY?
invoke PrintRel,CADD("programmed DAC with blank bit (i.e. only during blanking interval)")
invoke PrintRel,addr crg
.endif
popad
pushad
bt eax,3
.if CARRY?
bt eax,4
.if CARRY?
invoke PrintRel,CADD("(VBE v3.0)stereo signalling via external VESA stereo connector")
invoke PrintRel,addr crg
.else
invoke PrintRel,CADD("(VBE v3.0)stereo signalling via VESA EVC connector")
invoke PrintRel,addr crg
.endif
.else
bt eax,4
.if CARRY?
invoke PrintRel,CADD("4  (VBE/AF v1.0P) must call EnableDirectAccess to access framebuff")
invoke PrintRel,addr crg
.endif

.endif
popad
pushad
bt eax,5
.if CARRY?
invoke PrintRel,CADD("programmed DAC with blank bit (i.e. only during blanking interval)")
invoke PrintRel,addr crg
.endif
popad
pushad
movzx eax,.VgaInfoBlock.TotalMemory
mov ecx,64*1024
mul ecx
push eax
invoke PrintRel,CADD("Jumlah total Memory Video: ")
pop eax
invoke dw2a,eax,base_buffer
invoke Print,base_buffer
invoke PrintRel,addr crg
popad

mov ecx,vga_info0
mov ecx,.VgaInfoBlock.VideoModePtr
.if ecx!=0
movzx edx,cx
shr ecx,12
add ecx,edx
invoke LoadMem,addr acc_mode,ecx
.else
invoke PrintRel,CADD("Maaf, Komputer ini tidak mempunya pointer ke alamat mode yang didukung")
.endif



invOke fLEA,addr crg
invoke Print,eax

mov eax,1


ret
VesaInit endp

VesaFindMode proc xRes:dword,yRes:dword,bpp:dword,lfbs:dword
LOCAL reg:com32sys_t
LOCAL mode:dword
LOCAL vlfb:dword
LOCAL flbs:dword
LOCAL closest:dword

invoke Println,vga_info0,4
invoke PrintRel,CADD("Version ")
mov ecx,vga_info0
movzx eax,.VgaInfoBlock.VbeVersion
invoke dw2hex,eax,base_buffer
invoke Print,base_buffer
invoke PrintRel,addr crg

invoke StoreMem,addr acc_mode
.if eax!=0
xor ecx,ecx
loop_support:
movzx edx,word ptr
mov mode,edx
inc ecx
cmp dx,-1
jz done
pushad
mov eax,vga_info1
mov ecx,eax
and ecx,0Fh
shr eax,4
mov reg.eax_,4f01h
mov reg.es_,ax
mov reg.edi_,ecx
mov ecx,mode
mov reg.ecx_,ecx
invoke CallInterupt,addr reg,10h,addr reg
popad
pushad
mov ecx,vga_info1
movzx eax,.ModeInfoBlock.ModeAttributes
bt AX, 7      ; Does this mode support a linear frame buffer?
.if !CARRY?
    .if lfbs==TRUE
    popad
    jmp loop_support   
    .endif
    .else
  push mode
  pop closest
    .endif
   
    mov ecx,vga_info1
movzx eax,.ModeInfoBlock.ModeAttributes
bt AX, 4      ; Does this mode a graphic mode?
.if !CARRY?
    popad
jmp loop_support   
    .else
  push mode
  pop closest
    .endif
   
    mov ecx,vga_info1
movzx eax,.ModeInfoBlock.BitsPerPixel
cmp bpp,eax
popad
jnz loop_support
pushad

push mode
pop closest
   
    mov ecx,vga_info1
movzx eax,.ModeInfoBlock.XResolution
cmp xRes,eax
popad
jnz loop_support
pushad

push mode
pop closest

mov ecx,vga_info1
movzx eax,.ModeInfoBlock.YResolution
cmp yRes,eax
popad
jnz loop_support

push mode
pop closest
   
    .if flbs==TRUE
    or closest,4000h
    .endif
    invoke LoadMem,addr vmode,closest
   
    mov eax,vga_info1
mov ecx,eax
and ecx,0Fh
shr eax,4
mov reg.eax_,4f01h
mov reg.es_,ax
mov reg.edi_,ecx
mov ecx,closest
mov reg.ecx_,ecx
invoke CallInterupt,addr reg,10h,addr reg

  mov eax,closest
  ret
done:

mov eax,closest
.if eax!=0FFFFh
.if flbs==TRUE
    or closest,4000h
    .endif
    invoke LoadMem,addr vmode,closest
    pushad
mov eax,vga_info1
mov ecx,eax
and ecx,0Fh
shr eax,4
mov reg.eax_,4f01h
mov reg.es_,ax
mov reg.edi_,ecx
mov ecx,closest
mov reg.ecx_,ecx
invoke CallInterupt,addr reg,10h,addr reg
popad
    mov eax,closest
.endif
.endif

ret
VesaFindMode endp

VesaSetMode proc
LOCAL reg:com32sys_t

invoke StoreMem,addr vmode

.if eax!=0
mov reg.eax_,4f02h
invoke StoreMem,addr vmode
mov reg.ebx_,eax
invoke CallInterupt,addr reg,10h,addr reg
.else
invoke fLEA,addr vesa_msg6
invoke Print,eax
.endif



ret
VesaSetMode endp

VesaFormatPixel proc uses esi edi r:dword,g:dword,b:dword
LOCAL bpp:dword

mov eax,vga_info1
mov ecx,8
sub cl,.ModeInfoBlock.RedMaskSize
shr r,cl
mov ecx,8
sub cl,.ModeInfoBlock.GreenMaskSize
shr g,cl
mov ecx,8
sub cl,.ModeInfoBlock.BlueMaskSize
shr b,cl

mov cl,.ModeInfoBlock.RedFieldPosition
shl r,cl
mov cl,.ModeInfoBlock.GreenFieldPosition
shl g,cl
mov cl,.ModeInfoBlock.BlueFieldPosition
shl b,cl
xor eax,eax
or eax,r
or eax,g
or eax,b


ret
VesaFormatPixel endp

VesaCalculateOffset proc uses esi edi x:dword,y:dword
LOCAL b:dword
LOCAL offs:dword

mov ecx,vga_info1
xor edx,edx
movzx eax,.ModeInfoBlock.XResolution
mul y
add eax,x
xor edx,edx
movzx ecx,.ModeInfoBlock.BitsPerPixel
shr ecx,3
mul ecx
mov ecx,vga_info1
add eax,.ModeInfoBlock.PhysBasePtr

ret
VesaCalculateOffset endp

VesaPlotPixel  proc uses esi edi x:dword,y:dword,r:dword,g:dword,b:dword
LOCAL vlfb:dword
LOCAL reg:com32sys_t
LOCAL bpp,offs,pixel:dword

invoke VesaFormatPixel,r,g,b
mov pixel,eax

invoke VesaCalculateOffset,x,y
mov edi,eax

mov ecx,vga_info1
movzx ecx,.ModeInfoBlock.BitsPerPixel
shr ecx,3
mov eax,pixel
loop_store_byte:
cld
stosb
shr eax,8
dec ecx
jnz loop_store_byte

ret
VesaPlotPixel endp

VesaSwapBuffer proc uses esi edi lpSrc:dword,lpDest:dword

mov ecx,1024*768
mov esi,lpSrc
mov edi,lpDest
loop_swp:
cld
lodsd
stosd
dec ecx
jnz loop_swp

ret
VesaSwapBuffer endp

VesaClearScreen proc uses esi edi r:dword,g:dword,b:dword
LOCAL pixel:dword
LOCAL x,y:dword
LOCAL xres,yres:dword

invoke VesaFormatPixel,r,g,b
mov pixel,eax

mov ecx,vga_info1
movzx eax,.ModeInfoBlock.XResolution
movzx ecx,.ModeInfoBlock.YResolution
mul ecx
mov ecx,eax
xor edx,edx
loop_fill:
push ecx
push edx
mov eax,vga_info1
movzx ecx,.ModeInfoBlock.BitsPerPixel
shr ecx,3
add edx,.ModeInfoBlock.PhysBasePtr
push ecx
mov edi,edx
mov eax,pixel
loop_store_byte:
cld
stosb
shr eax,8
dec ecx
jnz loop_store_byte
pop ecx
pop edx
add edx,ecx
pop ecx
dec ecx
jnz loop_fill

invoke VesaFormatPixel,0,255,0
mov pixel,eax
mov ecx,vga_info1
movzx ecx,.ModeInfoBlock.XResolution
loop_test_plot:
push ecx
invoke VesaPlotPixel,ecx,100,r,g,b
pop ecx
dec ecx
jnz loop_test_plot




ret
VesaClearScreen endp


And here is for the mouse driver




PortWait proc a_type:dword

;A read from port 64H gives the following status byte:
;
;  Bit    Function
;    7      1 = Parity error
;    6      1 = General Time Out
;    5      1 = Auxiliary output buffer full
;    4      1 = Inhibit switch
;    3      1 = Command/data
;    2      1 = System flag
;    1      1 = Input buffer full
;    0      1 = Output buffer full
cli
.if a_type==WAIT_READ
wait_type_0:
in al,64h
bt ax,6
jc error
bt ax,7
jc error
bt ax,WAIT_READ ; if bit 3 set data is available at 64h
jnc wait_type_0
xor eax,eax
.elseif a_type==WAIT_WRITE
wait_type_1: ; Bit 1 should be zero before we able to send command
in al,64h
bt ax,6
jc error
bt ax,7
jc error
bt ax,WAIT_WRITE
jc wait_type_1
xor eax,eax
.elseif a_type==WAIT_COMMAND
wait_type_2: ; Bit 0 and 1 should be zero before we able to send command
in al,64h
bt ax,6
jc error
bt ax,7
jc error
bt ax,WAIT_COMMAND
jc wait_type_2
xor eax,eax
.elseif a_type==WAIT_READ60
wait_type_4:
in al,64h
bt ax,6
jc error
bt ax,7
jc error
bt ax,WAIT_READ ; if bit 3 not set data is available at 60h
jc wait_type_4
xor eax,eax
.elseif a_type==WAIT_OUTPUT
wait_type_5:
in al,64h
bt ax,6
jc error
bt ax,7
jc error
bt ax,WAIT_OUTPUT ; if bit 3 set data is available at 64h
jnc wait_type_5
xor eax,eax
.endif

error:
sti
ret
PortWait endp

PortRead proc

invoke PortWait,WAIT_READ
in al,60h

ret
PortRead endp

PortWrite proc a_cmd:byte

invoke PortWait,WAIT_WRITE
mov al,a_cmd
out 64h,al

ret
PortWrite endp

KeyBoardRead proc
LOCAL key:byte

invoke PortWrite,0AEh
invoke PortWrite,0D2h
in al,60h
; invoke PortRead
; mov key,al
; invoke PortWrite,0AEh
; mov al,key
; push eax
; push eax
; invoke dw2bin,eax,base_buffer
; invoke Print,base_buffer
; pop eax
; invoke dw2hex,eax,base_buffer
; invoke Print,base_buffer
; invoke PrintRel,addr crg
; pop eax
; invoke PortWrite,0A7h
ret
KeyBoardRead endp

MouseWaitACK proc

_wait:
in al,60h
cmp al,0FAh
jnz _wait

ret
MouseWaitACK endp

MouseSendCommand proc cmd:byte

invoke PortWrite,0D4h
mov al,cmd
out 60h,al
invoke MouseWaitACK

ret
MouseSendCommand endp

MouseInit proc
LOCAL mID:byte
LOCAL packet[4]:byte
;Get Mouse ID
; Reset
invoke StoreMem,addr mouse
mov esi,eax
invoke memfill,eax,sizeof mouse,0

invoke PortWrite,0A8h
invoke MouseSendCommand,0FFh
invoke MouseSendCommand,0F6h
invoke MouseSendCommand,0F4h
invoke MouseSendCommand,0F0h

invoke MouseSendCommand,0F2h
in al,60h
mov mID,al

invoke MouseSendCommand,0F3h
invoke MouseSendCommand,0Ah
invoke MouseSendCommand,0F2h
in al,60h
.if al!=0
mov mID,al ; Had Track Ball
.endif

; Activate Wheel
invoke MouseSendCommand,0F3h
invoke MouseSendCommand,0C8h
invoke MouseSendCommand,0F3h
invoke MouseSendCommand,064h
invoke MouseSendCommand,0F3h
invoke MouseSendCommand,050h
in al,60h
.if al==3
mov mID,al
.endif

mov al,mID
ret
MouseInit endp

MouseRead proc uses esi
LOCAL packet[4]:byte
LOCAL status[4]:byte
LOCAL fnt:dword

invoke StoreMem,addr lpfnt2
mov fnt,eax

cli
invoke MouseSendCommand,0F4h
invoke MouseSendCommand,0E9h
in al,60h
mov status[0],al
in al,60h
mov status[1],al
in al,60h
mov status[2],al
in al,60h
mov status[3],al

invoke MouseSendCommand,0EBh
in al,60h
mov packet[0],al
in al,60h
mov packet[1],al
in al,60h
mov packet[2],al
in al,60h
mov packet[3],al

lea ecx,status
mov ecx,
bswap ecx
lea edx,packet
mov edx,
bswap edx

invoke StoreMem,addr mouse
mov esi,eax


movzx eax,packet[2]
bt ax,7
jc y_minus
add .fMouse.y,eax
mov eax,vga_info1
movzx eax,.ModeInfoBlock.YResolution
.if .fMouse.y>eax
mov eax,vga_info1
movzx eax,.ModeInfoBlock.YResolution
mov .fMouse.y,eax
.endif
jmp done_y
y_minus:
not al
inc eax
sub .fMouse.y,eax
.if SIGN?
mov .fMouse.y,0
.endif
done_y:


movzx eax,packet[1]
bt ax,7
jc x_minus
add .fMouse.x,eax
mov eax,vga_info1
movzx eax,.ModeInfoBlock.XResolution
.if .fMouse.x>eax
mov eax,vga_info1
movzx eax,.ModeInfoBlock.XResolution
mov .fMouse.x,eax
.endif
jmp done_x
x_minus:
not al
inc eax
sub .fMouse.x,eax
.if SIGN?
mov .fMouse.x,0
.endif
done_x:

mov al,packet[0]
mov .fMouse.mb,eax

; invoke MouseSendCommand,0F5h
sti

lea eax,packet
mov eax,
bswap eax
; movzx eax,packet[1]
push eax
push eax
invoke StoreMem,addr mouse
mov esi,eax
invoke dw2a,.fMouse.x,base_buffer
; invoke Print,base_buffer
invoke fBitTextOutEx,fnt,VRAMB,400,10,base_buffer
; invoke PrintRel,CADD(" ")
pop eax
invoke StoreMem,addr mouse
mov esi,eax
invoke dw2a,.fMouse.y,base_buffer
invoke fBitTextOutEx,fnt,VRAMB,400,20,base_buffer
; invoke Print,base_buffer
; invoke PrintRel,addr crg
pop eax


ret
MouseRead endp

Posted on 2012-02-07 02:56:18 by Farabi
Cool! Thanks! I'll study that.

Best,
Frank

Posted on 2012-02-07 05:13:54 by fbkotler
You'll need this
http://mobalivecd.mobatek.net/en/

Attached is my full project using RadAsm and JWASM. No MASM Include or code taken. Used only free code mostly created by Me (Onan Farabi).
http://ompldr.org/vY296Mg/FOSGUI.rar
Posted on 2012-02-08 01:20:34 by Farabi
I don't think MobaLiveCD will help me much - I'm not running Windows. I wasn't interested in SysLinux, particularly, just how you got graphics in Linux. CallInterrupt on int 10h was the answer I was looking for, mostly. The mouse stuff is interesting, too. I'll look at the full project if I get a chance. Thanks!

Best,
Frank

Posted on 2012-02-08 04:00:30 by fbkotler