FreeBASIC  0.91.0
fb_gfx_mmx.h
Go to the documentation of this file.
1 /* assembler definitions for MMX routines */
2 
3 #ifndef __FB_GFX_MMX_H__
4 #define __FB_GFX_MMX_H__
5 
6 #include "../../rtlib/fb_config.h"
7 
8 #if defined(HOST_WIN32) || defined(HOST_DOS) || defined(HOST_XBOX)
9 #define FUNC(name) .globl _##name ; .balign 8, 0x90 ; _##name :
10 #define VAR(name) .globl _##name ; _##name :
11 #define GLOBL(name) _##name
12 #else
13 #define FUNC(name) .globl name ; .balign 8, 0x90 ; name :
14 #define VAR(name) .globl name ; name :
15 #define GLOBL(name) name
16 #endif
17 #define LABEL(name) .balign 4, 0x90 ; name :
18 
19 #define RESERVE_LOCALS(n) subl $((n)*4), %esp
20 #define FREE_LOCALS(n) addl $((n)*4), %esp
21 
22 #define ARG1 8(%ebp)
23 #define ARG2 12(%ebp)
24 #define ARG3 16(%ebp)
25 #define ARG4 20(%ebp)
26 #define ARG5 24(%ebp)
27 #define ARG6 28(%ebp)
28 #define ARG7 32(%ebp)
29 #define ARG8 36(%ebp)
30 
31 #define LOCAL1 -4(%ebp)
32 #define LOCAL2 -8(%ebp)
33 #define LOCAL3 -12(%ebp)
34 #define LOCAL4 -16(%ebp)
35 
36 #define MASK_COLOR_32 0xFF00FF
37 #define MASK_COLOR_16 0xF81F
38 
39 #define MASK_RGB_32 0x00FFFFFF
40 #define MASK_RB_32 0x00FF00FF
41 #define MASK_G_32 0x0000FF00
42 #define MASK_GA_32 0xFF00FF00
43 #define MASK_A_32 0xFF000000
44 
45 #define MASK_RB_16 0xF81F
46 #define MASK_R_16 0xF800
47 #define MASK_G_16 0x07E0
48 #define MASK_B_16 0x001F
49 
50 #define GFX_SCREEN_ID 0
51 #define GFX_MODE_NUM 4
52 #define GFX_PAGE 8
53 #define GFX_NUM_PAGES 12
54 #define GFX_VISIBLE_PAGE 16
55 #define GFX_FRAMEBUFFER 20
56 #define GFX_MODE_W 24
57 #define GFX_MODE_H 28
58 #define GFX_DEPTH 32
59 #define GFX_BPP 36
60 #define GFX_PITCH 40
61 #define GFX_PALETTE 44
62 #define GFX_DEVICE_PALETTE 48
63 #define GFX_COLOR_ASSOCIATION 52
64 #define GFX_DIRTY 56
65 #define GFX_DRIVER 60
66 #define GFX_COLOR_MASK 64
67 #define GFX_DEFAULT_PAL 68
68 #define GFX_SCANLINE_SIZE 72
69 #define GFX_CURSOR_X 76
70 #define GFX_CURSOR_Y 80
71 #define GFX_FONT 84
72 #define GFX_TEXT_W 88
73 #define GFX_TEXT_H 92
74 #define GFX_KEY 96
75 #define GFX_REFRESH_RATE 100
76 #define GFX_CON_PAGES 104
77 #define GFX_EVENTS_QUEUE 108
78 #define GFX_EVENT_HEAD 112
79 #define GFX_EVENT_TAIL 116
80 #define GFX_EVENT_MUTEX 120
81 #define GFX_FLAGS 124
82 
83 #define CTX_SCREEN_ID 0
84 #define CTX_WORK_PAGE 4
85 #define CTX_LINE 8
86 #define CTX_MAX_H 12
87 #define CTX_TARGET_BPP 16
88 #define CTX_TARGET_PITCH 20
89 #define CTX_LAST_TARGET 24
90 #define CTX_LAST_X 28
91 #define CTX_LAST_Y 32
92 #define CTX_VIEW_X 36
93 #define CTX_VIEW_Y 40
94 #define CTX_VIEW_W 44
95 #define CTX_VIEW_H 48
96 #define CTX_OLD_VIEW_X 52
97 #define CTX_OLD_VIEW_Y 56
98 #define CTX_OLD_VIEW_W 60
99 #define CTX_OLD_VIEW_H 64
100 #define CTX_WIN_X 68
101 #define CTX_WIN_Y 72
102 #define CTX_WIN_W 76
103 #define CTX_WIN_H 80
104 #define CTX_FG_COLOR 84
105 #define CTX_BG_COLOR 88
106 #define CTX_PUT_PIXEL 92
107 #define CTX_GET_PIXEL 96
108 #define CTX_PIXEL_SET 100
109 #define CTX_PUTTER 104
110 #define CTX_PUT_BPP 108
111 #define CTX_FLAGS 112
112 
113 #endif