-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathto_fixed1616.z80
74 lines (68 loc) · 1.23 KB
/
to_fixed1616.z80
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
to_fixed1616_LUT:
.db (+_-$-1)/2
.dw ui8_convert_to_fixed1616
.dw ui16_convert_to_fixed1616
.dw ui32_convert_to_fixed1616
.dw fixed88_convert_to_fixed1616
.dw fixed1616_convert_to_fixed1616
.dw var_convert_to_fixed1616
.dw true_convert_to_fixed1616
.dw false_convert_to_fixed1616
.dw tstr_ref_convert_to_fixed1616
.dw raw_convert_to_fixed1616
.dw str_convert_to_fixed1616
.dw str_ref_convert_to_fixed1616
.dw single_convert_to_fixed1616
.dw xfloat_convert_to_fixed1616
_:
ui8_convert_to_fixed1616:
ex de,hl
ld e,(hl)
ld hl,0
ld d,h
ret
ui32_convert_to_fixed1616:
ui16_convert_to_fixed1616:
ex de,hl
ld e,(hl)
inc hl
ld d,(hl)
ld hl,0
ret
fixed1616_convert_to_fixed1616:
ex de,hl
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ex de,hl
ret
fixed88_convert_to_fixed1616:
ex de,hl
ld d,(hl)
inc hl
ld l,(hl)
ld h,0
ld e,h
ret
true_convert_to_fixed1616:
ld hl,1
jr +_
false_convert_to_fixed1616:
ld hl,0
_:
ld d,h
ld e,h
ret
var_convert_to_fixed1616:
tstr_ref_convert_to_fixed1616:
raw_convert_to_fixed1616:
str_convert_to_fixed1616:
str_ref_convert_to_fixed1616:
single_convert_to_fixed1616:
xfloat_convert_to_fixed1616:
jp err_syntax