Skip to content

Commit

Permalink
Add option to set owl statue restore location.
Browse files Browse the repository at this point in the history
  • Loading branch information
cxd4 committed Apr 10, 2016
1 parent 00c3889 commit a7061cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion zs_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ int file_copy(int optc, char ** optv)
return ERR_NONE;
}

int owl_area(int optc, char ** optv)
{
unsigned long input;
const size_t file_offset = 0x00000E;

if (optc < 2)
return show16("owl area", file_offset);
write8(&file[0x000023], 0x01); /* set when saved by owl statues */
input = strtoul(optv[1], NULL, 0);
return send16(file_offset, input);
}
int player_mask(int optc, char ** optv)
{
unsigned long input;
Expand Down Expand Up @@ -980,13 +991,15 @@ void init_options(void)
opt_table['r'] = lupy_count; /* That means "Rupees". */
opt_table['z'] = zelda_time; /* daily time: 0x0000 midnight, 0x8000 noon */

opt_table['+'] = picture_frame_buffer;
opt_table['-'] = owl_area;

/*
* special-purpose command-line options fundamental to the flash RAM access
* Nothing here is pertinent to the game's saved progress data itself.
*/
opt_table['='] = zs_endian_swap_mask;
opt_table['@'] = zs_file_pointer;
opt_table['+'] = picture_frame_buffer;

opt_table['&'] = file_erase;
opt_table['|'] = file_new;
Expand Down
1 change: 1 addition & 0 deletions zs_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern unsigned int swap_mask;
*/
extern u8 * file;

extern int owl_area(int optc, char ** optv);
extern int player_mask(int optc, char ** optv);
extern int opening_flag(int optc, char ** optv);
extern int zelda_time(int optc, char ** optv);
Expand Down

0 comments on commit a7061cd

Please sign in to comment.