Rev 975 | Details | Compare with Previous | Last modification | View Log
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 23 | dimkam | 1 | WORDBUFSIZE=128 |
| 2 | |||
| 3 | CBOLD=1 |
||
| 28 | Alone | 4 | CITALIC=1;0x87;add a,a |
| 5 | CUNDERLINE=1;0x2f;cpl |
||
| 6 | CSTROKE=1;0xff |
||
| 68 | Alone | 7 | CLINK=2 |
| 8 | CLINKIMG=4 |
||
| 9 | CMARK=8 |
||
| 10 | ;TODO visited link |
||
| 28 | Alone | 11 | |
| 12 | |||
| 13 | |||
| 14 | loadhtml |
||
| 31 | Alone | 15 | push af ;first char |
| 32 | Alone | 16 | ;skip spaces and line breaks |
| 403 | alone | 17 | cp 0xef ;hippiman.16mb.com 稭 ef bb bf (UTF-8 BOM) |
| 32 | Alone | 18 | jr z,loadhtml_html |
| 19 | call htmlskipspaces_go |
||
| 20 | cp '<' |
||
| 21 | loadhtml_html |
||
| 22 | ld a,1 |
||
| 23 | jr nz,$+3 ;not html |
||
| 24 | xor a ;html |
||
| 25 | ld (ispre),a |
||
| 26 | ;xor a |
||
| 27 | ld (printableflag),a ;header is invisible for html |
||
| 33 | Alone | 28 | defaultunicodeflag=$+1 |
| 32 | Alone | 29 | xor 1 ;ld a,1 ;utf-8 by default for html, windows-1251 for text |
| 31 | Alone | 30 | ld (utf8flag),a |
| 28 | Alone | 31 | call setdefaultfontweight |
| 32 | |||
| 32 | Alone | 33 | xor a |
| 34 | ld (laststringx),a |
||
| 35 | ld h,a |
||
| 36 | ld l,a ;0 |
||
| 37 | ld (laststringy),hl |
||
| 38 | ld (curprintvirtualy),hl |
||
| 39 | |||
| 40 | dec a |
||
| 41 | dec hl |
||
| 28 | Alone | 42 | ld (lastpointer),hl |
| 43 | ld (lastpointerHSB),a |
||
| 44 | ld (last2pointer),hl |
||
| 45 | ld (last2pointerHSB),a |
||
| 46 | ld (firstpointer),hl |
||
| 47 | ld (firstpointerHSB),a |
||
| 48 | ld (first2pointer),hl |
||
| 49 | ld (first2pointerHSB),a |
||
| 50 | |||
| 344 | alone | 51 | call initstringbuf1 ;buf2 樠 a/img ;ᮤন setfontweight |
| 447 | alone | 52 | call rememberhrefyxposition ; 뫪 ࠢ Y div |
| 23 | dimkam | 53 | |
| 28 | Alone | 54 | ;ld de,0 |
| 55 | ;call setxymc_stateful |
||
| 403 | alone | 56 | pop af;ld a,'<' ;already read ;TODO ⠬ ᤥ push? '<'? |
| 31 | Alone | 57 | ;jr $ |
| 28 | Alone | 58 | call loadhtml_mainloop_go |
| 31 | Alone | 59 | call prcharvirtual_crlf_stateful |
| 60 | ;ld a,-2 |
||
| 61 | ;in a,(-2) |
||
| 62 | ;rra |
||
| 63 | ;jr nc,$ |
||
| 28 | Alone | 64 | ;jr $ |
| 31 | Alone | 65 | call closestream |
| 66 | jp htmlview ;can exit to browser_go via Enter |
||
| 28 | Alone | 67 | |
| 32 | Alone | 68 | loadhtml_mainloop_mangledcharq |
| 69 | call prcharvirtual_stateful |
||
| 23 | dimkam | 70 | loadhtml_mainloop |
| 71 | rdbyte |
||
| 32 | Alone | 72 | loadhtml_mainloop_go |
| 55 | Alone | 73 | ;push af |
| 74 | ;call prcharvirtual_stateful |
||
| 75 | ;pop af |
||
| 32 | Alone | 76 | cp '<'+1 |
| 77 | jp nc,loadhtml_mainloop_mangledcharq ;speedup |
||
| 23 | dimkam | 78 | or a |
| 28 | Alone | 79 | ret z |
| 23 | dimkam | 80 | cp '<' |
| 81 | jr z,loadhtml_mainloop_tag |
||
| 82 | cp '&' |
||
| 83 | jr z,loadhtml_mainloop_mangledchar |
||
| 84 | cp 0x0d |
||
| 31 | Alone | 85 | jr z,loadhtml_checkpremainloop |
| 23 | dimkam | 86 | cp 0x0a |
| 31 | Alone | 87 | jr z,loadhtml_checkpremainloop |
| 32 | Alone | 88 | cp ' ' |
| 89 | jr z,loadhtml_checkpremainloop |
||
| 90 | cp 0x09 |
||
| 91 | jr z,loadhtml_checkpremainloop |
||
| 92 | jp loadhtml_mainloop_mangledcharq |
||
| 31 | Alone | 93 | loadhtml_checkpremainloop |
| 94 | ispre=$+1 |
||
| 95 | ld b,0 |
||
| 96 | djnz loadhtml_spacemainloop |
||
| 32 | Alone | 97 | ;jr $ |
| 31 | Alone | 98 | jr loadhtml_mainloop_mangledcharq |
| 99 | |||
| 100 | loadhtml_spacemainloop |
||
| 32 | Alone | 101 | ;jr $ |
| 102 | ;call countlinewidth |
||
| 103 | ;ld a,h |
||
| 344 | alone | 104 | ;or l ; ⠬ 㦥 ࠢ騥 |
| 32 | Alone | 105 | ld a,(prcharvirtual_stateful_x) |
| 106 | or a |
||
| 31 | Alone | 107 | jr z,loadhtml_mainloop |
| 108 | ld a,' ' |
||
| 109 | jr loadhtml_mainloop_mangledcharq |
||
| 110 | |||
| 111 | loadhtml_mainloop_mangledchar |
||
| 112 | ;read until ; |
||
| 113 | ld hl,mangledcharslist |
||
| 114 | ld de,wordbuf |
||
| 115 | call getword_mangledchar ;hl=terminator/space addr,a=char |
||
| 116 | ld hl,mangledcharslist |
||
| 117 | mangledcharstrcp0 |
||
| 118 | ld a,(hl) ;decoded char |
||
| 119 | inc hl |
||
| 120 | or a |
||
| 121 | jr z,mangledchar_error |
||
| 122 | ld de,wordbuf |
||
| 123 | push hl |
||
| 124 | call strcp |
||
| 125 | pop hl |
||
| 126 | jr nz,mangledcharstrcp_fail |
||
| 127 | dec hl |
||
| 128 | ld a,(hl) ;decoded char |
||
| 129 | jp loadhtml_mainloop_mangledcharq |
||
| 130 | mangledcharstrcp_fail |
||
| 344 | alone | 131 | ld b,-1 ;⮡ 筮 ନ |
| 31 | Alone | 132 | xor a |
| 344 | alone | 133 | cpir ; 易⥫쭮 |
| 31 | Alone | 134 | jr mangledcharstrcp0 |
| 135 | mangledchar_error=loadhtml_mainloop |
||
| 23 | dimkam | 136 | loadhtml_mainloop_tag |
| 32 | Alone | 137 | call RDBYTE;rdbyte |
| 23 | dimkam | 138 | ld (loadhtml_tagcloser),a |
| 139 | cp '/' |
||
| 140 | jr nz,executetag |
||
| 32 | Alone | 141 | call RDBYTE;rdbyte |
| 23 | dimkam | 142 | executetag |
| 143 | ld de,wordbuf |
||
| 144 | call getword_tag_go ;hl=terminator/space addr,a=char ;first char already read |
||
| 145 | ld (executetag_endchar),a |
||
| 31 | Alone | 146 | |
| 147 | if 1==0 |
||
| 148 | ld hl,wordbuf |
||
| 149 | executetag_typetag0 |
||
| 150 | ld a,(hl) |
||
| 151 | or a |
||
| 152 | jr z,executetag_typetagq |
||
| 153 | inc hl |
||
| 154 | push hl |
||
| 155 | call prcharvirtual_stateful |
||
| 156 | pop hl |
||
| 157 | jr executetag_typetag0 |
||
| 158 | executetag_typetagq |
||
| 159 | endif |
||
| 160 | |||
| 23 | dimkam | 161 | ;cp '>' |
| 162 | ;call skipspaces |
||
| 163 | ;ld (execcmd_pars),hl |
||
| 164 | ld hl,tagslist ;list of internal commands |
||
| 165 | strcpexec0 |
||
| 166 | ld c,(hl) |
||
| 167 | inc hl |
||
| 168 | ld b,(hl) |
||
| 169 | inc hl |
||
| 170 | ld a,b |
||
| 171 | cp -1 |
||
| 172 | jr z,executetag_error ;a!=0: no such internal command |
||
| 173 | ld de,wordbuf |
||
| 174 | push hl |
||
| 175 | call strcp |
||
| 176 | pop hl |
||
| 177 | jr nz,strcpexec_fail |
||
| 178 | ld h,b |
||
| 179 | ld l,c |
||
| 180 | loadhtml_tagcloser=$+1 |
||
| 181 | ld a,0 |
||
| 182 | cp '/' |
||
| 183 | call jphl ;execute command (Z=closing tag) |
||
| 184 | |||
| 185 | ;TODO read the rest of the tag? |
||
| 186 | |||
| 187 | jp loadhtml_mainloop |
||
| 188 | jphl |
||
| 189 | jp (hl) ;run internal command |
||
| 190 | strcpexec_fail |
||
| 344 | alone | 191 | ld b,-1 ;⮡ 筮 ନ |
| 23 | dimkam | 192 | xor a |
| 344 | alone | 193 | cpir ; 易⥫쭮 |
| 23 | dimkam | 194 | jr strcpexec0 |
| 195 | |||
| 196 | executetag_error |
||
| 197 | ;no such tag |
||
| 61 | Alone | 198 | call skiprestoftag |
| 23 | dimkam | 199 | jp loadhtml_mainloop |
| 200 | |||
| 201 | |||
| 31 | Alone | 202 | mangledcharslist |
| 203 | db "&" |
||
| 204 | db "amp",0 |
||
| 205 | db "<" |
||
| 206 | db "lt",0 |
||
| 207 | db ">" |
||
| 208 | db "gt",0 |
||
| 209 | db " " |
||
| 210 | db "nbsp",0 |
||
| 211 | db 34 |
||
| 212 | db "quote",0 |
||
| 213 | db 34 |
||
| 214 | db "lquote",0 |
||
| 215 | db 34 |
||
| 216 | db "rquote",0 |
||
| 28 | Alone | 217 | |
| 31 | Alone | 218 | db 0 ;end of mangled chars list |
| 219 | |||
| 23 | dimkam | 220 | tagslist |
| 31 | Alone | 221 | dw tag_p |
| 222 | db "p",0 |
||
| 223 | dw tag_pre |
||
| 224 | db "pre",0 |
||
| 225 | dw tag_code |
||
| 226 | db "code",0 |
||
| 227 | dw tag_div |
||
| 228 | db "div",0 |
||
| 229 | dw tag_ul |
||
| 230 | db "ul",0 |
||
| 231 | dw tag_li |
||
| 232 | db "li",0 |
||
| 233 | dw tag_th |
||
| 234 | db "th",0 |
||
| 235 | dw tag_center |
||
| 236 | db "center",0 ;deprecated |
||
| 237 | dw tag_h1 |
||
| 238 | db "h1",0 |
||
| 239 | dw tag_h2 |
||
| 240 | db "h2",0 |
||
| 241 | dw tag_h3 |
||
| 242 | db "h3",0 |
||
| 243 | dw tag_h4 |
||
| 244 | db "h4",0 |
||
| 245 | dw tag_h5 |
||
| 246 | db "h5",0 |
||
| 247 | dw tag_h6 |
||
| 248 | db "h6",0 |
||
| 249 | dw tag_ins |
||
| 250 | db "ins",0 |
||
| 23 | dimkam | 251 | dw tag_u |
| 252 | db "u",0 |
||
| 253 | dw tag_b |
||
| 254 | db "b",0 |
||
| 31 | Alone | 255 | dw tag_em |
| 256 | db "em",0 |
||
| 257 | dw tag_cite |
||
| 258 | db "cite",0 |
||
| 23 | dimkam | 259 | dw tag_i |
| 260 | db "i",0 |
||
| 31 | Alone | 261 | dw tag_del |
| 262 | db "del",0 |
||
| 28 | Alone | 263 | dw tag_s |
| 23 | dimkam | 264 | db "s",0 |
| 265 | dw tag_a |
||
| 266 | db "a",0 |
||
| 267 | dw tag_strong |
||
| 268 | db "strong",0 |
||
| 269 | dw tag_img |
||
| 270 | db "img",0 |
||
| 271 | dw tag_html |
||
| 272 | db "html",0 |
||
| 273 | dw tag_head |
||
| 274 | db "head",0 |
||
| 275 | dw tag_meta |
||
| 276 | db "meta",0 |
||
| 277 | dw tag_title |
||
| 278 | db "title",0 |
||
| 279 | dw tag_body |
||
| 280 | db "body",0 |
||
| 281 | dw tag_font |
||
| 282 | db "font",0 |
||
| 283 | dw tag_br |
||
| 284 | db "br",0 |
||
| 285 | dw tag_table |
||
| 286 | db "table",0 |
||
| 287 | dw tag_tbody |
||
| 288 | db "tbody",0 |
||
| 289 | dw tag_tr |
||
| 290 | db "tr",0 |
||
| 291 | dw tag_td |
||
| 292 | db "td",0 |
||
| 31 | Alone | 293 | dw tag_mark |
| 294 | db "mark",0 |
||
| 295 | dw tag_span |
||
| 296 | db "span",0 |
||
| 297 | dw tag_script |
||
| 298 | db "script",0 |
||
| 299 | dw tag_doctype |
||
| 300 | db "!doctype",0 |
||
| 301 | dw tag_COMMENT |
||
| 302 | db "!--",0 |
||
| 303 | dw tag_link |
||
| 304 | db "link",0 |
||
| 305 | dw tag_style |
||
| 306 | db "style",0 |
||
| 307 | dw tag_frameset |
||
| 308 | db "frameset",0 |
||
| 309 | dw tag_frame |
||
| 310 | db "frame",0 |
||
| 55 | Alone | 311 | dw tag_iframe |
| 312 | db "iframe",0 |
||
| 32 | Alone | 313 | dw tag_label |
| 314 | db "label",0 |
||
| 315 | dw tag_form |
||
| 316 | db "form",0 |
||
| 317 | dw tag_input |
||
| 318 | db "input",0 |
||
| 319 | dw tag_dl ;forum.nedopc.com |
||
| 320 | db "dl",0 |
||
| 321 | dw tag_dd ;forum.nedopc.com |
||
| 322 | db "dd",0 |
||
| 323 | dw tag_dt ;forum.nedopc.com |
||
| 324 | db "dt",0 |
||
| 23 | dimkam | 325 | |
| 326 | dw -1 ;end of tags list |
||
| 327 | |||
| 31 | Alone | 328 | ;Z=closing tag |
| 329 | |||
| 32 | Alone | 330 | tag_label |
| 344 | alone | 331 | ;<label for="searchInput"></label> |
| 32 | Alone | 332 | ;TODO |
| 333 | jp skiprestoftag |
||
| 334 | |||
| 335 | tag_form |
||
| 336 | tag_input |
||
| 337 | ;<form action="http://speccy.info/w/index.php" id="searchform"> |
||
| 344 | alone | 338 | ;<input type="hidden" name="title" value="㦥:"> |
| 339 | ;<input type="search" name="search" placeholder="" title="᪠ SpeccyWiki [shift-esc-f]" accesskey="f" id="searchInput" autocomplete="off"> |
||
| 340 | ;<input type="submit" name="go" value="३" title="३ ࠭, 饩 筮 ⠪ " id="searchGoButton" class="searchButton"> |
||
| 341 | ;<input type="submit" name="fulltext" value="" title=" ࠭, ᮤঠ騥 㪠 ⥪" id="mw-searchButton" class="searchButton"> |
||
| 32 | Alone | 342 | ;</form> |
| 343 | ;TODO |
||
| 344 | jp skiprestoftag |
||
| 974 | dimkam | 345 | |
| 31 | Alone | 346 | tag_code |
| 347 | tag_pre |
||
| 32 | Alone | 348 | push af ;z/nz |
| 31 | Alone | 349 | call prcharvirtual_crlf_stateful ;opening&closing |
| 344 | alone | 350 | call htmlinitbody ;zxdn ४ plain text |
| 32 | Alone | 351 | pop af ;z/nz |
| 31 | Alone | 352 | ld hl,ispre |
| 353 | ld a,1 |
||
| 32 | Alone | 354 | jr tag_u_b_i |
| 31 | Alone | 355 | |
| 356 | tag_center |
||
| 501 | alone | 357 | ;TODO test |
| 31 | Alone | 358 | ld hl,iscentered |
| 359 | ld a,1 |
||
| 360 | jr tag_u_b_i |
||
| 361 | |||
| 362 | tag_h1 |
||
| 363 | tag_h2 |
||
| 364 | tag_h3 |
||
| 365 | tag_h4 |
||
| 366 | tag_h5 |
||
| 367 | tag_h6 |
||
| 501 | alone | 368 | jr z,tag_hclose |
| 31 | Alone | 369 | ld a,1 |
| 370 | ld (iscentered),a |
||
| 371 | jr tag_b |
||
| 501 | alone | 372 | tag_hclose |
| 373 | call prcharvirtual_crlf_stateful |
||
| 374 | ;xor a |
||
| 375 | ;ld (iscentered),a |
||
| 376 | jr tag_u_b_iq |
||
| 31 | Alone | 377 | |
| 378 | tag_mark |
||
| 379 | ld hl,curmark |
||
| 380 | ld a,CMARK |
||
| 381 | jr tag_u_b_i |
||
| 382 | |||
| 383 | tag_del |
||
| 23 | dimkam | 384 | tag_s |
| 385 | ld hl,curstroke |
||
| 386 | ld a,CSTROKE |
||
| 387 | jr tag_u_b_i |
||
| 31 | Alone | 388 | tag_ins |
| 23 | dimkam | 389 | tag_u |
| 390 | ld hl,curunderline |
||
| 391 | ld a,CUNDERLINE |
||
| 392 | jr tag_u_b_i |
||
| 31 | Alone | 393 | tag_th ;table header: TODO also center in cell |
| 23 | dimkam | 394 | tag_b |
| 395 | tag_strong |
||
| 396 | ld hl,curbold |
||
| 397 | ld a,CBOLD |
||
| 398 | jr tag_u_b_i |
||
| 31 | Alone | 399 | tag_em |
| 400 | tag_cite |
||
| 23 | dimkam | 401 | tag_i |
| 402 | ld hl,curitalic |
||
| 403 | ld a,CITALIC |
||
| 404 | tag_u_b_i |
||
| 405 | ld (hl),0 |
||
| 406 | jr z,$+3 ;Z=closing tag |
||
| 407 | ld (hl),a |
||
| 501 | alone | 408 | tag_u_b_iq |
| 23 | dimkam | 409 | call setfontweight |
| 410 | jp skiprestoftag |
||
| 411 | |||
| 31 | Alone | 412 | tag_ul ;list |
| 975 | dimkam | 413 | jp nz,skiprestoftag ;opening (li does newline) |
| 344 | alone | 414 | tag_dd ; lib.ru ॢ ப |
| 974 | dimkam | 415 | tag_p |
| 31 | Alone | 416 | tag_div |
| 974 | dimkam | 417 | call prcharvirtual_crlf_stateful |
| 418 | jp skiprestoftag |
||
| 23 | dimkam | 419 | tag_br |
| 974 | dimkam | 420 | ld (last_crlf_flag),a |
| 28 | Alone | 421 | call prcharvirtual_crlf_stateful |
| 23 | dimkam | 422 | jp skiprestoftag |
| 423 | tag_tr |
||
| 424 | ;only closing tr works as crlf |
||
| 28 | Alone | 425 | call z,prcharvirtual_crlf_stateful |
| 23 | dimkam | 426 | jp skiprestoftag |
| 427 | tag_td |
||
| 428 | ;only closing td works as tab |
||
| 28 | Alone | 429 | call z,prcharvirtual_tab_stateful |
| 23 | dimkam | 430 | jp skiprestoftag |
| 431 | |||
| 432 | tag_head |
||
| 433 | ;TODO read all tags inside (meta, title) |
||
| 28 | Alone | 434 | jp skiprestoftag |
| 435 | |||
| 55 | Alone | 436 | tag_iframe |
| 32 | Alone | 437 | tag_frame |
| 438 | ;TODO find src="..." (now we find last param) |
||
| 439 | ;jr $ |
||
| 55 | Alone | 440 | call htmlskipspaces |
| 32 | Alone | 441 | tag_frame0 |
| 442 | ;ld a,(prcharvirtual_stateful_x) |
||
| 443 | ;jr $ |
||
| 444 | |||
| 445 | ld a,(executetag_endchar) |
||
| 446 | call htmlskipspaces_go |
||
| 447 | ld de,wordbuf |
||
| 344 | alone | 448 | call getword_param_go ; ࠬ 祭 ! |
| 32 | Alone | 449 | ld (executetag_endchar),a |
| 450 | or a |
||
| 451 | ret z |
||
| 973 | dimkam | 452 | ld hl,(wordbuf) |
| 453 | ld de,0x7273 ;check src attribute |
||
| 454 | sbc hl,de |
||
| 455 | jr nz,.no_src_attr |
||
| 456 | |||
| 68 | Alone | 457 | ld a,CLINKIMG |
| 458 | ld (curlinkimg),a |
||
| 28 | Alone | 459 | call setfontweight |
| 460 | call rememberhrefyxposition |
||
| 32 | Alone | 461 | call initstringbuf2 |
| 462 | ld a,'[' |
||
| 463 | call prcharvirtual_stateful |
||
| 464 | ;read link to stringbuf2 until doublequote |
||
| 465 | ;print it |
||
| 466 | ld hl,wordbuf+5 ;after src=" |
||
| 973 | dimkam | 467 | .tag_frame_typetag0 |
| 32 | Alone | 468 | ld a,(hl) |
| 469 | or a |
||
| 973 | dimkam | 470 | jp z,.no_src_attr |
| 32 | Alone | 471 | cp 34 |
| 973 | dimkam | 472 | jp z,.no_src_attr |
| 55 | Alone | 473 | cp "'" |
| 973 | dimkam | 474 | jp z,.no_src_attr |
| 32 | Alone | 475 | inc hl |
| 476 | push hl |
||
| 477 | push af |
||
| 478 | call prcharvirtual_stateful |
||
| 479 | pop af |
||
| 480 | call printtostringbuf2 |
||
| 481 | pop hl |
||
| 973 | dimkam | 482 | jr .tag_frame_typetag0 |
| 483 | |||
| 484 | .no_src_attr |
||
| 485 | ld a,(iy+0) |
||
| 486 | cp '>' |
||
| 487 | jr nz,tag_frame0 |
||
| 488 | jp tag_frame_typetagq |
||
| 32 | Alone | 489 | |
| 490 | inithref |
||
| 491 | ld a,(curlink) |
||
| 492 | or a |
||
| 344 | alone | 493 | call nz,savestringbuf2 ; img a |
| 32 | Alone | 494 | call initstringbuf2 |
| 68 | Alone | 495 | ;ld a,CLINK |
| 496 | ;ld (curlink),a |
||
| 32 | Alone | 497 | call setfontweight |
| 498 | jp rememberhrefyxposition |
||
| 499 | |||
| 500 | tag_img |
||
| 501 | jp z,skiprestoftag ;Z=closing tag (does nothing) |
||
| 502 | ;jr $ |
||
| 503 | call htmlskipspaces |
||
| 42 | DimkaM | 504 | tag_img_readsrc |
| 505 | call htmlskipspaces_go |
||
| 28 | Alone | 506 | ld hl,tsrc |
| 32 | Alone | 507 | call eatgivenword_go |
| 42 | DimkaM | 508 | ;jr nz,tag_img_srcfail |
| 509 | |||
| 510 | jr z,tag_img_srcq |
||
| 511 | tag_img_srcfail |
||
| 512 | call htmlskipparam |
||
| 61 | Alone | 513 | or a |
| 514 | ret z |
||
| 42 | DimkaM | 515 | cp '>' |
| 516 | jr nz,tag_img_readsrc |
||
| 517 | jr tag_img_opening_readaltq |
||
| 518 | tag_img_srcq |
||
| 519 | |||
| 520 | ;ld hl,tsrc |
||
| 521 | ;call eatgivenword_go |
||
| 522 | ;jr nz,tag_img_opening_fail |
||
| 28 | Alone | 523 | ;read link to stringbuf2 until doublequote |
| 68 | Alone | 524 | ld a,CLINKIMG |
| 525 | ld (curlinkimg),a |
||
| 55 | Alone | 526 | call inithref |
| 527 | |||
| 528 | call RDBYTE;rdbyte |
||
| 529 | cp "'" |
||
| 530 | jr z,tag_img_opening_read0 |
||
| 531 | cp 34 |
||
| 532 | jr nz,tag_img_opening_read_go |
||
| 533 | |||
| 28 | Alone | 534 | tag_img_opening_read0 |
| 32 | Alone | 535 | call RDBYTE;rdbyte |
| 55 | Alone | 536 | tag_img_opening_read_go |
| 28 | Alone | 537 | or a |
| 538 | ret z |
||
| 539 | cp 34 |
||
| 540 | jr z,tag_img_opening_readq |
||
| 55 | Alone | 541 | cp "'" |
| 542 | jr z,tag_img_opening_readq |
||
| 61 | Alone | 543 | cp " " |
| 544 | jr z,tag_img_opening_readq |
||
| 55 | Alone | 545 | ;push af |
| 546 | ;call prcharvirtual_stateful |
||
| 547 | ;pop af |
||
| 28 | Alone | 548 | call printtostringbuf2 |
| 549 | jr tag_img_opening_read0 |
||
| 550 | tag_img_opening_readq |
||
| 551 | tag_img_opening_fail |
||
| 32 | Alone | 552 | ;a=last char read=quote |
| 61 | Alone | 553 | ;jr $ |
| 32 | Alone | 554 | call htmlskipspaces |
| 555 | push af |
||
| 28 | Alone | 556 | ld a,'[' |
| 557 | call prcharvirtual_stateful |
||
| 32 | Alone | 558 | pop af |
| 559 | tag_img_opening_readalt |
||
| 560 | ;a=last char read |
||
| 561 | call htmlskipspaces_go |
||
| 28 | Alone | 562 | ld hl,talt |
| 32 | Alone | 563 | call eatgivenword_go |
| 28 | Alone | 564 | jr nz,tag_img_opening_altfail |
| 55 | Alone | 565 | |
| 566 | call RDBYTE;rdbyte |
||
| 567 | cp "'" |
||
| 568 | jr z,tag_img_opening_readalt0 |
||
| 569 | cp 34 |
||
| 570 | jr nz,tag_img_opening_readalt_go |
||
| 571 | |||
| 28 | Alone | 572 | tag_img_opening_readalt0 |
| 32 | Alone | 573 | call RDBYTE;rdbyte |
| 55 | Alone | 574 | tag_img_opening_readalt_go |
| 28 | Alone | 575 | or a |
| 576 | ret z |
||
| 577 | cp 34 |
||
| 578 | jr z,tag_img_opening_readaltq |
||
| 55 | Alone | 579 | cp "'" |
| 580 | jr z,tag_img_opening_readaltq |
||
| 61 | Alone | 581 | ;TODO mangled symbols |
| 28 | Alone | 582 | call prcharvirtual_stateful |
| 583 | jr tag_img_opening_readalt0 |
||
| 32 | Alone | 584 | tag_img_opening_altfail |
| 585 | ;find alt in next parameters |
||
| 586 | call htmlskipparam |
||
| 61 | Alone | 587 | or a |
| 588 | ret z |
||
| 32 | Alone | 589 | cp '>' |
| 590 | jr nz,tag_img_opening_readalt |
||
| 28 | Alone | 591 | tag_img_opening_readaltq |
| 55 | Alone | 592 | ld (executetag_endchar),a |
| 344 | alone | 593 | tag_frame_typetagq ;TODO 祬 ꥤ ३ atmturbo? |
| 28 | Alone | 594 | ld a,']' |
| 68 | Alone | 595 | call prcharvirtual_stateful |
| 596 | xor a |
||
| 597 | ld (curlinkimg),a |
||
| 32 | Alone | 598 | jr closehrefq |
| 599 | ;call prcharvirtual_stateful |
||
| 600 | ;call savestringbuf2 ;after printing ']' to count full size |
||
| 601 | ;xor a |
||
| 602 | ;ld (curlink),a |
||
| 603 | ;call setfontweight |
||
| 604 | ;jp skiprestoftag |
||
| 28 | Alone | 605 | |
| 23 | dimkam | 606 | tag_a |
| 28 | Alone | 607 | jr nz,tag_a_opening |
| 608 | ld a,'}' |
||
| 609 | call prcharvirtual_stateful |
||
| 610 | xor a |
||
| 611 | ld (curlink),a |
||
| 68 | Alone | 612 | closehrefq |
| 613 | call savestringbuf2 ;after printing '}' to count full size |
||
| 614 | ;xor a |
||
| 615 | ;ld (curlink),a |
||
| 28 | Alone | 616 | call setfontweight |
| 617 | jp skiprestoftag |
||
| 618 | tag_a_opening |
||
| 32 | Alone | 619 | ;jr $ |
| 620 | call htmlskipspaces |
||
| 621 | tag_a_opening_readhref |
||
| 622 | call htmlskipspaces_go |
||
| 28 | Alone | 623 | ld hl,thref |
| 32 | Alone | 624 | call eatgivenword_go |
| 625 | jr nz,tag_a_opening_hreffail |
||
| 626 | |||
| 68 | Alone | 627 | ld a,CLINK |
| 628 | ld (curlink),a |
||
| 501 | alone | 629 | call inithref |
| 31 | Alone | 630 | |
| 631 | ;zxdn: no quotes in href |
||
| 32 | Alone | 632 | call RDBYTE;rdbyte |
| 55 | Alone | 633 | cp "'" |
| 634 | jr z,tag_a_opening_read0 |
||
| 31 | Alone | 635 | cp 34 |
| 636 | jr nz,tag_a_opening_read_go |
||
| 32 | Alone | 637 | |
| 28 | Alone | 638 | ;read link to stringbuf2 until doublequote |
| 639 | tag_a_opening_read0 |
||
| 32 | Alone | 640 | call RDBYTE;rdbyte |
| 31 | Alone | 641 | tag_a_opening_read_go |
| 28 | Alone | 642 | or a |
| 643 | ret z |
||
| 31 | Alone | 644 | cp '>' |
| 645 | jr z,tag_a_opening_readq |
||
| 28 | Alone | 646 | cp 34 |
| 647 | jr z,tag_a_opening_readq |
||
| 55 | Alone | 648 | cp "'" |
| 649 | jr z,tag_a_opening_readq |
||
| 33 | Alone | 650 | cp 0x0d |
| 651 | jr z,tag_a_opening_read0 ;lib.ru |
||
| 652 | cp 0x0a |
||
| 653 | jr z,tag_a_opening_read0 ;lib.ru |
||
| 55 | Alone | 654 | if 1==0 |
| 33 | Alone | 655 | cp '&' |
| 656 | jr nz,tag_a_opening_read0ok |
||
| 55 | Alone | 657 | call printtostringbuf2 |
| 344 | alone | 658 | ;TODO & (forum.nedopc.com) |
| 33 | Alone | 659 | call RDBYTE;rdbyte |
| 55 | Alone | 660 | cp 'a' |
| 661 | jr nz,tag_a_opening_read0ok |
||
| 33 | Alone | 662 | call RDBYTE;rdbyte |
| 663 | call RDBYTE;rdbyte |
||
| 664 | call RDBYTE;rdbyte |
||
| 55 | Alone | 665 | jr tag_a_opening_read0 |
| 33 | Alone | 666 | tag_a_opening_read0ok |
| 55 | Alone | 667 | endif |
| 668 | ;push af |
||
| 447 | alone | 669 | ;call prcharvirtual_stateful ;debug print |
| 55 | Alone | 670 | ;pop af |
| 28 | Alone | 671 | call printtostringbuf2 |
| 672 | jr tag_a_opening_read0 |
||
| 32 | Alone | 673 | tag_a_opening_hreffail |
| 674 | ;find href in next parameters |
||
| 675 | call htmlskipparam |
||
| 61 | Alone | 676 | or a |
| 677 | ret z |
||
| 32 | Alone | 678 | cp '>' |
| 679 | jr nz,tag_a_opening_readhref |
||
| 28 | Alone | 680 | tag_a_opening_readq |
| 31 | Alone | 681 | ld (executetag_endchar),a |
| 28 | Alone | 682 | tag_a_opening_fail |
| 683 | ld a,'{' |
||
| 684 | call prcharvirtual_stateful |
||
| 685 | jp skiprestoftag |
||
| 23 | dimkam | 686 | |
| 32 | Alone | 687 | |
| 688 | ;skip until space/>/"/EOF |
||
| 689 | ;if ", skip until another ", then skip space/> |
||
| 690 | ;a=last char read |
||
| 691 | ;out: a=last char (space/>/") |
||
| 692 | htmlskipparam0 |
||
| 693 | call RDBYTE;rdbyte |
||
| 694 | htmlskipparam |
||
| 695 | or a |
||
| 696 | ret z |
||
| 697 | cp ' ' |
||
| 698 | ret z |
||
| 699 | cp '>' |
||
| 700 | ret z |
||
| 701 | cp 34 |
||
| 702 | jr nz,htmlskipparam0 |
||
| 703 | htmlskipparamquote0 |
||
| 704 | call RDBYTE;rdbyte |
||
| 705 | or a |
||
| 706 | ret z |
||
| 707 | cp 34 |
||
| 708 | jr nz,htmlskipparamquote0 |
||
| 709 | jp RDBYTE;rdbyte ;skip space/> |
||
| 710 | |||
| 28 | Alone | 711 | eatgivenword |
| 712 | ;hl=word (asciiz) |
||
| 713 | ;out: Z=OK (or else a=last char read) |
||
| 714 | eatgivenword0 |
||
| 715 | ld a,(hl) |
||
| 716 | or a |
||
| 717 | ret z |
||
| 32 | Alone | 718 | call RDBYTE;rdbyte |
| 719 | ;ld (executetag_endchar),a |
||
| 720 | eatgivenword_go |
||
| 33 | Alone | 721 | or 0x20 |
| 28 | Alone | 722 | cp (hl) |
| 723 | inc hl |
||
| 724 | jr z,eatgivenword0 |
||
| 32 | Alone | 725 | ld (executetag_endchar),a |
| 28 | Alone | 726 | ret ;fail |
| 32 | Alone | 727 | |
| 728 | getword_tag |
||
| 729 | ;hl=string |
||
| 730 | ;de=wordbuf |
||
| 731 | ;out: hl=terminator/space/> addr, a=terminator/space/> char |
||
| 344 | alone | 732 | ;TODO ९ WORDBUFSIZE |
| 32 | Alone | 733 | getword_tag0 |
| 734 | call RDBYTE;rdbyte |
||
| 735 | getword_tag_go |
||
| 736 | or a |
||
| 737 | jr z,getword_tagq |
||
| 738 | cp ' ' |
||
| 739 | jr z,getword_tagq |
||
| 740 | cp '>' |
||
| 741 | jr z,getword_tagq |
||
| 742 | or 0x20 |
||
| 743 | ld (de),a |
||
| 744 | inc de |
||
| 745 | jr getword_tag0 |
||
| 746 | getword_tagq |
||
| 747 | push af |
||
| 748 | xor a |
||
| 749 | ld (de),a |
||
| 750 | pop af |
||
| 751 | ret |
||
| 752 | |||
| 753 | |||
| 754 | getword_mangledchar |
||
| 755 | ;hl=string |
||
| 756 | ;de=wordbuf |
||
| 757 | ;out: hl=terminator/space/; addr, a=terminator/space/; char |
||
| 344 | alone | 758 | ;TODO ९ WORDBUFSIZE |
| 32 | Alone | 759 | getword_mangledchar0 |
| 760 | call RDBYTE;rdbyte |
||
| 59 | Alone | 761 | ;or a |
| 762 | ;jr z,getword_mangledcharq |
||
| 763 | cp "A" |
||
| 764 | jr c,getword_mangledcharq |
||
| 765 | ;cp ';' |
||
| 766 | ;jr z,getword_mangledcharq |
||
| 767 | ;cp '#' |
||
| 768 | ;jr z,getword_mangledcharq ;lib.ru afranius@newmail.ru |
||
| 769 | ld (de),a |
||
| 770 | inc de |
||
| 771 | jr getword_mangledchar0 |
||
| 772 | getword_mangledcharq |
||
| 773 | push af |
||
| 774 | xor a |
||
| 775 | ld (de),a |
||
| 776 | pop af |
||
| 777 | ret |
||
| 778 | |||
| 779 | ;getword_param |
||
| 780 | ;hl=string |
||
| 781 | ;de=wordbuf |
||
| 782 | ;out: hl=terminator/space/; addr, a=terminator/space/; char |
||
| 344 | alone | 783 | ;TODO ९ WORDBUFSIZE |
| 59 | Alone | 784 | getword_param0 |
| 785 | call RDBYTE;rdbyte |
||
| 344 | alone | 786 | getword_param_go ; ࠬ 祭 ! |
| 32 | Alone | 787 | or a |
| 59 | Alone | 788 | jr z,getword_paramq |
| 55 | Alone | 789 | cp "'" |
| 59 | Alone | 790 | jr z,getword_paramquote |
| 55 | Alone | 791 | cp 34 |
| 59 | Alone | 792 | jr z,getword_paramquote |
| 32 | Alone | 793 | cp ' ' |
| 59 | Alone | 794 | jr z,getword_paramspaceq |
| 795 | ;cp ';' |
||
| 796 | ;jr z,getword_paramcharq |
||
| 797 | ;cp '#' |
||
| 798 | ;jr z,getword_paramcharq ;lib.ru afranius@newmail.ru |
||
| 32 | Alone | 799 | cp '>' |
| 59 | Alone | 800 | jr z,getword_paramq |
| 801 | getword_param0ok |
||
| 32 | Alone | 802 | or 0x20 |
| 803 | ld (de),a |
||
| 804 | inc de |
||
| 59 | Alone | 805 | jr getword_param0 |
| 806 | getword_paramquote |
||
| 55 | Alone | 807 | ld c,a |
| 59 | Alone | 808 | getword_paramquote0 |
| 55 | Alone | 809 | ld (de),a |
| 810 | inc de |
||
| 811 | call RDBYTE;rdbyte |
||
| 812 | cp c |
||
| 344 | alone | 813 | jr nz,getword_paramquote0 ;TODO ??? |
| 59 | Alone | 814 | jr getword_param0ok |
| 815 | getword_paramspaceq |
||
| 344 | alone | 816 | ; , 窠 ? |
| 59 | Alone | 817 | getword_paramq |
| 32 | Alone | 818 | push af |
| 819 | xor a |
||
| 820 | ld (de),a |
||
| 821 | pop af |
||
| 822 | ret |
||
| 823 | |||
| 824 | |||
| 28 | Alone | 825 | |
| 32 | Alone | 826 | strcp |
| 827 | ;hl=s1 |
||
| 828 | ;de=s2 |
||
| 829 | ;out: Z (equal, hl=terminator of s1+1, de=terminator of s2+1), NZ (not equal, hl=erroraddr in s1, de=erroraddr in s2) |
||
| 830 | strcp0. |
||
| 831 | ld a,[de] ;s2 |
||
| 832 | cp [hl] ;s1 |
||
| 833 | ret nz |
||
| 834 | inc hl |
||
| 835 | inc de |
||
| 836 | or a |
||
| 837 | jr nz,strcp0. |
||
| 838 | ret ;z |
||
| 839 | |||
| 840 | strcp_tillde0 |
||
| 841 | ;hl=s1 |
||
| 842 | ;de=s2 |
||
| 843 | ;out: Z (equal, hl=terminator of s1+1, de=terminator of s2+1), NZ (not equal, hl=erroraddr in s1, de=erroraddr in s2) |
||
| 844 | strcp_tillde0_0. |
||
| 845 | ld a,[de] ;s2 |
||
| 846 | or a |
||
| 847 | ret z |
||
| 848 | cp [hl] ;s1 |
||
| 849 | ret nz |
||
| 850 | inc hl |
||
| 851 | inc de |
||
| 852 | jr strcp_tillde0_0. |
||
| 853 | |||
| 854 | |||
| 28 | Alone | 855 | thref |
| 31 | Alone | 856 | db "href=",0 |
| 28 | Alone | 857 | tsrc |
| 55 | Alone | 858 | db "src=",0 |
| 28 | Alone | 859 | talt |
| 55 | Alone | 860 | db "alt=",0 |
| 28 | Alone | 861 | |
| 862 | rememberhrefyxposition |
||
| 501 | alone | 863 | ld a,(prcharvirtual_stateful_x) ; 業 砥 ࠢ쭮! ⮬ ⠯ ࠭ x ⥭! |
| 28 | Alone | 864 | ld (hrefxposition),a |
| 865 | ld hl,(curprintvirtualy) |
||
| 866 | ld (hrefyposition),hl |
||
| 867 | ret |
||
| 31 | Alone | 868 | |
| 869 | tag_title |
||
| 32 | Alone | 870 | ;not used, because header is skipped (TODO) |
| 31 | Alone | 871 | ;jp z,tag_titleclose |
| 872 | jp nz,tag_h1 ;open |
||
| 873 | ;tag_titleclose |
||
| 874 | ;ld a,1 |
||
| 447 | alone | 875 | ;ld (utf8flag),a ;, .. title charset |
| 31 | Alone | 876 | call prcharvirtual_crlf_stateful ;</title> forces newline |
| 877 | xor a ;z |
||
| 878 | jp tag_h1 |
||
| 1656 | dimkam | 879 | |
| 447 | alone | 880 | tag_li ;list line (no closing tag)? msn.com <li ><a...>...</a></li> |
| 975 | dimkam | 881 | push af |
| 882 | call prcharvirtual_crlf_stateful |
||
| 883 | pop af |
||
| 31 | Alone | 884 | jp z,skiprestoftag ;closing |
| 447 | alone | 885 | ld a,'*';'-';'*' ;TODO ⮬ UTF8 |
| 31 | Alone | 886 | call prcharvirtual_stateful |
| 887 | ld a,' ' |
||
| 888 | call prcharvirtual_stateful |
||
| 889 | jp skiprestoftag |
||
| 890 | |||
| 891 | tag_meta |
||
| 892 | ;TODO find "charset=UTF-8" or "charset=windows-1251" |
||
| 893 | tag_meta0 |
||
| 894 | ld b,a |
||
| 895 | push bc |
||
| 32 | Alone | 896 | call RDBYTE;rdbyte |
| 31 | Alone | 897 | pop bc |
| 898 | or a |
||
| 899 | ret z |
||
| 900 | cp '>' |
||
| 901 | jp z,skiprestoftag0 |
||
| 902 | or 0x20 |
||
| 903 | cp 'w' |
||
| 904 | jr nz,tag_meta0 |
||
| 905 | ld a,b |
||
| 906 | cp '=' |
||
| 907 | ld a,'w' |
||
| 908 | jr nz,tag_meta0 |
||
| 32 | Alone | 909 | xor a;ld a,0 |
| 31 | Alone | 910 | ld (utf8flag),a |
| 32 | Alone | 911 | jp skiprestoftag_go |
| 31 | Alone | 912 | |
| 61 | Alone | 913 | tag_style |
| 31 | Alone | 914 | tag_script |
| 915 | ;TODO skip until </script> |
||
| 32 | Alone | 916 | tag_script0 |
| 31 | Alone | 917 | ld b,a |
| 918 | push bc |
||
| 32 | Alone | 919 | call RDBYTE;rdbyte |
| 31 | Alone | 920 | pop bc |
| 921 | or a |
||
| 922 | ret z |
||
| 923 | cp '/' |
||
| 32 | Alone | 924 | jr nz,tag_script0 |
| 31 | Alone | 925 | ld a,b |
| 926 | cp '<' |
||
| 927 | ld a,'/' |
||
| 32 | Alone | 928 | jr nz,tag_script0 |
| 929 | jp skiprestoftag_go |
||
| 31 | Alone | 930 | |
| 32 | Alone | 931 | htmlskipspaces |
| 31 | Alone | 932 | htmlskipspaces0 |
| 32 | Alone | 933 | call RDBYTE;rdbyte |
| 934 | htmlskipspaces_go |
||
| 31 | Alone | 935 | cp ' ' |
| 936 | jr z,htmlskipspaces0 |
||
| 32 | Alone | 937 | cp 0x0d |
| 938 | jr z,htmlskipspaces0 |
||
| 939 | cp 0x0a |
||
| 940 | jr z,htmlskipspaces0 |
||
| 31 | Alone | 941 | ld (executetag_endchar),a |
| 942 | ret |
||
| 744 | alone | 943 | |
| 944 | tag_COMMENT |
||
| 945 | call RDBYTE |
||
| 946 | or a |
||
| 947 | ret z |
||
| 948 | cp '-' |
||
| 949 | jr nz,tag_COMMENT |
||
| 950 | call RDBYTE |
||
| 951 | or a |
||
| 952 | ret z |
||
| 953 | cp '-' |
||
| 954 | jr nz,tag_COMMENT |
||
| 955 | call RDBYTE |
||
| 956 | or a |
||
| 957 | ret z |
||
| 958 | cp '>' |
||
| 959 | jr nz,tag_COMMENT |
||
| 960 | ret |
||
| 28 | Alone | 961 | |
| 23 | dimkam | 962 | tag_font |
| 963 | ;TODO push old font/pop old font |
||
| 964 | |||
| 31 | Alone | 965 | tag_link |
| 966 | ;TODO find href |
||
| 23 | dimkam | 967 | |
| 32 | Alone | 968 | tag_dl |
| 969 | tag_dt |
||
| 31 | Alone | 970 | tag_doctype |
| 971 | tag_span |
||
| 23 | dimkam | 972 | tag_html |
| 975 | dimkam | 973 | ;tag_ul ;७ 㦥, ⠪ li |
| 974 | dimkam | 974 | tag_table ;७ 㦥, ⠪ tr |
| 31 | Alone | 975 | tag_tbody |
| 32 | Alone | 976 | jp skiprestoftag |
| 977 | |||
| 978 | tag_frameset ;before body |
||
| 23 | dimkam | 979 | tag_body |
| 34 | Alone | 980 | call htmlinitbody |
| 981 | jp skiprestoftag |
||
| 982 | |||
| 983 | htmlinitbody |
||
| 984 | xor a |
||
| 985 | ld (iscentered),a |
||
| 986 | inc a ;ld a,1 |
||
| 32 | Alone | 987 | ld (printableflag),a |
| 344 | alone | 988 | ; 樨 㦥 ⠭ ३: |
| 32 | Alone | 989 | ;call prcharvirtual_x0 |
| 990 | call setdefaultfontweight |
||
| 344 | alone | 991 | jp setfontweight;call initstringbuf1 ; ⮣ ⠭ 梥 |
| 23 | dimkam | 992 | |
| 993 | skiprestoftag |
||
| 994 | ;we can be at >/space/EOF (in executetag_endchar) |
||
| 995 | executetag_endchar=$+1 |
||
| 996 | ld a,0 |
||
| 997 | skiprestoftag0 |
||
| 998 | cp '>' |
||
| 999 | ret z |
||
| 32 | Alone | 1000 | skiprestoftag_go |
| 1001 | call RDBYTE;rdbyte |
||
| 23 | dimkam | 1002 | or a |
| 1003 | ret z |
||
| 1004 | jr skiprestoftag0 |
||
| 1005 | |||
| 28 | Alone | 1006 | |
| 23 | dimkam | 1007 | wordbuf |
| 1008 | ds WORDBUFSIZE |