FreeCalypso > hg > fc-tourmaline
diff src/cs/services/buzm/buzm_struct_i.h @ 297:8dfdf88d632f
BUZM SWE initial implementation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 29 Mar 2022 03:45:41 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cs/services/buzm/buzm_struct_i.h Tue Mar 29 03:45:41 2022 +0000 @@ -0,0 +1,37 @@ +/* + * This header file holds the internal structure definition + * for BUZM SWE. + */ + +#ifndef __BUZM_STRUCT_I +#define __BUZM_STRUCT_I + +#include "rv/rv_general.h" +#include "rvf/rvf_api.h" +#include "ffs/ffs_api.h" + +#define MELODY_CHUNK_SIZE 64 /* entries, not bytes */ + +struct melody_entry { + UINT8 pwt_note; + UINT8 note_volume; + UINT16 duration; +}; + +struct buzm_env { + /* RiViera boilerplate */ + T_RVF_ADDR_ID addr_id; + T_RVF_MB_ID prim_id; + /* global flag */ + BOOL melody_running; + /* all following vars are valid only during melody play */ + T_FFS_FD ffs_fd; + UINT8 play_volume; + BOOL loop_mode; + struct melody_entry chunk_buf[MELODY_CHUNK_SIZE]; + UINT8 chunk_play_ptr; + UINT8 chunk_end_ptr; + BOOL melody_end_flag; +}; + +#endif /* include guard */