-
Notifications
You must be signed in to change notification settings - Fork 2
/
bga.inc
55 lines (47 loc) · 1.72 KB
/
bga.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;; Writen by Maxim Logaev (turbocat2001) ;;
;; 2022 year ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VBE_DISPI_IOPORT_INDEX = 0x01CE
VBE_DISPI_IOPORT_DATA = 0x01CF
VBE_DISPI_BPP_4 = 0x04
VBE_DISPI_BPP_8 = 0x08
VBE_DISPI_BPP_15 = 0x0F
VBE_DISPI_BPP_16 = 0x10
VBE_DISPI_BPP_24 = 0x18
VBE_DISPI_BPP_32 = 0x20
VBE_DISPI_DISABLED = 0
VBE_DISPI_ENABLED = 1
VBE_DISPI_LFB_ENABLED = 0x40
VBE_DISPI_INDEX_ID = 0
VBE_DISPI_INDEX_XRES = 1
VBE_DISPI_INDEX_YRES = 2
VBE_DISPI_INDEX_BPP = 3
VBE_DISPI_INDEX_ENABLE = 4
VBE_DISPI_INDEX_BANK = 5
VBE_DISPI_INDEX_VIRT_WIDTH = 6
VBE_DISPI_INDEX_VIRT_HEIGHT = 7
VBE_DISPI_INDEX_X_OFFSET = 8
VBE_DISPI_INDEX_Y_OFFSET = 9
macro bga_write_reg index_val, data_val
{
mov eax, index_val
mov dx, VBE_DISPI_IOPORT_INDEX
out dx, ax
mov eax, data_val
mov dx, VBE_DISPI_IOPORT_DATA
out dx, ax
}
macro bga_set_video_mode w, h, bpp
{
bga_write_reg VBE_DISPI_INDEX_ENABLE, VBE_DISPI_DISABLED
bga_write_reg VBE_DISPI_INDEX_XRES, w
bga_write_reg VBE_DISPI_INDEX_YRES, h
bga_write_reg VBE_DISPI_INDEX_BPP, bpp
bga_write_reg VBE_DISPI_INDEX_ENABLE, VBE_DISPI_ENABLED or VBE_DISPI_LFB_ENABLED
}