Subversion Repositories eduke32

Rev

Rev 4758 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 Plagman 1
// Assembly-language function wrappers for a.asm functions
2
// for the Build Engine
2456 hendricks2 3
// by Jonathon Fowler (jf@jonof.id.au)
5 Plagman 4
 
5
 
4747 terminx 6
#ifndef a_h_
7
#define a_h_
5 Plagman 8
 
1205 terminx 9
#include "compat.h"
10
 
4658 terminx 11
#define CLASSIC_SLICE_BY_4
4702 terminx 12
#define A_C_RESTRICT __restrict
4658 terminx 13
 
4758 helixhorne 14
#define CLASSIC_NONPOW2_YSIZE_SPRITES
15
#ifdef LUNATIC
16
# define CLASSIC_NONPOW2_YSIZE_WALLS
17
#endif
18
 
4578 helixhorne 19
/** Definitions of high-precision integer types. **/
20
// Should be used for values that represent coordinates with which calculations
21
// like dot product are carried out. Substituting 32-bit ints for these will
22
// very likely yield issues in border cases:
23
typedef int64_t coord_t;
24
// Should be used for values that may overflow if 32-bit arithmetic were used,
25
// but where no other adverse effect (except being undefined behavior,
26
// obviously) is expected to result:
27
typedef int64_t inthi_t;
28
 
4717 terminx 29
#if !defined(NOASM) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__i386__)))
4578 helixhorne 30
 
5037 hendricks2 31
#if defined __linux || defined __APPLE__ || defined EDUKE32_BSD || defined __SYLLABLE__
5 Plagman 32
#define __cdecl
33
#endif
34
 
3116 hendricks2 35
#ifdef __cplusplus
36
extern "C"
37
{
38
#endif
39
 
1205 terminx 40
extern int32_t __cdecl mmxoverlay();
41
extern int32_t __cdecl sethlinesizes(int32_t,int32_t,int32_t);
42
extern int32_t __cdecl setpalookupaddress(char *);
43
extern int32_t __cdecl setuphlineasm4(int32_t,int32_t);
44
extern int32_t __cdecl hlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
45
extern int32_t __cdecl setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
46
extern int32_t __cdecl rhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
47
extern int32_t __cdecl setuprmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
48
extern int32_t __cdecl rmhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
49
extern int32_t __cdecl setupqrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
50
extern int32_t __cdecl qrhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
51
extern int32_t __cdecl setvlinebpl(int32_t);
52
extern int32_t __cdecl fixtransluscence(int32_t);
53
extern int32_t __cdecl prevlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
54
extern int32_t __cdecl vlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
2806 helixhorne 55
extern int32_t __cdecl vlineasm1nonpow2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
4161 helixhorne 56
extern int32_t __cdecl setuptvlineasm(int32_t,int32_t);
1205 terminx 57
extern int32_t __cdecl tvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
2806 helixhorne 58
extern int32_t __cdecl tvlineasm1nonpow2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
1205 terminx 59
extern int32_t __cdecl setuptvlineasm2(int32_t,int32_t,int32_t);
60
extern int32_t __cdecl tvlineasm2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
61
extern int32_t __cdecl mvlineasm1(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
2806 helixhorne 62
extern int32_t __cdecl mvlineasm1nonpow2(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
1205 terminx 63
extern int32_t __cdecl setupvlineasm(int32_t);
2497 helixhorne 64
extern int32_t __cdecl vlineasm4(int32_t,char *);
4161 helixhorne 65
extern int32_t __cdecl setupmvlineasm(int32_t,int32_t);
2497 helixhorne 66
extern int32_t __cdecl mvlineasm4(int32_t,char *);
1205 terminx 67
extern int32_t __cdecl setupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
68
extern int32_t __cdecl spritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
69
extern int32_t __cdecl msetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
70
extern int32_t __cdecl mspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
71
extern int32_t __cdecl tsetupspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
72
extern int32_t __cdecl tspritevline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
73
extern int32_t __cdecl mhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
74
extern int32_t __cdecl mhlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
75
extern int32_t __cdecl msethlineshift(int32_t,int32_t);
76
extern int32_t __cdecl thline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
77
extern int32_t __cdecl thlineskipmodify(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
78
extern int32_t __cdecl tsethlineshift(int32_t,int32_t);
79
extern int32_t __cdecl setupslopevlin(int32_t,int32_t,int32_t);
80
extern int32_t __cdecl slopevlin(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
81
extern int32_t __cdecl settransnormal();
82
extern int32_t __cdecl settransreverse();
83
extern int32_t __cdecl setupdrawslab(int32_t,int32_t);
84
extern int32_t __cdecl drawslab(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
85
extern void __cdecl stretchhline(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
5 Plagman 86
 
3116 hendricks2 87
#ifdef __cplusplus
88
}
89
#endif
90
 
4717 terminx 91
#else // !defined(NOASM) && (defined(_MSC_VER) || (defined(__GNUC__) && defined(__i386__)))
5 Plagman 92
 
292 terminx 93
#define ENGINE_USING_A_C
714 qbix79 94
#include <stdint.h>
5 Plagman 95
 
2497 helixhorne 96
#define prevlineasm1 vlineasm1
97
 
1205 terminx 98
void setvlinebpl(int32_t dabpl);
714 qbix79 99
void fixtransluscence(intptr_t datransoff);
292 terminx 100
void settransnormal(void);
101
void settransreverse(void);
102
 
1205 terminx 103
void sethlinesizes(int32_t logx, int32_t logy, intptr_t bufplc);
292 terminx 104
void setpalookupaddress(char *paladdr);
1205 terminx 105
void setuphlineasm4(int32_t bxinc, int32_t byinc);
106
void hlineasm4(int32_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by, uint32_t bx, intptr_t p);
292 terminx 107
 
1205 terminx 108
void setupslopevlin(int32_t logylogx, intptr_t bufplc, int32_t pinc);
109
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by);
292 terminx 110
 
1205 terminx 111
void setupvlineasm(int32_t neglogy);
2497 helixhorne 112
int32_t vlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
113
void vlineasm4(int32_t cnt, char *p);
292 terminx 114
 
4161 helixhorne 115
void setupmvlineasm(int32_t neglogy, int32_t dosaturate);
2497 helixhorne 116
int32_t mvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
117
void mvlineasm4(int32_t cnt, char *p);
292 terminx 118
 
4161 helixhorne 119
void setuptvlineasm(int32_t neglogy, int32_t dosaturate);
2497 helixhorne 120
int32_t tvlineasm1(int32_t vinc, intptr_t paloffs, int32_t cnt, uint32_t vplc, intptr_t bufplc, intptr_t p);
292 terminx 121
 
2498 helixhorne 122
void setuptvlineasm2(int32_t neglogy, intptr_t paloffs1, intptr_t paloffs2);
123
void tvlineasm2(uint32_t vplc2, int32_t vinc1, intptr_t bufplc1, intptr_t bufplc2, uint32_t vplc1, intptr_t p);
124
 
1205 terminx 125
void msethlineshift(int32_t logx, int32_t logy);
126
void mhline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p);
292 terminx 127
 
1205 terminx 128
void tsethlineshift(int32_t logx, int32_t logy);
129
void thline(intptr_t bufplc, uint32_t bx, int32_t cntup16, int32_t junk, uint32_t by, intptr_t p);
292 terminx 130
 
1205 terminx 131
void setupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
132
void spritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
292 terminx 133
 
1205 terminx 134
void msetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
135
void mspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
292 terminx 136
 
1205 terminx 137
void tsetupspritevline(intptr_t paloffs, int32_t bxinc, int32_t byinc, int32_t ysiz);
138
void tspritevline(int32_t bx, int32_t by, int32_t cnt, intptr_t bufplc, intptr_t p);
292 terminx 139
 
1205 terminx 140
void setupdrawslab (int32_t dabpl, intptr_t pal);
141
void drawslab (int32_t dx, int32_t v, int32_t dy, int32_t vi, intptr_t vptr, intptr_t p);
142
void stretchhline (intptr_t p0, int32_t u, int32_t cnt, int32_t uinc, intptr_t rptr, intptr_t p);
292 terminx 143
 
144
void mmxoverlay();
145
 
5 Plagman 146
#endif  // else
147
 
4747 terminx 148
#endif // a_h_