Newsgroups: rec.games.int-fiction Path: raven.alaska.edu!news.u.washington.edu!usenet.coe.montana.edu!uakari.primate.wisc.edu!caen!spool.mu.edu!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!peril From: peril@extro.ucc.su.OZ.AU (Peter Lisle) Subject: Patch for ITF V4.01 Interpreter Message-ID: Keywords: ITF V4.01 Interpreter Patch Sender: news@ucc.su.OZ.AU Nntp-Posting-Host: extro.ucc.su.oz.au Organization: Sydney University Computing Service, Sydney, NSW, Australia Date: Tue, 6 Oct 1992 15:06:34 GMT Lines: 342 Oops, umm, well, err .... thars bugs in them thar sources ... There were a few bugs in our version 4.01 sources. We will be modifying our ftp site shortly (it may take a few days). In the mean time, either call us all silly wombats, or try the following patches. They should fix most of the bugs that were reported (and at least one that wasn't). They affect the following files: infocom.c, init.c and object.c They fix the -hovr option problems for unix machines (INIT_IO() should have been called before init()) - this bug does not affect MSDOS machines and hence wasn't picked up in this version. Thanks to Mike Kienenberger for pointing us to the problem with the script_status_ptr variable. The following patches also fix this problem. However, Mike's patch is not quite correct - data_head is a local copy of the game file's header, but it isn't updated when the interpreter uses a save_byte_array instruction to change the header variables during the game. So script_status_ptr should actually point to the region pointed to by base_ptr. The init_script() code is actually correct. Our mistake was to use base_ptr before it was given a proper value by malloc. The following patches fix this problem correctly. In beyond zork, the arrow keys will not work. If you notice, we have set the interpreter to be an APPLE2 which didn't have up and down arrows in the early versions - setting this in the header allows the use of the space bar to make selections instead - its a bit yuckier, but it works for us. Arrow support may be added later ... It has also been reported that some people's backspace keys don't work properly. We think (though are not sure) that it isn't our code, but your termcap entries that are not quite right. We have come across many machines with brain-damaged termcap definition files. Please check that your termcap files are correct for your terminal type. If the bug persists, see your doctor ... or mail us with the specifics. I hope this helps ... Sorry for the inconvenience. Please continue sending those bug reports. The ITF. ################################################################################ The following list were made using "diff -c" for the file infocom.c: *** infocom.old Tue Jul 28 06:01:54 199207/28/92 --- infocom.c Tue Oct 06 19:36:54 199210/06/92 *************** *** 85,94 **** { if ( stop == FALSE ) { if ( opt ) { - init_script () ; - init () ; sig_async = SH_NO_IO ; if ( sig_action != SH_NO_SIGNAL ) SIGNAL_QUIT ( sig_action ) ; --- 85,95 ---- { if ( stop == FALSE ) { + INIT_IO () ; + init () ; + init_script () ; if ( opt ) { sig_async = SH_NO_IO ; if ( sig_action != SH_NO_SIGNAL ) SIGNAL_QUIT ( sig_action ) ; *************** *** 98,106 **** } else { - init_script () ; - INIT_IO () ; - init () ; if ( stop == FALSE ) { init_interpreter ( TRUE ) ; --- 99,104 ---- *************** ################################################################################ After modification, the file should look like: if ( stop == FALSE ) { INIT_IO () ; init () ; init_script () ; if ( opt ) { sig_async = SH_NO_IO ; if ( sig_action != SH_NO_SIGNAL ) SIGNAL_QUIT ( sig_action ) ; options ( opt ) ; sig_async = SH_EXIT ; deallocate () ; } else { if ( stop == FALSE ) { init_interpreter ( TRUE ) ; sig_async = SH_NORMAL ; if ( sig_action != SH_NO_SIGNAL ) SIGNAL_QUIT ( sig_action ) ; execute_opcode () ; } sig_async = SH_EXIT ; deallocate () ; EXIT_IO () ; } } ################################################################################ The following list were made using "diff -c" for the file init.c: *** init.old Tue Jul 28 06:01:54 199207/28/92 --- init.c Tue Oct 06 19:48:06 199210/06/92 *************** *** 139,144 **** --- 139,147 ---- jmp_op2[0x2A] = split_screen ; jmp_op2[0x2B] = set_current_window ; + + operands[0x2A] = 1 ; /* split_screen */ + operands[0x2B] = 1 ; /* set_current_window */ } } *************** ################################################################################ After modification, the file should look like: if ( version == VERSION_3 ) { jmp_op0[0x0C] = prt_status ; jmp_op0[0x0D] = verify ; if ( enhanced ) { /* ** In the Standard Series Executor, two extra opcodes can ** be enabled for screen formatting. Some machines may not ** be able to support these extra commands ( opcodes $EA & ** $EB - corresponding to entries "split_screen" ($2A) & ** "set_current_screen" ($2B) in the array "(*jmp_op2[])()" ). */ jmp_op2[0x2A] = split_screen ; jmp_op2[0x2B] = set_current_window ; operands[0x2A] = 1 ; /* split_screen */ operands[0x2B] = 1 ; /* set_current_window */ } } ################################################################################ The following list were made using "diff -c" for the file object.c: *** object.old Tue Jul 28 06:02:00 199207/28/92 --- object.c Tue Oct 06 20:22:12 199210/06/92 *************** *** 27,33 **** if ( xfer ) { print_char ( (word)'[' ) ; ! p_obj ( o1 ) ; print_char ( (word)' ' ) ; print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; --- 27,33 ---- if ( xfer ) { print_char ( (word)'[' ) ; ! std_p_obj ( o1 ) ; print_char ( (word)' ' ) ; print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; *************** *** 32,38 **** print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; print_char ( (word)' ' ) ; ! p_obj ( o2 ) ; print_char ( (word)']' ) ; new_line () ; } --- 32,38 ---- print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; print_char ( (word)' ' ) ; ! std_p_obj ( o2 ) ; print_char ( (word)']' ) ; new_line () ; } *************** *** 63,69 **** if ( xfer ) { print_char ( (word)'[' ) ; ! p_obj ( o1 ) ; print_char ( (word)' ' ) ; print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; --- 63,69 ---- if ( xfer ) { print_char ( (word)'[' ) ; ! plus_p_obj ( o1 ) ; print_char ( (word)' ' ) ; print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; *************** *** 68,74 **** print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; print_char ( (word)' ' ) ; ! p_obj ( o2 ) ; print_char ( (word)']' ) ; new_line () ; } --- 68,74 ---- print_char ( (word)'-' ) ; print_char ( (word)'>' ) ; print_char ( (word)' ' ) ; ! plus_p_obj ( o2 ) ; print_char ( (word)']' ) ; new_line () ; } *************** *** 163,169 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 163,169 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! std_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; *************** *** 205,211 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 205,211 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! plus_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; *************** *** 248,254 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 248,254 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! std_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; *************** *** 284,290 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 284,290 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! plus_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; *************** *** 320,326 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 320,326 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! std_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; *************** *** 356,362 **** if ( attribute ) { print_char ( (word)'[' ) ; ! p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; --- 356,362 ---- if ( attribute ) { print_char ( (word)'[' ) ; ! plus_p_obj ( obj_num ) ; print_char ( (word)'(' ) ; print_num ( attr ) ; print_char ( (word)')' ) ; ################################################################################