Skip to content

Commit 3119bc2

Browse files
committed
Tidy up the PR
1 parent 3fef4a6 commit 3119bc2

File tree

10 files changed

+222
-654
lines changed

10 files changed

+222
-654
lines changed

frotz/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ RANLIB = /usr/bin/ranlib
1010
CC = gcc
1111

1212
# Enable compiler warnings. This is an absolute minimum.
13-
#CFLAGS += -Wall -Wextra -std=gnu99 -fPIC -Werror=implicit-function-declaration
14-
CFLAGS += -w
13+
CFLAGS += -Wall -Wextra -std=gnu99 -fPIC -Werror=implicit-function-declaration
14+
CFLAGS = -w
1515

1616
# Define your optimization flags.
1717
#

frotz/src/common/frotz.h

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -550,32 +550,6 @@ extern char *option_zcode_path; /* dg */
550550

551551
extern long reserve_mem;
552552

553-
554-
#define MOVE_DIFF_CNT 16
555-
#define ATTR_SET_CNT 16
556-
#define ATTR_CLR_CNT 16
557-
#define PROP_PUT_CNT 64
558-
559-
// Keep track of the last n=16 changes to object tree
560-
extern int move_diff_cnt;
561-
extern zword move_diff_objs[MOVE_DIFF_CNT];
562-
extern zword move_diff_dest[MOVE_DIFF_CNT];
563-
564-
// Keep track of the last n=16 changes to obj attributes
565-
extern int attr_diff_cnt;
566-
extern zword attr_diff_objs[ATTR_SET_CNT];
567-
extern zword attr_diff_nb[ATTR_SET_CNT];
568-
569-
// Keep track of the last n=16 clears of obj attributes
570-
extern int attr_clr_cnt;
571-
extern zword attr_clr_objs[ATTR_CLR_CNT];
572-
extern zword attr_clr_nb[ATTR_CLR_CNT];
573-
574-
// Keep track of the last n=32 changes to obj properties
575-
extern int prop_put_cnt;
576-
extern zword prop_put_objs[PROP_PUT_CNT];
577-
extern zword prop_put_nb[PROP_PUT_CNT];
578-
579553
// Keep track of up to n=16 changes to special ram locations defined by the game
580554
extern int ram_diff_cnt;
581555
extern zword ram_diff_addr[16];
@@ -703,7 +677,7 @@ void z_window_style (void);
703677

704678
void init_err (void);
705679
void runtime_error (int);
706-
680+
707681
/* Error codes */
708682
#define ERR_TEXT_BUF_OVF 1 /* Text buffer overflow */
709683
#define ERR_STORE_RANGE 2 /* Store out of dynamic memory */
@@ -741,7 +715,7 @@ void runtime_error (int);
741715
#define ERR_REMOVE_OBJECT_0 31 /* @remove_object called with object 0 */
742716
#define ERR_GET_NEXT_PROP_0 32 /* @get_next_prop called with object 0 */
743717
#define ERR_NUM_ERRORS (32)
744-
718+
745719
/* There are four error reporting modes: never report errors;
746720
report only the first time a given error type occurs; report
747721
every time an error occurs; or treat all errors as fatal

frotz/src/common/object.c

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,6 @@
3434
#define O4_PROPERTY_OFFSET 12
3535
#define O4_SIZE 14
3636

37-
int move_diff_cnt;
38-
zword move_diff_objs[MOVE_DIFF_CNT];
39-
zword move_diff_dest[MOVE_DIFF_CNT];
40-
int attr_diff_cnt;
41-
zword attr_diff_objs[ATTR_SET_CNT];
42-
zword attr_diff_nb[ATTR_SET_CNT];
43-
int attr_clr_cnt;
44-
zword attr_clr_objs[ATTR_CLR_CNT];
45-
zword attr_clr_nb[ATTR_CLR_CNT];
46-
int prop_put_cnt;
47-
zword prop_put_objs[PROP_PUT_CNT];
48-
zword prop_put_nb[PROP_PUT_CNT];
49-
5037
/*
5138
* object_address
5239
*
@@ -454,14 +441,6 @@ void z_clear_attr (void)
454441
if (zargs[1] > ((h_version <= V3) ? 31 : 47))
455442
runtime_error (ERR_ILL_ATTR);
456443

457-
/* If we are monitoring attribute assignment display a short note */
458-
459-
if (attr_clr_cnt < ATTR_CLR_CNT) {
460-
attr_clr_objs[attr_clr_cnt] = zargs[0];
461-
attr_clr_nb[attr_clr_cnt] = zargs[1];
462-
attr_clr_cnt++;
463-
}
464-
465444
if (f_setup.attribute_assignment) {
466445
stream_mssg_on ();
467446
print_string ("@clear_attr ");
@@ -1066,14 +1045,6 @@ void z_insert_obj (void)
10661045
zword obj1_addr;
10671046
zword obj2_addr;
10681047

1069-
/* If we are monitoring object movements display a short note */
1070-
1071-
if (move_diff_cnt < MOVE_DIFF_CNT) {
1072-
move_diff_objs[move_diff_cnt] = obj1;
1073-
move_diff_dest[move_diff_cnt] = obj2;
1074-
move_diff_cnt++;
1075-
}
1076-
10771048
if (f_setup.object_movement) {
10781049
stream_mssg_on ();
10791050
print_string ("@move_obj ");
@@ -1186,12 +1157,6 @@ void z_put_prop (void)
11861157
SET_WORD (prop_addr, v)
11871158
}
11881159

1189-
if (prop_put_cnt < PROP_PUT_CNT) {
1190-
prop_put_objs[prop_put_cnt] = zargs[0];
1191-
prop_put_nb[prop_put_cnt] = zargs[1];
1192-
prop_put_cnt++;
1193-
}
1194-
11951160
}/* z_put_prop */
11961161

11971162

@@ -1204,13 +1169,6 @@ void z_put_prop (void)
12041169
void z_remove_obj (void)
12051170
{
12061171

1207-
/* If we are monitoring object movements display a short note */
1208-
if (move_diff_cnt < 16) {
1209-
move_diff_objs[move_diff_cnt] = zargs[0];
1210-
move_diff_dest[move_diff_cnt] = (zword) 0;
1211-
move_diff_cnt++;
1212-
}
1213-
12141172
if (f_setup.object_movement) {
12151173
stream_mssg_on ();
12161174
print_string ("@remove_obj ");
@@ -1244,14 +1202,6 @@ void z_set_attr (void)
12441202
if (zargs[1] > ((h_version <= V3) ? 31 : 47))
12451203
runtime_error (ERR_ILL_ATTR);
12461204

1247-
/* If we are monitoring attribute assignment display a short note */
1248-
1249-
if (attr_diff_cnt < ATTR_SET_CNT) {
1250-
attr_diff_objs[attr_diff_cnt] = zargs[0];
1251-
attr_diff_nb[attr_diff_cnt] = zargs[1];
1252-
attr_diff_cnt++;
1253-
}
1254-
12551205
if (f_setup.attribute_assignment) {
12561206
stream_mssg_on ();
12571207
print_string ("@set_attr ");

0 commit comments

Comments
 (0)