Skip to content

Commit b999bf4

Browse files
committed
Added init_sound param, fix markdown underscores.
1 parent b1e680b commit b999bf4

11 files changed

+166
-132
lines changed

.gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.deps/
2+
Makefile
3+
Makefile.in
4+
aclocal.m4
5+
ar-lib
6+
autom4te.cache/
7+
compile
8+
config.log
9+
config.status
10+
configure
11+
depcomp
12+
install-sh
13+
libsndifsdl2.a
14+
missing
15+
.dirstamp
16+
*.o
17+
*.a

CHANGELOG.md

+123-115
Large diffs are not rendered by default.

Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ install-dev:: libfizmo.a
9393
echo >>"$(pkgfile)"
9494
echo 'Name: libfizmo' >>"$(pkgfile)"
9595
echo 'Description: libfizmo' >>"$(pkgfile)"
96-
echo 'Version: 0.7.15' >>"$(pkgfile)"
96+
echo 'Version: 0.7.16' >>"$(pkgfile)"
9797
echo "Requires: $(LIBFIZMO_REQS)" >>"$(pkgfile)"
9898
echo 'Requires.private:' >>"$(pkgfile)"
9999
echo 'Cflags: -I$(pkg_prefix)/include/fizmo' >>"$(pkgfile)"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33

4-
libfizmo aims to provide a Z-Machine interpreter core library in plain C. The goal is to have an interpreter library with as little dependencies as possible to allow for easy portability. In order to use it stand-alone, you have to invoke the “fizmo_start” function in “src/interpreter/fizmo.c” with a screen interface. Check fizmo-console for an example.
4+
libfizmo aims to provide a Z-Machine interpreter core library in plain C. The goal is to have an interpreter library with as little dependencies as possible to allow for easy portability. In order to use it stand-alone, you have to invoke the “fizmo\_start” function in “src/interpreter/fizmo.c” with a screen interface. Check fizmo-console for an example.
55

66
Currently the interpreter is in beta status, which means it seems to run all non-version-6 games quite well without any known bugs.
77

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ m4_include(config-flags.m4)
103103

104104
AC_INIT(
105105
[libfizmo],
106-
[0.7.15],
106+
[0.7.16],
107107
fizmo@spellbreaker.org,
108108
libfizmo)
109109

doc/changelog.xml

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<changelog>
3+
<change version="0.7.16">
4+
<datetime day-of-week="Sun" month="2" day="10" hour="11"
5+
minute="54" second="35" timezone="CET" year="2019"/>
6+
<logentry>Added parameter to <tt>init_sound</tt> to simplify testing.</logentry>
7+
<logentry>Fixed underscores in markdown files.</logentry>
8+
</change>
9+
310
<change version="0.7.15">
411
<datetime day-of-week="Sun" month="9" day="3" hour="21"
512
minute="22" second="23" timezone="CEST" year="2017"/>

libfizmo-initialization.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ _2011-08-23_
1212
There are six initialization steps:
1313

1414

15-
- `fizmo_register_screen_interface`
16-
- `fizmo_register_sound_interface`
17-
- optional: `parse_fizmo_config_files`
18-
- `fizmo_start`
19-
- `parse_fizmo_config_files` if not happened before
20-
- implicit: `link_active_interface_to_story`
15+
- `fizmo\_register\_screen\_interface`
16+
- `fizmo\_register\_sound\_interface`
17+
- optional: `parse\_fizmo\_config\_files`
18+
- `fizmo\_start`
19+
- `parse\_fizmo\_config\_files` if not happened before
20+
- implicit: `link\_active\_interface\_to\_story`
2121

2222

2323
fizmo config files:
2424

2525

2626
- `/etc/fizmo.conf`, always parsed.
27-
- All `fizmo/config` files in all directories from colon-spearated `XDG_CONFIG_DIRS` path.
27+
- All `fizmo/config` files in all directories from colon-spearated `XDG\_CONFIG\_DIRS` path.
2828
- `$HOME/.config.fizmo`
2929

3030

@@ -33,13 +33,13 @@ fizmo config files:
3333
**Color initialization**
3434

3535

36-
The screen default colors are stored in variables `default_foreground_colour` and `default_background_colour` inside `output.c`. By default, the foreground is initialized as white, the background as black. Initialization is as follows:
36+
The screen default colors are stored in variables `default\_foreground\_colour` and `default\_background\_colour` inside `output.c`. By default, the foreground is initialized as white, the background as black. Initialization is as follows:
3737

3838

3939
1. By default, the foreground color is set to white, the background to black in `output.c`.
40-
2. The screen interface's functions `get_default_foreground_colour` and `get_default_background_colour` are evaluated. In case these return valid z_colour values, these are used as the default colors. That means that by returning -1 for one or both of the functions, the screen interface may choose not to alter the interpreter's default values.
40+
2. The screen interface's functions `get\_default\_foreground\_colour` and `get\_default\_background\_colour` are evaluated. In case these return valid z\_colour values, these are used as the default colors. That means that by returning -1 for one or both of the functions, the screen interface may choose not to alter the interpreter's default values.
4141
3. The `foreground-color` and `background-color` config variables are evaluated from the configuration file(s).
42-
4. The `fizmo-start` function's variables `screen_default_foreground_color` and `screen_default_background_colour` are evaluated. In case these contains valid z_colour values, they're used as the new default. As in step 2, that means that the default, as evaluated up to this step, may be kept by setting one or both of the values to -1.
42+
4. The `fizmo-start` function's variables `screen\_default\_foreground\_color` and `screen\_default\_background\_colour` are evaluated. In case these contains valid z\_colour values, they're used as the new default. As in step 2, that means that the default, as evaluated up to this step, may be kept by setting one or both of the values to -1.
4343

4444

4545
Why the additional step 4? While it's already possible to read color information from the screen interface in step 2, step 4 ensures that it's possible to still override the information parsed from the config files in step 3 from the screen interface.

src/interpreter/fizmo.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ void fizmo_start(z_file* story_stream, z_file *blorb_stream,
12971297
)
12981298
{
12991299
TRACE_LOG("Activating sound.\n");
1300-
active_sound_interface->init_sound();
1300+
active_sound_interface->init_sound(NULL);
13011301
}
13021302

13031303
write_interpreter_info_into_header();

src/interpreter/fizmo.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#include "../blorb_interface/blorb_interface.h"
4444
#include "blockbuf.h"
4545

46-
#define LIBFIZMO_VERSION "0.7.15"
46+
#define LIBFIZMO_VERSION "0.7.16"
4747

4848
#define FIZMO_INTERPRETER_NUMBER 6
4949
/*

src/sound_interface/sound_interface.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444

4545
struct z_sound_interface
4646
{
47-
void (*init_sound)();
47+
// "absolute_story_file_name" only needs to be set during test cases, if
48+
// it's NULL, "active_z_story->absolute_file_name" is used instead.
49+
void (*init_sound)(char * absolute_story_file_name);
4850
void (*close_sound)();
4951
void (*prepare_sound)(int sound_nr, int volume, int repeats);
5052
void (*play_sound)(int sound_nr, int volume, int repeats, uint16_t routine);

0 commit comments

Comments
 (0)