diff --git a/src/6502/a2_frontend.s b/src/6502/a2_frontend.s index 178216f..86deca4 100644 --- a/src/6502/a2_frontend.s +++ b/src/6502/a2_frontend.s @@ -231,6 +231,7 @@ AUXUNDOBANK2 = $d0 ; logical page from ; ---- frontend zero page ---- +curstyle = $04 ; last style bits set by io_mstyle nunread = $05 ; lines scrolled off since last clear ioparam = $06 ; word, used by the engine wrappos = $08 @@ -882,8 +883,11 @@ moretxt .asc "<...>",0 io_mstyle - ; style bits are already in rstyle zp var in engine - jmp io_mflush_nostyle + pha + jsr io_mflush + pla + sta curstyle + rts ; TODO consider refactoring with sprogress? io_mprogress @@ -1358,7 +1362,7 @@ gotoxy mstyle_enter .( - lda `rstyle + lda curstyle lsr ; reverse style bit bcc set_inverse_rts ; fallthrough to set_inverse @@ -3065,6 +3069,7 @@ auxclrlp sta stxoffs sta cury sta strow + sta curstyle #if UNDO sta u_ready sta u_count diff --git a/src/6502/engine.s b/src/6502/engine.s index 7ae9b4a..d24d3bd 100644 --- a/src/6502/engine.s +++ b/src/6502/engine.s @@ -3778,6 +3778,11 @@ op_en_lv_span stx divsp inc nspan + ; ENTER_SPAN emits a pending AUTO/PENDING + ; space before entering the span, + ; so the space has the outer style. + ; op_style does the same thing. + jsr syncspace done jsr unstyle skip diff --git a/test/codepoints/codepoints.6502.gold b/test/codepoints/codepoints.6502.gold index 2e75f34..fbbcf33 100644 --- a/test/codepoints/codepoints.6502.gold +++ b/test/codepoints/codepoints.6502.gold @@ -276,6 +276,7 @@ and must leave the other alone. bold normal bold italic upright italic both italic only both +reverse normal reverse --- The deprecated SET_STYLE/RESET_STYLE opcodes, which bypass the CSS parser diff --git a/test/codepoints/codepoints.aastory b/test/codepoints/codepoints.aastory index 8fc7d4c..808cac9 100644 Binary files a/test/codepoints/codepoints.aastory and b/test/codepoints/codepoints.aastory differ diff --git a/test/codepoints/codepoints.dg b/test/codepoints/codepoints.dg index 4c0325b..a699b50 100644 --- a/test/codepoints/codepoints.dg +++ b/test/codepoints/codepoints.dg @@ -157,6 +157,12 @@ (style class @fixed) font-family: monospace; +(style class @reverse) + -iftf-reverse-video: reverse; + +(style class @unreverse) + -iftf-reverse-video: none; + %% A font-family that is not monospace must set no bit at all. The name is %% deliberately one that contains neither 'm' nor a substring of 'monospace', %% since the matcher scans for the word rather than comparing the whole value. @@ -649,6 +655,7 @@ (line) (span @bold) { bold (span @unbold) { normal } bold } (line) (span @italic) { italic (span @roman) { upright } italic } (line) (span @bolditalic) { both (span @unbold) { italic only } both } + (line) (span @reverse) { reverse (span @unreverse) { normal } reverse } (line) --- (line) The deprecated SET_STYLE/RESET_STYLE (line) opcodes, which bypass the CSS parser diff --git a/test/codepoints/codepoints.js.gold b/test/codepoints/codepoints.js.gold index 58de3cb..b8b8d25 100644 --- a/test/codepoints/codepoints.js.gold +++ b/test/codepoints/codepoints.js.gold @@ -269,6 +269,7 @@ and must leave the other alone. bold normal bold italic upright italic both italic only both +reverse normal reverse --- The deprecated SET_STYLE/RESET_STYLE opcodes, which bypass the CSS parser