Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ Release notes:
Backend: fixed bug with hex colors (#ff8800) on Z-machine
causing problems for older interpreters.

Backend: colored spans inside (collect words) no longer corrupt
the stack on Z-machine.

Unit test runner: (game over) and (game over $) are
now overridden in unit.dg, to enable testing of win
conditions.
Expand Down
7 changes: 7 additions & 0 deletions src/runtime_z.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,8 @@ struct rtroutine rtroutines[] = {
// 0 (param): styles to set for this box class
// 1 (param): styles to unset for this box class
(struct zinstr []) {
{Z_JNZ, {VALUE(REG_FORWORDS)}, 0, RFALSE},

{Z_CALL2N, {ROUTINE(R_AUX_PUSH1), VALUE(REG_STYLE)}}, // Save the previous value of REG_STYLE
{Z_JE, {VALUE(REG_STYLE), SMALL(STYLE_INVISIBLE)}, 0, RFALSE}, // Then if we're currently in an invisible box, don't save anything, the style should remain invisible until we exit the original invisible box

Expand Down Expand Up @@ -794,6 +796,8 @@ struct rtroutine rtroutines[] = {
1,
// 0: previous value of REG_STYLE for checking things
(struct zinstr []) {
{Z_JNZ, {VALUE(REG_FORWORDS)}, 0, RFALSE},

{Z_STORE, {SMALL(REG_LOCAL+0), VALUE(REG_STYLE)}}, // Save the current value of REG_STYLE to check something
{Z_DEC, {SMALL(REG_COLL)}}, // Pull the previous value of REG_STYLE back off the stack
{Z_LOADW, {VALUE(REG_AUXBASE), VALUE(REG_COLL)}, REG_STYLE},
Expand All @@ -813,6 +817,8 @@ struct rtroutine rtroutines[] = {
// 0 (param): foreground color to use
// 1 (param): background color to use
(struct zinstr []) {
{Z_JNZ, {VALUE(REG_FORWORDS)}, 0, RFALSE},

// Push BGCOLOR, then FGCOLOR
{Z_CALL2N, {ROUTINE(R_AUX_PUSH1), VALUE(REG_BGCOLOR)}},
{Z_CALL2N, {ROUTINE(R_AUX_PUSH1), VALUE(REG_FGCOLOR)}},
Expand All @@ -837,6 +843,7 @@ struct rtroutine rtroutines[] = {
// We don't have to do this for styles because that's handled within BEGIN_ and END_ for the boxes and spans, but the Dialog assembler can't pass more than three arguments to a routine (it doesn't support Z_CALLVN2), so we just assemble a separate routine call instead
0,
(struct zinstr []) {
{Z_JNZ, {VALUE(REG_FORWORDS)}, 0, RFALSE},
// Pull FGCOLOR, then BGCOLOR
{Z_DEC, {SMALL(REG_COLL)}},
{Z_LOADW, {VALUE(REG_AUXBASE), VALUE(REG_COLL)}, REG_FGCOLOR},
Expand Down
Loading