| 178 | } |
| 179 | |
| 180 | void uae_lua_init_state(lua_State *L) |
| 181 | { |
| 182 | write_log(_T("uae_lua_init_state %p\n"), L); |
| 183 | if (g_num_states == MAX_LUA_STATES) { |
| 184 | write_log(_T("WARNING: too many lua states (ignored this one)\n")); |
| 185 | return; |
| 186 | } |
| 187 | g_states[g_num_states] = L; |
| 188 | g_num_states++; |
| 189 | |
| 190 | lua_register(L, "uae_log", l_uae_log); |
| 191 | |
| 192 | lua_register(L, "uae_read_u8", l_uae_read_u8); |
| 193 | lua_register(L, "uae_read_u16", l_uae_read_u16); |
| 194 | lua_register(L, "uae_peek_u16", l_uae_peek_u16); |
| 195 | lua_register(L, "uae_write_u8", l_uae_write_u8); |
| 196 | lua_register(L, "uae_write_u16", l_uae_write_u16); |
| 197 | |
| 198 | lua_register(L, "uae_read_config", l_uae_read_config); |
| 199 | lua_register(L, "uae_write_config", l_uae_write_config); |
| 200 | |
| 201 | for (int i = 0; custd[i].name; i++) { |
| 202 | char *s = ua(custd[i].name); |
| 203 | lua_pushinteger(L, custd[i].adr); |
| 204 | lua_setglobal(L, s); |
| 205 | xfree(s); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | void uae_lua_init(void) |
| 210 | { |
no test coverage detected