Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MegaZeux 2.51s1 release.

  • Loading branch information...
commit 5e7c79be2b87fd0d764256bfda9378d8ced244cd 1 parent fbb5992
ajs1984 authored
46 README.1ST
... ... @@ -0,0 +1,46 @@
  1 +
  2 +IMPORNAT NOTICE:
  3 + PLEASE READ THIS FILE BEFORE TRYING TO USE MZX 2.51S1b! YOU ALREADY DID,
  4 + DIDN'T YOU? YOU RAN THE PROGRAM AND IT DIDN'T WORK AND NOW YOU'RE ALL
  5 + UPSET AND YOU THINK IT'S OUR FAULT, DON'T YOU? HA HA HA! SEE IF I HELP
  6 + YOU OUT! I'M GUESSING THE SOUND DOESN'T WORK, RIGHT? TOO BAD! MAYBE
  7 + YOU SHOULD HAVE READ THIS FILE EARLIER, THAT'S WHY IT'S NAMED README.1ST!
  8 +
  9 + Okay, This is sort of a betaish release, in the sense that I'm pretty sure
  10 + everything works right, but you never know :) It's also the first release
  11 + since I plan on adding more improvements over time. So even if everything
  12 + works perfectly, I still get to call it a beta since it's not really done.
  13 +
  14 + First big thing is that this software is protected by the General Public
  15 + License, a copy of which has been included for your convenience.
  16 +
  17 + Second big thing is that as of right now, you must have MZX 2.51 installed
  18 + on your system. This is because I haven't included all the various support
  19 + files that MegaZeux needs. In light of this, you MUST copy the included
  20 + .EXE file into your normal MegaZeux directory, if you don't, your sound
  21 + will not function, and the help files will be missing, and other nasty
  22 + things.
  23 +
  24 + In accordance with the General Public License, the source code for
  25 + MZX 2.51S1 is available, and you are free to use/modify it under the
  26 + terms set forth in the General Public License. The source code should be
  27 + available wherever you got this binary package, if not, you should always
  28 + be able to obtain the source at:
  29 + http://www.execpc.com/~tgoetzma/
  30 + Barring server failures or me changing ISPs or something :)
  31 +
  32 + Changes are outlined in whatsnew.251. If you find a major bug in the
  33 + program, please email me at the address below. But ONLY for bugs (or
  34 + perhaps cash donations, complements, etc...:) PLEASE DO NOT EMAIL me
  35 + with questions on how to use the new stuff, or amazing ideas that you
  36 + have for MZX 2.51S2. I may or may not release some more detailed info
  37 + on using MZX 2.51Sx, or perhaps some kind of FAQ. Keep an eye on any
  38 + zeux.org or some other popular mzx news page.
  39 +
  40 + I guess that's it...Enjoy!
  41 +
  42 + Charles Goetzman
  43 + tgoetzma@execpc.com
  44 +
  45 +
  46 +
22 WHATSNEW.251
... ... @@ -1,4 +1,26 @@
1 1
  2 +2.51S1 release:
  3 +
  4 +
  5 ++ Increased counters to 1000.
  6 ++ Added following counters: (ro) is read only, (r&w) is read + write
  7 +(r&w) MOUSEX, MOUSEY - Location of mouse cursor over the screen.
  8 +(ro) BUTTONS - Status of the buttons (none=0,left=1,right=2,both=3)
  9 +(ro) MBOARDX, MBOARDy - Location of mouse cursor over the board.
  10 +(ro) SCROLLEDX, SCROLLEDY - Length the screen has been scrolled in each direction.
  11 +(ro) PLAYERX, PLAYERY - Location of the player
  12 +(r&w) CURSORSTATE - Turns on & off the hardware cursor (0= off, 1= on, 0 default)
  13 +
  14 ++ Added new independant counter like LOOPCOUNT, named LOCAL, it's now possible
  15 + for a robot to search the screen or something without wasting a counter.
  16 +* New .MZX and .SAV formats for MZX2.51S1.
  17 +* .SAV files from 2.51S1 are incompatible with 2.51, and vice-versa
  18 +* 2.51S1 is capable of loading 2.51 .MZX world files.
  19 +* 2.51 is not capable of loading .MZX files created or opened & saved in 2.51S1
  20 +
  21 +
  22 +
  23 +
2 24 2.51 release: (quick bug-fix release while working on 3.00)
3 25
4 26 * NOTE: I HAVE decided to release a 3.00 version of MegaZeux using
3  boardmem.cpp
@@ -64,6 +64,7 @@ char allocate_board_space(long size,unsigned char id,char conv_mem_ok) {
64 64 return 0;
65 65 }
66 66 //Nope.. try conventional
  67 + // SPIDER'S NOTE: WILL NOT USE CONVENTIONAL, DISABLED
67 68 if(conv_mem_ok) {
68 69 board_offsets[id].mem=(unsigned char *)farmalloc(size);
69 70 if(board_offsets[id].mem) {
@@ -82,7 +83,7 @@ char allocate_board_space(long size,unsigned char id,char conv_mem_ok) {
82 83 return 0;
83 84 }
84 85 }
85   - //Nope.. try disk
  86 + //Nope.. try disk
86 87 //Make temporary filename
87 88 str_cpy(&board_filenames[id*FILENAME_SIZE],"~MZTMPXXXXXX");
88 89 mktemp(&board_filenames[id*FILENAME_SIZE]);
9 const.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -20,7 +21,6 @@
20 21 */
21 22
22 23 /* Constants */
23   -
24 24 #ifndef __CONST_H
25 25 #define __CONST_H
26 26
@@ -89,9 +89,10 @@
89 89 //"SIZE" includes terminating \0
90 90 #define PATHNAME_SIZE 129
91 91 #define FILENAME_SIZE 13
92   -#define NUM_BOARDS 150
  92 +#define NUM_BOARDS 150 //Haven't increased this yet, over 255 causes mzx to crash on load
  93 + //Each board requires considerable amount of conventional mem Spid
93 94 #define BOARD_NAME_SIZE 25
94   -#define COUNTER_NAME_SIZE 15
  95 +#define COUNTER_NAME_SIZE 15 //Possibly decrease counter name size to gain conventional mem? Spid
95 96 #define NUM_KEYS 16
96 97
97 98 //Where something is in memory (CURRENT means it is in special variables for
@@ -144,7 +145,7 @@
144 145 #define NUM_ROBOTS 200
145 146 #define NUM_SCROLLS 50
146 147 #define NUM_SENSORS 20
147   -#define NUM_COUNTERS 59
  148 +#define NUM_COUNTERS 1020 // This is a decent # for now. Spid
148 149 #define NUM_STATUS_CNTRS 6
149 150 //The first n counters are reserved for internal use (GEMS, etc)
150 151 #define RESERVED_COUNTERS 9
86 counter.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -25,13 +26,19 @@
25 26 #include "runrobot.h"
26 27 #include "idarray.h"
27 28 #include "data.h"
  29 +// #include <math.h> // Meant for a hypot func to find actual distance, doesnt' work. Spid
28 30 #include "const.h"
29 31 #include "string.h"
30 32 #include "struct.h"
31 33 #include <stdlib.h>
32 34 #include "counter.h"
  35 +#include "mouse.h"
  36 +#include "game.h"
  37 +#include "game2.h"
33 38
34   -int player_restart_x=0,player_restart_y=0;
  39 +
  40 +int player_restart_x=0,player_restart_y=0,gridxsize=1,gridysize=1;
  41 +int myscrolledx=0,myscrolledy=0;
35 42 char was_zapped=0;
36 43 extern char mid_prefix;
37 44 void prefix_xy(int&fx,int&fy,int&mx,int&my,int&lx,int&ly,int robotx,
@@ -41,6 +48,7 @@ void prefix_xy(int&fx,int&fy,int&mx,int&my,int&lx,int&ly,int robotx,
41 48 int get_counter(char far *name,unsigned char id) {
42 49 int t1;
43 50 if(!str_cmp(name,"LOOPCOUNT")) return robots[id].loop_count;
  51 + if(!str_cmp(name,"LOCAL")) return robots[id].blank; //Found this, no idea if it works Spid
44 52 //Now search counter structs
45 53 for(t1=0;t1<NUM_COUNTERS;t1++)
46 54 if(!str_cmp(name,counters[t1].counter_name)) break;
@@ -49,6 +57,10 @@ int get_counter(char far *name,unsigned char id) {
49 57 if(!str_cmp(name,"BULLETTYPE")) return robots[id].bullet_type;
50 58 if(!str_cmp(name,"PLAYERDIST"))
51 59 return abs(robots[id].xpos-player_x)+abs(robots[id].ypos-player_y);
  60 + // if(!str_cmp(name,"PLADIST"))
  61 + // return 34;
  62 + // return sqrtl((abs(robots[id].xpos-player_x) * abs(robots[id].xpos-player_x)) +
  63 + // (abs(robots[id].ypos-player_y) * abs(robots[id].ypos-player_y)));
52 64 if(!str_cmp(name,"HORIZPLD"))
53 65 return abs(robots[id].xpos-player_x);
54 66 if(!str_cmp(name,"VERTPLD"))
@@ -71,9 +83,36 @@ int get_counter(char far *name,unsigned char id) {
71 83 if(!str_cmp(name,"TIMERESET")) return time_limit;
72 84 if(!str_cmp(name,"PLAYERFACEDIR")) return player_last_dir>>4;
73 85 if(!str_cmp(name,"PLAYERLASTDIR")) return player_last_dir&15;
  86 + // Mouse info Spid
  87 + if(!str_cmp(name,"MOUSEX")) return mousex;
  88 + if(!str_cmp(name,"MOUSEY")) return mousey;
  89 + if(!str_cmp(name,"BUTTONS")) return mybutton;
  90 + // scroll_x and scroll_y never work, always return 0. Spid
  91 + if(!str_cmp(name,"SCROLLEDX")) {
  92 + calculate_xytop(myscrolledx,myscrolledy);
  93 + return myscrolledx;
  94 + }
  95 + if(!str_cmp(name,"SCROLLEDY")) {
  96 + calculate_xytop(myscrolledx,myscrolledy);
  97 + return myscrolledy;
  98 + }
  99 + // Player position Spid
  100 + if(!str_cmp(name,"PLAYERX")) return player_x;
  101 + if(!str_cmp(name,"PLAYERY")) return player_y;
  102 + // This WILL be position over the game board, once scroll_ works. Spid
  103 + if(!str_cmp(name,"MBOARDX")) {
  104 + calculate_xytop(myscrolledx,myscrolledy);
  105 + return (mousex + myscrolledx - viewport_x);
  106 + }
  107 + if(!str_cmp(name,"MBOARDY")) {
  108 + calculate_xytop(myscrolledx,myscrolledy);
  109 + return (mousey + myscrolledy - viewport_y);
  110 + }
  111 + // viewport_x viewport_y
74 112 return 0;//Not found
75 113 }
76 114
  115 +
77 116 //Sets the value of a counter. Include robot id if a robot is running.
78 117 void set_counter(char far *name,int value,unsigned char id) {
79 118 int t1;
@@ -82,12 +121,57 @@ void set_counter(char far *name,int value,unsigned char id) {
82 121 robots[id].loop_count=value;
83 122 return;
84 123 }
  124 + if(!str_cmp(name,"LOCAL")) {
  125 + robots[id].blank=value;
  126 + return;
  127 + }
85 128 if(!str_cmp(name,"BULLETTYPE")) {
86 129 if(value>2) value=2;
87 130 robots[id].bullet_type=value;
88 131 return;
89 132 }
90 133 //Next, check for global, non-standard counters
  134 +
  135 + // SHOULD allow instant scrolling of screen, once scroll_x can be referenced
  136 + // As of yet, doesn't work. Spid
  137 + if(!str_cmp(name,"SCROLLEDX")) {
  138 + scroll_x= value;
  139 + return;
  140 + }
  141 + if(!str_cmp(name,"SCROLLEDY")) {
  142 + scroll_y= value;
  143 + return;
  144 + }
  145 +/* // These Grids will be used for mouse buttons, once that is in. Spid
  146 + if(!str_cmp(name,"GRIDXSIZE")) {
  147 + gridxsize=value;
  148 + return;
  149 + }
  150 + if(!str_cmp(name,"GRIDYSIZE")) {
  151 + gridysize=value;
  152 + return;
  153 + }
  154 +*/ // Shows or hides the hardware cursor Spid
  155 + if(!str_cmp(name,"CURSORSTATE")) {
  156 + if (value==1) m_show();
  157 + if (value==0) m_hide();
  158 + } //Don't return! We need to set the counter, as well.
  159 + // CURSORSTATE is referenced in GAME.CPP
  160 + // This should PROBABLY be a variable, instead of a counter,
  161 + // but I DID have a reason for using a counter, if I ever
  162 + // remember it. Spid
  163 + if(!str_cmp(name,"MOUSEX")) {
  164 + if(value>79) value=79;
  165 + if(value<0) value=0;
  166 + m_move(value,mousey);
  167 + return;
  168 + }
  169 + if(!str_cmp(name,"MOUSEY")) {
  170 + if(value>24) value=24;
  171 + if(value<0) value=0;
  172 + m_move(mousex,value);
  173 + return;
  174 + }
91 175 if(!str_cmp(name,"INPUT")) {
92 176 num_input=value;
93 177 return;
1  counter.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
5 data.h
@@ -128,8 +128,9 @@ extern unsigned char pl_saved_board[8];
128 128 extern unsigned char edge_color;//Global
129 129 extern unsigned char scroll_color;//Global, not saved
130 130 extern unsigned char lazwall_start;//Local
131   -extern int scroll_x;//Local
132   -extern int scroll_y;//Local
  131 +extern int scroll_x;//Local // Something is SERIOUSLY wrong with these two, counter.cpp
  132 +extern int scroll_y;//Local // can't even see them! Spid
  133 +
133 134 extern unsigned int locked_x;//Local (-1 or 65535 for none)
134 135 extern unsigned int locked_y;//Local (-1 or 65535 for none)
135 136 extern unsigned char protection_method;
79 game.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -19,6 +20,13 @@
19 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 21 */
21 22
  23 +
  24 +// I added a bunch of stuff here. Whenever a window is popped up, the mouse
  25 +// cursor is re-activated, and then CURSORSTATE is checked upon closing the
  26 +// window. If it's 1, the cursor is left on, otherwise it's hidden as normal.
  27 +// You can find all instances by searching for CURSORSTATE. Spid
  28 +
  29 +
22 30 /* Main title screen/gaming code */
23 31
24 32 #include <dos.h>
@@ -96,6 +104,7 @@ int target_y=-1;//Or id of entrance
96 104 int target_d_id=-1;//For RESTORE/EXCHANGE PLAYER POSITION with DUPLICATION.
97 105 int target_d_color=-1;//For RESTORE/EXCHANGE PLAYER POSITION with DUPLICATION.
98 106
  107 +
99 108 char pal_update=0;//Whether to update a palette from robot activity
100 109
101 110 void title_screen(void) {
@@ -149,6 +158,9 @@ void title_screen(void) {
149 158 do {
150 159 //Update
151 160 if(update(0,fadein)) continue;
  161 + // Update stupid variables
  162 + // mynewx= scroll_x;
  163 + // mynewy= scroll_y;
152 164 //Keycheck
153 165 if(keywaiting()) {
154 166 //Get key...
@@ -281,7 +293,6 @@ void title_screen(void) {
281 293 m_hide();
282 294 break;
283 295 case 13://Enter
284   - case MOUSE_EVENT://Mouse
285 296 //Menu
286 297 //19x9
287 298 save_screen(current_pg_seg);
@@ -305,7 +316,7 @@ void title_screen(void) {
305 316 (mouse_event.cy<8)||(mouse_event.cy>17)) key=0;
306 317 else key=main_menu_keys[mouse_event.cy-8];
307 318 }
308   - m_hide();
  319 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
309 320 restore_screen(current_pg_seg);
310 321 goto process_key;
311 322 case 27://ESC
@@ -318,7 +329,7 @@ void title_screen(void) {
318 329 }
319 330 if(confirm("Quit to DOS- Are you sure?")) key=0;
320 331 if(t1) insta_fadeout();
321   - m_hide();
  332 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
322 333 break;
323 334 case 'L'://L
324 335 case -61://F3
@@ -334,7 +345,7 @@ void title_screen(void) {
334 345 if(t1) insta_fadeout();
335 346 break;
336 347 }
337   - m_hide();
  348 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
338 349 //Load world curr_file
339 350 vquick_fadeout();
340 351 end_mod();
@@ -353,7 +364,13 @@ void title_screen(void) {
353 364 fadein=1;
354 365 dead=0;
355 366 menu_mesg:
  367 +#ifdef UNREG
  368 + set_mesg("** UNREGISTERED ** Press F1 for help, Enter for menu");
  369 +#elif defined(BETA)
  370 + set_mesg("** BETA ** Press F1 for help, Enter for menu");
  371 +#else
356 372 set_mesg("- Press F1 for help, Enter for menu -");
  373 +#endif
357 374 break;
358 375 case 'R'://R
359 376 case -62://F4
@@ -373,7 +390,7 @@ void title_screen(void) {
373 390 fadein=0;
374 391 if(load_world(temp,0,1,&fadein)) {
375 392 vquick_fadeout();
376   - m_hide();
  393 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
377 394 switch_keyb_table(1);
378 395 clear_world();
379 396 return;
@@ -388,11 +405,11 @@ void title_screen(void) {
388 405 dead=0;
389 406 vquick_fadeout();
390 407 fadein^=1;
391   - m_hide();
  408 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
392 409 goto gameplay;
393 410 }
394 411 if(t1) insta_fadeout();
395   - m_hide();
  412 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
396 413 break;
397 414 case 'P'://P
398 415 case -63://F5
@@ -402,7 +419,7 @@ void title_screen(void) {
402 419 m_show();
403 420 error("You can only play this game via a swap from another game",
404 421 0,24,current_pg_seg,0x3101);
405   - m_hide();
  422 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
406 423 break;
407 424 }
408 425 //Load world curr_file
@@ -467,7 +484,7 @@ void title_screen(void) {
467 484 fadein=0;
468 485 if(load_world(curr_sav,0,1,&fadein)) {
469 486 vquick_fadeout();
470   - m_hide();
  487 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
471 488 clear_world();
472 489 fadein=1;
473 490 break;
@@ -480,7 +497,7 @@ void title_screen(void) {
480 497 dead=0;
481 498 vquick_fadeout();
482 499 fadein^=1;
483   - m_hide();
  500 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
484 501 goto gameplay;
485 502 }
486 503 }
@@ -492,6 +509,9 @@ void title_screen(void) {
492 509 }
493 510
494 511 void draw_viewport(void) {
  512 + // Sneak this biotch in here
  513 + //mynewx= scroll_x;
  514 + //mynewy= scroll_y;
495 515 int t1,t2;
496 516 enter_func("draw_viewport");
497 517 //Draw the current viewport on current_pg_seg
@@ -1001,10 +1021,9 @@ void play_game(char fadein) {
1001 1021 game_settings();
1002 1022 if(t1) insta_fadeout();
1003 1023 switch_keyb_table(0);
1004   - m_hide();
  1024 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1005 1025 break;
1006 1026 case 13://Enter
1007   - case MOUSE_EVENT://Mouse
1008 1027 //Menu
1009 1028 //19x9
1010 1029 save_screen(current_pg_seg);
@@ -1029,7 +1048,7 @@ void play_game(char fadein) {
1029 1048 (mouse_event.cy<6)||(mouse_event.cy>18)) key=0;
1030 1049 else key=game_menu_keys[mouse_event.cy-6];
1031 1050 }
1032   - m_hide();
  1051 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1033 1052 restore_screen(current_pg_seg);
1034 1053 if(t1) insta_fadeout();
1035 1054 goto process_key;
@@ -1045,7 +1064,7 @@ void play_game(char fadein) {
1045 1064 if(confirm("Quit playing- Are you sure?")) key=0;
1046 1065 if(t1) insta_fadeout();
1047 1066 switch_keyb_table(0);
1048   - m_hide();
  1067 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1049 1068 break;
1050 1069 case -61://F3
1051 1070 //Save game
@@ -1068,7 +1087,7 @@ void play_game(char fadein) {
1068 1087 if(curr_sav[0]==0) {
1069 1088 if(t1) insta_fadeout();
1070 1089 switch_keyb_table(0);
1071   - m_hide();
  1090 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1072 1091 break;
1073 1092 }
1074 1093 add_ext(curr_sav,".SAV");
@@ -1078,7 +1097,7 @@ void play_game(char fadein) {
1078 1097 if(confirm("File exists- Overwrite?")) {
1079 1098 if(t1) insta_fadeout();
1080 1099 switch_keyb_table(0);
1081   - m_hide();
  1100 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1082 1101 break;
1083 1102 }
1084 1103 }
@@ -1091,7 +1110,7 @@ void play_game(char fadein) {
1091 1110 }
1092 1111 if(t1) insta_fadeout();
1093 1112 switch_keyb_table(0);
1094   - m_hide();
  1113 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1095 1114 }
1096 1115 break;
1097 1116 case -62://F4
@@ -1112,7 +1131,7 @@ void play_game(char fadein) {
1112 1131 fadein=0;
1113 1132 if(load_world(temp,0,1,&fadein)) {
1114 1133 vquick_fadeout();
1115   - m_hide();
  1134 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1116 1135 switch_keyb_table(1);
1117 1136 clear_world();
1118 1137 return;
@@ -1129,7 +1148,7 @@ void play_game(char fadein) {
1129 1148 }
1130 1149 if(t1) insta_fadeout();
1131 1150 switch_keyb_table(0);
1132   - m_hide();
  1151 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1133 1152 break;
1134 1153 case -63://F5
1135 1154 case -82://Ins
@@ -1215,7 +1234,7 @@ void play_game(char fadein) {
1215 1234 select_current(curr_board);
1216 1235 if(t1) insta_fadeout();
1217 1236 switch_keyb_table(0);
1218   - m_hide();
  1237 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1219 1238 }
1220 1239 break;
1221 1240 case -68://F10
@@ -1231,7 +1250,7 @@ void play_game(char fadein) {
1231 1250 fadein=0;
1232 1251 if(load_world(curr_sav,0,1,&fadein)) {
1233 1252 vquick_fadeout();
1234   - m_hide();
  1253 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1235 1254 switch_keyb_table(1);
1236 1255 clear_world();
1237 1256 return;
@@ -1245,7 +1264,7 @@ void play_game(char fadein) {
1245 1264 vquick_fadeout();
1246 1265 fadein^=1;
1247 1266 switch_keyb_table(0);
1248   - m_hide();
  1267 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1249 1268 break;
1250 1269 }
1251 1270 }
@@ -1459,7 +1478,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
1459 1478 t2=confirm("Inside the chest you find a potion. Drink it?");
1460 1479 if(fad) insta_fadeout();
1461 1480 switch_keyb_table(old_keyb);
1462   - m_hide();
  1481 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1463 1482 if(t2) {
1464 1483 exit_func();
1465 1484 return 0;
@@ -1477,7 +1496,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
1477 1496 t2=confirm("Inside the chest you find a ring. Wear it?");
1478 1497 if(fad) insta_fadeout();
1479 1498 switch_keyb_table(old_keyb);
1480   - m_hide();
  1499 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1481 1500 if(t2) {
1482 1501 exit_func();
1483 1502 return 0;
@@ -1812,7 +1831,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
1812 1831 switch_keyb_table(1);
1813 1832 m_show();
1814 1833 scroll_edit(param,id&1);
1815   - m_hide();
  1834 + if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
1816 1835 switch_keyb_table(old_keyb);
1817 1836 if(id==126) goto remove_item;
1818 1837 break;
@@ -1873,6 +1892,9 @@ char update(char game,char &fadein) {
1873 1892 unsigned int time;
1874 1893 static reload=0;
1875 1894 static slowed=0;//Flips between 0 and 1 during slow_time
  1895 +#ifdef BETA
  1896 + static unsigned char cyc=0;//Debugging
  1897 +#endif
1876 1898 int tmp_x[5];
1877 1899 int tmp_y[5];
1878 1900 char tmp_str[10];
@@ -2006,6 +2028,9 @@ char update(char game,char &fadein) {
2006 2028 if(reload) reload--;
2007 2029 }
2008 2030 //Global robot BEFORE other stuff
  2031 + // mynewx= scroll_x;
  2032 + // mynewy= scroll_y;
  2033 +
2009 2034 run_robot(NUM_ROBOTS,-1,-1);
2010 2035 if(!slowed) {
2011 2036 if(flags[level_under_id[player_x+player_y*max_bxsiz]]&A_ENTRANCE) t1=0;
@@ -2118,6 +2143,10 @@ char update(char game,char &fadein) {
2118 2143 draw_game_window(t1,t2,current_pg_seg);
2119 2144 exit_func();
2120 2145 }
  2146 +#ifdef BETA
  2147 + //Debugging
  2148 + write_hex_byte(++cyc,15,0,0,current_pg_seg);
  2149 +#endif
2121 2150 //Add time limit
2122 2151 time=get_counter("TIME");
2123 2152 if(time) {
2  game.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -45,6 +46,7 @@ extern int target_y;//Or id of entrance
45 46 extern int target_d_id;
46 47 extern int target_d_color;
47 48
  49 +
48 50 extern char pal_update;
49 51
50 52 #ifdef __cplusplus
6 getkey.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -56,11 +57,12 @@ int getkey(void) {
56 57 acknowledge_mouse();
57 58 return 0;
58 59 }
59   - //Turn right button into ESC
  60 + //Turn right button into ESC (Not anymore! Spid)
60 61 if(mouse_event.buttonstat&RIGHTBPRESS) {
61 62 acknowledge_mouse();
62   - return 27;
  63 + return 0; // WAS 27. Spid
63 64 }
  65 +
64 66 if(auto_pop_mouse_events) acknowledge_mouse();
65 67 return MOUSE_EVENT;
66 68 }
1  getkey.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
71 main.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -64,21 +65,34 @@ char force_ega=0,no_mouse=0,no_ems=0,new_settings=0;
64 65 jmp_buf exit_jump;//Used in error function and nowhere else
65 66 extern unsigned int Addr,IRQ,DMA;//Sound card parameters (-1=detect)
66 67
67   -char exit_mesg[]=
68   -"MegaZeux 2.51\n\n"
69   -" Copyright (C) 1996 Greg Janson\n"
70   -" Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net\n\n"
71   -" This program is free software; you can redistribute it and/or\n"
72   -" modify it under the terms of the GNU General Public License as\n"
73   -" published by the Free Software Foundation; either version 2 of\n"
74   -" the License, or (at your option) any later version.\n\n"
75   -" This program is distributed in the hope that it will be useful,\n"
76   -" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
77   -" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
78   -" General Public License for more details.\n\n"
79   -" You should have received a copy of the GNU General Public License\n"
80   -" along with this program; if not, write to the Free Software\n"
81   -" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n$";
  68 +#ifdef UNREG
  69 +char *unreg_exit_mesg =
  70 +"Thank you for playing MegaZeux! If you enjoy MegaZeux, you should register it.\n"
  71 +"Registration gets you the remaining three games in the Zeux series and pays\n"
  72 +"for the actual MegaZeux program. When you register, you tell us that you enjoy\n"
  73 +"getting such intellegent games at low costs. To register, send 15 dollars, plus\n"
  74 +"2 for shipping/handling (3 outside the US) to:\n\n"
  75 +"\tSoftware Visions\n"
  76 +"\t4875 Sunset Ave.\n"
  77 +"\tLa Crescenta, CA 91214\n\n"
  78 +"Make checks and money orders payable to Gregory Janson. Include a copy of our\n"
  79 +"order form, or a note stating your name and address and the desired product.\n\n"
  80 +"Remember to read CONTEST.TXT about a world design contest!\n\n"
  81 +"See README.TXT if you are having problems with EMS, memory, or bugs/support.\n"
  82 +"See the Frequently Asked Questions section of MEGAZEUX.DOC if you have a\n"
  83 +"problem, before contacting Software Visions.\n\n$";
  84 +#else
  85 +char *reg_exit_mesg =
  86 +"Thank you for registering MegaZeux.\n\n"
  87 +"Remember to read CONTEST.TXT about a world design contest!\n\n"
  88 +"See README.TXT if you are having problems with EMS, memory, or bugs/support.\n"
  89 +"See the Frequently Asked Questions section of MEGAZEUX.DOC if you have a\n"
  90 +"problem, before contacting Software Visions.\n\n"
  91 +" \n\n"
  92 +" MZX2.51S1 improvements by Charles Goetzman \n\n$";
  93 +
  94 +#endif
  95 +
82 96 #pragma warn -par
83 97 int main(int argc,char **argv) {
84 98 //Temp var for number->string conversion
@@ -142,7 +156,16 @@ int main(int argc,char **argv) {
142 156 draw_window_box(2,1,77,3,0xB800,120,127,113,0);
143 157 draw_window_box(2,4,77,16,0xB800,120,127,113,0);
144 158 draw_window_box(2,17,77,23,0xB800,120,127,113,0);
145   - write_string("MegaZeux version 2.51",28,2,127,0xB800);
  159 + write_string("MegaZeux version 2.51S1",27,2,127,0xB800);
  160 +// #ifdef BETA
  161 + write_string("BETA- PLEASE DISTRIBUTE",27,17,127,0xB800);
  162 +// #endif
  163 +#ifdef GAMMA
  164 + write_string("GAMMA- MAY CONTAIN BUGS",27,17,127,0xB800);
  165 +#endif
  166 +#ifdef UNREG
  167 + write_string("Unregistered Evaluation Copy",25,0,122,0xB800);
  168 +#endif
146 169 write_string("Graphics card:",4,18,122,0xB800);
147 170 write_string("Processor:",8,19,122,0xB800);
148 171 write_string("EMS available:",4,20,122,0xB800);
@@ -253,11 +276,11 @@ int main(int argc,char **argv) {
253 276 install_i09();
254 277 installceh();
255 278
256   - //Write up free memory (below 200 shown as bad)
  279 + //Write up free memory (below 100 shown as bad)
257 280 itoa(t1=(int)(farcoreleft()>>10),temp,10);
258 281 temp[str_len(temp)+1]=0;
259 282 temp[str_len(temp)]='k';
260   - if(t1>=150) write_string(temp,19,21,121,0xB800);
  283 + if(t1>=100) write_string(temp,19,21,121,0xB800);
261 284 else write_string(temp,19,21,124,0xB800);
262 285 //Give error message if appropriate (including if free Kb below 20)
263 286 if((errors)||(t1<20)) {
@@ -461,9 +484,15 @@ int main(int argc,char **argv) {
461 484 cursor_underline();
462 485
463 486 asm push ds
464   - asm mov dx,OFFSET exit_mesg
465   - asm mov ax,SEG exit_mesg
466   - asm mov ds,ax
  487 +#ifdef UNREG
  488 + asm mov dx,SEG unreg_exit_mesg
  489 + asm mov ds,dx
  490 + asm lds dx,ds:unreg_exit_mesg
  491 +#else
  492 + asm mov dx,SEG reg_exit_mesg
  493 + asm mov ds,dx
  494 + asm lds dx,ds:reg_exit_mesg
  495 +#endif
467 496 asm mov ah,9
468 497 asm int 21h
469 498 asm pop ds
1  main.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
4 mouse.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -32,7 +33,7 @@ char mousehidden=0;//Is the mouse hidden? (Additive)
32 33 unsigned int mouseinstalled=0;//Is the mouse installed?
33 34 char driver_activated=0;//Is our driver installed?
34 35
35   -volatile int mousex,mousey;//Character position of mouse
  36 +volatile int mousex,mousey,mybutton;//Character position of mouse
36 37 volatile int mbufin=0,mbufout=0;//Mouse buffer pointers
37 38 char mousefreeze=0;//Is mouse frozen in place?
38 39 mouse_info_rec mbuf[MOUSE_BUFFERSIZE];//Mouse event buffer
@@ -72,6 +73,7 @@ static void far mousehandler(void) {
72 73 asm {
73 74 mov mousex, cx
74 75 mov mousey, dx
  76 + mov mybutton, bx //Gotta snag the mouse buttons now too. Spid
75 77 }
76 78
77 79 mousex>>=3;//Characters are 8 pixels wide
3  mouse.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -53,7 +54,7 @@ typedef struct mouse_info_rec mouse_info_rec;
53 54 extern char mousehidden;
54 55 extern unsigned int mouseinstalled;
55 56 extern char driver_activated;
56   -extern volatile int mousex,mousey;
  57 +extern volatile int mousex,mousey,mybutton;
57 58 extern int mouse_count;
58 59
59 60 //Initialize the mouse routines
6 mtype.h
... ... @@ -0,0 +1,6 @@
  1 +typedef char byte; // signed one byte
  2 +typedef unsigned char ubyte; // unsigned one byte
  3 +typedef short word; // signed two bytes
  4 +typedef unsigned short uword; // unsigned two bytes
  5 +typedef long dword; // signed four bytes
  6 +typedef unsigned long udword; // unsigned four bytes
50 saveload.cpp
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as
@@ -20,6 +21,25 @@
20 21 */
21 22
22 23 // Saving/loading worlds- dialogs and functions
  24 +// *** READ THIS!!!! ****
  25 +/* New naming conventions:
  26 + .MZX files:
  27 + MZX - Ver 1.x MegaZeux
  28 + MZ2 - Ver 2.x MegaZeux
  29 + MZA - Ver 2.51S1+ Megazeux, may change to MZB,MZC, up in letters etc.. if neccesary
  30 +
  31 + .SAV files:
  32 + MZSV2 - Ver 2.x MegaZeux
  33 + MZXSA - Ver 2.51S1+ MegaZeux, again, may change if necessary
  34 +
  35 + All others are unchanged.
  36 +
  37 +*/
  38 +
  39 +
  40 +
  41 +
  42 +
23 43
24 44 #include "helpsys.h"
25 45 #include "sfx.h"
@@ -99,7 +119,7 @@ void save_world(char far *file,char savegame,char faded) {
99 119 save_screen(current_pg_seg);
100 120 meter("Saving...",current_pg_seg,meter_curr,meter_target);
101 121 if(savegame) {
102   - fwrite("MZSV2",1,6,fp);
  122 + fwrite("MZXSA",1,6,fp);
103 123 fputc(curr_board,fp);
104 124 xor=0;
105 125 }
@@ -109,7 +129,7 @@ void save_world(char far *file,char savegame,char faded) {
109 129 //Pw info-
110 130 write_password(fp);
111 131 //File type id-
112   - fwrite("MZ2",1,3,fp);
  132 + fwrite("MZA",1,3,fp);
113 133 //Get xor code...
114 134 xor=get_pw_xor_code();
115 135 }
@@ -211,12 +231,25 @@ void save_world(char far *file,char savegame,char faded) {
211 231 fputc(under_player_param,fp);
212 232 fputc(under_player_color,fp);
213 233 //Counters
  234 + // Here I took out all the old stuff + just made megazeux save all
  235 + // 17k of the 1000 counters, ha ha ha. Spid
  236 + // Actually, the above is wrong :), I just fixed it so that the fputc(t2,fp) is now a
  237 + // fwrite(), and it will write out the # of counters properly (thanx ment&Kev!) Spid
  238 +
214 239 t2=0;
215 240 for(t1=0;t1<NUM_COUNTERS;t1++)
216 241 if((counters[t1].counter_value)>0) t2=t1+1;
217   - fputc(t2,fp);
  242 + // fputc(t2,fp);
  243 + // fprintf(fp, "%d", t2);
  244 + fwrite(&t2, sizeof(int), 1, fp); //THIS is the # of counters, as an int. Spid
218 245 for(t1=0;t1<t2;t1++)
219 246 fwrite(&counters[t1],1,sizeof(Counter),fp);
  247 +
  248 +
  249 +
  250 +// for (t1=0;t1<NUM_COUNTERS;t1++) //Write out every last counter Spid
  251 +// fwrite(&counters[t1],1,sizeof(Counter),fp);
  252 +
220 253 }
221 254 //Save space for global robot pos.
222 255 temp3=ftell(fp);
@@ -340,7 +373,7 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
340 373 meter("Loading...",current_pg_seg,meter_curr,meter_target);
341 374 if(savegame) {
342 375 fread(tempstr,1,6,fp);
343   - if(str_cmp(tempstr,"MZSV2")) {
  376 + if(str_cmp(tempstr,"MZXSA")) {
344 377 restore_screen(current_pg_seg);
345 378 error("Error loading save game",1,24,current_pg_seg,0x2101);
346 379 fclose(fp);
@@ -388,7 +421,7 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
388 421 str_cpy(password,tempstr);
389 422 fclose(fp);
390 423 return 1;
391   - }
  424 + }
392 425 if(fgetc(fp)!='Z') {
393 426 restore_screen(current_pg_seg);
394 427 error("Error loading world",1,24,current_pg_seg,0x0D03);
@@ -410,7 +443,7 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
410 443 fclose(fp);
411 444 return 1;
412 445 }
413   - else if(t1!='2') {
  446 + else if((t1!='2')&&(t1!='A')) {
414 447 restore_screen(current_pg_seg);
415 448 //This is not a version 2.00 file
416 449 error("World is from a more recent version of MegaZeux",0,24,
@@ -519,7 +552,10 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
519 552 under_player_id=fgetc(fp);
520 553 under_player_color=fgetc(fp);
521 554 under_player_param=fgetc(fp);
522   - t2=fgetc(fp);
  555 + //Again, it's fixed so that it will read the whole integer
  556 +
  557 + // t2=fgetc(fp);
  558 + fread(&t2, sizeof(int), 1, fp);
523 559 for(t1=0;t1<t2;t1++)
524 560 fread(&counters[t1],1,sizeof(Counter),fp);
525 561 if(t1<NUM_COUNTERS)
1  saveload.h
@@ -3,6 +3,7 @@
3 3 *
4 4 * Copyright (C) 1996 Greg Janson
5 5 * Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
  6 + * Copyright (C) 1999 Charles Goetzman
6 7 *
7 8 * This program is free software; you can redistribute it and/or
8 9 * modify it under the terms of the GNU General Public License as

0 comments on commit 5e7c79b

Please sign in to comment.
Something went wrong with that request. Please try again.