Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MegaZeux 2.51s1 release.

  • Loading branch information...
commit 5e7c79be2b87fd0d764256bfda9378d8ced244cd 1 parent fbb5992
ajs1984 authored
46 README.1ST
View
@@ -0,0 +1,46 @@
+
+IMPORNAT NOTICE:
+ PLEASE READ THIS FILE BEFORE TRYING TO USE MZX 2.51S1b! YOU ALREADY DID,
+ DIDN'T YOU? YOU RAN THE PROGRAM AND IT DIDN'T WORK AND NOW YOU'RE ALL
+ UPSET AND YOU THINK IT'S OUR FAULT, DON'T YOU? HA HA HA! SEE IF I HELP
+ YOU OUT! I'M GUESSING THE SOUND DOESN'T WORK, RIGHT? TOO BAD! MAYBE
+ YOU SHOULD HAVE READ THIS FILE EARLIER, THAT'S WHY IT'S NAMED README.1ST!
+
+ Okay, This is sort of a betaish release, in the sense that I'm pretty sure
+ everything works right, but you never know :) It's also the first release
+ since I plan on adding more improvements over time. So even if everything
+ works perfectly, I still get to call it a beta since it's not really done.
+
+ First big thing is that this software is protected by the General Public
+ License, a copy of which has been included for your convenience.
+
+ Second big thing is that as of right now, you must have MZX 2.51 installed
+ on your system. This is because I haven't included all the various support
+ files that MegaZeux needs. In light of this, you MUST copy the included
+ .EXE file into your normal MegaZeux directory, if you don't, your sound
+ will not function, and the help files will be missing, and other nasty
+ things.
+
+ In accordance with the General Public License, the source code for
+ MZX 2.51S1 is available, and you are free to use/modify it under the
+ terms set forth in the General Public License. The source code should be
+ available wherever you got this binary package, if not, you should always
+ be able to obtain the source at:
+ http://www.execpc.com/~tgoetzma/
+ Barring server failures or me changing ISPs or something :)
+
+ Changes are outlined in whatsnew.251. If you find a major bug in the
+ program, please email me at the address below. But ONLY for bugs (or
+ perhaps cash donations, complements, etc...:) PLEASE DO NOT EMAIL me
+ with questions on how to use the new stuff, or amazing ideas that you
+ have for MZX 2.51S2. I may or may not release some more detailed info
+ on using MZX 2.51Sx, or perhaps some kind of FAQ. Keep an eye on any
+ zeux.org or some other popular mzx news page.
+
+ I guess that's it...Enjoy!
+
+ Charles Goetzman
+ tgoetzma@execpc.com
+
+
+
22 WHATSNEW.251
View
@@ -1,4 +1,26 @@
+2.51S1 release:
+
+
++ Increased counters to 1000.
++ Added following counters: (ro) is read only, (r&w) is read + write
+(r&w) MOUSEX, MOUSEY - Location of mouse cursor over the screen.
+(ro) BUTTONS - Status of the buttons (none=0,left=1,right=2,both=3)
+(ro) MBOARDX, MBOARDy - Location of mouse cursor over the board.
+(ro) SCROLLEDX, SCROLLEDY - Length the screen has been scrolled in each direction.
+(ro) PLAYERX, PLAYERY - Location of the player
+(r&w) CURSORSTATE - Turns on & off the hardware cursor (0= off, 1= on, 0 default)
+
++ Added new independant counter like LOOPCOUNT, named LOCAL, it's now possible
+ for a robot to search the screen or something without wasting a counter.
+* New .MZX and .SAV formats for MZX2.51S1.
+* .SAV files from 2.51S1 are incompatible with 2.51, and vice-versa
+* 2.51S1 is capable of loading 2.51 .MZX world files.
+* 2.51 is not capable of loading .MZX files created or opened & saved in 2.51S1
+
+
+
+
2.51 release: (quick bug-fix release while working on 3.00)
* NOTE: I HAVE decided to release a 3.00 version of MegaZeux using
3  boardmem.cpp
View
@@ -64,6 +64,7 @@ char allocate_board_space(long size,unsigned char id,char conv_mem_ok) {
return 0;
}
//Nope.. try conventional
+ // SPIDER'S NOTE: WILL NOT USE CONVENTIONAL, DISABLED
if(conv_mem_ok) {
board_offsets[id].mem=(unsigned char *)farmalloc(size);
if(board_offsets[id].mem) {
@@ -82,7 +83,7 @@ char allocate_board_space(long size,unsigned char id,char conv_mem_ok) {
return 0;
}
}
- //Nope.. try disk
+ //Nope.. try disk
//Make temporary filename
str_cpy(&board_filenames[id*FILENAME_SIZE],"~MZTMPXXXXXX");
mktemp(&board_filenames[id*FILENAME_SIZE]);
9 const.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -20,7 +21,6 @@
*/
/* Constants */
-
#ifndef __CONST_H
#define __CONST_H
@@ -89,9 +89,10 @@
//"SIZE" includes terminating \0
#define PATHNAME_SIZE 129
#define FILENAME_SIZE 13
-#define NUM_BOARDS 150
+#define NUM_BOARDS 150 //Haven't increased this yet, over 255 causes mzx to crash on load
+ //Each board requires considerable amount of conventional mem Spid
#define BOARD_NAME_SIZE 25
-#define COUNTER_NAME_SIZE 15
+#define COUNTER_NAME_SIZE 15 //Possibly decrease counter name size to gain conventional mem? Spid
#define NUM_KEYS 16
//Where something is in memory (CURRENT means it is in special variables for
@@ -144,7 +145,7 @@
#define NUM_ROBOTS 200
#define NUM_SCROLLS 50
#define NUM_SENSORS 20
-#define NUM_COUNTERS 59
+#define NUM_COUNTERS 1020 // This is a decent # for now. Spid
#define NUM_STATUS_CNTRS 6
//The first n counters are reserved for internal use (GEMS, etc)
#define RESERVED_COUNTERS 9
86 counter.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -25,13 +26,19 @@
#include "runrobot.h"
#include "idarray.h"
#include "data.h"
+// #include <math.h> // Meant for a hypot func to find actual distance, doesnt' work. Spid
#include "const.h"
#include "string.h"
#include "struct.h"
#include <stdlib.h>
#include "counter.h"
+#include "mouse.h"
+#include "game.h"
+#include "game2.h"
-int player_restart_x=0,player_restart_y=0;
+
+int player_restart_x=0,player_restart_y=0,gridxsize=1,gridysize=1;
+int myscrolledx=0,myscrolledy=0;
char was_zapped=0;
extern char mid_prefix;
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,
int get_counter(char far *name,unsigned char id) {
int t1;
if(!str_cmp(name,"LOOPCOUNT")) return robots[id].loop_count;
+ if(!str_cmp(name,"LOCAL")) return robots[id].blank; //Found this, no idea if it works Spid
//Now search counter structs
for(t1=0;t1<NUM_COUNTERS;t1++)
if(!str_cmp(name,counters[t1].counter_name)) break;
@@ -49,6 +57,10 @@ int get_counter(char far *name,unsigned char id) {
if(!str_cmp(name,"BULLETTYPE")) return robots[id].bullet_type;
if(!str_cmp(name,"PLAYERDIST"))
return abs(robots[id].xpos-player_x)+abs(robots[id].ypos-player_y);
+ // if(!str_cmp(name,"PLADIST"))
+ // return 34;
+ // return sqrtl((abs(robots[id].xpos-player_x) * abs(robots[id].xpos-player_x)) +
+ // (abs(robots[id].ypos-player_y) * abs(robots[id].ypos-player_y)));
if(!str_cmp(name,"HORIZPLD"))
return abs(robots[id].xpos-player_x);
if(!str_cmp(name,"VERTPLD"))
@@ -71,9 +83,36 @@ int get_counter(char far *name,unsigned char id) {
if(!str_cmp(name,"TIMERESET")) return time_limit;
if(!str_cmp(name,"PLAYERFACEDIR")) return player_last_dir>>4;
if(!str_cmp(name,"PLAYERLASTDIR")) return player_last_dir&15;
+ // Mouse info Spid
+ if(!str_cmp(name,"MOUSEX")) return mousex;
+ if(!str_cmp(name,"MOUSEY")) return mousey;
+ if(!str_cmp(name,"BUTTONS")) return mybutton;
+ // scroll_x and scroll_y never work, always return 0. Spid
+ if(!str_cmp(name,"SCROLLEDX")) {
+ calculate_xytop(myscrolledx,myscrolledy);
+ return myscrolledx;
+ }
+ if(!str_cmp(name,"SCROLLEDY")) {
+ calculate_xytop(myscrolledx,myscrolledy);
+ return myscrolledy;
+ }
+ // Player position Spid
+ if(!str_cmp(name,"PLAYERX")) return player_x;
+ if(!str_cmp(name,"PLAYERY")) return player_y;
+ // This WILL be position over the game board, once scroll_ works. Spid
+ if(!str_cmp(name,"MBOARDX")) {
+ calculate_xytop(myscrolledx,myscrolledy);
+ return (mousex + myscrolledx - viewport_x);
+ }
+ if(!str_cmp(name,"MBOARDY")) {
+ calculate_xytop(myscrolledx,myscrolledy);
+ return (mousey + myscrolledy - viewport_y);
+ }
+ // viewport_x viewport_y
return 0;//Not found
}
+
//Sets the value of a counter. Include robot id if a robot is running.
void set_counter(char far *name,int value,unsigned char id) {
int t1;
@@ -82,12 +121,57 @@ void set_counter(char far *name,int value,unsigned char id) {
robots[id].loop_count=value;
return;
}
+ if(!str_cmp(name,"LOCAL")) {
+ robots[id].blank=value;
+ return;
+ }
if(!str_cmp(name,"BULLETTYPE")) {
if(value>2) value=2;
robots[id].bullet_type=value;
return;
}
//Next, check for global, non-standard counters
+
+ // SHOULD allow instant scrolling of screen, once scroll_x can be referenced
+ // As of yet, doesn't work. Spid
+ if(!str_cmp(name,"SCROLLEDX")) {
+ scroll_x= value;
+ return;
+ }
+ if(!str_cmp(name,"SCROLLEDY")) {
+ scroll_y= value;
+ return;
+ }
+/* // These Grids will be used for mouse buttons, once that is in. Spid
+ if(!str_cmp(name,"GRIDXSIZE")) {
+ gridxsize=value;
+ return;
+ }
+ if(!str_cmp(name,"GRIDYSIZE")) {
+ gridysize=value;
+ return;
+ }
+*/ // Shows or hides the hardware cursor Spid
+ if(!str_cmp(name,"CURSORSTATE")) {
+ if (value==1) m_show();
+ if (value==0) m_hide();
+ } //Don't return! We need to set the counter, as well.
+ // CURSORSTATE is referenced in GAME.CPP
+ // This should PROBABLY be a variable, instead of a counter,
+ // but I DID have a reason for using a counter, if I ever
+ // remember it. Spid
+ if(!str_cmp(name,"MOUSEX")) {
+ if(value>79) value=79;
+ if(value<0) value=0;
+ m_move(value,mousey);
+ return;
+ }
+ if(!str_cmp(name,"MOUSEY")) {
+ if(value>24) value=24;
+ if(value<0) value=0;
+ m_move(mousex,value);
+ return;
+ }
if(!str_cmp(name,"INPUT")) {
num_input=value;
return;
1  counter.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
5 data.h
View
@@ -128,8 +128,9 @@ extern unsigned char pl_saved_board[8];
extern unsigned char edge_color;//Global
extern unsigned char scroll_color;//Global, not saved
extern unsigned char lazwall_start;//Local
-extern int scroll_x;//Local
-extern int scroll_y;//Local
+extern int scroll_x;//Local // Something is SERIOUSLY wrong with these two, counter.cpp
+extern int scroll_y;//Local // can't even see them! Spid
+
extern unsigned int locked_x;//Local (-1 or 65535 for none)
extern unsigned int locked_y;//Local (-1 or 65535 for none)
extern unsigned char protection_method;
79 game.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -19,6 +20,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+// I added a bunch of stuff here. Whenever a window is popped up, the mouse
+// cursor is re-activated, and then CURSORSTATE is checked upon closing the
+// window. If it's 1, the cursor is left on, otherwise it's hidden as normal.
+// You can find all instances by searching for CURSORSTATE. Spid
+
+
/* Main title screen/gaming code */
#include <dos.h>
@@ -96,6 +104,7 @@ int target_y=-1;//Or id of entrance
int target_d_id=-1;//For RESTORE/EXCHANGE PLAYER POSITION with DUPLICATION.
int target_d_color=-1;//For RESTORE/EXCHANGE PLAYER POSITION with DUPLICATION.
+
char pal_update=0;//Whether to update a palette from robot activity
void title_screen(void) {
@@ -149,6 +158,9 @@ void title_screen(void) {
do {
//Update
if(update(0,fadein)) continue;
+ // Update stupid variables
+ // mynewx= scroll_x;
+ // mynewy= scroll_y;
//Keycheck
if(keywaiting()) {
//Get key...
@@ -281,7 +293,6 @@ void title_screen(void) {
m_hide();
break;
case 13://Enter
- case MOUSE_EVENT://Mouse
//Menu
//19x9
save_screen(current_pg_seg);
@@ -305,7 +316,7 @@ void title_screen(void) {
(mouse_event.cy<8)||(mouse_event.cy>17)) key=0;
else key=main_menu_keys[mouse_event.cy-8];
}
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
restore_screen(current_pg_seg);
goto process_key;
case 27://ESC
@@ -318,7 +329,7 @@ void title_screen(void) {
}
if(confirm("Quit to DOS- Are you sure?")) key=0;
if(t1) insta_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
case 'L'://L
case -61://F3
@@ -334,7 +345,7 @@ void title_screen(void) {
if(t1) insta_fadeout();
break;
}
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
//Load world curr_file
vquick_fadeout();
end_mod();
@@ -353,7 +364,13 @@ void title_screen(void) {
fadein=1;
dead=0;
menu_mesg:
+#ifdef UNREG
+ set_mesg("** UNREGISTERED ** Press F1 for help, Enter for menu");
+#elif defined(BETA)
+ set_mesg("** BETA ** Press F1 for help, Enter for menu");
+#else
set_mesg("- Press F1 for help, Enter for menu -");
+#endif
break;
case 'R'://R
case -62://F4
@@ -373,7 +390,7 @@ void title_screen(void) {
fadein=0;
if(load_world(temp,0,1,&fadein)) {
vquick_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
switch_keyb_table(1);
clear_world();
return;
@@ -388,11 +405,11 @@ void title_screen(void) {
dead=0;
vquick_fadeout();
fadein^=1;
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
goto gameplay;
}
if(t1) insta_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
case 'P'://P
case -63://F5
@@ -402,7 +419,7 @@ void title_screen(void) {
m_show();
error("You can only play this game via a swap from another game",
0,24,current_pg_seg,0x3101);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
}
//Load world curr_file
@@ -467,7 +484,7 @@ void title_screen(void) {
fadein=0;
if(load_world(curr_sav,0,1,&fadein)) {
vquick_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
clear_world();
fadein=1;
break;
@@ -480,7 +497,7 @@ void title_screen(void) {
dead=0;
vquick_fadeout();
fadein^=1;
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
goto gameplay;
}
}
@@ -492,6 +509,9 @@ void title_screen(void) {
}
void draw_viewport(void) {
+ // Sneak this biotch in here
+ //mynewx= scroll_x;
+ //mynewy= scroll_y;
int t1,t2;
enter_func("draw_viewport");
//Draw the current viewport on current_pg_seg
@@ -1001,10 +1021,9 @@ void play_game(char fadein) {
game_settings();
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
case 13://Enter
- case MOUSE_EVENT://Mouse
//Menu
//19x9
save_screen(current_pg_seg);
@@ -1029,7 +1048,7 @@ void play_game(char fadein) {
(mouse_event.cy<6)||(mouse_event.cy>18)) key=0;
else key=game_menu_keys[mouse_event.cy-6];
}
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
restore_screen(current_pg_seg);
if(t1) insta_fadeout();
goto process_key;
@@ -1045,7 +1064,7 @@ void play_game(char fadein) {
if(confirm("Quit playing- Are you sure?")) key=0;
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
case -61://F3
//Save game
@@ -1068,7 +1087,7 @@ void play_game(char fadein) {
if(curr_sav[0]==0) {
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
}
add_ext(curr_sav,".SAV");
@@ -1078,7 +1097,7 @@ void play_game(char fadein) {
if(confirm("File exists- Overwrite?")) {
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
}
}
@@ -1091,7 +1110,7 @@ void play_game(char fadein) {
}
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
}
break;
case -62://F4
@@ -1112,7 +1131,7 @@ void play_game(char fadein) {
fadein=0;
if(load_world(temp,0,1,&fadein)) {
vquick_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
switch_keyb_table(1);
clear_world();
return;
@@ -1129,7 +1148,7 @@ void play_game(char fadein) {
}
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
case -63://F5
case -82://Ins
@@ -1215,7 +1234,7 @@ void play_game(char fadein) {
select_current(curr_board);
if(t1) insta_fadeout();
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
}
break;
case -68://F10
@@ -1231,7 +1250,7 @@ void play_game(char fadein) {
fadein=0;
if(load_world(curr_sav,0,1,&fadein)) {
vquick_fadeout();
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
switch_keyb_table(1);
clear_world();
return;
@@ -1245,7 +1264,7 @@ void play_game(char fadein) {
vquick_fadeout();
fadein^=1;
switch_keyb_table(0);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
break;
}
}
@@ -1459,7 +1478,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
t2=confirm("Inside the chest you find a potion. Drink it?");
if(fad) insta_fadeout();
switch_keyb_table(old_keyb);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
if(t2) {
exit_func();
return 0;
@@ -1477,7 +1496,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
t2=confirm("Inside the chest you find a ring. Wear it?");
if(fad) insta_fadeout();
switch_keyb_table(old_keyb);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
if(t2) {
exit_func();
return 0;
@@ -1812,7 +1831,7 @@ char grab_item(int x,int y,char dir) {//Dir is for transporter
switch_keyb_table(1);
m_show();
scroll_edit(param,id&1);
- m_hide();
+ if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
switch_keyb_table(old_keyb);
if(id==126) goto remove_item;
break;
@@ -1873,6 +1892,9 @@ char update(char game,char &fadein) {
unsigned int time;
static reload=0;
static slowed=0;//Flips between 0 and 1 during slow_time
+#ifdef BETA
+ static unsigned char cyc=0;//Debugging
+#endif
int tmp_x[5];
int tmp_y[5];
char tmp_str[10];
@@ -2006,6 +2028,9 @@ char update(char game,char &fadein) {
if(reload) reload--;
}
//Global robot BEFORE other stuff
+ // mynewx= scroll_x;
+ // mynewy= scroll_y;
+
run_robot(NUM_ROBOTS,-1,-1);
if(!slowed) {
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) {
draw_game_window(t1,t2,current_pg_seg);
exit_func();
}
+#ifdef BETA
+ //Debugging
+ write_hex_byte(++cyc,15,0,0,current_pg_seg);
+#endif
//Add time limit
time=get_counter("TIME");
if(time) {
2  game.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -45,6 +46,7 @@ extern int target_y;//Or id of entrance
extern int target_d_id;
extern int target_d_color;
+
extern char pal_update;
#ifdef __cplusplus
6 getkey.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -56,11 +57,12 @@ int getkey(void) {
acknowledge_mouse();
return 0;
}
- //Turn right button into ESC
+ //Turn right button into ESC (Not anymore! Spid)
if(mouse_event.buttonstat&RIGHTBPRESS) {
acknowledge_mouse();
- return 27;
+ return 0; // WAS 27. Spid
}
+
if(auto_pop_mouse_events) acknowledge_mouse();
return MOUSE_EVENT;
}
1  getkey.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
71 main.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* 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;
jmp_buf exit_jump;//Used in error function and nowhere else
extern unsigned int Addr,IRQ,DMA;//Sound card parameters (-1=detect)
-char exit_mesg[]=
-"MegaZeux 2.51\n\n"
-" Copyright (C) 1996 Greg Janson\n"
-" Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net\n\n"
-" This program is free software; you can redistribute it and/or\n"
-" modify it under the terms of the GNU General Public License as\n"
-" published by the Free Software Foundation; either version 2 of\n"
-" the License, or (at your option) any later version.\n\n"
-" This program is distributed in the hope that it will be useful,\n"
-" but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
-" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
-" General Public License for more details.\n\n"
-" You should have received a copy of the GNU General Public License\n"
-" along with this program; if not, write to the Free Software\n"
-" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n\n$";
+#ifdef UNREG
+char *unreg_exit_mesg =
+"Thank you for playing MegaZeux! If you enjoy MegaZeux, you should register it.\n"
+"Registration gets you the remaining three games in the Zeux series and pays\n"
+"for the actual MegaZeux program. When you register, you tell us that you enjoy\n"
+"getting such intellegent games at low costs. To register, send 15 dollars, plus\n"
+"2 for shipping/handling (3 outside the US) to:\n\n"
+"\tSoftware Visions\n"
+"\t4875 Sunset Ave.\n"
+"\tLa Crescenta, CA 91214\n\n"
+"Make checks and money orders payable to Gregory Janson. Include a copy of our\n"
+"order form, or a note stating your name and address and the desired product.\n\n"
+"Remember to read CONTEST.TXT about a world design contest!\n\n"
+"See README.TXT if you are having problems with EMS, memory, or bugs/support.\n"
+"See the Frequently Asked Questions section of MEGAZEUX.DOC if you have a\n"
+"problem, before contacting Software Visions.\n\n$";
+#else
+char *reg_exit_mesg =
+"Thank you for registering MegaZeux.\n\n"
+"Remember to read CONTEST.TXT about a world design contest!\n\n"
+"See README.TXT if you are having problems with EMS, memory, or bugs/support.\n"
+"See the Frequently Asked Questions section of MEGAZEUX.DOC if you have a\n"
+"problem, before contacting Software Visions.\n\n"
+" \n\n"
+" MZX2.51S1 improvements by Charles Goetzman \n\n$";
+
+#endif
+
#pragma warn -par
int main(int argc,char **argv) {
//Temp var for number->string conversion
@@ -142,7 +156,16 @@ int main(int argc,char **argv) {
draw_window_box(2,1,77,3,0xB800,120,127,113,0);
draw_window_box(2,4,77,16,0xB800,120,127,113,0);
draw_window_box(2,17,77,23,0xB800,120,127,113,0);
- write_string("MegaZeux version 2.51",28,2,127,0xB800);
+ write_string("MegaZeux version 2.51S1",27,2,127,0xB800);
+// #ifdef BETA
+ write_string("BETA- PLEASE DISTRIBUTE",27,17,127,0xB800);
+// #endif
+#ifdef GAMMA
+ write_string("GAMMA- MAY CONTAIN BUGS",27,17,127,0xB800);
+#endif
+#ifdef UNREG
+ write_string("Unregistered Evaluation Copy",25,0,122,0xB800);
+#endif
write_string("Graphics card:",4,18,122,0xB800);
write_string("Processor:",8,19,122,0xB800);
write_string("EMS available:",4,20,122,0xB800);
@@ -253,11 +276,11 @@ int main(int argc,char **argv) {
install_i09();
installceh();
- //Write up free memory (below 200 shown as bad)
+ //Write up free memory (below 100 shown as bad)
itoa(t1=(int)(farcoreleft()>>10),temp,10);
temp[str_len(temp)+1]=0;
temp[str_len(temp)]='k';
- if(t1>=150) write_string(temp,19,21,121,0xB800);
+ if(t1>=100) write_string(temp,19,21,121,0xB800);
else write_string(temp,19,21,124,0xB800);
//Give error message if appropriate (including if free Kb below 20)
if((errors)||(t1<20)) {
@@ -461,9 +484,15 @@ int main(int argc,char **argv) {
cursor_underline();
asm push ds
- asm mov dx,OFFSET exit_mesg
- asm mov ax,SEG exit_mesg
- asm mov ds,ax
+#ifdef UNREG
+ asm mov dx,SEG unreg_exit_mesg
+ asm mov ds,dx
+ asm lds dx,ds:unreg_exit_mesg
+#else
+ asm mov dx,SEG reg_exit_mesg
+ asm mov ds,dx
+ asm lds dx,ds:reg_exit_mesg
+#endif
asm mov ah,9
asm int 21h
asm pop ds
1  main.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
4 mouse.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -32,7 +33,7 @@ char mousehidden=0;//Is the mouse hidden? (Additive)
unsigned int mouseinstalled=0;//Is the mouse installed?
char driver_activated=0;//Is our driver installed?
-volatile int mousex,mousey;//Character position of mouse
+volatile int mousex,mousey,mybutton;//Character position of mouse
volatile int mbufin=0,mbufout=0;//Mouse buffer pointers
char mousefreeze=0;//Is mouse frozen in place?
mouse_info_rec mbuf[MOUSE_BUFFERSIZE];//Mouse event buffer
@@ -72,6 +73,7 @@ static void far mousehandler(void) {
asm {
mov mousex, cx
mov mousey, dx
+ mov mybutton, bx //Gotta snag the mouse buttons now too. Spid
}
mousex>>=3;//Characters are 8 pixels wide
3  mouse.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -53,7 +54,7 @@ typedef struct mouse_info_rec mouse_info_rec;
extern char mousehidden;
extern unsigned int mouseinstalled;
extern char driver_activated;
-extern volatile int mousex,mousey;
+extern volatile int mousex,mousey,mybutton;
extern int mouse_count;
//Initialize the mouse routines
6 mtype.h
View
@@ -0,0 +1,6 @@
+typedef char byte; // signed one byte
+typedef unsigned char ubyte; // unsigned one byte
+typedef short word; // signed two bytes
+typedef unsigned short uword; // unsigned two bytes
+typedef long dword; // signed four bytes
+typedef unsigned long udword; // unsigned four bytes
50 saveload.cpp
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -20,6 +21,25 @@
*/
// Saving/loading worlds- dialogs and functions
+// *** READ THIS!!!! ****
+/* New naming conventions:
+ .MZX files:
+ MZX - Ver 1.x MegaZeux
+ MZ2 - Ver 2.x MegaZeux
+ MZA - Ver 2.51S1+ Megazeux, may change to MZB,MZC, up in letters etc.. if neccesary
+
+ .SAV files:
+ MZSV2 - Ver 2.x MegaZeux
+ MZXSA - Ver 2.51S1+ MegaZeux, again, may change if necessary
+
+ All others are unchanged.
+
+*/
+
+
+
+
+
#include "helpsys.h"
#include "sfx.h"
@@ -99,7 +119,7 @@ void save_world(char far *file,char savegame,char faded) {
save_screen(current_pg_seg);
meter("Saving...",current_pg_seg,meter_curr,meter_target);
if(savegame) {
- fwrite("MZSV2",1,6,fp);
+ fwrite("MZXSA",1,6,fp);
fputc(curr_board,fp);
xor=0;
}
@@ -109,7 +129,7 @@ void save_world(char far *file,char savegame,char faded) {
//Pw info-
write_password(fp);
//File type id-
- fwrite("MZ2",1,3,fp);
+ fwrite("MZA",1,3,fp);
//Get xor code...
xor=get_pw_xor_code();
}
@@ -211,12 +231,25 @@ void save_world(char far *file,char savegame,char faded) {
fputc(under_player_param,fp);
fputc(under_player_color,fp);
//Counters
+ // Here I took out all the old stuff + just made megazeux save all
+ // 17k of the 1000 counters, ha ha ha. Spid
+ // Actually, the above is wrong :), I just fixed it so that the fputc(t2,fp) is now a
+ // fwrite(), and it will write out the # of counters properly (thanx ment&Kev!) Spid
+
t2=0;
for(t1=0;t1<NUM_COUNTERS;t1++)
if((counters[t1].counter_value)>0) t2=t1+1;
- fputc(t2,fp);
+ // fputc(t2,fp);
+ // fprintf(fp, "%d", t2);
+ fwrite(&t2, sizeof(int), 1, fp); //THIS is the # of counters, as an int. Spid
for(t1=0;t1<t2;t1++)
fwrite(&counters[t1],1,sizeof(Counter),fp);
+
+
+
+// for (t1=0;t1<NUM_COUNTERS;t1++) //Write out every last counter Spid
+// fwrite(&counters[t1],1,sizeof(Counter),fp);
+
}
//Save space for global robot pos.
temp3=ftell(fp);
@@ -340,7 +373,7 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
meter("Loading...",current_pg_seg,meter_curr,meter_target);
if(savegame) {
fread(tempstr,1,6,fp);
- if(str_cmp(tempstr,"MZSV2")) {
+ if(str_cmp(tempstr,"MZXSA")) {
restore_screen(current_pg_seg);
error("Error loading save game",1,24,current_pg_seg,0x2101);
fclose(fp);
@@ -388,7 +421,7 @@ char load_world(char far *file,char edit,char savegame,char *faded) {
str_cpy(password,tempstr);
fclose(fp);
return 1;
- }
+ }
if(fgetc(fp)!='Z') {
restore_screen(current_pg_seg);
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) {
fclose(fp);
return 1;
}
- else if(t1!='2') {
+ else if((t1!='2')&&(t1!='A')) {
restore_screen(current_pg_seg);
//This is not a version 2.00 file
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) {
under_player_id=fgetc(fp);
under_player_color=fgetc(fp);
under_player_param=fgetc(fp);
- t2=fgetc(fp);
+ //Again, it's fixed so that it will read the whole integer
+
+ // t2=fgetc(fp);
+ fread(&t2, sizeof(int), 1, fp);
for(t1=0;t1<t2;t1++)
fread(&counters[t1],1,sizeof(Counter),fp);
if(t1<NUM_COUNTERS)
1  saveload.h
View
@@ -3,6 +3,7 @@
*
* Copyright (C) 1996 Greg Janson
* Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
+ * Copyright (C) 1999 Charles Goetzman
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
Please sign in to comment.
Something went wrong with that request. Please try again.