?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download

  1. /*
  2. ** Lua binding: sjasm
  3. ** Generated automatically by tolua++-1.0.92 on 11/06/08 00:50:38.
  4. */
  5.  
  6. #ifndef __cplusplus
  7. #include "stdlib.h"
  8. #endif
  9. #include "string.h"
  10.  
  11. #include "tolua++.h"
  12.  
  13. /* Exported function */
  14. TOLUA_API int  tolua_sjasm_open (lua_State* tolua_S);
  15.  
  16. #include "sjdefs.h"
  17. using namespace Options;
  18.  
  19. /* function to register type */
  20. static void tolua_reg_types (lua_State* tolua_S)
  21. {
  22.  tolua_usertype(tolua_S,"TCHAR");
  23. }
  24.  
  25. /* function: DefineTable.Get */
  26. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_define00
  27. static int tolua_sjasm_sj_get_define00(lua_State* tolua_S)
  28. {
  29. #ifndef TOLUA_RELEASE
  30.  tolua_Error tolua_err;
  31.  if (
  32.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  33.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  34.  )
  35.   goto tolua_lerror;
  36.  else
  37. #endif
  38.  {
  39.   char* tolua_var_1 = ((char*)  tolua_tostring(tolua_S,1,0));
  40.   {
  41.    char* tolua_ret = (char*)  DefineTable.Get(tolua_var_1);
  42.    tolua_pushstring(tolua_S,(const char*)tolua_ret);
  43.   }
  44.  }
  45.  return 1;
  46. #ifndef TOLUA_RELEASE
  47.  tolua_lerror:
  48.  tolua_error(tolua_S,"#ferror in function 'get_define'.",&tolua_err);
  49.  return 0;
  50. #endif
  51. }
  52. #endif //#ifndef TOLUA_DISABLE
  53.  
  54. /* function: DefineTable.Replace */
  55. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_insert_define00
  56. static int tolua_sjasm_sj_insert_define00(lua_State* tolua_S)
  57. {
  58. #ifndef TOLUA_RELEASE
  59.  tolua_Error tolua_err;
  60.  if (
  61.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  62.      !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  63.      !tolua_isnoobj(tolua_S,3,&tolua_err)
  64.  )
  65.   goto tolua_lerror;
  66.  else
  67. #endif
  68.  {
  69.   char* tolua_var_2 = ((char*)  tolua_tostring(tolua_S,1,0));
  70.   char* tolua_var_3 = ((char*)  tolua_tostring(tolua_S,2,0));
  71.   {
  72.    bool tolua_ret = (bool)  DefineTable.Replace(tolua_var_2,tolua_var_3);
  73.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  74.   }
  75.  }
  76.  return 1;
  77. #ifndef TOLUA_RELEASE
  78.  tolua_lerror:
  79.  tolua_error(tolua_S,"#ferror in function 'insert_define'.",&tolua_err);
  80.  return 0;
  81. #endif
  82. }
  83. #endif //#ifndef TOLUA_DISABLE
  84.  
  85. /* function: LuaGetLabel */
  86. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_label00
  87. static int tolua_sjasm_sj_get_label00(lua_State* tolua_S)
  88. {
  89. #ifndef TOLUA_RELEASE
  90.  tolua_Error tolua_err;
  91.  if (
  92.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  93.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  94.  )
  95.   goto tolua_lerror;
  96.  else
  97. #endif
  98.  {
  99.   char* tolua_var_4 = ((char*)  tolua_tostring(tolua_S,1,0));
  100.   {
  101.    int tolua_ret = (int)  LuaGetLabel(tolua_var_4);
  102.    tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  103.   }
  104.  }
  105.  return 1;
  106. #ifndef TOLUA_RELEASE
  107.  tolua_lerror:
  108.  tolua_error(tolua_S,"#ferror in function 'get_label'.",&tolua_err);
  109.  return 0;
  110. #endif
  111. }
  112. #endif //#ifndef TOLUA_DISABLE
  113.  
  114. /* function: LabelTable.Insert */
  115. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_insert_label00
  116. static int tolua_sjasm_sj_insert_label00(lua_State* tolua_S)
  117. {
  118. #ifndef TOLUA_RELEASE
  119.  tolua_Error tolua_err;
  120.  if (
  121.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  122.      !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  123.      !tolua_isboolean(tolua_S,3,1,&tolua_err) ||
  124.      !tolua_isboolean(tolua_S,4,1,&tolua_err) ||
  125.      !tolua_isnoobj(tolua_S,5,&tolua_err)
  126.  )
  127.   goto tolua_lerror;
  128.  else
  129. #endif
  130.  {
  131.   char* tolua_var_5 = ((char*)  tolua_tostring(tolua_S,1,0));
  132.   unsigned int tolua_var_6 = ((unsigned int)  tolua_tonumber(tolua_S,2,0));
  133.   bool tolua_var_7 = ((bool)  tolua_toboolean(tolua_S,3,false));
  134.   bool tolua_var_8 = ((bool)  tolua_toboolean(tolua_S,4,false));
  135.   bool tolua_var_9 = ((bool)  tolua_toboolean(tolua_S,5,false));
  136.   {
  137.    bool tolua_ret = (bool)  LabelTable.Insert(tolua_var_5,tolua_var_6,tolua_var_7,tolua_var_8,tolua_var_9);
  138.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  139.   }
  140.  }
  141.  return 1;
  142. #ifndef TOLUA_RELEASE
  143.  tolua_lerror:
  144.  tolua_error(tolua_S,"#ferror in function 'insert_label'.",&tolua_err);
  145.  return 0;
  146. #endif
  147. }
  148. #endif //#ifndef TOLUA_DISABLE
  149.  
  150. /* get function: CurAddress */
  151. #ifndef TOLUA_DISABLE_tolua_get_sj_unsigned_current_address
  152. static int tolua_get_sj_unsigned_current_address(lua_State* tolua_S)
  153. {
  154.   tolua_pushnumber(tolua_S,(lua_Number)CurAddress);
  155.  return 1;
  156. }
  157. #endif //#ifndef TOLUA_DISABLE
  158.  
  159. /* get function: WarningCount */
  160. #ifndef TOLUA_DISABLE_tolua_get_sj_warning_count
  161. static int tolua_get_sj_warning_count(lua_State* tolua_S)
  162. {
  163.   tolua_pushnumber(tolua_S,(lua_Number)WarningCount);
  164.  return 1;
  165. }
  166. #endif //#ifndef TOLUA_DISABLE
  167.  
  168. /* get function: ErrorCount */
  169. #ifndef TOLUA_DISABLE_tolua_get_sj_error_count
  170. static int tolua_get_sj_error_count(lua_State* tolua_S)
  171. {
  172.   tolua_pushnumber(tolua_S,(lua_Number)ErrorCount);
  173.  return 1;
  174. }
  175. #endif //#ifndef TOLUA_DISABLE
  176.  
  177. /* function: LuaShellExec */
  178. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_shellexec00
  179. static int tolua_sjasm_sj_shellexec00(lua_State* tolua_S)
  180. {
  181. #ifndef TOLUA_RELEASE
  182.  tolua_Error tolua_err;
  183.  if (
  184.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  185.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  186.  )
  187.   goto tolua_lerror;
  188.  else
  189. #endif
  190.  {
  191.   char* command = ((char*)  tolua_tostring(tolua_S,1,0));
  192.   {
  193.    LuaShellExec(command);
  194.   }
  195.  }
  196.  return 0;
  197. #ifndef TOLUA_RELEASE
  198.  tolua_lerror:
  199.  tolua_error(tolua_S,"#ferror in function 'shellexec'.",&tolua_err);
  200.  return 0;
  201. #endif
  202. }
  203. #endif //#ifndef TOLUA_DISABLE
  204.  
  205. /* function: TRD_SaveEmpty */
  206. #ifndef TOLUA_DISABLE_tolua_sjasm_zx_trdimage_create00
  207. static int tolua_sjasm_zx_trdimage_create00(lua_State* tolua_S)
  208. {
  209. #ifndef TOLUA_RELEASE
  210.  tolua_Error tolua_err;
  211.  if (
  212.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  213.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  214.  )
  215.   goto tolua_lerror;
  216.  else
  217. #endif
  218.  {
  219.   char* fname = ((char*)  tolua_tostring(tolua_S,1,0));
  220.   {
  221.    int tolua_ret = (int)  TRD_SaveEmpty(fname, nullptr);
  222.    tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  223.   }
  224.  }
  225.  return 1;
  226. #ifndef TOLUA_RELEASE
  227.  tolua_lerror:
  228.  tolua_error(tolua_S,"#ferror in function 'trdimage_create'.",&tolua_err);
  229.  return 0;
  230. #endif
  231. }
  232. #endif //#ifndef TOLUA_DISABLE
  233.  
  234. /* function: TRD_AddFile */
  235. #ifndef TOLUA_DISABLE_tolua_sjasm_zx_trdimage_add_file00
  236. static int tolua_sjasm_zx_trdimage_add_file00(lua_State* tolua_S)
  237. {
  238. #ifndef TOLUA_RELEASE
  239.  tolua_Error tolua_err;
  240.  if (
  241.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  242.      !tolua_isstring(tolua_S,2,0,&tolua_err) ||
  243.      !tolua_isnumber(tolua_S,3,0,&tolua_err) ||
  244.      !tolua_isnumber(tolua_S,4,0,&tolua_err) ||
  245.      !tolua_isnumber(tolua_S,5,0,&tolua_err) ||
  246.      !tolua_isboolean(tolua_S,6,0,&tolua_err) ||
  247.      !tolua_isnoobj(tolua_S,7,&tolua_err)
  248.  )
  249.   goto tolua_lerror;
  250.  else
  251. #endif
  252.  {
  253.   char* fname = ((char*)  tolua_tostring(tolua_S,1,0));
  254.   char* fhobname = ((char*)  tolua_tostring(tolua_S,2,0));
  255.   int start = ((int)  tolua_tonumber(tolua_S,3,0));
  256.   int length = ((int)  tolua_tonumber(tolua_S,4,0));
  257.   int autostart = ((int)  tolua_tonumber(tolua_S,5,0));
  258.   bool replace = ((int)  tolua_toboolean(tolua_S,6,0));
  259.   {
  260.    int tolua_ret = (int)  TRD_AddFile(fname,fhobname,start,length,autostart,replace,false);
  261.    tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  262.   }
  263.  }
  264.  return 1;
  265. #ifndef TOLUA_RELEASE
  266.  tolua_lerror:
  267.  tolua_error(tolua_S,"#ferror in function 'trdimage_add_file'.",&tolua_err);
  268.  return 0;
  269. #endif
  270. }
  271. #endif //#ifndef TOLUA_DISABLE
  272.  
  273. /* function: SaveSNA_ZX */
  274. #ifndef TOLUA_DISABLE_tolua_sjasm_zx_save_snapshot_sna12800
  275. static int tolua_sjasm_zx_save_snapshot_sna12800(lua_State* tolua_S)
  276. {
  277. #ifndef TOLUA_RELEASE
  278.  tolua_Error tolua_err;
  279.  if (
  280.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  281.      !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
  282.      !tolua_isnoobj(tolua_S,3,&tolua_err)
  283.  )
  284.   goto tolua_lerror;
  285.  else
  286. #endif
  287.  {
  288.   char* fname = ((char*)  tolua_tostring(tolua_S,1,0));
  289.   unsigned short start = ((unsigned short)  tolua_tonumber(tolua_S,2,0));
  290.   {
  291.    int tolua_ret = (int)  SaveSNA_ZX(fname,start);
  292.    tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  293.   }
  294.  }
  295.  return 1;
  296. #ifndef TOLUA_RELEASE
  297.  tolua_lerror:
  298.  tolua_error(tolua_S,"#ferror in function 'save_snapshot_sna128'.",&tolua_err);
  299.  return 0;
  300. #endif
  301. }
  302. #endif //#ifndef TOLUA_DISABLE
  303.  
  304. /* get function: CurrentDirectory */
  305. #ifndef TOLUA_DISABLE_tolua_get_sj_current_path
  306. static int tolua_get_sj_current_path(lua_State* tolua_S)
  307. {
  308.   tolua_pushstring(tolua_S,(const char*)CurrentDirectory);
  309.  return 1;
  310. }
  311. #endif //#ifndef TOLUA_DISABLE
  312.  
  313. /* function: ExitASM */
  314. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_exit00
  315. static int tolua_sjasm_sj_exit00(lua_State* tolua_S)
  316. {
  317. #ifndef TOLUA_RELEASE
  318.  tolua_Error tolua_err;
  319.  if (
  320.      !tolua_isnumber(tolua_S,1,1,&tolua_err) ||
  321.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  322.  )
  323.   goto tolua_lerror;
  324.  else
  325. #endif
  326.  {
  327.   int p = ((int)  tolua_tonumber(tolua_S,1,1));
  328.   {
  329.    ExitASM(p);
  330.   }
  331.  }
  332.  return 0;
  333. #ifndef TOLUA_RELEASE
  334.  tolua_lerror:
  335.  tolua_error(tolua_S,"#ferror in function 'exit'.",&tolua_err);
  336.  return 0;
  337. #endif
  338. }
  339. #endif //#ifndef TOLUA_DISABLE
  340.  
  341. /* function: Error */
  342. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_error00
  343. static int tolua_sjasm_sj_error00(lua_State* tolua_S)
  344. {
  345. #ifndef TOLUA_RELEASE
  346.  tolua_Error tolua_err;
  347.  if (
  348.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  349.      !tolua_isstring(tolua_S,2,1,&tolua_err) ||
  350.      !tolua_isnumber(tolua_S,3,1,&tolua_err) ||
  351.      !tolua_isnoobj(tolua_S,4,&tolua_err)
  352.  )
  353.   goto tolua_lerror;
  354.  else
  355. #endif
  356.  {
  357.   char* tolua_var_9 = ((char*)  tolua_tostring(tolua_S,1,0));
  358.   char* tolua_var_10 = ((char*)  tolua_tostring(tolua_S,2,0));
  359.   EStatus tolua_var_11 = ((EStatus) tolua_tovalue(tolua_S,3,ALL));
  360.   {
  361.    Error(tolua_var_9, tolua_var_10, tolua_var_11);
  362.   }
  363.  }
  364.  return 0;
  365. #ifndef TOLUA_RELEASE
  366.  tolua_lerror:
  367.  tolua_error(tolua_S,"#ferror in function 'error'.",&tolua_err);
  368.  return 0;
  369. #endif
  370. }
  371. #endif //#ifndef TOLUA_DISABLE
  372.  
  373. /* function: Warning */
  374. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_warning00
  375. static int tolua_sjasm_sj_warning00(lua_State* tolua_S)
  376. {
  377. #ifndef TOLUA_RELEASE
  378.  tolua_Error tolua_err;
  379.  if (
  380.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  381.      !tolua_isstring(tolua_S,2,1,&tolua_err) ||
  382.      !tolua_isnumber(tolua_S,3,1,&tolua_err) ||
  383.      !tolua_isnoobj(tolua_S,4,&tolua_err)
  384.  )
  385.   goto tolua_lerror;
  386.  else
  387. #endif
  388.  {
  389.   char* tolua_var_12 = ((char*)  tolua_tostring(tolua_S,1,0));
  390.   char* tolua_var_13 = ((char*)  tolua_tostring(tolua_S,2,0));
  391.   EWStatus tolua_var_14 = ((EWStatus) tolua_tovalue(tolua_S,3,W_ALL));
  392.   {
  393.    Warning(tolua_var_12, tolua_var_13, tolua_var_14);
  394.   }
  395.  }
  396.  return 0;
  397. #ifndef TOLUA_RELEASE
  398.  tolua_lerror:
  399.  tolua_error(tolua_S,"#ferror in function 'warning'.",&tolua_err);
  400.  return 0;
  401. #endif
  402. }
  403. #endif //#ifndef TOLUA_DISABLE
  404.  
  405. /* function: FileExists */
  406. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_file_exists00
  407. static int tolua_sjasm_sj_file_exists00(lua_State* tolua_S)
  408. {
  409. #ifndef TOLUA_RELEASE
  410.  tolua_Error tolua_err;
  411.  if (
  412.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  413.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  414.  )
  415.   goto tolua_lerror;
  416.  else
  417. #endif
  418.  {
  419.   char* filename = ((char*)  tolua_tostring(tolua_S,1,0));
  420.   {
  421.    bool tolua_ret = (bool)  FileExists(filename);
  422.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  423.   }
  424.  }
  425.  return 1;
  426. #ifndef TOLUA_RELEASE
  427.  tolua_lerror:
  428.  tolua_error(tolua_S,"#ferror in function 'file_exists'.",&tolua_err);
  429.  return 0;
  430. #endif
  431. }
  432. #endif //#ifndef TOLUA_DISABLE
  433.  
  434. /* function: GetPath */
  435. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_path00
  436. static int tolua_sjasm_sj_get_path00(lua_State* tolua_S)
  437. {
  438. #ifndef TOLUA_RELEASE
  439.  tolua_Error tolua_err;
  440.  if (
  441.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  442.      !tolua_isusertype(tolua_S,2,"TCHAR",0,&tolua_err) ||
  443.      !tolua_isnoobj(tolua_S,3,&tolua_err)
  444.  )
  445.   goto tolua_lerror;
  446.  else
  447. #endif
  448.  {
  449.   char* fname = ((char*)  tolua_tostring(tolua_S,1,0));
  450.   TCHAR* filenamebegin = ((TCHAR*)  tolua_tousertype(tolua_S,2,0));
  451.   {
  452.    char* tolua_ret = (char*)  GetPath(fname,&filenamebegin);
  453.    tolua_pushstring(tolua_S,(const char*)tolua_ret);
  454.    tolua_pushusertype(tolua_S,(void*)filenamebegin,"TCHAR");
  455.   }
  456.  }
  457.  return 2;
  458. #ifndef TOLUA_RELEASE
  459.  tolua_lerror:
  460.  tolua_error(tolua_S,"#ferror in function 'get_path'.",&tolua_err);
  461.  return 0;
  462. #endif
  463. }
  464. #endif //#ifndef TOLUA_DISABLE
  465.  
  466. /* function: SetDevice */
  467. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_set_device00
  468. static int tolua_sjasm_sj_set_device00(lua_State* tolua_S)
  469. {
  470. #ifndef TOLUA_RELEASE
  471.  tolua_Error tolua_err;
  472.  if (
  473.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  474.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  475.  )
  476.   goto tolua_lerror;
  477.  else
  478. #endif
  479.  {
  480.   char* id = ((char*)  tolua_tostring(tolua_S,1,0));
  481.   {
  482.    bool tolua_ret = (bool)  SetDevice(id);
  483.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  484.   }
  485.  }
  486.  return 1;
  487. #ifndef TOLUA_RELEASE
  488.  tolua_lerror:
  489.  tolua_error(tolua_S,"#ferror in function 'set_device'.",&tolua_err);
  490.  return 0;
  491. #endif
  492. }
  493. #endif //#ifndef TOLUA_DISABLE
  494.  
  495. /* function: GetDeviceName */
  496. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_device00
  497. static int tolua_sjasm_sj_get_device00(lua_State* tolua_S)
  498. {
  499. #ifndef TOLUA_RELEASE
  500.  tolua_Error tolua_err;
  501.  if (
  502.      !tolua_isnoobj(tolua_S,1,&tolua_err)
  503.  )
  504.   goto tolua_lerror;
  505.  else
  506. #endif
  507.  {
  508.   {
  509.    char* tolua_ret = (char*)  GetDeviceName();
  510.    tolua_pushstring(tolua_S,(const char*)tolua_ret);
  511.   }
  512.  }
  513.  return 1;
  514. #ifndef TOLUA_RELEASE
  515.  tolua_lerror:
  516.  tolua_error(tolua_S,"#ferror in function 'get_device'.",&tolua_err);
  517.  return 0;
  518. #endif
  519. }
  520. #endif //#ifndef TOLUA_DISABLE
  521.  
  522. /* function: LuaSetPage */
  523. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_set_page00
  524. static int tolua_sjasm_sj_set_page00(lua_State* tolua_S)
  525. {
  526. #ifndef TOLUA_RELEASE
  527.  tolua_Error tolua_err;
  528.  if (
  529.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  530.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  531.  )
  532.   goto tolua_lerror;
  533.  else
  534. #endif
  535.  {
  536.   unsigned int n = ((unsigned int)  tolua_tonumber(tolua_S,1,0));
  537.   {
  538.    bool tolua_ret = (bool)  LuaSetPage(n);
  539.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  540.   }
  541.  }
  542.  return 1;
  543. #ifndef TOLUA_RELEASE
  544.  tolua_lerror:
  545.  tolua_error(tolua_S,"#ferror in function 'set_page'.",&tolua_err);
  546.  return 0;
  547. #endif
  548. }
  549. #endif //#ifndef TOLUA_DISABLE
  550.  
  551. /* function: LuaSetSlot */
  552. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_set_slot00
  553. static int tolua_sjasm_sj_set_slot00(lua_State* tolua_S)
  554. {
  555. #ifndef TOLUA_RELEASE
  556.  tolua_Error tolua_err;
  557.  if (
  558.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  559.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  560.  )
  561.   goto tolua_lerror;
  562.  else
  563. #endif
  564.  {
  565.   unsigned int n = ((unsigned int)  tolua_tonumber(tolua_S,1,0));
  566.   {
  567.    bool tolua_ret = (bool)  LuaSetSlot(n);
  568.    tolua_pushboolean(tolua_S,(bool)tolua_ret);
  569.   }
  570.  }
  571.  return 1;
  572. #ifndef TOLUA_RELEASE
  573.  tolua_lerror:
  574.  tolua_error(tolua_S,"#ferror in function 'set_slot'.",&tolua_err);
  575.  return 0;
  576. #endif
  577. }
  578. #endif //#ifndef TOLUA_DISABLE
  579.  
  580. /* function: MemGetByte */
  581. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_byte00
  582. static int tolua_sjasm_sj_get_byte00(lua_State* tolua_S)
  583. {
  584. #ifndef TOLUA_RELEASE
  585.  tolua_Error tolua_err;
  586.  if (
  587.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  588.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  589.  )
  590.   goto tolua_lerror;
  591.  else
  592. #endif
  593.  {
  594.   unsigned int address = ((unsigned int)  tolua_tonumber(tolua_S,1,0));
  595.   {
  596.    unsigned char tolua_ret = (unsigned char)  MemGetByte(address);
  597.    tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  598.   }
  599.  }
  600.  return 1;
  601. #ifndef TOLUA_RELEASE
  602.  tolua_lerror:
  603.  tolua_error(tolua_S,"#ferror in function 'get_byte'.",&tolua_err);
  604.  return 0;
  605. #endif
  606. }
  607. #endif //#ifndef TOLUA_DISABLE
  608.  
  609. /* function: MemGetWord */
  610. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_get_word00
  611. static int tolua_sjasm_sj_get_word00(lua_State* tolua_S)
  612. {
  613. #ifndef TOLUA_RELEASE
  614.  tolua_Error tolua_err;
  615.  if (
  616.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  617.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  618.  )
  619.   goto tolua_lerror;
  620.  else
  621. #endif
  622.  {
  623.   unsigned int address = ((unsigned int)  tolua_tonumber(tolua_S,1,0));
  624.   {
  625.    lua_Number tolua_ret = 0xFFFF & MemGetWord(address);
  626.    tolua_pushnumber(tolua_S, tolua_ret);
  627.   }
  628.  }
  629.  return 1;
  630. #ifndef TOLUA_RELEASE
  631.  tolua_lerror:
  632.  tolua_error(tolua_S,"#ferror in function 'get_word'.",&tolua_err);
  633.  return 0;
  634. #endif
  635. }
  636. #endif //#ifndef TOLUA_DISABLE
  637.  
  638. /* function: EmitByte */
  639. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_add_byte00
  640. static int tolua_sjasm_sj_add_byte00(lua_State* tolua_S)
  641. {
  642. #ifndef TOLUA_RELEASE
  643.  tolua_Error tolua_err;
  644.  if (
  645.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  646.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  647.  )
  648.   goto tolua_lerror;
  649.  else
  650. #endif
  651.  {
  652.   unsigned char byte = ((unsigned char)  tolua_tonumber(tolua_S,1,0));
  653.   {
  654.    EmitByte(byte);
  655.   }
  656.  }
  657.  return 0;
  658. #ifndef TOLUA_RELEASE
  659.  tolua_lerror:
  660.  tolua_error(tolua_S,"#ferror in function 'add_byte'.",&tolua_err);
  661.  return 0;
  662. #endif
  663. }
  664. #endif //#ifndef TOLUA_DISABLE
  665.  
  666. /* function: EmitWord */
  667. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_add_word00
  668. static int tolua_sjasm_sj_add_word00(lua_State* tolua_S)
  669. {
  670. #ifndef TOLUA_RELEASE
  671.  tolua_Error tolua_err;
  672.  if (
  673.      !tolua_isnumber(tolua_S,1,0,&tolua_err) ||
  674.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  675.  )
  676.   goto tolua_lerror;
  677.  else
  678. #endif
  679.  {
  680.   unsigned int word = ((unsigned int)  tolua_tonumber(tolua_S,1,0));
  681.   {
  682.    EmitWord(word);
  683.   }
  684.  }
  685.  return 0;
  686. #ifndef TOLUA_RELEASE
  687.  tolua_lerror:
  688.  tolua_error(tolua_S,"#ferror in function 'add_word'.",&tolua_err);
  689.  return 0;
  690. #endif
  691. }
  692. #endif //#ifndef TOLUA_DISABLE
  693.  
  694. /* function: LuaCalculate */
  695. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_calc00
  696. static int tolua_sjasm_sj_calc00(lua_State* tolua_S)
  697. {
  698. #ifndef TOLUA_RELEASE
  699.  tolua_Error tolua_err;
  700.  if (
  701.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  702.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  703.  )
  704.   goto tolua_lerror;
  705.  else
  706. #endif
  707.  {
  708.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  709.   {
  710.    lua_Number tolua_ret = LuaCalculate(str);
  711.    tolua_pushnumber(tolua_S, tolua_ret);
  712.   }
  713.  }
  714.  return 1;
  715. #ifndef TOLUA_RELEASE
  716.  tolua_lerror:
  717.  tolua_error(tolua_S,"#ferror in function 'calc'.",&tolua_err);
  718.  return 0;
  719. #endif
  720. }
  721. #endif //#ifndef TOLUA_DISABLE
  722.  
  723. /* function: LuaParseLine */
  724. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_parse_line00
  725. static int tolua_sjasm_sj_parse_line00(lua_State* tolua_S)
  726. {
  727. #ifndef TOLUA_RELEASE
  728.  tolua_Error tolua_err;
  729.  if (
  730.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  731.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  732.  )
  733.   goto tolua_lerror;
  734.  else
  735. #endif
  736.  {
  737.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  738.   {
  739.    LuaParseLine(str);
  740.   }
  741.  }
  742.  return 0;
  743. #ifndef TOLUA_RELEASE
  744.  tolua_lerror:
  745.  tolua_error(tolua_S,"#ferror in function 'parse_line'.",&tolua_err);
  746.  return 0;
  747. #endif
  748. }
  749. #endif //#ifndef TOLUA_DISABLE
  750.  
  751. /* function: LuaParseCode */
  752. #ifndef TOLUA_DISABLE_tolua_sjasm_sj_parse_code00
  753. static int tolua_sjasm_sj_parse_code00(lua_State* tolua_S)
  754. {
  755. #ifndef TOLUA_RELEASE
  756.  tolua_Error tolua_err;
  757.  if (
  758.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  759.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  760.  )
  761.   goto tolua_lerror;
  762.  else
  763. #endif
  764.  {
  765.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  766.   {
  767.    LuaParseCode(str);
  768.   }
  769.  }
  770.  return 0;
  771. #ifndef TOLUA_RELEASE
  772.  tolua_lerror:
  773.  tolua_error(tolua_S,"#ferror in function 'parse_code'.",&tolua_err);
  774.  return 0;
  775. #endif
  776. }
  777. #endif //#ifndef TOLUA_DISABLE
  778.  
  779. /* function: LuaCalculate */
  780. #ifndef TOLUA_DISABLE_tolua_sjasm__c00
  781. static int tolua_sjasm__c00(lua_State* tolua_S)
  782. {
  783. #ifndef TOLUA_RELEASE
  784.  tolua_Error tolua_err;
  785.  if (
  786.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  787.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  788.  )
  789.   goto tolua_lerror;
  790.  else
  791. #endif
  792.  {
  793.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  794.   {
  795.    lua_Number tolua_ret = LuaCalculate(str);
  796.    tolua_pushnumber(tolua_S, tolua_ret);
  797.   }
  798.  }
  799.  return 1;
  800. #ifndef TOLUA_RELEASE
  801.  tolua_lerror:
  802.  tolua_error(tolua_S,"#ferror in function '_c'.",&tolua_err);
  803.  return 0;
  804. #endif
  805. }
  806. #endif //#ifndef TOLUA_DISABLE
  807.  
  808. /* function: LuaParseLine */
  809. #ifndef TOLUA_DISABLE_tolua_sjasm__pl00
  810. static int tolua_sjasm__pl00(lua_State* tolua_S)
  811. {
  812. #ifndef TOLUA_RELEASE
  813.  tolua_Error tolua_err;
  814.  if (
  815.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  816.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  817.  )
  818.   goto tolua_lerror;
  819.  else
  820. #endif
  821.  {
  822.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  823.   {
  824.    LuaParseLine(str);
  825.   }
  826.  }
  827.  return 0;
  828. #ifndef TOLUA_RELEASE
  829.  tolua_lerror:
  830.  tolua_error(tolua_S,"#ferror in function '_pl'.",&tolua_err);
  831.  return 0;
  832. #endif
  833. }
  834. #endif //#ifndef TOLUA_DISABLE
  835.  
  836. /* function: LuaParseCode */
  837. #ifndef TOLUA_DISABLE_tolua_sjasm__pc00
  838. static int tolua_sjasm__pc00(lua_State* tolua_S)
  839. {
  840. #ifndef TOLUA_RELEASE
  841.  tolua_Error tolua_err;
  842.  if (
  843.      !tolua_isstring(tolua_S,1,0,&tolua_err) ||
  844.      !tolua_isnoobj(tolua_S,2,&tolua_err)
  845.  )
  846.   goto tolua_lerror;
  847.  else
  848. #endif
  849.  {
  850.   char* str = ((char*)  tolua_tostring(tolua_S,1,0));
  851.   {
  852.    LuaParseCode(str);
  853.   }
  854.  }
  855.  return 0;
  856. #ifndef TOLUA_RELEASE
  857.  tolua_lerror:
  858.  tolua_error(tolua_S,"#ferror in function '_pc'.",&tolua_err);
  859.  return 0;
  860. #endif
  861. }
  862. #endif //#ifndef TOLUA_DISABLE
  863.  
  864. /* Open function */
  865. TOLUA_API int tolua_sjasm_open (lua_State* tolua_S)
  866. {
  867.  tolua_open(tolua_S);
  868.  tolua_reg_types(tolua_S);
  869.  tolua_module(tolua_S,NULL,0);
  870.  tolua_beginmodule(tolua_S,NULL);
  871.   tolua_module(tolua_S,"sj",0);
  872.   tolua_beginmodule(tolua_S,"sj");
  873.    tolua_function(tolua_S,"get_define",tolua_sjasm_sj_get_define00);
  874.    tolua_function(tolua_S,"insert_define",tolua_sjasm_sj_insert_define00);
  875.    tolua_function(tolua_S,"get_label",tolua_sjasm_sj_get_label00);
  876.    tolua_function(tolua_S,"insert_label",tolua_sjasm_sj_insert_label00);
  877.   tolua_endmodule(tolua_S);
  878.   tolua_module(tolua_S,"sj",1);
  879.   tolua_beginmodule(tolua_S,"sj");
  880.    tolua_variable(tolua_S,"current_address",tolua_get_sj_unsigned_current_address,NULL);
  881.    tolua_variable(tolua_S,"warning_count",tolua_get_sj_warning_count,NULL);
  882.    tolua_variable(tolua_S,"error_count",tolua_get_sj_error_count,NULL);
  883.    tolua_function(tolua_S,"shellexec",tolua_sjasm_sj_shellexec00);
  884.   tolua_endmodule(tolua_S);
  885.   tolua_module(tolua_S,"zx",0);
  886.   tolua_beginmodule(tolua_S,"zx");
  887.    tolua_function(tolua_S,"trdimage_create",tolua_sjasm_zx_trdimage_create00);
  888.    tolua_function(tolua_S,"trdimage_add_file",tolua_sjasm_zx_trdimage_add_file00);
  889.    tolua_function(tolua_S,"save_snapshot_sna128",tolua_sjasm_zx_save_snapshot_sna12800);
  890.   tolua_endmodule(tolua_S);
  891.   tolua_module(tolua_S,"sj",1);
  892.   tolua_beginmodule(tolua_S,"sj");
  893.    tolua_variable(tolua_S,"current_path",tolua_get_sj_current_path,NULL);
  894.    tolua_function(tolua_S,"exit",tolua_sjasm_sj_exit00);
  895.   tolua_endmodule(tolua_S);
  896.   tolua_module(tolua_S,"sj",0);
  897.   tolua_beginmodule(tolua_S,"sj");
  898.    tolua_function(tolua_S,"error",tolua_sjasm_sj_error00);
  899.    tolua_function(tolua_S,"warning",tolua_sjasm_sj_warning00);
  900.    tolua_function(tolua_S,"file_exists",tolua_sjasm_sj_file_exists00);
  901.    tolua_function(tolua_S,"get_path",tolua_sjasm_sj_get_path00);
  902.    tolua_function(tolua_S,"set_device",tolua_sjasm_sj_set_device00);
  903.    tolua_function(tolua_S,"get_device",tolua_sjasm_sj_get_device00);
  904.    tolua_function(tolua_S,"set_page",tolua_sjasm_sj_set_page00);
  905.    tolua_function(tolua_S,"set_slot",tolua_sjasm_sj_set_slot00);
  906.    tolua_function(tolua_S,"get_byte",tolua_sjasm_sj_get_byte00);
  907.    tolua_function(tolua_S,"get_word",tolua_sjasm_sj_get_word00);
  908.    tolua_function(tolua_S,"add_byte",tolua_sjasm_sj_add_byte00);
  909.    tolua_function(tolua_S,"add_word",tolua_sjasm_sj_add_word00);
  910.    tolua_function(tolua_S,"calc",tolua_sjasm_sj_calc00);
  911.    tolua_function(tolua_S,"parse_line",tolua_sjasm_sj_parse_line00);
  912.    tolua_function(tolua_S,"parse_code",tolua_sjasm_sj_parse_code00);
  913.   tolua_endmodule(tolua_S);
  914.   tolua_function(tolua_S,"_c",tolua_sjasm__c00);
  915.   tolua_function(tolua_S,"_pl",tolua_sjasm__pl00);
  916.   tolua_function(tolua_S,"_pc",tolua_sjasm__pc00);
  917.  
  918.   { /* begin embedded lua code */"tolua: embedded Lua code 1");
  919.    lua_settop(tolua_S, top);
  920.   } /* end of embedded lua code */
  921.  
  922.  
  923.   { /* begin embedded lua code */
  924.    int top = lua_gettop(tolua_S);
  925.    static unsigned char B[] = {
  926.     10, 72,101,120, 32,118, 48, 46, 51, 10, 72,101,120, 32, 99,
  927.     111,110,118,101,114,115,105,111,110, 32,108,105, 98, 32,102,
  928.     111,114, 32,108,117, 97, 46, 10, 80, 97,114,116, 32,111,102,
  929.      32, 76,117, 97, 66,105,116, 40,104,116,116,112, 58, 47, 47,
  930.     108,117, 97,102,111,114,103,101, 46,110,101,116, 47,112,114,
  931.     111,106,101, 99,116,115, 47, 98,105,116, 47, 41, 46, 10, 85,
  932.     110,100,101,114, 32,116,104,101, 32, 77, 73, 84, 32,108,105,
  933.      99,101,110,115,101, 46, 10, 99,111,112,121,114,105,103,104,
  934.     116, 40, 99, 41, 32, 50, 48, 48, 54, 32,104, 97,110,122,104,
  935.      97,111, 32, 40, 97, 98,114, 97,115,104, 95,104, 97,110, 64,
  936.     104,111,116,109, 97,105,108, 46, 99,111,109, 41, 10,100,111,
  937.      10,108,111, 99, 97,108, 32,102,117,110, 99,116,105,111,110,
  938.      32,116,111, 95,104,101,120, 40,110, 41, 10,105,102, 40,116,
  939.     121,112,101, 40,110, 41, 32,126, 61, 32, 34,110,117,109, 98,
  940.     101,114, 34, 41, 32,116,104,101,110, 10,101,114,114,111,114,
  941.      40, 34,110,111,110, 45,110,117,109, 98,101,114, 32,116,121,
  942.     112,101, 32,112, 97,115,115,101,100, 32,105,110, 46, 34, 41,
  943.      10,101,110,100, 10,105,102, 40,110, 32, 45, 32,109, 97,116,
  944.     104, 46,102,108,111,111,114, 40,110, 41, 32, 62, 32, 48, 41,
  945.      32,116,104,101,110, 10,101,114,114,111,114, 40, 34,116,114,
  946.     121,105,110,103, 32,116,111, 32, 97,112,112,108,121, 32, 98,
  947.     105,116,119,105,115,101, 32,111,112,101,114, 97,116,105,111,
  948.     110, 32,111,110, 32,110,111,110, 45,105,110,116,101,103,101,
  949.     114, 33, 34, 41, 10,101,110,100, 10,105,102, 40,110, 32, 60,
  950.      32, 48, 41, 32,116,104,101,110, 10,110, 32, 61, 32, 98,105,
  951.     116, 46,116,111, 98,105,116,115, 40, 98,105,116, 46, 98,110,
  952.     111,116, 40,109, 97,116,104, 46, 97, 98,115, 40,110, 41, 41,
  953.      32, 43, 32, 49, 41, 10,110, 32, 61, 32, 98,105,116, 46,116,
  954.     111,110,117,109, 98, 40,110, 41, 10,101,110,100, 10,104,101,
  955.     120, 95,116, 98,108, 32, 61, 32,123, 39, 65, 39, 44, 32, 39,
  956.      66, 39, 44, 32, 39, 67, 39, 44, 32, 39, 68, 39, 44, 32, 39,
  957.      69, 39, 44, 32, 39, 70, 39,125, 10,104,101,120, 95,115,116,
  958.     114, 32, 61, 32, 34, 34, 10,119,104,105,108,101, 40,110, 32,
  959.     126, 61, 32, 48, 41, 32,100,111, 10,108, 97,115,116, 32, 61,
  960.      32,109, 97,116,104, 46,109,111,100, 40,110, 44, 32, 49, 54,
  961.      41, 10,105,102, 40,108, 97,115,116, 32, 60, 32, 49, 48, 41,
  962.      32,116,104,101,110, 10,104,101,120, 95,115,116,114, 32, 61,
  963.      32,116,111,115,116,114,105,110,103, 40,108, 97,115,116, 41,
  964.      32, 46, 46, 32,104,101,120, 95,115,116,114, 10,101,108,115,
  965.     101, 10,104,101,120, 95,115,116,114, 32, 61, 32,104,101,120,
  966.      95,116, 98,108, 91,108, 97,115,116, 45, 49, 48, 43, 49, 93,
  967.      32, 46, 46, 32,104,101,120, 95,115,116,114, 10,101,110,100,
  968.      10,110, 32, 61, 32,109, 97,116,104, 46,102,108,111,111,114,
  969.      40,110, 47, 49, 54, 41, 10,101,110,100, 10,105,102, 40,104,
  970.     101,120, 95,115,116,114, 32, 61, 61, 32, 34, 34, 41, 32,116,
  971.     104,101,110, 10,104,101,120, 95,115,116,114, 32, 61, 32, 34,
  972.      48, 34, 10,101,110,100, 10,114,101,116,117,114,110, 32, 34,
  973.      48,120, 34, 32, 46, 46, 32,104,101,120, 95,115,116,114, 10,
  974.     101,110,100, 10,108,111, 99, 97,108, 32,102,117,110, 99,116,
  975.     105,111,110, 32,116,111, 95,100,101, 99, 40,104,101,120, 41,
  976.      10,105,102, 40,116,121,112,101, 40,104,101,120, 41, 32,126,
  977.      61, 32, 34,115,116,114,105,110,103, 34, 41, 32,116,104,101,
  978.     110, 10,101,114,114,111,114, 40, 34,110,111,110, 45,115,116,
  979.     114,105,110,103, 32,116,121,112,101, 32,112, 97,115,115,101,
  980.     100, 32,105,110, 46, 34, 41, 10,101,110,100, 10,104,101, 97,
  981.     100, 32, 61, 32,115,116,114,105,110,103, 46,115,117, 98, 40,
  982.     104,101,120, 44, 32, 49, 44, 32, 50, 41, 10,105,102, 40, 32,
  983.     104,101, 97,100, 32,126, 61, 32, 34, 48,120, 34, 32, 97,110,
  984.     100, 32,104,101, 97,100, 32,126, 61, 32, 34, 48, 88, 34, 41,
  985.      32,116,104,101,110, 10,101,114,114,111,114, 40, 34,119,114,
  986.     111,110,103, 32,104,101,120, 32,102,111,114,109, 97,116, 44,
  987.      32,115,104,111,117,108,100, 32,108,101, 97,100, 32, 98,121,
  988.      32, 48,120, 32,111,114, 32, 48, 88, 46, 34, 41, 10,101,110,
  989.     100, 10,118, 32, 61, 32,116,111,110,117,109, 98,101,114, 40,
  990.     115,116,114,105,110,103, 46,115,117, 98, 40,104,101,120, 44,
  991.      32, 51, 41, 44, 32, 49, 54, 41, 10,114,101,116,117,114,110,
  992.      32,118, 59, 10,101,110,100, 10,104,101,120, 32, 61, 32,123,
  993.      10,116,111, 95,100,101, 99, 32, 61, 32,116,111, 95,100,101,
  994.      99, 44, 10,116,111, 95,104,101,120, 32, 61, 32,116,111, 95,
  995.     104,101,120, 44, 10,125, 10,101,110,100, 10,100, 32, 61, 32,
  996.      52, 51, 52, 49, 54, 56, 56, 10,104, 32, 61, 32,116,111, 95,
  997.     104,101,120, 40,100, 41, 10,112,114,105,110,116, 40,104, 41,
  998.      10,112,114,105,110,116, 40,116,111, 95,100,101, 99, 40,104,
  999.      41, 41, 10,102,111,114, 32,105, 32, 61, 32, 49, 44, 32, 49,
  1000.      48, 48, 48, 48, 48, 32,100,111, 10,104, 32, 61, 32,104,101,
  1001.     120, 46,116,111, 95,104,101,120, 40,105, 41, 10,100, 32, 61,
  1002.      32,104,101,120, 46,116,111, 95,100,101, 99, 40,104, 41, 10,
  1003.     105,102, 40,100, 32,126, 61, 32,105, 41, 32,116,104,101,110,
  1004.      10,101,114,114,111,114, 40, 34,102, 97,105,108,101,100, 32,
  1005.      34, 32, 46, 46, 32,105, 32, 46, 46, 32, 34, 44, 32, 34, 32,
  1006.      46, 46, 32,104, 41, 10,101,110,100, 10,101,110,100, 10,32
  1007.    };
  1008.    tolua_dobuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code 2");
  1009.    lua_settop(tolua_S, top);
  1010.   } /* end of embedded lua code */
  1011.  
  1012.  tolua_endmodule(tolua_S);
  1013.  return 1;
  1014. }
  1015.  
  1016.  
  1017. #if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
  1018.  TOLUA_API int luaopen_sjasm (lua_State* tolua_S) {
  1019.  return tolua_sjasm_open(tolua_S);
  1020. }
  1021. #endif
  1022.  
  1023.