-
Notifications
You must be signed in to change notification settings - Fork 42
[WIP] FIX: Incomplete objects tree for some games #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MarcCote
wants to merge
85
commits into
microsoft:master
Choose a base branch
from
MarcCote:fix_obj_num
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
8407a85
Clear create attr 12 in Zork1
MarcCote 40d11fb
If PC is different from last PC, then assume state has changed.
MarcCote dcfeda5
Add unrecognized template (from acorncourt). Add ILLEGAL action.
MarcCote 07e2bb5
Add test file to bench_valid_action
MarcCote cc96475
Set object count according to the output of Infodump.
MarcCote 48df322
Making sure commands in walkthrough causes world_changed.
MarcCote 8402e62
Add script to help finding special ram.
MarcCote d42e6ab
Testing more games
MarcCote b3688bc
Testing more games + better handle leading newlines/whitespaces
MarcCote 489220f
Add missing md5.h file
MarcCote 15bf5e6
Improve testing tools + planetfall
MarcCote 483c7b6
Disable status line for z3 or lower.
MarcCote 3fd2229
Fix getRetPC
MarcCote b538903
Refactor find_special_ram
MarcCote 9d79eb2
Add get_calls_stack as a more precise alternative to getRetPC
MarcCote 52c3336
Planetfall and plundered
MarcCote 64d1c28
Reverb
MarcCote 59c0a72
seastalker
MarcCote bf64560
ENH: separate buffer for upper (status line) and lower screen
MarcCote 95be1a2
Tweak find_special_ram.py
MarcCote 16c0a9e
Sherlock
MarcCote c2bd1de
Snacktime
MarcCote 3b4a2b1
Sorcerer
MarcCote 0571736
Spellbrkr
MarcCote e2d7cf7
temple
MarcCote 49e81e2
theatre
MarcCote 0f5ba62
trinity
MarcCote d950360
tryst205
MarcCote 114ab23
weapon
MarcCote 0643307
wishbringer
MarcCote 20904dc
yomomma
MarcCote e3b3271
zenon
MarcCote e708fb0
Zork1
MarcCote 3a62063
Zork2
MarcCote 0fa2b4a
Zork3
MarcCote ef6306f
spirit
MarcCote c1aba4f
FIX: step -> jericho_step to avoid name clashing with regexp.c:step f…
MarcCote 89d5fc3
Tidy up the PR
MarcCote 9d2af0e
Add Matthew's script to test walkthrough.
MarcCote b9fc0a0
Fix memory issue.
MarcCote 5143731
FIX: wrong memcmp size for special_ram.
MarcCote 5508cf5
Noop checks for curses.z5
MarcCote 732b0f2
Noop check: advent.z5
MarcCote a04c289
Noop check: afflicted.z8
MarcCote 5870a2f
Improve test_games.py script to display better diff between objects a…
MarcCote dcf757e
Noop check: anchor.z8
MarcCote a956daa
Noop check: balances.z5
MarcCote bb3b6e9
Util function to clear_attr of a zobject
MarcCote de131ae
Noop check: ballyhoo.z3
MarcCote 7cfe88e
Flush buffer before getting screen. Trim leading/trailing whitespace …
MarcCote bfa92a3
Noop check: cutthroat
MarcCote 815754d
Noop check: deephome
MarcCote da86a5b
Noop check: detective
MarcCote 6f66fec
Noop check: dragon
MarcCote de7c43e
Util function to clear a property of a zobject
MarcCote fce1a87
Noop check: enchanter
MarcCote 0b6fbab
Noop check: enter
MarcCote c20f5ea
Noop check: gold
MarcCote b2d277f
Noop check: hhgg
MarcCote 5245fba
Noop check: hollywood
MarcCote b6a440d
Noop check: huntdark
MarcCote 0c87558
Noop check: infidel
MarcCote 4fb314f
Sort interactable objects.
MarcCote 61c3af9
Noop check: inhumane
MarcCote a5e492f
Noop check: jewel
MarcCote ce3388d
Noop check: karn
MarcCote 60b36ff
Noop check: library
MarcCote b946067
Noop check: loose
MarcCote 68242f0
Noop check: loose.z5
MarcCote 9aa45ef
Tweak test_games.py to detect unused special ram addresses.
MarcCote 869a950
Noop check: lostpig
MarcCote 8baa787
Noop check: ludicorp
MarcCote 87ed928
Improve debugging tools
MarcCote 87eb5fc
Noop check: lurking
MarcCote bd99c9e
Noop check: moonlit
MarcCote e4e4ce8
Halt emulator on z_quit
MarcCote 25fbed5
FIX: do not assume RAM size is even.
MarcCote dfbf697
Noop check: murdac
MarcCote 39b6f8d
Noop check: night
MarcCote 93cff3f
Noop check: omniquest
MarcCote 9c4f9fa
Noop check: partyfoul + add option to skip z_read_char
MarcCote 88f15eb
Noop check: pentari
MarcCote 9348e2d
Fix md5 import
MarcCote 8bea90c
Improve find_special_ram printing
MarcCote 2634772
Improve checks for anchor.c
MarcCote File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -890,6 +890,7 @@ void z_nop (void) | |
void z_quit (void) | ||
{ | ||
finished = 9999; | ||
emulator_halted = 2; | ||
|
||
}/* z_quit */ | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,9 +50,13 @@ static cell make_cell(int style, char c) {return (style << 8) | (0xff & c);} | |
static char cell_char(cell c) {return c & 0xff;} | ||
static int cell_style(cell c) {return c >> 8;} | ||
|
||
#define UPPER_SCREEN_BUFF_SIZE 256 | ||
#define SCREEN_BUFF_SIZE 8192 | ||
static char screen_buffer[SCREEN_BUFF_SIZE]; | ||
static char screen_buffer[SCREEN_BUFF_SIZE]; // aka window 0 (lower screen) | ||
static char upper_screen_buffer[UPPER_SCREEN_BUFF_SIZE]; // aka window 1 (upper screen) | ||
|
||
char* screen_buffer_ptr = screen_buffer; | ||
char* upper_screen_buffer_ptr = upper_screen_buffer; | ||
|
||
/* A cell's style is REVERSE_STYLE, normal (0), or PICTURE_STYLE. | ||
* PICTURE_STYLE means the character is part of an ascii image outline | ||
|
@@ -114,7 +118,12 @@ int os_string_width (const zchar *s) | |
|
||
void os_set_cursor(int row, int col) | ||
{ | ||
cursor_row = row - 1; cursor_col = col - 1; | ||
//printf("\n--> win:%d\trow:%d\tcol:%d MAX_COLS:%d<--\n", cwin, row, col, h_screen_cols); | ||
if (cwin == 1 && row == 1) { | ||
upper_screen_buffer_ptr = upper_screen_buffer + (col-1); | ||
} | ||
|
||
cursor_row = row - 1; cursor_col = col - 1; // 0-index | ||
if (cursor_row >= h_screen_rows) | ||
cursor_row = h_screen_rows - 1; | ||
} | ||
|
@@ -148,9 +157,16 @@ void os_set_text_style(int x) | |
/* put a character in the cell at the cursor and advance the cursor. */ | ||
static void dumb_display_char(char c) | ||
{ | ||
if ((screen_buffer_ptr - screen_buffer) < (SCREEN_BUFF_SIZE - 1)) { | ||
*screen_buffer_ptr++ = c; | ||
} | ||
if (cwin == 1 && cursor_row == 0) { | ||
if ((upper_screen_buffer_ptr - upper_screen_buffer) < (UPPER_SCREEN_BUFF_SIZE - 1)) { | ||
*upper_screen_buffer_ptr++ = c; | ||
} | ||
} | ||
else { | ||
if ((screen_buffer_ptr - screen_buffer) < (SCREEN_BUFF_SIZE - 1)) { | ||
*screen_buffer_ptr++ = c; | ||
} | ||
} | ||
} | ||
|
||
void dumb_display_user_input(char *s) | ||
|
@@ -210,7 +226,7 @@ void os_display_string (const zchar *s) | |
} | ||
} | ||
|
||
void os_erase_area (int top, int left, int bottom, int right, int UNUSED (win)) | ||
void os_erase_area (int top, int left, int bottom, int right, int win) | ||
{ | ||
int row, col; | ||
top--; left--; bottom--; right--; | ||
|
@@ -222,9 +238,16 @@ void os_erase_area (int top, int left, int bottom, int right, int UNUSED (win)) | |
|
||
void os_scroll_area (int top, int left, int bottom, int right, int units) | ||
{ | ||
if ((screen_buffer_ptr - screen_buffer) < (SCREEN_BUFF_SIZE - 1)) { | ||
*screen_buffer_ptr++ = '\n'; | ||
} | ||
if (cwin == 1) { | ||
if ((upper_screen_buffer_ptr - upper_screen_buffer) < (UPPER_SCREEN_BUFF_SIZE - 1)) { | ||
*upper_screen_buffer_ptr++ = '\n'; | ||
} | ||
} | ||
else { | ||
if ((screen_buffer_ptr - screen_buffer) < (SCREEN_BUFF_SIZE - 1)) { | ||
*screen_buffer_ptr++ = '\n'; | ||
} | ||
} | ||
} | ||
|
||
int os_font_data(int font, int *height, int *width) | ||
|
@@ -522,6 +545,7 @@ void dumb_init_output(void) | |
{ | ||
if (h_version == V3) { | ||
h_config |= CONFIG_SPLITSCREEN; | ||
h_config |= CONFIG_NOSTATUSLINE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the option to disable status line for V3 games. This simplifies the |
||
h_flags &= ~OLD_SOUND_FLAG; | ||
} | ||
|
||
|
@@ -548,6 +572,7 @@ void dumb_init_output(void) | |
} | ||
|
||
char* dumb_get_screen(void) { | ||
flush_buffer(); | ||
*screen_buffer_ptr = '\0'; | ||
return screen_buffer; | ||
} | ||
|
@@ -556,6 +581,26 @@ void dumb_clear_screen(void) { | |
screen_buffer_ptr = screen_buffer; | ||
} | ||
|
||
|
||
char* dumb_get_lower_screen(void) { | ||
flush_buffer(); | ||
*screen_buffer_ptr = '\0'; | ||
return screen_buffer; | ||
} | ||
|
||
void dumb_clear_lower_screen(void) { | ||
screen_buffer_ptr = screen_buffer; | ||
} | ||
|
||
char* dumb_get_upper_screen(void) { | ||
upper_screen_buffer[UPPER_SCREEN_BUFF_SIZE-1] = '\0'; | ||
return upper_screen_buffer; | ||
} | ||
|
||
void dumb_clear_upper_screen(void) { | ||
upper_screen_buffer_ptr = upper_screen_buffer; | ||
} | ||
|
||
void dumb_free(void) { | ||
if (screen_data) { | ||
free(screen_data); | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip printing the status line when the corresponding option is set. This simplifies the
clean_observation_...
functions.