editstub.cpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* $Id$
  2. * MegaZeux
  3. *
  4. * Copyright (C) 1996 Greg Janson
  5. * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #include "helpsys.h"
  22. #include "runrobot.h"
  23. #include "scrdisp.h"
  24. #include "scrdump.h"
  25. #include "sfx.h"
  26. #include "sfx_edit.h"
  27. #include "counter.h"
  28. #include "game.h"
  29. #include "fill.h"
  30. #include "meter.h"
  31. //#include "password.h"
  32. #include "egacode.h"
  33. #include "block.h"
  34. #include "pal_ed.h"
  35. #include "char_ed.h"
  36. #include "edit_di.h"
  37. #include "beep.h"
  38. #include "boardmem.h"
  39. #include "intake.h"
  40. #include "mod.h"
  41. #include "param.h"
  42. #include "error.h"
  43. #include "idarray.h"
  44. #include "ems.h"
  45. #include "meminter.h"
  46. #include "cursor.h"
  47. #include "retrace.h"
  48. #include "string.h"
  49. #include "edit.h"
  50. #include "ezboard.h"
  51. #include "data.h"
  52. #include "const.h"
  53. #include "graphics.h"
  54. #include "window.h"
  55. #include "getkey.h"
  56. #include "palette.h"
  57. #include "idput.h"
  58. #include "hexchar.h"
  59. #include <dos.h>
  60. #include "roballoc.h"
  61. #include "saveload.h"
  62. #include <stdio.h>
  63. #include "blink.h"
  64. #include "cursor.h"
  65. #include "counter.h"
  66. // What little that is required by the editor is here. - Exo
  67. char debug_mode=0, debug_x=0; //If debug mode is on, and X position of box.
  68. void add_ext(char far *str,char far *ext) {
  69. int t1,t2=str_len(str);
  70. //check for existing ext.
  71. for(t1=0;t1<t2;t1++)
  72. if(str[t1]=='.') break;
  73. if(t1<t2) return;
  74. str[8]=0;//Limit main filename section to 8 chars
  75. str_cat(str,ext);
  76. }
  77. void draw_debug_box(char ypos) {
  78. int t1;
  79. draw_window_box(debug_x,ypos,debug_x+14,24,current_pg_seg,
  80. EC_DEBUG_BOX,EC_DEBUG_BOX_DARK,EC_DEBUG_BOX_CORNER,0);
  81. write_string("X/Y: /\nBoard:\nMem: k\nEMS: k\nRobot memory-\n . /61k %",
  82. debug_x+1,ypos+1,EC_DEBUG_LABEL,current_pg_seg);
  83. write_number(curr_board,EC_DEBUG_NUMBER,debug_x+13,ypos+2,
  84. current_pg_seg,0,1);
  85. write_number((int)(farcoreleft()>>10),EC_DEBUG_NUMBER,
  86. debug_x+12,ypos+3,current_pg_seg,0,1);
  87. write_number(free_mem_EMS()<<4,EC_DEBUG_NUMBER,debug_x+12,ypos+4,
  88. current_pg_seg,0,1);
  89. t1=robot_free_mem/102;
  90. write_number(t1/10,EC_DEBUG_NUMBER,debug_x+2,ypos+6,current_pg_seg,
  91. 0,1);
  92. write_number(t1%10,EC_DEBUG_NUMBER,debug_x+4,ypos+6,current_pg_seg,1);
  93. if(*mod_playing != 0)
  94. {
  95. write_string(mod_playing,debug_x+2,ypos+7,EC_DEBUG_NUMBER,current_pg_seg);
  96. }
  97. else
  98. {
  99. write_string("(no module)",debug_x+2,ypos+7, EC_DEBUG_NUMBER, current_pg_seg);
  100. }
  101. t1=(unsigned int)(robot_free_mem*100L/62464L);
  102. write_number(t1,EC_DEBUG_NUMBER,debug_x+12,ypos+6,current_pg_seg,0,1);
  103. }