Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MegaZeux 2.51s3 release.

  • Loading branch information...
commit 9389bc72b589ba2dc2acbf8e1fd9bad625ce28ae 1 parent de721af
@ajs1984 authored
View
18 CHANGELOG
@@ -1,9 +1,25 @@
+2.51s3 release:
+
++ Fixed bug involving savegame name being overwritten by mod name
++ Fixed overlay transparency weirdness. Now, background of lower layer will
+ ALWAYS show through if background of overlay is 0
++ Added in kev's refresh screen support. Press alt+w on the title screen or
+ editor screen, and = in the game(don't ask, has to do with mzx's keybard
+ handler). Use this if your charset gets corrupted in windows.
++ Screen shot saving rotates file name (starts with screen0.pcx)
++ Fixed bug involving incorrect loading of max_health and others
+
2.51s2final release:
+ Deleted cpu checking code, was unnecesary and caused errors.
+ Fixed bug involving mod * settings being lost when loading
+ Should have fixed ems problems some were reporting, if not, just
- try to get more conventional memory.
+ try to get more conventional memory. Enclosed document (convmem.txt)
+ should help you.
++ Fixed a bug involving direction checking.
++ Pressing ']' at most any time will now save a screenshot to screen.pcx
++ Pressing alt+8 in the editor will set the current mod to *. Trust me.
+
2.5.1s2beta release:
View
11 README.1ST
@@ -1,6 +1,6 @@
IMPORTANT NOTICE:
- PLEASE READ THIS FILE BEFORE TRYING TO USE MZX 2.51S2! YOU ALREADY DID,
+ PLEASE READ THIS FILE BEFORE TRYING TO USE MZX 2.51S3! 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
@@ -32,6 +32,15 @@ IMPORTANT NOTICE:
except by making mzx easier to look at and nicer, read whatsnew.251 for
details
+ Also, changes from s2 to s3:
+ No more bug with the savegame name being the playing mod
+ Overlay transparentcy works now, ie, the background color of the base layer
+ will show through if the background of the overlay is 0
+ Screenshot save name rotates
+ Can refresh screen in editor or title screen with alt+w. during the game,
+ due to strangeness of code, press =. This reload shte char set in case
+ it gets corrupted by windows
+
In accordance with the GNU GPL, the full source for this program is
available. The download page of zeux.org should have the source, and any
number of other places will as well.
View
4 counter.cpp
@@ -221,11 +221,11 @@ void set_counter(char far *name,int value,unsigned char id) {
//Invinco
if(!str_cmp(name,"INVINCO")) {
if(!get_counter("INVINCO",0))
- saved_pl_color=player_color;
+ saved_pl_color=*player_color;
else if(value==0) {
clear_sfx_queue();
play_sfx(18);
- player_color=saved_pl_color;
+ *player_color=saved_pl_color;
}
}
//Now search counter structs
View
14 data.h
@@ -29,14 +29,14 @@
/* This first section is from IDPUT.ASM */
extern unsigned char id_chars[455];
-extern unsigned char id_dmg[128];
+extern unsigned char *id_dmg; /* was [128] */
extern unsigned char def_id_chars[455];
-extern unsigned char player_color;
-extern unsigned char player_char[4];
-extern unsigned char bullet_color[3];
-extern unsigned char missile_color;
-extern unsigned char bullet_char[12];
-
+extern unsigned char *player_color;
+extern unsigned char *player_char; /* was [4]*/
+extern unsigned char bullet_color[3]; /* was [3]*/
+extern unsigned char *missile_color;
+/*extern unsigned char bullet_char[12];*/
+extern unsigned char *bullet_char;
extern char refresh_mod_playing;
extern char mesg_edges;
extern unsigned int saved_mouse_x;
View
19 edit.cpp
@@ -63,7 +63,8 @@
#include "roballoc.h"
#include "saveload.h"
#include <stdio.h>
-
+#include "blink.h"
+#include "cursor.h"
/* Edit menu- (w/box ends on sides) Current menu name is highlighted. The
bottom section zooms to show a list of options for the current menu,
although all keys are available at all times. PGUP/PGDN changes menu.
@@ -124,6 +125,7 @@ End: LR corner
Home: UL corner
ESC: Cancel mode/overlay mode if active (otherwise exit)
Backspace: Delete (move left one in text)
+Alt+W: redraw screen
*/
/* Editing data */
@@ -707,6 +709,17 @@ void edit_world(void) {
sfx_edit();
changed=1;
break;
+ case -17://AltW
+ //Re-init screen
+ vga_16p_mode();
+ ega_14p_mode();
+ cursor_off();
+ blink_off();
+ ec_update_set();
+ update_palette(0);
+ changed=1;
+ update_menu=1;
+ break;
case 'F'://F
//Fill
//Just, well, fill! Fill function takes care of all
@@ -3214,8 +3227,8 @@ void edit_world(void) {
if(mod_playing[0]!=0) end_mod();
//...else new module
str_cpy(mod_playing,"*");
- changed=1;
- break;
+ changed=1;
+ break;
case -38://AltL
if(draw_mode&128) break;
//Sample
View
3  ezboard.cpp
@@ -267,6 +267,9 @@ void clear_world(char clear_curr_file) {
robots[GLOBAL_ROBOT].used=1;
//Clear all other global parameters
mem_cpy((char far *)id_chars,(char far *)def_id_chars,455);
+ bullet_color[0] = 15;
+ bullet_color[1] = 15;
+ bullet_color[2] = 15;
first_board=clear_on_exit=endgame_x=endgame_y=death_x=
death_y=only_from_swap=protection_method=password[0]=
enemy_hurt_enemy=0;
View
44 game.cpp
@@ -64,6 +64,8 @@
#include "game2.h"
#include "timer.h"
#include "scrdump.h"
+#include "blink.h"
+#include "cursor.h"
char far *main_menu= "F1/H - Help\n"
"Enter- Menu\n"
@@ -113,6 +115,7 @@ void title_screen(void) {
int key=0,t1;
FILE *fp;
char temp[FILENAME_SIZE];
+ char temp2[FILENAME_SIZE];
#ifdef PROFILE
char profiling=0;
@@ -182,6 +185,15 @@ void title_screen(void) {
case ']'://Screen .PCX dump
dump_screen("SCREEN.PCX");
break;
+ case -17://AltW
+ //Re-init screen
+ vga_16p_mode();
+ ega_14p_mode();
+ cursor_off();
+ blink_off();
+ ec_update_set();
+ update_palette(0);
+ break;
case 'E'://E
case -66://F8
//Editor
@@ -335,8 +347,8 @@ void title_screen(void) {
if(board_where[curr_board]!=W_NOWHERE)
select_current(curr_board);
else select_current(0);
- str_cpy(temp,mod_playing);
- load_mod(temp);
+ str_cpy(temp2,mod_playing);
+ load_mod(temp2);
send_robot_def(0,10);
//Copy filename
@@ -432,8 +444,8 @@ void title_screen(void) {
if(board_where[curr_board]!=W_NOWHERE)
select_current(curr_board);
else select_current(0);
- str_cpy(temp,mod_playing);
- load_mod(temp);
+ str_cpy(temp2,mod_playing);
+ load_mod(temp2);
send_robot_def(0,10);
dead=0;
@@ -560,13 +572,13 @@ void update_variables(char slowed) {
set_counter("INVINCO");
clear_sfx_queue();
play_sfx(18);
- player_color=saved_pl_color;
+ *player_color=saved_pl_color;
}
else {
//Decrease
set_counter("INVINCO",t1-1);
play_sfx(17);
- player_color=random_num()&255;
+ *player_color=random_num()&255;
}
}
//Lazerwall start- cycle 0 to 7 then -7 to -1
@@ -851,6 +863,7 @@ void play_game(char fadein) {
int t1,key;
FILE *fp;
char temp[FILENAME_SIZE];
+ char temp2[FILENAME_SIZE];
char keylbl[5]="KEY?";
enter_func("play_game");
@@ -1020,8 +1033,8 @@ void play_game(char fadein) {
if(board_where[curr_board]!=W_NOWHERE)
select_current(curr_board);
else select_current(0);
- str_cpy(temp,mod_playing);
- load_mod(temp);
+ str_cpy(temp2,mod_playing);
+ load_mod(temp2);
send_robot_def(0,10);
//Copy filename
@@ -1120,6 +1133,15 @@ void play_game(char fadein) {
if(get_counter("CURSORSTATE",0) == 0) { m_hide();}
}
break;
+ case '='://AltW
+ //Re-init screen
+ vga_16p_mode();
+ ega_14p_mode();
+ cursor_off();
+ blink_off();
+ ec_update_set();
+ update_palette(0);
+ break;
case -68://F10
//Quickload
if(cheats_active>1) break;
@@ -1143,8 +1165,8 @@ void play_game(char fadein) {
select_current(curr_board);
else select_current(0);
- str_cpy(temp,mod_playing);
- load_mod(temp);
+ str_cpy(temp2,mod_playing);
+ load_mod(temp2);
send_robot_def(0,10);
dead=0;
@@ -2015,7 +2037,7 @@ char update(char game,char &fadein) {
draw_viewport();
//Draw screen
if(!game) {
- player_color=0;
+ *player_color=0;
player_char[0]=player_char[1]=player_char[2]=player_char[3]=32;
}
//Figure out x/y of top
View
26 help.doc
@@ -34,7 +34,7 @@ $~A
>#MEGAZEUX.HLP:1st:MegaZeux Limitations
>#IFYOUFIN.HLP:1st:If You Find a Bug...
>Please:Registration Info- MegaZeux is Not Free
->#NEWINVER.HLP:1st:NEW in Version 2.51! (Changes Since Version 1.03)
+>#NEWINVER.HLP:1st:NEW in Version 2.51s3! (Changes Since Version 1.03)
$** Credits and Acknowledgments **
@@ -147,7 +147,7 @@ $~EWelcome to MegaZeux! Use the arrow keys to Scroll
$~Ethis text, and ESC when you are done reading.
$~BPress END to learn about the NEW FEATURES in
-$~BMegaZeux 2.51s2!
+$~BMegaZeux 2.51s3!
As you may already know, MegaZeux is a game system which
allows you to play almost limitless worlds in EGA graphics
@@ -181,7 +181,7 @@ ESC now to exit to the game.
>#CONTROLS.HLP:091:Controls
>#THEWORLD.HLP:1st:The World Editor
->#NEWINVER.HLP:1st:WHAT'S NEW in version 2.51s2!
+>#NEWINVER.HLP:1st:WHAT'S NEW in version 2.51s3!
#CONTROLS.HLP
:091:Controls
@@ -5895,7 +5895,7 @@ Formatting' section for more advanced programming.
#NEWINVER.HLP
:1st:NEW in Version 2.51! (Changes Since Version 1.03)
-For information on mzx s2, read readme.1st.
+For information on mzx s3, read readme.1st.
$~ENEW in version 2.51- ALL NEW music/sound code! 32-channels;
$~Ebug-free; support for stereo, 16-bit, GUS, and PAS-16;
@@ -5912,7 +5912,21 @@ Note- This is a direct translation from the file WHATSNEW.251,
included with MegaZeux. If you haven't used version 1.03 or
before, you probably won't understand much of this list.
-~E2.51s2final release:
+~E2.51s3 release:
+
+ + Fixed bug involving savegame name being overwritten by mod
+ name
+ + Fixed overlay transparency weirdness. Now, background of
+ lower layer will ALWAYS show through if background of
+ overlay is 0
+ + Added in kev's refresh screen support. Press alt+w on the
+ title screen or editor screen, and = in the game(don't ask,
+ has to do with mzx's keybard handler). Use this if your
+ charset gets corrupted in windows.
+ + Screen shot saving rotates file name(starts with screen0.pcx)
+ + Fixed bug involving incorrect loading of mzx health etc.
+
+~E2.51s3final release:
+ Fixed bug involving mod * settings being lost when loading
+ Should have fixed ems problems some were reporting, if not,
@@ -6467,5 +6481,5 @@ before, you probably won't understand much of this list.
* Robot commands- DIVIDE, MULTIPLY, MODULO.
* Different player pics per direction.
->#NEWINVER.HLP:1st:New in versions 2.01 to 2.51
+>#NEWINVER.HLP:1st:New in versions 2.01 to 2.51s3
>#MAIN.HLP:072:Table of Contents
View
1,202 idput.asm
@@ -1,1202 +0,0 @@
-; $Id$
-; MegaZeux
-;
-; Copyright (C) 1996 Greg Janson
-; Copyright (C) 1998 Matthew D. Williams - dbwilli@scsn.net
-;
-; This program is free software; you can redistribute it and/or
-; modify it under the terms of the GNU General Public License as
-; published by the Free Software Foundation; either version 2 of
-; the License, or (at your option) any later version.
-;
-; This program is distributed in the hope that it will be useful,
-; but WITHOUT ANY WARRANTY; without even the implied warranty of
-; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-; General Public License for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with this program; if not, write to the Free Software
-; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-;
-; This file contains fuctions and data for displaying boards (ids)
-;
-
-Ideal
-
-include "data.inc"
-include "const.inc"
-include "idput.inc"
-
-p186
-JUMPS
-include "model.inc"
-
-Dataseg
-
-label id_chars byte ; Table of characters for each id, a 0 means
- ; that the ID is based on the parameter.
- ; 255 means the ID is exactly the parameter.
-
- db 32,178,219,6,0,255,177,255,233,254,255,254,255,178,177,176; 0-15
- db 254,255,0,0,176,24,25,26,27,0,0,160,4,4,3,9; 16-31
- db 150,7,176,0,11,0,177,12,10,0,0,162,161,0,0,22; 32-47
- db 196,0,7,255,255,255,255,159,0,18,29,0,206,0,0,0; 48-63
- db '?',178,0,151,152,153,154,32,0,42,0,0,255,255,0,0; 64-79
- db 235,236,5,42,2,234,21,224,127,149,5,227,0,0,172,173; 80-95
- db '?',0; 96-97
- db 24 dup ('?'); 98-121
- db 0,0,0,226,232,0; 122-127
-;
-; Note: Bullets and players reference global data for characters
-;
-
-label thin_line byte ; Table of characters for thin lines. Bits:
- ; 0=Line to north
- ; 1=Line to south
- ; 2=Line to east
- ; 3=Line to west
-
- db 249,179,179,179 ; None, N, S, NS
- db 196,192,218,195 ; E, NE, SE, NSE
- db 196,217,191,180 ; W, NW, SW, NSW
- db 196,193,194,197 ; EW, NEW, SEW, NSEW
-
-label thick_line byte ; Table of characters for thick lines.
-
- db 249,186,186,186 ; None, N, S, NS
- db 205,200,201,204 ; E, NE, SE, NSE
- db 205,188,187,185 ; W, NW, SW, NSW
- db 205,202,203,206 ; EW, NEW, SEW, NSEW
-
-ice_anim db 32,252,253,255 ; Ice animation table
-
-lava_anim db 176,177,178 ; Lava animation table
-
-low_ammo db 163 ; < 10 ammunition pic
-hi_ammo db 164 ; > 9 ammunition pic
-
-lit_bomb db 171,170,169,168,167,166,165 ; Lit bomb animation
-
-energizer_glow db 1,9,3,11,15,11,3,9 ; Energizer Glow
-
-explosion_colors db 239,206,76,4 ; Explosion color table
-
-horiz_door db 196 ; Horizontal door pic
-vert_door db 179 ; Vertical door pic
-
-cw_anim db 47,196,92,179 ; CW animation table
-ccw_anim db 47,179,92,196 ; CCW animation table
-
-label open_door byte ; Table of door animation pics, use bits
- ; 1 2 4 8 and 16 of the door parameter
- ; to offset properly.
-
- db 47,47 ; Open 1/2 of type 0
- db 92,92 ; Open 1/2 of type 1
- db 92,92 ; Open 1/2 of type 2
- db 47,47 ; Open 1/2 of type 3
- db 179,196,179,196,179,196,179,196 ; Open full of all types
- db 179,196,179,196,179,196,179,196 ; Open full of all types
- db 47,47 ; Close 1/2 of type 0
- db 92,92 ; Close 1/2 of type 1
- db 92,92 ; Close 1/2 of type 2
- db 47,47 ; Close 1/2 of type 3
-
-label transport_anims byte ; Table of transporter animations
-
-trans_north db 45,94,126,94 ; North
-trans_south db 86,118,95,118 ; South
-trans_east db 93,41,62,41 ; East
-trans_west db 91,40,60,40 ; West
-trans_all db 94,62,118,60 ; All directions
-
-thick_arrow db 30,31,16,17 ; Thick arrows (pusher-style) NSEW
-thin_arrow db 24,25,26,27 ; Thin arrows (gun-style) NSEW
-
-horiz_lazer db 130,196,131,196 ; Horizontal Lazer Anim Table
-vert_lazer db 128,179,129,179 ; Vertical Lazer Anim Table
-
-fire_anim db 177,178,178,178,177,176 ; Fire animation
-fire_colors db 4,6,12,14,12,6 ; Fire colors
-
-life_anim db 155,156,157,158 ; Free life animation
-life_colors db 15,11,3,11 ; Free life colors
-
-ricochet_panels db 28,23 ; Ricochet pics
-
-mine_anim db 143,144 ; Mine animation
-
-shooting_fire_anim db 15,42 ; Shooting Fire Anim
-shooting_fire_colors db 12,14 ; Shooting Fire Colors
-
-seeker_anim db "/-\|" ; Seeker animation
-seeker_colors db 11,14,10,12 ; Seeker colors
-
-whirlpool_glow db 11,3,9,15 ; Whirlpool colors
-
-bullet_char db 145,146,147,148 ; Player
- db 145,146,147,148 ; Neutral
- db 145,146,147,148 ; Enemy
-
-player_char db 2,2,2,2 ;N S E W
-
-player_color db 27
-missile_color db 8
-bullet_color db 15 ; Player
- db 15 ; Neutral
- db 15 ; Enemy
-
-; Damage done by each id
-label id_dmg byte ; Table of damage for each id, a 0 means
- ; that the ID does no damage.
-
- db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 0-15
- db 0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0; 16-31
- db 0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0; 32-47
- db 0,0,0,0,0,0,0,0,0,0,0,10,0,10,5,5; 48-63
- db 0,0,0,0,0,0,0,0,0,0,0,10,10,0,10,10; 64-79
- db 10,0,0,10,10,10,10,10,10,10,10,10,0,0,10,10; 80-95
- db 0,0; 96-97
- db 24 dup (0); 98-121
- db 0,0,0,0,0,0; 122-127
-
-;
-; The defaults for id_chars, id_dmg, and all inbetween, so that CHANGE
-; CHAR ID can be used. (a total of 455 bytes, from ID's 0 to 454.)
-;
-
-label def_id_chars byte ;* 455 bytes *
- ; id_chars
- db 32,178,219,6,0,255,177,255,233,254,255,254,255,178,177,176; 0-15
- db 254,255,0,0,176,24,25,26,27,0,0,160,4,4,3,9; 16-31
- db 150,7,176,0,11,0,177,12,10,0,0,162,161,0,0,22; 32-47
- db 196,0,7,255,255,255,255,159,0,18,29,0,206,0,0,0; 48-63
- db '?',178,0,151,152,153,154,32,0,42,0,0,255,255,0,0; 64-79
- db 235,236,5,42,2,234,21,224,127,149,5,227,0,0,172,173; 80-95
- db '?',0; 96-97
- db 24 dup ('?'); 98-121
- db 0,0,0,226,232,0; 122-127
- ; thin_line
- db 249,179,179,179 ; None, N, S, NS
- db 196,192,218,195 ; E, NE, SE, NSE
- db 196,217,191,180 ; W, NW, SW, NSW
- db 196,193,194,197 ; EW, NEW, SEW, NSEW
- ; thick_line
- db 249,186,186,186 ; None, N, S, NS
- db 205,200,201,204 ; E, NE, SE, NSE
- db 205,188,187,185 ; W, NW, SW, NSW
- db 205,202,203,206 ; EW, NEW, SEW, NSEW
- ; ice_anim
- db 32,252,253,255 ; Ice animation table
- ; lava_anim
- db 176,177,178 ; Lava animation table
- ; low_ammo, hi_ammo
- db 163 ; < 10 ammunition pic
- db 164 ; > 9 ammunition pic
- ; lit_bomb
- db 171,170,169,168,167,166,165 ; Lit bomb animation
- ; energizer_glow
- db 1,9,3,11,15,11,3,9 ; Energizer Glow
- ; explosion_colors
- db 239,206,76,4 ; Explosion color table
- ; horiz_door, vert_door
- db 196 ; Horizontal door pic
- db 179 ; Vertical door pic
- ; cw_anim, ccw_anim
- db 47,196,92,179 ; CW animation table
- db 47,179,92,196 ; CCW animation table
- ; open_door
- db 47,47 ; Open 1/2 of type 0
- db 92,92 ; Open 1/2 of type 1
- db 92,92 ; Open 1/2 of type 2
- db 47,47 ; Open 1/2 of type 3
- db 179,196,179,196,179,196,179,196 ; Open full of all types
- db 179,196,179,196,179,196,179,196 ; Open full of all types
- db 47,47 ; Close 1/2 of type 0
- db 92,92 ; Close 1/2 of type 1
- db 92,92 ; Close 1/2 of type 2
- db 47,47 ; Close 1/2 of type 3
- ; transport_anims
- db 45,94,126,94 ; North
- db 86,118,95,118 ; South
- db 93,41,62,41 ; East
- db 91,40,60,40 ; West
- db 94,62,118,60 ; All directions
- ; thick_arrow, thin_arrow
- db 30,31,16,17 ; Thick arrows (pusher-style) NSEW
- db 24,25,26,27 ; Thin arrows (gun-style) NSEW
- ; horiz_lazer, vert_lazer
- db 130,196,131,196 ; Horizontal Lazer Anim Table
- db 128,179,129,179 ; Vertical Lazer Anim Table
- ; fire_anim, fire_colors
- db 177,178,178,178,177,176 ; Fire animation
- db 4,6,12,14,12,6 ; Fire colors
- ; life_anim, life_colors
- db 155,156,157,158 ; Free life animation
- db 15,11,3,11 ; Free life colors
- ; ricochet_panels
- db 28,23 ; Ricochet pics
- ; mine_anim
- db 143,144 ; Mine animation
- ; shooting_fire_anim, shooting_fire_colors
- db 15,42 ; Shooting Fire Anim
- db 12,14 ; Shooting Fire Colors
- ; seeker_anim, seeker_colors
- db "/-\|" ; Seeker animation
- db 11,14,10,12 ; Seeker colors
- ; whirlpool_glow
- db 11,3,9,15 ; Whirlpool colors (this ends at 306 bytes, where ver
- ; 1.02 used to end)
- ; bullet_char
- db 145,146,147,148 ; Player
- db 145,146,147,148 ; Neutral
- db 145,146,147,148 ; Enemy
- ; player_char
- db 2,2,2,2 ;N S E W
- ; player_color, missile_color, bullet_color
- db 27
- db 8
- db 15 ; Player
- db 15 ; Neutral
- db 15 ; Enemy
- ; id_dmg
- db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0; 0-15
- db 0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0; 16-31
- db 0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0; 32-47
- db 0,0,0,0,0,0,0,0,0,0,0,10,0,10,5,5; 48-63
- db 0,0,0,0,0,0,0,0,0,0,0,10,10,0,10,10; 64-79
- db 10,0,0,10,10,10,10,10,10,10,10,10,0,0,10,10; 80-95
- db 0,0; 96-97
- db 24 dup (0); 98-121
- db 0,0,0,0,0,0; 122-127
-
-Codeseg
-
-;
-;Code to place any ID/PARAM/COLOR combo in MegaZeux at any SCREEN x/y
-;
-;Note: Special color handling for: 33 (Energizer)
-; 38 (Explosion)
-; 63 (Fire)
-; 66 (Free Life)
-; 78 (Shooting Fire)
-; 79 (Seeker)
-; 126 (Scroll)
-;
-; Shows overlay if overlay mode is 1 or 2.
-;
-; Ignores overlay if bit 128 set.
-; 127 (Player) (read from global variable)
-;
-
-proc id_put
-arg x_pos:byte,y_pos:byte,array_x:word,array_y:word,ovr_x:word,ovr_y:word,vid_seg:word
-
- pusha
- push es ds
-
- mov bx,SEG level_id ; Load data segment (global)
- mov ds,bx
-
- ;
- ; Calculate offset within arrays
- ;
-
- ; Put Ypos in BX, Xpos in CX
- mov ax,[array_y]
- mov cx,[array_x]
- ; Multiply Ypos by max_bxsiz into SI
- mul [max_bxsiz]
- mov si,ax
- ; Add Xpos
- add si,cx
- ; SI holds offset
-
- ;
- ; Calculate offset within screen
- ;
-
- ; Put Ypos in BX, Xpos in AX
- mov bl,[y_pos]
- mov al,[x_pos]
- xor bh,bh
- mov ah,bh
- ; Put into DI, multiply by 80, and add X position, multiply by 2.
- mov di,bx
- shl di,2
- add di,bx
- shl di,4
- add di,ax
- add di,di
- ; Offset in DI
-
- ; Screen offset in DI, array offset in SI
- ; Check overlay mode
-
- mov ah,[ds:overlay_mode]
-
- ; Overlay mode in AH- ignore if 0/3 or bit 128 is set.
-
- test ah,3
- jpe @@no_overlay ; If both or neither set, it is 0/3
-
- test ah,128
- jnz @@no_overlay
-
- ; Save old si
-
- push si
-
- ; Overlay- Use si as offset UNLESS bit 2 set
-
- test ah,2
- jz @@normal_overlay
-
- ; Calculate offset from DL/DH
-
- ; Put Ypos in BX, Xpos in DX
-
- mov bx,[ovr_y]
- mov dx,[ovr_x]
-
- ; Multiply Ypos by max_bxsiz into SI
-
- push ax dx
- mov ax,bx
- mul [max_bxsiz]
- mov si,ax
- pop dx ax
-
- ; Add Xpos
-
- add si,dx
-
- ; Offset in SI of overlay array- load segment
-
-@@normal_overlay:
- push ds
- lds bx,[ds:overlay]
-
- ; Get code
-
- mov al,[ds:bx+si]
-
- ; Space = no overlay
-
- cmp al,32
- jne @@not_space_overlay
- pop ds
- pop si
- jmp @@no_overlay
-@@not_space_overlay:
-
- ; Code in al... load color to dh
-
- pop ds
- lds bx,[ds:overlay_color]
- mov dh,[ds:bx+si]
- pop si
-
- ; Al=char, Ah=color
-
- mov cx,[vid_seg]
- mov es,cx ; Video seg
- mov [es:di],al ; Store character
- test dh,240 ; Does current color have a background
- ; color?
- jz @@overlay_needs_bk ; Nope
-@@overlay_has_bk:
- mov [es:di+1],dh ; Yep- Store color
-
- ; Done!
-
- pop ds es
- popa
- ret
-
-@@overlay_needs_bk:
- test [overlay_mode],64
- jnz @@overlay_has_bk
-
- ; Overlay color in ah. Jump to color det. code to get background color IF
- ; we are showing non-overlay
-
- xor dh,128 ; Set bit 128 to denote special color code
- mov ax,SEG level_id
- mov ds,ax
- les bx,[ds:level_id] ; Load level_id into es:bx
- mov ah,[es:bx+si] ; Get id in AH
- les bx,[ds:level_param] ; Load level_param into es:bx
- mov dl,[es:bx+si] ; Get param in Dl
-
- ; All vars set, go do it!
-
- jmp @@do_color_from_overlay
-
- ; Calculate offset as screen, by using array offset minus
- ;
-
-@@no_overlay:
-@@overlay_all_done:
- test [overlay_mode],64
- jz @@okokok
- mov al,32
- jmp @@place_char
-@@okokok:
- ; Overlay done... screen offset in DI, array offset in SI,
-
- push ds
- les bx,[ds:level_id] ; Load level_id into es:bx
- mov al,[es:bx+si] ; Get id in AL
-
- ; Screen offset in DI, array offset in SI, id in AL
- ; Load DS:BX with address of Id_chars
-
- mov bx,SEG id_chars
- mov ds,bx
- mov bx,OFFSET id_chars
- mov ah,al ; Save ID in AH
- xlat ; AL holds character for id of AL
-
- ; Screen offset in DI, array offset in SI, id in AH, character in AL
-
- pop es
- lds bx,[es:level_param] ; Load DS:BX w/level parameters
- mov dl,[ds:bx+si]
-
- mov bx,SEG id_chars
- mov ds,bx
-
- ; Screen at DI, array offset in SI, id in AH, character in AL,
- ; parameter in DL, ES holds global data, DS holds local data.
-
- cmp al,0ffh
- je @@check_2
- cmp al,0h
- jne @@place_char
-
- ;
- ; Process al=0 (parameter-based characters)
- ;
-
- cmp ah,123
- je @@cRobot
- cmp ah,124
- je @@cRobot ; Non-pushable robot
- cmp ah,4
- je @@cLine
- cmp ah,18
- je @@cWeb
- cmp ah,19
- je @@cWeb ; Web code differentiates between thin/thick
- cmp ah,25
- je @@cIce
- cmp ah,26
- je @@cLava
- cmp ah,35
- je @@cAmmo
- cmp ah,37
- je @@cLitBomb
- cmp ah,41
- je @@cDoor
- cmp ah,45
- je @@cCw
- cmp ah,46
- je @@cCcw
- cmp ah,42
- je @@cOpenDoor
- cmp ah,49
- je @@cTransport
- cmp ah,56
- je @@cPusher
- cmp ah,59
- je @@cLazer
- cmp ah,61
- je @@cBullet
- cmp ah,62
- je @@cPusher ; Missile uses same shapes as pusher
- cmp ah,63
- je @@cFire
- cmp ah,66
- je @@cLife
- cmp ah,72
- je @@cRicochet
- cmp ah,74
- je @@cMine
- cmp ah,75
- je @@cPusher ; Spike uses same shapes as pusher
- cmp ah,78
- je @@cShootingFire
- cmp ah,79
- je @@cSeeker
- cmp ah,92
- je @@cBulletGun
- cmp ah,93
- je @@cBulletGun ; Spinning gun uses same shapes as bullet gun
- cmp ah,97
- je @@cMissileGun
- cmp ah,122
- je @@cSensor
-
- ;
- ; Must be player...
- ;
-
- xor bh,bh
- mov bl,[es:player_last_dir] ; Get direction to FACE
- shr bl,4
- mov al,[ds:player_char+bx]; Load player character
- jmp @@place_char
-
-@@cLine:
-
- ;
- ; Place line wall- Find out if other lines to n/s/e/w, then calculate
- ; proper ThickLine character to use.
- ;
-
- lds bx,[es:level_id] ; Load seg:offs of level ids
-
- xor al,al ; Clear AL to fill with "direction" bits
- sub si,[es:max_bxsiz]
- cmp [array_y],0 ; Check to see if at top of array
- je @@cLineNorth ; ADD NORTH
- cmp [BYTE PTR ds:bx+si],4 ; Check north
- jne @@cLine2
-@@cLineNorth:
- setflag al,1 ; "or" in NORTH bit
-@@cLine2:
- add si,[es:max_bxsiz]
- add si,[es:max_bxsiz]
- mov dx,[es:board_ysiz]
- dec dx
- cmp [array_y],dx ; Check to see if at bottom of array
- je @@cLineSouth ; ADD SOUTH
- cmp [BYTE PTR ds:bx+si],4 ; Check south
- jne @@cLine3
-@@cLineSouth:
- setflag al,2 ; "or" in SOUTH bit
-@@cLine3:
- sub si,[es:max_bxsiz]
- ; Check for west edge of screen
- cmp [array_x],0 ; Check for west edge
- je @@cLineWest ; ADD WEST
- cmp [BYTE PTR ds:bx-1+si],4 ; Check west
- jne @@cLine4 ; NO WEST
-@@cLineWest:
- setflag al,8 ; "or" in WEST bit
-@@cLine4:
- ; Check for east edge of screen
- mov dx,[es:board_xsiz]
- dec dx
- cmp [array_x],dx
- je @@cLineEast ; ADD EAST
- cmp [BYTE PTR ds:bx+1+si],4 ; Check east
- jne @@cLine5 ; NO EAST
-@@cLineEast:
- setflag al,4 ; "or" in EAST bit
-@@cLine5:
- ;AL contains array index into "thick_line" matrix
- mov bx,SEG thick_line
- mov ds,bx
- mov bx,OFFSET thick_line ; Load table offset
- xlat ; AL contains character!
- jmp @@place_char
-
-@@cWeb:
-
- ;
- ; Place web- Find out if any non-spaces to n/s/e/w then calculate ThinLine.
- ;
-
- lds bx,[es:level_id]
-
- xor al,al ; Clear AL to fill with "direction" bits
- sub si,[es:max_bxsiz]
- cmp [array_y],0 ; Check to see if at top of array
- je @@cWebNorth ; ADD NORTH
- cmp [BYTE PTR ds:bx+si],0 ; Check north for any non-space
- je @@cWeb2
-@@cWebNorth:
- setflag al,1 ; "or" in NORTH bit
-@@cWeb2:
- add si,[es:max_bxsiz]
- add si,[es:max_bxsiz]
- mov dx,[es:board_ysiz]
- dec dx
- cmp [array_y],dx ; Check to see if at bottom of array
- je @@cWebSouth ; ADD SOUTH
- cmp [BYTE PTR ds:bx+si],0 ; Check south for any non-space
- je @@cWeb3
-@@cWebSouth:
- setflag al,2 ; "or" in SOUTH bit
-@@cWeb3:
- sub si,[es:max_bxsiz]
- ; Check for west edge of screen
- cmp [array_x],0
- je @@cWebWest ; ADD WEST
- cmp [BYTE PTR ds:bx-1+si],0 ; Check west for any non-space (0)
- je @@cWeb4 ; NO WEST
-@@cWebWest:
- setflag al,8 ; "or" in WEST bit
-@@cWeb4:
- ; Check for east edge of screen
- mov dx,[es:board_xsiz]
- dec dx
- cmp [array_x],dx
- je @@cWebEast ; ADD EAST
- cmp [BYTE PTR ds:bx+1+si],0 ; Check east for any non-space
- je @@cWeb5 ; NO EAST
-@@cWebEast:
- setflag al,4 ; "or" in EAST bit
-@@cWeb5:
- ; AL contains array index into web matrix
- mov bx,SEG thick_line ; Reload local data segment
- mov ds,bx
- cmp ah,18 ; Check which type of web; Is it thin?
- je @@cThinWeb ; Yes
- mov bx,OFFSET thick_line ; No, load offset of thick lines
- xlat
- jmp @@place_char
-@@cThinWeb:
- mov bx,OFFSET thin_line ; Load table offset
- xlat ; AL contains character!
- jmp @@place_char
-
-@@cIce:
- mov al,dl ; Load array index
- mov bx,OFFSET ice_anim ; Load array offset
- xlat ; Load character
- jmp @@place_char
-
-@@cLava:
- mov al,dl ; Load array index
- mov bx,OFFSET lava_anim ; Load array offset
- xlat
- jmp @@place_char
-
-@@cAmmo:
- cmp dl,10 ; Check amount of ammo-
- jb @@cAmmo2 ; Is it less than 10?
- mov al,[hi_ammo] ; Nope, use high_ammo pic
- jmp @@place_char
-@@cAmmo2: ; Yep.
- mov al,[low_ammo] ; Use low_ammo pic
- jmp @@place_char
-
-@@cLitBomb:
- mov al,dl ; Load array index
- mov bx,OFFSET lit_bomb ; Load array offset
- maskflag al,15 ; Use only lower nybble
- xlat
- jmp @@place_char
-
-@@cDoor:
- testflag dl,1 ; Check bit 1
- jz @@cDoor2 ; Jump if horiz
- mov al,[vert_door] ; Nope.
- jmp @@place_char
-@@cDoor2: ; Horiz.
- mov al,[horiz_door]
- jmp @@place_char
-
-@@cCw:
- mov al,dl ; Load array index
- mov bx,OFFSET cw_anim ; Load array offset
- xlat
- jmp @@place_char
-
-@@cCcw:
- mov al,dl
- mov bx,OFFSET ccw_anim
- xlat
- jmp @@place_char
-
-@@cOpenDoor:
- mov al,dl ; Load array offset
- maskflag al,31 ; Use bits 1, 2, 4, 8, & 16
- mov bx,OFFSET open_door ; Use this cool table!
- xlat
- jmp @@place_char
-
-@@cTransport:
- mov al,dl ; Load parameter for checking
- maskflag dl,7h ; Mask out unneeded bits
- ; and check direction
- cmp dl,0 ; North?
- je @@cTransN
- cmp dl,1 ; South?
- je @@cTransS
- cmp dl,2 ; East?
- je @@cTransE
- cmp dl,3 ; West?
- je @@cTransW
- ; Nope, use "all" direction
- mov bx,OFFSET trans_all ; Load array offset,
- jmp @@cTrans2 ; Jump to common transporter code
-@@cTransN:
- mov bx,OFFSET trans_north
- jmp @@cTrans2
-@@cTransS:
- mov bx,OFFSET trans_south
- jmp @@cTrans2
-@@cTransE:
- mov bx,OFFSET trans_east
- jmp @@cTrans2
-@@cTransW:
- mov bx,OFFSET trans_west
-@@cTrans2: ; Common transporter char code
- maskflag al,24 ; Use only bits 8 & 16
- shr al,3 ; Shift to be in bits 1 & 2
- xlat ; BX already loaded; Index array!
- jmp @@place_char
-
-@@cPusher:
- mov al,dl ; Load array index
- mov bx,OFFSET thick_arrow ; Use thick_arrow table
- xlat
- jmp @@place_char
-
-@@cLazer:
- mov al,dl ; Load array index
- ; Determine orientation w/test
- testflag al,1 ; Is it horiz?
- jz @@cLazer2
- mov bx,OFFSET vert_lazer ; Nope, vertical
- jmp @@cLazer3 ; Jump to array indexing section
-@@cLazer2:
- mov bx,OFFSET horiz_lazer ; Load horiz table
-@@cLazer3: ; Array indexing section
- maskflag al,6 ; Use only bits 2 & 4
- shr al,1 ; Translate to bits 1 & 2
- xlat
- jmp @@place_char
-
-@@cBullet:
- mov al,dl
- mov bx,OFFSET bullet_char ; Param already a perfect translation
- xlat ; of direction and type.
- jmp @@place_char
-
-@@cFire:
- mov al,dl ; Load array index
- mov bx,OFFSET fire_anim ; Load table offset
- xlat
- jmp @@place_char
-
-@@cLife:
- mov al,dl ; Load array index
- mov bx,OFFSET life_anim ; Load table offset
- xlat
- jmp @@place_char
-
-@@cRicochet:
- mov al,dl ; Load array index
- mov bx,OFFSET ricochet_panels ; Load table offset
- xlat
- jmp @@place_char
-
-@@cMine:
- mov al,dl ; Load array index
- maskflag al,1 ; Use only first bit
- mov bx,OFFSET mine_anim ; Load table offset
- xlat
- jmp @@place_char
-
-@@cShootingFire:
- mov al,dl ; Load array index
- maskflag al,1 ; Use only first bit
- mov bx,OFFSET shooting_fire_anim
- xlat
- jmp @@place_char
-
-@@cSeeker:
- mov al,dl ; Load array index
- maskflag al,03h
- mov bx,OFFSET seeker_anim ; Load table offset
- xlat
- jmp @@place_char
-
-@@cBulletGun:
- mov al,dl ; Load array index
- maskflag al,24 ; Use only bits 8 & 16
- shr al,3 ; Translate to bits 1 & 2
- mov bx,OFFSET thin_arrow ; Use thin_arrow table
- xlat
- jmp @@place_char
-
-@@cMissileGun:
- mov al,dl ; Load array index
- maskflag al,24 ; Use only bits 8 & 16
- shr al,3 ; Translate to bits 1 & 2
- mov bx,OFFSET thick_arrow ; Use thick_arrow table
- xlat
- jmp @@place_char
-
-@@cSensor:
-
- ;
- ; Look up sensor #param in table and grab character
- ;
-
- mov bx,SEG sensors
- mov es,bx
- les bx,[sensors]
-
- push ax ; save ax (for ah- id)
-
- mov al,dl ; Load param
- mov ah,SENSOR_SIZE ; Load sensor size, and
- mul ah ; Multiply.
- add bx,ax ; Move into bx for offset
-
- pop ax ; restore ax
-
- add bx,15 ; Point to sensor_char location
- mov al,[es:bx] ; Load sensor character
-
- jmp @@place_char
-
-@@cRobot:
-
- ;
- ; Look up robot #param in table and grab character
- ;
-
- mov bx,SEG robots
- mov es,bx
- les bx,[robots]
-
- push ax ; save ax (for ah- id)
-
- mov al,dl ; Load param
- mov ah,ROBOT_SIZE ; Load robot size, and
- mul ah ; Multiply.
- add bx,ax ; Move into bx for offset
-
- pop ax ; restore ax
-
- add bx,19 ; Point to robot_char location
- mov al,[es:bx] ; Load robot character
-
- jmp @@place_char
-
-@@check_2:
-
- ;
- ; "char:=param" code in char byte ( FF )
- ;
-
- mov al,dl ; Yep, character is now parameter byte
-
-@@place_char:
- mov cx,[vid_seg]
- mov es,cx ; Video seg
- mov [es:di],al ; Store character
- xor dh,dh
- test [overlay_mode],64
- jz @@do_color_from_overlay
- mov ch,7
- jmp @@no_add_overlay_color
-
-@@do_color_from_overlay:
-
- ; Screen in ES:DI, array offset in SI, id in AH, AL now unused,
- ; parameter in DL, DS undefined but set to global data below
-
- ; If DH is 0, normal color code. If DH is non-zero, it already holds
- ; overlay color and is only waiting for a bk color. (bit 128 is also
- ; set, clear it first)
-
- mov bx,SEG level_color
- mov ds,bx
- les bx,[ds:level_color] ; Load seg:offs of level colors
-
- mov ch,[es:bx+si] ; Load color
-
- ;
- ; Load segments- ES for global, DS for local
- mov bx,ds
- mov es,bx
- mov bx,SEG id_chars
- mov ds,bx
-
- ;
- ; Check for special cases where color is not based on "color" value
- ;
-
- cmp ah,67 ; Check for 67-70 (whirlpool) first
- jb @@no_wp
- cmp ah,70
- jbe @@color_whirlpool
-@@no_wp:
- cmp ah,33
- je @@color_energizer
- cmp ah,38
- je @@color_explosion
- cmp ah,63
- je @@color_fire
- cmp ah,66
- je @@color_life
- cmp ah,78
- je @@color_shooting_fire
- cmp ah,79
- je @@color_seeker
- cmp ah,126
- je @@color_scroll
- cmp ah,127
- jne @@normal_color
-
- ; Color_player
-
- mov al,[ds:player_color]
- jmp @@spec_color_bk_and_fg
-
-@@color_energizer:
-
- mov al,dl ; Load parameter for array index
- mov bx,OFFSET energizer_glow
- xlat ; Index into energizerGlow[] (near data)
- jmp @@end_spec_color ; Go to keep the orig. background color
-
-@@color_explosion:
-
- mov al,dl ; Load parameter for array index
- maskflag al,0fh ; and limit to first 4 bits
- mov bx,OFFSET explosion_colors
- xlat
- jmp @@spec_color_bk_and_fg
-
-@@color_fire:
-
- mov al,dl ; Load array index
- mov bx,OFFSET fire_colors
- xlat
- jmp @@end_spec_color
-
-@@color_whirlpool:
-
- mov al,ah ; Copy id
- sub al,67 ; Convert id of 67-70 to array offset of 0-3
- mov bx,OFFSET whirlpool_glow
- xlat
- jmp @@end_spec_color
-
-@@color_life:
-
- mov al,dl
- mov bx,OFFSET life_colors
- xlat
- jmp @@end_spec_color
-
-@@color_shooting_fire:
-
- mov al,dl
- maskflag al,1
- mov bx,OFFSET shooting_fire_colors
- xlat
- jmp @@end_spec_color
-
-@@color_seeker:
-
- mov al,dl
- maskflag al,03h
- mov bx,OFFSET seeker_colors
- xlat
- jmp @@end_spec_color
-
-@@color_scroll:
-
- mov al,[ds:scroll_color]
-
-@@end_spec_color:
- ; Color is in al; copy to FOREGROUND portion of ch
- ; Copy bk if non 0, also
- test al,0f0h
- jz @@spec_color_fg_only
-
- ; Copy fg AND bk
-@@spec_color_bk_and_fg:
- mov ch,al
- jmp @@normal_color
-
-@@spec_color_fg_only:
- maskflag al,0fh ; Mask for foreground only
- maskflag ch,0f0h ; Mask for background only
- or ch,al ; Add together
-
-@@normal_color:
- les bx,[es:level_under_color] ; Load seg:offs of level under colors
- mov cl,[es:bx+si] ; Load under color
-
- ; Screen offset in DI, array offset in SI, id in AH,
- ; under color in CL, color in CH, parameter in DL
-
- cmp ch,0fh ; Check for whether color has a background
- ja @@no_add_bk ; Yep! Already has a background color
- ; Nope, add in bk from under color
- maskflag cl,0f0h
- add ch,cl
-
-@@no_add_bk:
-
- ; Check- add overlay color?
- or dh,dh
- jz @@no_add_overlay_color
- ; Replace foreground with overlay foreground (remembering to reset bit
- ; 128 of overlay color in DH first)
- xor dh,128
- and ch,240
- add ch,dh
-
-@@no_add_overlay_color:
- mov bx,[vid_seg]
- mov es,bx ; Video Segment
- mov [es:di+1],ch ; Store in color memory
-
- pop ds es
- popa
- ret
-
-endp id_put
-
-;
-; Draw edit window according to global variables; Size is 80x19 or VIRTUAL
-; SIZE, whichever is smaller, drawn at 0/0.
-; Top left corner is indexed into array according to parameters.
-;
-
-proc draw_edit_window far
-arg array_x:word,array_y:word,vid_seg:word
-
- push ax bx cx dx di si ds
-
- ; Load global data seg
- mov bx,SEG board_xsiz
- mov ds,bx
-
- ; Determine x size (in bl) and y size (in bh)
-
- mov cx,[board_xsiz]
- cmp cx,80
- jb @@use_virt_xs ; Size is below 80; use it.
- mov cx,80 ; Use size of 80
-@@use_virt_xs:
- mov dx,[board_ysiz]
- cmp dx,19
- jb @@use_virt_ys ; Size is below 19; use it.
- mov dx,19 ; Use size of 19
-@@use_virt_ys:
-
- mov si,[array_x] ; Load starting array position
- mov di,[array_y]
- xor ax,ax ; Load starting screen position (0/0)
- xor bx,bx
-
- ; AX=screen pos
- ; BX=x/y count
- ; SI=array x
- ; DI=array y
- ; CX=array x max
- ; DX=array y max
-
-@@e_draw_loop1:
-
- push ax bx ds
- mov bl,ah
- xor ah,ah
- mov bh,ah
- call id_put,ax,bx,si,di,si,di,[vid_seg]; Print ID
- pop ds bx ax
-
- inc al ; One to right
- inc si
- inc bl ; Increase width count
- cmp bl,cl
- jb @@e_draw_loop1
- xor bl,bl ; Reset width count
- xor al,al ; Reset screen X
- mov si,[array_x] ; and array X
- inc ah ; One down
- inc di
- inc bh ; Increase height count
- cmp bh,dl
- jb @@e_draw_loop1
-
- ; Done
-
- pop ds si di dx cx bx ax
- ret
-
-endp draw_edit_window
-
-;
-; Draw game window according to global variables; Doesn't draw edge lines.
-; Top left corner is indexed into array according to parameters.
-;
-
-proc draw_game_window far
-arg array_x:word,array_y:word,vid_seg:word
-
- push ax bx cx dx si di ds
-
- ; Load global data seg
- mov bx,SEG board_xsiz
- mov ds,bx
-
- mov cl,[viewport_xsiz]
- mov dl,[viewport_ysiz]
-
- mov si,[array_x] ; Load starting array position
- mov di,[array_y]
- mov al,[viewport_x]
- mov ah,[viewport_y]
- xor bx,bx
-
- ; AX=screen pos
- ; BX=x/y count
- ; SI=array x
- ; DI=array y
- ; CX=count max (x)
- ; DX=count max (y)
-
-@@e_draw_loop1:
-
- push ax bx cx dx ds
- mov cl,bl
- mov dl,bh
- mov bl,ah
- xor ah,ah
- mov bh,ah
- mov ch,ah
- mov dh,ah
- call id_put,ax,bx,si,di,cx,dx,[vid_seg]; Print ID
- pop ds dx cx bx ax
-
- inc al ; One to right
- inc si
- inc bl ; Increase width count
- cmp bl,cl
- jb @@e_draw_loop1
- xor bl,bl ; Reset width count
- mov al,[viewport_x] ; Reset screen X
- mov si,[array_x] ; and array X
- inc ah ; One down
- inc di
- inc bh ; Increase height count
- cmp bh,dl
- jb @@e_draw_loop1
-
- ; Done
-
- pop ds di si dx cx bx ax
- ret
-
-endp draw_game_window
-
-ends
-
-end
-
-end
View
471 idput.cpp
@@ -0,0 +1,471 @@
+/* $Id: idput.cc,v 1.2 1999/01/17 20:35:41 mental Exp $
+ * MegaZeux
+ *
+ * Copyright (C) 1998 MenTaLguY - mentalg@geocities.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+/* edited for mzx s3 by JZig */
+
+
+#include <stdlib.h>
+#include "const.h"
+#include "graphics.h"
+#define OMIT_IDCHAR_DECLARATIONS
+#include "data.h"
+#include "idput.h"
+
+/* Unfortunately, this needs to be C++, since C doesn't consider the below
+ to be true constants */
+unsigned char id_chars[455];
+ unsigned char const *thin_line = id_chars+128;
+ unsigned char const *thick_line = thin_line+16;
+ unsigned char const *ice_anim = thick_line+16;
+ unsigned char const *lava_anim = ice_anim+4;
+ unsigned char const *low_ammo = lava_anim+3;
+ unsigned char const *hi_ammo = low_ammo+1;
+ unsigned char const *lit_bomb = hi_ammo+1;
+ unsigned char const *energizer_glow = lit_bomb+7;
+ unsigned char const *explosion_colors = energizer_glow+8;
+ unsigned char const *horiz_door = explosion_colors+4;
+ unsigned char const *vert_door = horiz_door+1;
+ unsigned char const *cw_anim = vert_door+1;
+ unsigned char const *ccw_anim = cw_anim+4;
+ unsigned char const *open_door = ccw_anim+4;
+ unsigned char const *transport_anims = open_door+32;
+ unsigned char const *trans_north = transport_anims;
+ unsigned char const *trans_south = trans_north+4;
+ unsigned char const *trans_east = trans_south+4;
+ unsigned char const *trans_west = trans_east+4;
+ unsigned char const *trans_all = trans_west+4;
+ unsigned char const *thick_arrow = transport_anims+20;
+ unsigned char const *thin_arrow = thick_arrow+4;
+ unsigned char const *horiz_lazer = thin_arrow+4;
+ unsigned char const *vert_lazer = horiz_lazer+4;
+ unsigned char const *fire_anim = vert_lazer+4;
+ unsigned char const *fire_colors = fire_anim+6;
+ unsigned char const *life_anim = fire_colors+6;
+ unsigned char const *life_colors = life_anim+4;
+ unsigned char const *ricochet_panels = life_colors+4;
+ unsigned char const *mine_anim = ricochet_panels+2;
+ unsigned char const *shooting_fire_anim = mine_anim+2;
+ unsigned char const *shooting_fire_colors = shooting_fire_anim+2;
+ unsigned char const *seeker_anim = shooting_fire_colors+2;
+ unsigned char const *seeker_colors = seeker_anim+4;
+ unsigned char const *whirlpool_glow = seeker_colors+4;
+ unsigned char *bullet_char = (unsigned char *)whirlpool_glow+4;
+ unsigned char *player_char = bullet_char+12;
+ unsigned char *player_color = player_char+4;
+ unsigned char *missile_color = player_color+1;
+ unsigned char *_bullet_color = missile_color+1;
+unsigned char *id_dmg = _bullet_color+3;
+
+unsigned char def_id_chars[455] = {
+/* id_chars */
+ 32,178,219,6,0,255,177,255,233,254,255,254,255,178,177,176, /* 0-15 */
+ 254,255,0,0,176,24,25,26,27,0,0,160,4,4,3,9, /* 16-31 */
+ 150,7,176,0,11,0,177,12,10,0,0,162,161,0,0,22, /* 32-47 */
+ 196,0,7,255,255,255,255,159,0,18,29,0,206,0,0,0, /* 48-63 */
+ '?',178,0,151,152,153,154,32,0,42,0,0,255,255,0,0, /* 64-79 */
+ 235,236,5,42,2,234,21,224,127,149,5,227,0,0,172,173, /* 80-95 */
+ '?',0, /* 96-97 */
+ '?','?','?','?','?','?','?','?', /* 98-121 */
+ '?','?','?','?','?','?','?','?',
+ '?','?','?','?','?','?','?','?',
+ 0,0,0,226,232,0, /* 122-127 */
+/* thin_line */
+ 249,179,179,179, /* None, N, S, NS */
+ 196,192,218,195, /* E, NE, SE, NSE */
+ 196,217,191,180, /* W, NW, SW, NSW */
+ 196,193,194,197, /* EW, NEW, SEW, NSEW */
+/* thick_line */
+ 249,186,186,186, /* None, N, S, NS */
+ 205,200,201,204, /* E, NE, SE, NSE */
+ 205,188,187,185, /* W, NW, SW, NSW */
+ 205,202,203,206, /* EW, NEW, SEW, NSEW */
+/* ice_anim */
+ 32,252,253,255, /* Ice animation table */
+/* lava_anim */
+ 176,177,178, /* Lava animation table */
+/* low_ammo, hi_ammo */
+ 163, /* < 10 ammunition pic */
+ 164, /* > 9 ammunition pic */
+/* lit_bomb */
+ 171,170,169,168,167,166,165, /* Lit bomb animation */
+/* energizer_glow */
+ 1,9,3,11,15,11,3,9, /* Energizer Glow */
+/* explosion_colors */
+ 239,206,76,4, /* Explosion color table */
+/* horiz_door, vert_door */
+ 196, /* Horizontal door pic */
+ 179, /* Vertical door pic */
+/* cw_anim, ccw_anim */
+ 47,196,92,179, /* CW animation table */
+ 47,179,92,196, /* CCW animation table */
+/* open_door */
+ 47,47, /* Open 1/2 of type 0 */
+ 92,92, /* Open 1/2 of type 1 */
+ 92,92, /* Open 1/2 of type 2 */
+ 47,47, /* Open 1/2 of type 3 */
+ 179,196,179,196,179,196,179,196, /* Open full of all types */
+ 179,196,179,196,179,196,179,196, /* Open full of all types */
+ 47,47, /* Close 1/2 of type 0 */
+ 92,92, /* Close 1/2 of type 1 */
+ 92,92, /* Close 1/2 of type 2 */
+ 47,47, /* Close 1/2 of type 3 */
+/* transport_anims */
+ 45,94,126,94, /* North */
+ 86,118,95,118, /* South */
+ 93,41,62,41, /* East */
+ 91,40,60,40, /* West */
+ 94,62,118,60, /* All directions */
+/* thick_arrow, thin_arrow */
+ 30,31,16,17, /* Thick arrows (pusher-style) NSEW */
+ 24,25,26,27, /* Thin arrows (gun-style) NSEW */
+/* horiz_lazer, vert_lazer */
+ 130,196,131,196, /* Horizontal Lazer Anim Table */
+ 128,179,129,179, /* Vertical Lazer Anim Table */
+/* fire_anim, fire_colors */
+ 177,178,178,178,177,176, /* Fire animation */
+ 4,6,12,14,12,6, /* Fire colors */
+/* life_anim, life_colors */
+ 155,156,157,158, /* Free life animation */
+ 15,11,3,11, /* Free life colors */
+/* ricochet_panels */
+ 28,23, /* Ricochet pics */
+/* mine_anim */
+ 143,144, /* Mine animation */
+/* shooting_fire_anim, shooting_fire_colors */
+ 15,42, /* Shooting Fire Anim */
+ 12,14, /* Shooting Fire Colors */
+/* seeker_anim, seeker_colors */
+ '/','-','\\','|', /* Seeker animation */
+ 11,14,10,12, /* Seeker colors */
+/* whirlpool_glow */
+ 11,3,9,15, /* Whirlpool colors (this ends at 306 bytes, where ver */
+ /* 1.02 used to end) */
+/* bullet_char */
+ 145,146,147,148, /* Player */
+ 145,146,147,148, /* Neutral */
+ 145,146,147,148, /* Enemy */
+/* player_char */
+ 2,2,2,2, /*N S E W */
+/* player_color, missile_color, bullet_color */
+ 27,
+ 8,
+ 15, /* Player */
+ 15, /* Neutral */
+ 15, /* Enemy */
+/* id_dmg */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0-15 */
+ 0,0,0,0,0,0,0,0,0,0,100,0,0,0,0,0, /* 16-31 */
+ 0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0, /* 32-47 */
+ 0,0,0,0,0,0,0,0,0,0,0,10,0,10,5,5, /* 48-63 */
+ 0,0,0,0,0,0,0,0,0,0,0,10,10,0,10,10, /* 64-79 */
+ 10,0,0,10,10,10,10,10,10,10,10,10,0,0,10,10, /* 80-95 */
+ 0,0, /* 96-97 */
+ 0,0,0,0,0,0,0,0, /* 98-121 */
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0 /* 122-127 */
+};
+unsigned char bullet_color[3] = {15,15,15};
+
+
+unsigned char get_special_id_char(unsigned char cell_id,
+ int offset) {
+ /* this is, unfortunately, GCC-specific */
+ int array_x, array_y;
+
+ array_x = offset % max_bxsiz;
+ array_y = offset / max_bxsiz;
+
+ switch (cell_id) {
+ case 4: goto id_line;
+ case 18:
+ case 19: goto id_web;
+ case 25: goto id_ice;
+ case 26: goto id_lava;
+ case 35: goto id_ammo;
+ case 37: goto id_litbomb;
+ case 41: goto id_door;
+ case 42: goto id_opendoor;
+ case 45: goto id_cw;
+ case 46: goto id_ccw;
+ case 49: goto id_transport;
+ case 56: goto id_pusher;
+ case 59: goto id_lazer;
+ case 61: goto id_bullet;
+ case 62: goto id_pusher; /* missile */
+ case 63: goto id_fire;
+ case 66: goto id_life;
+ case 72: goto id_ricochet;
+ case 74: goto id_mine;
+ case 75: goto id_pusher;
+ case 78: goto id_shootingfire;
+ case 79: goto id_seeker;
+ case 92:
+ case 93: goto id_bulletgun; /* spinning gun */
+ case 97: goto id_missilegun;
+ case 122: goto id_sensor;
+ case 123: goto id_robot;
+ case 124: goto id_robot; /* pushable robot */
+ case 127: goto id_player;
+ default: goto id_default;
+ }
+
+
+id_line:
+ {
+ register int bits=0;
+ unsigned char *ptr;
+ ptr = level_id+offset;
+ if ( array_y > 0 ) {
+ if ( *(ptr-max_bxsiz) == 4 ) bits = 1;
+ } else {
+ bits = 1;
+ }
+ if ( array_y < board_ysiz - 1) {
+ if ( *(ptr+max_bxsiz) == 4 ) bits |= 2;
+ } else {
+ bits |= 2;
+ }
+ if ( array_x > 0 ) {
+ if ( *(ptr-1) == 4 ) bits |= 8;
+ } else {
+ bits |= 8;
+ }
+ if ( array_x < board_xsiz - 1) {
+ if ( *(ptr+1) == 4 ) bits |= 4;
+ } else {
+ bits |= 4;
+ }
+ return thick_line[bits];
+ }
+id_web:
+ {
+ register int bits=0;
+ unsigned char *ptr;
+ ptr = level_id+offset;
+ if ( array_y > 0 ) {
+ if ( *(ptr-max_bxsiz) != 0 ) bits = 1;
+ } else {
+ bits = 1;
+ }
+ if ( array_y < board_ysiz - 1) {
+ if ( *(ptr+max_bxsiz) != 0 ) bits |= 2;
+ } else {
+ bits |= 2;
+ }
+ if ( array_x > 0 ) {
+ if ( *(ptr-1) != 0 ) bits |= 8;
+ } else {
+ bits |= 8;
+ }
+ if ( array_x < board_xsiz - 1) {
+ if ( *(ptr+1) != 0 ) bits |= 4;
+ } else {
+ bits |= 4;
+ }
+ if ( cell_id == 18 ) return thin_line[bits];
+ return thick_line[bits];
+ }
+id_ice: return ice_anim[level_param[offset]];
+id_lava: return lava_anim[level_param[offset]];
+id_ammo: return ( level_param[offset] < 10 ) ? *low_ammo : *hi_ammo;
+id_litbomb: return lit_bomb[level_param[offset]&0x0F];
+id_door: return ( level_param[offset] & 1 ) ? *vert_door : *horiz_door;
+id_cw: return cw_anim[level_param[offset]];
+id_ccw: return ccw_anim[level_param[offset]];
+id_opendoor: return open_door[level_param[offset]&0x1F];
+id_transport:
+ switch (level_param[offset]&0x07) {
+ case 0: return trans_north[(level_param[offset]>>3)&0x03];
+ case 1: return trans_south[(level_param[offset]>>3)&0x03];
+ case 2: return trans_east[(level_param[offset]>>3)&0x03];
+ case 3: return trans_west[(level_param[offset]>>3)&0x03];
+ default: return trans_all[(level_param[offset]>>3)&0x03];
+ }
+id_pusher: return thick_arrow[level_param[offset]];
+id_lazer:
+ if ( level_param[offset] & 1 ) {
+ return vert_lazer[(level_param[offset]>>1)&0x03];
+ } else {
+ return horiz_lazer[(level_param[offset]>>1)&0x03];
+ }
+id_bullet: return bullet_char[level_param[offset]];
+id_fire: return fire_anim[level_param[offset]];
+id_life: return life_anim[level_param[offset]];
+id_ricochet: return ricochet_panels[level_param[offset]];
+id_mine: return mine_anim[level_param[offset]&1];
+id_shootingfire: return shooting_fire_anim[level_param[offset]&1];
+id_seeker: return seeker_anim[level_param[offset]&0x03];
+id_bulletgun: return thin_arrow[(level_param[offset]>>3)&0x03];
+id_missilegun: return thick_arrow[(level_param[offset]>>3)&0x03];
+id_sensor: return sensors[level_param[offset]].sensor_char;
+id_robot: return robots[level_param[offset]].robot_char;
+id_player: return player_char[(player_last_dir >> 4)];
+id_default:
+ return id_chars[cell_id];
+}
+
+unsigned char get_id_char(int id_offset) {
+ unsigned char cell_id, cell_char;
+ cell_id = level_id[id_offset];
+ cell_char = id_chars[cell_id];
+ switch (cell_char) {
+ case 255: return level_param[id_offset];
+ case 0: return get_special_id_char(cell_id, id_offset);
+ default: return cell_char;
+ }
+}
+
+unsigned char get_id_color(int id_offset) {
+ unsigned char cell_id;
+ unsigned char normal_color;
+ unsigned char spec_color;
+
+ cell_id = level_id[id_offset];
+ normal_color = level_color[id_offset];
+ spec_color = 0;
+ switch (cell_id) {
+ case 33: /* energizer */
+ spec_color = energizer_glow[level_param[id_offset]];
+ break;
+ case 38: /* explosion */
+ normal_color = explosion_colors[level_param[id_offset]&0x0F];
+ goto no_spec;
+ case 63: /* fire */
+ spec_color = fire_colors[level_param[id_offset]];
+ break;
+ case 66: /* life */
+ spec_color = life_colors[level_param[id_offset]];
+ break;
+ case 67:
+ case 68:
+ case 69:
+ case 70: /* whirlpool */
+ spec_color = whirlpool_glow[cell_id-67];
+ break;
+ case 78: /* shooting fire */
+ spec_color = shooting_fire_colors[level_param[id_offset]&1];
+ break;
+ case 79: /* seeker */
+ spec_color = seeker_colors[level_param[id_offset]&0x03];
+ break;
+ case 126: /* scroll */
+ spec_color = scroll_color;
+ break;
+ case 127: /* player */
+ normal_color = *player_color;
+ default:
+ goto no_spec;
+ }
+ if (!( spec_color & 0xF0 ) ) {
+ normal_color &= 0xF0;
+ normal_color |= (spec_color & 0x0F);
+ } else {
+ normal_color = spec_color;
+ }
+no_spec:
+ if (!( normal_color & 0xF0 ) ) {
+ normal_color |= (level_under_color[id_offset] & 0xF0);
+ }
+ return normal_color;
+}
+
+void _id_put(unsigned char x_pos, unsigned char y_pos, int array_x,
+ int array_y, int ovr_x, int ovr_y, void *vid_seg)
+{
+ int array_offset, overlay_offset;
+ unsigned char c, color;
+ array_offset = array_y * max_bxsiz + array_x;
+ if ( !( overlay_mode & 128 )
+ && ( overlay_mode & 3 ) && ((overlay_mode & 3) != 3)){
+ if ( overlay_mode & 2 ) {
+ overlay_offset = ovr_y * max_bxsiz + ovr_x;
+ } else {
+ overlay_offset = array_offset;
+ }
+ c = overlay[overlay_offset];
+ color = overlay_color[overlay_offset];
+ if ( c == 32 ) {
+ c = get_id_char(array_offset);
+ color = get_id_color(array_offset);
+ } else {
+ if ( !( color & 0xF0 ) && !( overlay_mode & 64 ) ) {
+ color = ( color & 0x0F )
+ | ( get_id_color(array_offset) & 0xF0 );
+ }
+ }
+ } else {
+ c = get_id_char(array_offset);
+ color = get_id_color(array_offset);
+ }
+ draw_char(c, color, x_pos, y_pos, (unsigned int)vid_seg);
+}
+
+extern "C" void id_put(unsigned char x_pos, unsigned char y_pos, int array_x,
+ int array_y, int ovr_x, int ovr_y, int vid_seg)
+{
+ _id_put(x_pos, y_pos, array_x, array_y, ovr_x, ovr_y, (void *)vid_seg);
+}
+extern "C" void draw_edit_window(int array_x, int array_y, int vid_seg){
+ _draw_edit_window(array_x, array_y, (void *)vid_seg);
+}
+
+void _draw_edit_window(int array_x, int array_y, void *vid_seg)
+{
+ int viewport_x_size, viewport_y_size;
+ int x, y;
+ int a_x, a_y;
+ viewport_x_size = 80;
+ viewport_y_size = 19;
+ if ( board_xsiz < viewport_x_size ) viewport_x_size = board_xsiz;
+ if ( board_ysiz < viewport_y_size ) viewport_y_size = board_ysiz;
+ for ( y = 0, a_y = array_y ; y < viewport_y_size ; y++, a_y++ ) {
+ for ( x = 0, a_x = array_x ; x < viewport_x_size ; x++, a_x++ ) {
+ _id_put(x, y, a_x, a_y, a_x, a_y, vid_seg);
+ }
+ }
+}
+
+
+
+extern "C" void draw_game_window(int array_x, int array_y, int vid_seg) {
+ _draw_game_window(array_x, array_y, (void *)vid_seg);
+}
+
+void _draw_game_window(int array_x, int array_y, void *vid_seg)
+{
+ int x_limit, y_limit;
+ int x, y;
+ int a_x, a_y;
+ int o_x, o_y;
+ x_limit = viewport_xsiz;
+ y_limit = viewport_ysiz;
+ for ( y = viewport_y, a_y = array_y, o_y = 0 ;
+ o_y < y_limit ;
+ y++, a_y++, o_y++ )
+ {
+ for ( x = viewport_x, a_x = array_x, o_x = 0 ;
+ o_x < x_limit ;
+ x++, a_x++, o_x++ )
+ {
+ _id_put(x, y, a_x, a_y, o_x, o_y, vid_seg);
+ }
+ }
+
+}
View
16 idput.h
@@ -1,4 +1,4 @@
-/* $Id$
+/* $Id: idput.h,v 1.2 1999/01/17 20:35:41 mental Exp $
* MegaZeux
*
* Copyright (C) 1996 Greg Janson
@@ -29,12 +29,18 @@ extern "C" {
#endif
void id_put(unsigned char x_pos,unsigned char y_pos,
- int array_x,int array_y,int ovr_x,int ovr_y,unsigned int vid_seg);
-void draw_edit_window(int array_x,int array_y,unsigned int vid_seg);
-void draw_game_window(int array_x,int array_y,unsigned int vid_seg);
+ int array_x,int array_y,int ovr_x,int ovr_y,int vid_seg);
+void draw_edit_window(int array_x,int array_y,int vid_seg);
+void draw_game_window(int array_x,int array_y,int vid_seg);
+
+void _id_put(unsigned char x_pos,unsigned char y_pos,
+ int array_x,int array_y,int ovr_x,int ovr_y,void * vid_seg);
+void _draw_edit_window(int array_x,int array_y,void * vid_seg);
+void _draw_game_window(int array_x,int array_y,void * vid_seg);
+
#ifdef __cplusplus
}
#endif
-#endif
+#endif
View
6 idput.inc
@@ -1,6 +0,0 @@
-
-; Declarations for IDPUT.ASM
-
-global C id_put:far
-global C draw_edit_window:far
-global C draw_game_window:far
View
7 main.cpp
@@ -76,10 +76,11 @@ char *unreg_exit_mesg=
char *reg_exit_mesg=
"Thank you for registering MegaZeux.\n\n\n\r"
"Read the files megazeux.doc and readme.1st if you need help.\n\n\r"
-"Contributors to MZX2.51 version s2:\n\n\r"
+"Contributors to MZX2.51 version S3:\n\n\r"
"Charles Goetzman - mzx s1 base and misc. code\n\r"
"MenTaLguY - anti-flicker code, mouse buffering, mod \"*\"\n\r"
-"Ben Zeigler - under bug fix and getting the thing to run\n\n\r"
+"Ben Zeigler - under bug fix and getting the thing to run\n\r"
+"CapnKev - refresh screen code\n\n\r"
"Visit zeux.org for newer versions of this software\n\n\r$";
#endif
@@ -147,7 +148,7 @@ 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.51S2",27,2,127,0xB800);
+ write_string("MegaZeux version 2.51S3",27,2,127,0xB800);
// #ifdef BETA
write_string("BETA- PLEASE DISTRIBUTE",27,17,127,0xB800);
// #endif
View
222 runrobo2.cpp
<
@@ -182,46 +182,46 @@ void run_robot(int id,int x,int y) {
player_y=y;
id_place(x,y,127,0,0);
}
- }
+ }
exit_func();
return;
case 2://Wait
t1=(unsigned char)parse_param(&cmd_ptr[1],id);
if(t1==robots[id].pos_within_line) break;
- robots[id].pos_within_line++;
+ robots[id].pos_within_line++;
if(first_cmd) robots[id].status=1;
goto breaker;
case 3://Cycle
robots[id].robot_cycle=(unsigned char)parse_param(&cmd_ptr[1],id);
- done=1;
+ done=1;
break;
case 4://Go dir num
//get num
t1=(unsigned char)parse_param(&cmd_ptr[next_param(cmd_ptr,1)],id);
//Inc. pos. or break
- if(t1==robots[id].pos_within_line) break;
+ if(t1==robots[id].pos_within_line) break;
robots[id].pos_within_line++;
case 68://Go dir label
if(id==NUM_ROBOTS) break;
//Parse dir
- t1=parsedir(cmd_ptr[2],x,y,robots[id].walk_dir);
+ t1=parsedir(cmd_ptr[2],x,y,robots[id].walk_dir);
t1--;
if((t1<0)||(t1>3)) break;
t2=_move(x,y,t1,1|2|8|16|4*robots[id].can_lavawalk);
if((t2>0)&&(cmd==68)) {
//blocked- send to label
- send_robot_id(id,tr_msg(&cmd_ptr[next_param(cmd_ptr,1)+1],id),1);
+ send_robot_id(id,tr_msg(&cmd_ptr[next_param(cmd_ptr,1)+1],id),1);
gotoed=1;
break;
}
move_dir(x,y,t1);
- if(cmd==68) {
+ if(cmd==68) {
//not blocked- make sure only moves once!
done=1;
break;
}
goto breaker;
- case 5://Walk dir
+ case 5://Walk dir
if(id==NUM_ROBOTS) break;
t1=parsedir(cmd_ptr[2],x,y,robots[id].walk_dir);
if((t1<1)||(t1>4)) {
@@ -232,7 +232,7 @@ void run_robot(int id,int x,int y) {
break;
case 6://Become color thing param
if(id==NUM_ROBOTS) goto die;
- t1=x+y*max_bxsiz;
+ t1=x+y*max_bxsiz;
//Color-
t2=level_color[t1];
t3=fix_color(parse_param(&cmd_ptr[1],id),t2);
@@ -243,7 +243,7 @@ void run_robot(int id,int x,int y) {
level_id[t1]=t6=parse_param(&cmd_ptr[t4],id);
//Param- Only change if not becoming a robot
if((t6!=123)&&(t6!=124)) {
- level_param[t1]=(unsigned char)parse_param(&cmd_ptr[t4+3],id);
+ level_param[t1]=(unsigned char)parse_param(&cmd_ptr[t4+3],id);
clear_robot(id);
//If became a scroll, sensor, or sign...
if((t6==122)||(t6==125)||(t6==126)||(t6==127))
@@ -254,7 +254,7 @@ void run_robot(int id,int x,int y) {
level_under_param[t1]=level_under_id[t1]=0;
level_under_color[t1]=7;
}
- exit_func();
+ exit_func();
return;
}
//Became a robot. Whoopi.
@@ -265,7 +265,7 @@ void run_robot(int id,int x,int y) {
case 8://Color
if(id==NUM_ROBOTS) break;
level_color[x+y*max_bxsiz]=fix_color(parse_param(&cmd_ptr[1],id),
- level_color[x+y*max_bxsiz]);
+ level_color[x+y*max_bxsiz]);
break;
case 9://Gotoxy
if(id==NUM_ROBOTS) break;
@@ -276,7 +276,7 @@ void run_robot(int id,int x,int y) {
if((t1==x)&&(t2==y)) break;
//delete at x y
t3=level_id[t1+t2*max_bxsiz];
- t4=level_param[t1+t2*max_bxsiz];
+ t4=level_param[t1+t2*max_bxsiz];
if(t3==122) clear_sensor(t4);
if((t3==126)||(t3==125)) clear_scroll(t4);
if((t3==123)||(t3==124)) {
@@ -287,7 +287,7 @@ void run_robot(int id,int x,int y) {
if(t3==127) break;//Abort jump if player there
//move
id_place(t1,t2,level_id[x+y*max_bxsiz],level_color[x+y*max_bxsiz],id);
- //remove
+ //remove
id_remove_top(x,y);
break;
case 10://set c #
@@ -298,7 +298,7 @@ void run_robot(int id,int x,int y) {
ibuff[COUNTER_NAME_SIZE-1]=0;
t1=parse_param(&cmd_ptr[next_param(cmd_ptr,1)],id);
if(cmd==10) set_counter(ibuff,t1,id);
- else if(cmd==11) inc_counter(ibuff,t1,id);
+ else if(cmd==11) inc_counter(ibuff,t1,id);
else dec_counter(ibuff,t1,id);
last_label=-1;//Allows looping "infinitely"
break;
@@ -320,7 +320,7 @@ void run_robot(int id,int x,int y) {
if(t1>t2) t4=1;
break;
case 3:
- if(t1>=t2) t4=1;
+ if(t1>=t2) t4=1;
break;
case 4:
if(t1<=t2) t4=1;
@@ -331,7 +331,7 @@ void run_robot(int id,int x,int y) {
}
if(t4) {
send_robot_id(id,tr_msg(&cmd_ptr[1+next_param(cmd_ptr,
- 3+next_param(cmd_ptr,1))],id),1);
+ 3+next_param(cmd_ptr,1))],id),1);
gotoed=1;
}
break;
@@ -342,7 +342,7 @@ void run_robot(int id,int x,int y) {
t1=((unsigned int)t1)&255;
t2=parsedir(t2,x,y,robots[id].walk_dir);
//t1=condition, t2=direction if any (already parsed)
- t3=0;//Set to 1 for true
+ t3=0;//Set to 1 for true
switch(t1) {
case 0://Walking dir
if(t2<5) {
@@ -353,7 +353,7 @@ void run_robot(int id,int x,int y) {
if(robots[id].walk_dir==0) t3=1;
break;
}
- //assumed anydir
+ //assumed anydir
if(robots[id].walk_dir!=0) t3=1;
break;
case 1://swimming
@@ -364,7 +364,7 @@ void run_robot(int id,int x,int y) {
case 2://firewalking
if(id==NUM_ROBOTS) break;
t2=level_under_id[x+y*max_bxsiz];
- if((t2==26)||(t2==63)) t3=1;
+ if((t2==26)||(t2==63)) t3=1;
break;
case 3://touching dir
if(id==NUM_ROBOTS) break;
@@ -375,7 +375,7 @@ void run_robot(int id,int x,int y) {
if((player_x==t4)&&(player_y==t5)) t3=1;
break;
}
- //either anydir or nodir
+ //either anydir or nodir
//is player touching at all?
for(t6=0;t6<4;t6++) {//try all dirs
t4=x; t5=y;
@@ -386,7 +386,7 @@ void run_robot(int id,int x,int y) {
if((t2==14)||(t2==0)) //We want NODIR though, so
t3^=1; //reverse t3.
break;
- case 4://Blocked dir
+ case 4://Blocked dir
//If REL PLAYER or REL COUNTERS, use special code
if(mid_prefix==2) {
//Rel player
@@ -397,7 +397,7 @@ void run_robot(int id,int x,int y) {
//Not edge... blocked?