Skip to content

Commit 471f175

Browse files
committed
Check in a copy of the LuaCATS annotations from the WIP
the PR #3755 adds a button to generate these automatically, similar to the existing TASVideos wiki generation
1 parent 203f001 commit 471f175

26 files changed

Lines changed: 4659 additions & 0 deletions

Assets/Lua/_docs_luacats/SQL.d.lua

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
-- Lua functions available in EmuHawk 2.11
2+
-- https://tasvideos.org/Bizhawk
3+
4+
error("This is a definition file for Lua Language Server and not a usable script")
5+
6+
---@meta _
7+
8+
---A library for performing SQLite operations.
9+
---@class SQL
10+
SQL = {}
11+
12+
---Creates a SQLite Database. Name should end with .db
13+
---
14+
---Example:
15+
---
16+
--- local stSQLcre = SQL.createdatabase( "eg_db" );
17+
---@param name string
18+
---@return string
19+
function SQL.createdatabase(name) end
20+
21+
---Opens a SQLite database. Name should end with .db
22+
---
23+
---Example:
24+
---
25+
--- local stSQLope = SQL.opendatabase( "eg_db" );
26+
---@param name string
27+
---@return string
28+
function SQL.opendatabase(name) end
29+
30+
---Run a SQLite read command which includes Select. Returns all rows into a LuaTable.Ex: select * from rewards
31+
---
32+
---Example:
33+
---
34+
--- local obSQLrea = SQL.readcommand( "SELECT * FROM eg_tab WHERE eg_tab_id = 1;" );
35+
---@param query? string
36+
---@return any
37+
function SQL.readcommand(query) end
38+
39+
---Runs a SQLite write command which includes CREATE,INSERT, UPDATE. Ex: create TABLE rewards (ID integer PRIMARY KEY, action VARCHAR(20))
40+
---
41+
---Example:
42+
---
43+
--- local stSQLwri = SQL.writecommand( "CREATE TABLE eg_tab ( eg_tab_id integer PRIMARY KEY, eg_tab_row_name text NOT NULL ); INSERT INTO eg_tab ( eg_tab_id, eg_tab_row_name ) VALUES ( 1, 'Example table row' );" );
44+
---@param query? string
45+
---@return string
46+
function SQL.writecommand(query) end
47+

Assets/Lua/_docs_luacats/bit.d.lua

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
-- Lua functions available in EmuHawk 2.11
2+
-- https://tasvideos.org/Bizhawk
3+
4+
error("This is a definition file for Lua Language Server and not a usable script")
5+
6+
---@meta _
7+
8+
---A library for performing standard bitwise operations.
9+
---@class bit
10+
bit = {}
11+
12+
---Arithmetic shift right of 'val' by 'amt' bits
13+
---
14+
---Example:
15+
---
16+
--- local inbitars = bit.arshift( -1000, 4 );
17+
---@param val integer
18+
---@param amt integer
19+
---@return integer
20+
function bit.arshift(val, amt) end
21+
22+
---Bitwise AND of 'val' against 'amt'
23+
---
24+
---Example:
25+
---
26+
--- local uibitban = bit.band( 1000, 4 );
27+
---@deprecated
28+
---@param val integer
29+
---@param amt integer
30+
---@return integer
31+
function bit.band(val, amt) end
32+
33+
---Bitwise NOT of 'val'
34+
---
35+
---Example:
36+
---
37+
--- local uibitbno = bit.bnot( 1000 );
38+
---@deprecated
39+
---@param val integer
40+
---@return integer
41+
function bit.bnot(val) end
42+
43+
---Bitwise OR of 'val' against 'amt'
44+
---
45+
---Example:
46+
---
47+
--- local uibitbor = bit.bor( 1000, 4 );
48+
---@deprecated
49+
---@param val integer
50+
---@param amt integer
51+
---@return integer
52+
function bit.bor(val, amt) end
53+
54+
---Bitwise XOR of 'val' against 'amt'
55+
---
56+
---Example:
57+
---
58+
--- local uibitbxo = bit.bxor( 1000, 4 );
59+
---@deprecated
60+
---@param val integer
61+
---@param amt integer
62+
---@return integer
63+
function bit.bxor(val, amt) end
64+
65+
---Byte swaps 'short', i.e. bit.byteswap_16(0xFF00) would return 0x00FF
66+
---
67+
---Example:
68+
---
69+
--- local usbitbyt = bit.byteswap_16( 100 );
70+
---@param val integer
71+
---@return integer
72+
function bit.byteswap_16(val) end
73+
74+
---Byte swaps 'dword'
75+
---
76+
---Example:
77+
---
78+
--- local uibitbyt = bit.byteswap_32( 1000 );
79+
---@param val integer
80+
---@return integer
81+
function bit.byteswap_32(val) end
82+
83+
---Byte swaps 'long'
84+
---
85+
---Example:
86+
---
87+
--- local ulbitbyt = bit.byteswap_64( 10000 );
88+
---@param val integer
89+
---@return integer
90+
function bit.byteswap_64(val) end
91+
92+
---Returns result of bit 'pos' being set in 'num'
93+
---
94+
---Example:
95+
---
96+
--- if ( bit.check( -12345, 35 ) ) then
97+
--- console.log( "Returns result of bit 'pos' being set in 'num'" );
98+
--- end;
99+
---@param num integer
100+
---@param pos integer
101+
---@return boolean
102+
function bit.check(num, pos) end
103+
104+
---Clears the bit 'pos' in 'num'
105+
---
106+
---Example:
107+
---
108+
--- local lobitcle = bit.clear( 25, 35 );
109+
---@param num integer
110+
---@param pos integer
111+
---@return integer
112+
function bit.clear(num, pos) end
113+
114+
---Logical shift left of 'val' by 'amt' bits
115+
---
116+
---Example:
117+
---
118+
--- local uibitlsh = bit.lshift( 1000, 4 );
119+
---@deprecated
120+
---@param val integer
121+
---@param amt integer
122+
---@return integer
123+
function bit.lshift(val, amt) end
124+
125+
---Left rotate 'val' by 'amt' bits
126+
---
127+
---Example:
128+
---
129+
--- local uibitrol = bit.rol( 1000, 4 );
130+
---@param val integer
131+
---@param amt integer
132+
---@return integer
133+
function bit.rol(val, amt) end
134+
135+
---Right rotate 'val' by 'amt' bits
136+
---
137+
---Example:
138+
---
139+
--- local uibitror = bit.ror( 1000, 4 );
140+
---@param val integer
141+
---@param amt integer
142+
---@return integer
143+
function bit.ror(val, amt) end
144+
145+
---Logical shift right of 'val' by 'amt' bits
146+
---
147+
---Example:
148+
---
149+
--- local uibitrsh = bit.rshift( 1000, 4 );
150+
---@deprecated
151+
---@param val integer
152+
---@param amt integer
153+
---@return integer
154+
function bit.rshift(val, amt) end
155+
156+
---Sets the bit 'pos' in 'num'
157+
---
158+
---Example:
159+
---
160+
--- local uibitset = bit.set( 25, 35 );
161+
---@param num integer
162+
---@param pos integer
163+
---@return integer
164+
function bit.set(num, pos) end
165+

0 commit comments

Comments
 (0)