ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/vt102/vt102
(Generate patch)

Comparing vt102/vt102 (file contents):
Revision 1.9 by root, Mon Dec 1 20:12:07 2014 UTC vs.
Revision 1.10 by root, Wed Dec 3 02:07:44 2014 UTC

15# 15#
16 16
17# If this file contains embedded ROMs, the above copyright notice does 17# If this file contains embedded ROMs, the above copyright notice does
18# not apply to them. 18# not apply to them.
19 19
20# this hack is not considered release ready in and way, shape, or form
21# ./vt102 bash
22# ./vt102 telnet towel.blinkenlights.nl
23# ./vt102 curl http://artscene.textfiles.com/vt100/trekvid.vt
24# ./vt102 curl http://artscene.textfiles.com/vt100/surf.vt # in 3d!
25
26use strict; 20use strict;
27use feature qw(state);
28#use common::sense; 21#use common::sense;
29 22
30$| = 1;
31
32my $VT102 = 1; 23my $VT102 = 1;
33my $AVO = $VT102 || 1; 24my $VT131 = 0;
25my $AVO = 1;
34my $KBD = 1; 26my $KBD = 1;
35 27
36############################################################################# 28if ($ARGV[0] =~ /^-?-vt100$/) {
37# rom initialising 29 shift; $VT102 = 0; $AVO = 0;
30}
38 31
32if ($ARGV[0] =~ /^-?-vt100\+avo$/) {
33 shift; $VT102 = 0; $AVO = 1;
34}
35
36if ($ARGV[0] =~ /^-?-vt102$/) {
37 shift; # default
38}
39
40if ($ARGV[0] =~ /^-?-vt131$/) {
41 shift; $VT131 = 1;
42}
43
44if ($ARGV[0] =~ /^-/) {
45 die <<EOF;
46
47VT102, A VT100/101/102/131 SIMULATOR
48
49Usage:
50
51 $0 [option] [program [args]]
52
53Examples:
54
55 $0 bash
56 $0 telnet towel.blinkenlights.nl
57 $0 curl http://artscene.textfiles.com/vt100/trekvid.vt
58 $0 curl http://artscene.textfiles.com/vt100/surf.vt # in 3d!
59
60Option can be one of:
61
62 --vt100
63 --vt100+avo
64 --vt102
65 --vt131
66
67Non-obvious special keys are:
68
69 SET UP Home
70 BACKSPACE Rubout
71 CAPS LOCK Prior/PgUp
72 NO SCROLL Next/PgDown
73 BREAK End
74
75Set-Up Guide:
76
77 http://vt100.net/docs/vt102-ug/chapter3.html#S3.6
78
79Author:
80
81 Marc Lehmann <vt102\@schmorp.de>
82
83EOF
84}
85
86#############################################################################
87# ROM/hardware init
88
39my $ROM = do { 89my $ROMS = do {
40 binmode DATA; 90 binmode DATA;
41 local $/; 91 local $/;
42 <DATA> 92 <DATA>
43}; 93};
44 94
450x6001 == length $ROM or die "corrupted rom image"; 950x6801 == length $ROMS or die "corrupted rom image";
46 96
47binmode STDOUT; 97binmode STDOUT;
48 98
49my @M = (0xff) x 65536; # main memory, = (0xff) x 65536; 99my @M = (0xff) x 65536; # main memory, = (0xff) x 65536;
50 100
51# populate mem with rom contents 101# populate mem with rom contents
52if ($VT102) { 102if ($VT102) {
53 @M[0x0000 .. 0x1fff] = unpack "C*", substr $ROM, 0x2000, 0x2000; 103 @M[0x0000 .. 0x1fff] = unpack "C*", substr $ROMS, 0x2000, 0x2000;
54 @M[0x8000 .. 0x9fff] = unpack "C*", substr $ROM, 0x4000, 0x2000; 104 @M[0x8000 .. 0x9fff] = unpack "C*", substr $ROMS, 0x4000, 0x2000;
105 @M[0xa000 .. 0xa7ff] = unpack "C*", substr $ROMS, 0x6000, 0x0800 if $VT131;
55} else { 106} else {
56 @M[0x0000 .. 0x1fff] = unpack "C*", substr $ROM, 0x0000, 0x2000; 107 @M[0x0000 .. 0x1fff] = unpack "C*", substr $ROMS, 0x0000, 0x2000;
57} 108}
58 109
59############################################################################# 110#############################################################################
60# cpu registers and I/O support 111# 8085 CPU registers and I/O support
61 112
62my $PTY; # the pty we allocated, if any 113my $PTY; # the pty we allocated, if any
63my $PRSTATUS = 0;
64 114
65# 8080/8085 registers 115# 8080/8085 registers
66# b, c, d, e, h, l, a 116# b, c, d, e, h, l, a
67my ($A, $B, $C, $D, $E, $H, $L, $A); 117my ($A, $B, $C, $D, $E, $H, $L, $A);
68my ($PC, $SP, $IFF, $FA, $FZ, $FS, $FP, $FC); 118my ($PC, $SP, $IFF, $FA, $FZ, $FS, $FP, $FC);
74my $x; # dummy temp for instructions 124my $x; # dummy temp for instructions
75 125
76my $CLK; # rather inexact clock 126my $CLK; # rather inexact clock
77 127
78############################################################################# 128#############################################################################
79# the dreaded nvr1400 chip. not needed to get it going, but provided for reference 129# the dreaded NVR1400 chip. not needed to get it going, but provided anyway
80 130
81# nvram 131# nvram
82my @NVR = (0x3fff) x 100; # vt102: 214e accum, 214f only lower 8 bit used, first 44 bytes 132my @NVR = (0x3fff) x 100; # vt102: 214e accum, 214f only lower 8 bit used, first 44 bytes
83my $NVRADDR; 133my $NVRADDR;
84my $NVRDATA; 134my $NVRDATA;
107 157
108 $NVRCMD[($NVRLATCH >> 1) & 7]($a1 * 10 + $a0, $NVRLATCH & 1) 158 $NVRCMD[($NVRLATCH >> 1) & 7]($a1 * 10 + $a0, $NVRLATCH & 1)
109} 159}
110 160
111############################################################################# 161#############################################################################
162# I/O ports - output
112 163
113my $DC11_REVERSE = 0; 164my $DC11_REVERSE = 0;
114 165
115my $XON = 1; # false if terminal wants us to pause 166my $XON = 1; # false if terminal wants us to pause
116my $PUSARTCMD; 167my $PUSARTCMD;
167sub out_d2 { } # 0..3 == 80c/132c/60hz/50hz 218sub out_d2 { } # 0..3 == 80c/132c/60hz/50hz
168 219
169sub out_82 { 220sub out_82 {
170 # keyboard 221 # keyboard
171 222
172 # CLICK STARTSCAN ONLINE LOCKED | CTS DSR INSERT L1(?) 223 # CLICK STARTSCAN ONLINE LOCKED | CTS DSR INS L1
173 # CLICK STARTSCAN ONLINE LOCKED | LED1 LED2 LED3 LED4 224 # CLICK STARTSCAN ONLINE LOCKED | L1 L2 L3 L4
174 $KSTATUS = $_[0]; 225 $KSTATUS = $_[0];
175 226
176 # start new scan unless scan in progress 227 # start new scan unless scan in progress
177 if (($_[0] & 0x40) && !@KXMIT) { 228 if (($_[0] & 0x40) && !@KXMIT) {
178 # do not reply with keys in locked mode 229 # do not reply with keys in locked mode
201 $RST |= 1; 252 $RST |= 1;
202 } 253 }
203} 254}
204 255
205############################################################################# 256#############################################################################
257# I/O ports - input
206 258
207my $NVRBIT; 259my $NVRBIT;
208my $LBA; 260my $LBA6; # twice the frequenxy of LBA7
209 261
210sub in_00 { # pusart data 262sub in_00 { # pusart data
211 # interrupt not generated here, because infinite 263 # interrupt not generated here, because infinite
212 # speed does not go well with the vt102. 264 # speed does not go well with the vt102.
213 265
222sub in_22 { # modem buffer(?) 274sub in_22 { # modem buffer(?)
223 # wild guess: -CTS -SPDI -RI -CD 0 0 0 0 275 # wild guess: -CTS -SPDI -RI -CD 0 0 0 0
224 0x20 276 0x20
225} 277}
226 278
227sub in_0f { } # unknown, connected to out 2f 279sub in_0f { 0xff } # vt102 unknown, connected to out 2f
228 280
229sub in_42 { # flag buffer 281sub in_42 { # flag buffer
230 ++$LBA; 282 ++$LBA6;
231 283
232 $NVRBIT = nvr ? 0x20 : 0x00 if ($LBA & 0x3) == 0x2; 284 $NVRBIT = nvr ? 0x20 : 0x00 if ($LBA6 & 0x3) == 0x2;
233 285
234 # KBD_XMITEMPTY LBA7 NVRDATA ODDFIELD - OPTION !GFX !AVO PUSART_TXRDY 286 # KBD_XMITEMPTY LBA7 NVRDATA ODDFIELD - OPTION !GFX !AVO PUSART_TXRDY
235 287
236 my $f = 0x85 | $NVRBIT; 288 my $f = 0x85 | $NVRBIT;
237 289
238 $f |= 0x02 unless $AVO; 290 $f |= 0x02 unless $AVO;
239 $f |= 0x40 if $LBA & 0x2; 291 $f |= 0x40 if $LBA6 & 0x2;
240 292
241 $f 293 $f
242} 294}
243 295
244sub in_82 { # tbmt keyboard uart 296sub in_82 { # tbmt keyboard uart
246 298
247 $RST |= 1; 299 $RST |= 1;
248 shift @KXMIT 300 shift @KXMIT
249} 301}
250 302
251sub in_03 { 0xff } # unknown, printer uart input? 303sub in_03 { 0xff } # vt102 unknown, printer uart input?
252sub in_0b { 0xff } # unknown 304sub in_0b { 0xff } # vt102 unknown
253sub in_17 { 0xff } # unknown, printer status clear by reading? 305sub in_17 { 0xff } # vt102 unknown, printer status clear by reading?
254sub in_1b { 0xff } # unknown 306sub in_1b { 0xff } # vt102 unknown
255 307
256############################################################################# 308#############################################################################
309# 8085 cpu opcodes and flag handling
257 310
258sub sf { # set flags (ZSC - AP not implemented) 311sub sf { # set flags (ZSC - AP not implemented)
259 $FS = $_[0] & 0x080; 312 $FS = $_[0] & 0x080;
260 $FZ = ($_[0] & 0x0ff) == 0; 313 $FZ = !($_[0] & 0x0ff);
261 $FC = $_[0] & 0x100; 314 $FC = $_[0] & 0x100;
262 315
263 $_[0] & 0xff 316 $_[0] &= 0xff;
317}
318
319sub sf8 { # set flags (ZSC - AP not implemented)
320 $FS = $_[0] & 0x080;
321 $FZ = !($_[0] & 0x0ff);
322 $FC = 0;
264} 323}
265 324
266sub sf_nc { # set flags except carry 325sub sf_nc { # set flags except carry
267 $FS = $_[0] & 0x080; 326 $FS = $_[0] & 0x080;
268 $FZ = ($_[0] & 0x0ff) == 0; 327 $FZ = ($_[0] & 0x0ff) == 0;
269 328
270 $_[0] & 0xff 329 $_[0] &= 0xff;
271} 330}
272 331
273my @op = map { sprintf "status(); die 'unknown op %02x'", $_ } 0 .. 255; 332my @op = map { sprintf "status(); die 'unknown op %02x'", $_ } 0x00 .. 0xff;
274my @ops;
275 333
276my @reg = qw($B $C $D $E $H $L $M[$H*256+$L] $A); 334my @reg = qw($B $C $D $E $H $L $M[$H*256+$L] $A);
277my @cc = ('if !$FZ', 'if $FZ', 'if !$FC', 'if $FC', ';die', ';die', 'if !$FS', 'if $FS'); # die == unimplemented $FP parity 335my @cc = ('if !$FZ', 'if $FZ', 'if !$FC', 'if $FC', ';die', ';die', 'if !$FS', 'if $FS'); # die == unimplemented $FP parity
336
337$op[0x00] = '';
278 338
279# mov r,r / r,M / M,r 339# mov r,r / r,M / M,r
280for my $s (0..7) { 340for my $s (0..7) {
281 for my $d (0..7) { 341 for my $d (0..7) {
282 $op[0x40 + $d * 8 + $s] = "$reg[$d] = $reg[$s]"; 342 $op[0x40 + $d * 8 + $s] = "$reg[$d] = $reg[$s]"; # mov
283 } 343 }
284} 344}
285 345
286$op[0x00] = ''; 346$op[0x76] = 'die "HLT"'; # hlt (mov m,m)
347
348# mvi r / M
349$op[0x06 + $_ * 8] = "$reg[$_] = IMM8" for 0..7;
287 350
288$op[0x01] = '($B, $C) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi 351$op[0x01] = '($B, $C) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi
289$op[0x11] = '($D, $E) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi 352$op[0x11] = '($D, $E) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi
290$op[0x21] = '($H, $L) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi 353$op[0x21] = '($H, $L) = (IMM16 >> 8, IMM16 & 0xff)'; # lxi
291$op[0x31] = '$SP = IMM16' ; # lxi #d# 0xf000 because of limited stack 354$op[0x31] = '$SP = IMM16' ; # lxi
292 355
293$op[0x02] = '$M[$B * 256 + $C] = $A'; # stax 356$op[0x02] = '$M[$B * 256 + $C] = $A'; # stax
294$op[0x12] = '$M[$D * 256 + $E] = $A'; # stax 357$op[0x12] = '$M[$D * 256 + $E] = $A'; # stax
295$op[0x32] = '$M[IMM16 ] = $A'; # sta 358$op[0x32] = '$M[IMM16 ] = $A'; # sta
296 359
360$op[0x0a] = '$A = $M[$B * 256 + $C]'; # ldax b
361$op[0x1a] = '$A = $M[$D * 256 + $E]'; # ldax d
362$op[0x3a] = '$A = $M[IMM16]'; # lda
363
364$op[0x22] = '($M[IMM16], $M[IMM16 + 1]) = ($L, $H)'; # shld
365$op[0x2a] = '($L, $H) = ($M[IMM16], $M[IMM16 + 1])'; # lhld
366
297sub inxdcx($$$) { 367sub inxdcx($$$) {
298 $x = ($_[0] * 256 + $_[1] + $_[2]) & 0xffff; 368 $x = $_[0] * 256 + $_[1] + $_[2];
299 $_[0] = $x >> 8; 369 ($_[0], $_[1]) = (($x >> 8) & 0xff, $x & 0xff);
300 $_[1] = $x & 0xff;
301} 370}
302 371
303$op[0x03] = 'inxdcx $B, $C, 1'; # inx 372$op[0x03] = 'inxdcx $B, $C, 1'; # inx
304$op[0x13] = 'inxdcx $D, $E, 1'; # inx 373$op[0x13] = 'inxdcx $D, $E, 1'; # inx
305$op[0x23] = 'inxdcx $H, $L, 1'; # inx 374$op[0x23] = 'inxdcx $H, $L, 1'; # inx
308$op[0x1b] = 'inxdcx $D, $E, -1'; # dcx 377$op[0x1b] = 'inxdcx $D, $E, -1'; # dcx
309$op[0x2b] = 'inxdcx $H, $L, -1'; # dcx 378$op[0x2b] = 'inxdcx $H, $L, -1'; # dcx
310$op[0x3b] = '--$SP' ; # dcx 379$op[0x3b] = '--$SP' ; # dcx
311 380
312# "no carry" doesn't seem to be needed for vt100 - optimize? 381# "no carry" doesn't seem to be needed for vt100 - optimize?
313$op[0x04 + $_ * 8] = "$reg[$_] = sf_nc $reg[$_] + 1" for 0..7; # inr
314$op[0x05 + $_ * 8] = "$reg[$_] = sf_nc $reg[$_] - 1" for 0..7; # dcr
315
316# mvi r / M
317$op[0x06 + $_ * 8] = "$reg[$_] = IMM8" for 0..7; 382$op[0x04 + $_ * 8] = "sf_nc ++$reg[$_]" for 0..7; # inr
383$op[0x05 + $_ * 8] = "sf_nc --$reg[$_]" for 0..7; # dcr
384
385$op[0x07] = ' $FC = $A & 0x80; $A = (($A << 1) + ($FC && 0x01)) & 0xff '; # rlc
386$op[0x17] = ' ($FC, $A) = ($A & 0x80, (($A << 1) + ($FC && 0x01)) & 0xff)'; # ral
387
388$op[0x0f] = ' $FC = $A & 0x01; $A = ($A >> 1) | ($FC && 0x80) '; # rrc
389$op[0x1f] = ' ($FC, $A) = ($A & 0x01, ($A >> 1) | ($FC && 0x80))'; # rar
390
391$op[0x2f] = '$A ^= 0xff'; # cma
318 392
319# getting this insn wrong (its the only 16 bit insn to modify flags) 393# getting this insn wrong (its the only 16 bit insn to modify flags)
320# wasted three of my best days with mindless vt102 rom reverse engineering 394# wasted three of my best days with mindless vt102 rom reverse engineering
321sub dad { 395sub dad {
322 $x = $H * 256 + $L + $_[0]; 396 $x = $H * 256 + $L + $_[0];
328$op[0x09] = 'dad $B * 256 + $C'; # dad 402$op[0x09] = 'dad $B * 256 + $C'; # dad
329$op[0x19] = 'dad $D * 256 + $E'; # dad 403$op[0x19] = 'dad $D * 256 + $E'; # dad
330$op[0x29] = 'dad $H * 256 + $L'; # dad 404$op[0x29] = 'dad $H * 256 + $L'; # dad
331$op[0x39] = 'dad $SP '; # dad 405$op[0x39] = 'dad $SP '; # dad
332 406
333$op[0x07] = ' $FC = $A >> 7; $A = ($A * 2 + $FC) & 0xff '; # rlc 407$op[0x80 + $_] = 'sf $A += + ' . $reg[$_] for 0..7; # add
334$op[0x17] = ' ($FC, $A) = ($A >> 7, ($A * 2 + $FC) & 0xff)'; # ral 408$op[0x88 + $_] = 'sf $A += ($FC && 1) + ' . $reg[$_] for 0..7; # adc
409$op[0x90 + $_] = 'sf $A -= + ' . $reg[$_] for 0..7; # sub
410$op[0x98 + $_] = 'sf $A -= ($FC && 1) + ' . $reg[$_] for 0..7; # sbb
411$op[0xa0 + $_] = 'sf8 $A &= ' . $reg[$_] for 0..7; # ana
412$op[0xa8 + $_] = 'sf8 $A ^= ' . $reg[$_] for 0..7; # xra
413$op[0xb0 + $_] = 'sf8 $A |= ' . $reg[$_] for 0..7; # ora
414$op[0xb8 + $_] = 'sf $x = $A - ' . $reg[$_] for 0..7; # cmp
415# possible todo: optimize ora a, maybe xra a
335 416
336$op[0x0f] = ' $FC = $A & 1; $A = ($A >> 1) | ($FC && 0x80) '; # rrc 417$op[0xc6] = 'sf $A += IMM8'; # adi
337$op[0x1f] = ' ($FC, $A) = ($A & 1, ($A >> 1) | ($FC && 0x80))'; # rar 418# ce ADI NYI
419$op[0xd6] = 'sf $A -= IMM8'; # sui
420# de SBI NYI
421$op[0xe6] = 'sf8 $A &= IMM8'; # ani
422$op[0xee] = 'sf8 $A ^= IMM8'; # xri
423$op[0xf6] = 'sf8 $A |= IMM8'; # ori
424$op[0xfe] = 'sf $A - IMM8'; # cpi
338 425
339$op[0x0a] = '$A = $M[$B * 256 + $C]'; # ldax b 426$op[0xc5] = 'PUSH $B; PUSH $C';
340$op[0x1a] = '$A = $M[$D * 256 + $E]'; # ldax d 427$op[0xd5] = 'PUSH $D; PUSH $E';
341$op[0x3a] = '$A = $M[IMM16]'; # lda 428$op[0xe5] = 'PUSH $H; PUSH $L';
429$op[0xf5] = 'PUSH $A; PUSH +($FS && 0x80) | ($FZ && 0x40) | ($FA && 0x10) | ($FP && 0x04) | ($FC && 0x01)'; # psw
430
431$op[0xc1] = '($C, $B) = (POP, POP)'; # pop
432$op[0xd1] = '($E, $D) = (POP, POP)'; # pop
433$op[0xe1] = '($L, $H) = (POP, POP)'; # pop
434$op[0xf1] = '($x, $A) = (POP, POP); ($FS, $FZ, $FA, $FP, $FC) = ($x & 0x80, $x & 0x40, $x & 0x10, $x & 0x04, $x & 0x01)'; # pop psw
435
436$op[0xc2 + $_ * 8] = 'BRA IMM16 ' . $cc[$_] for 0..7; # jcc
437$op[0xc3] = 'JMP IMM16'; # jmp
438
439$op[0xc4 + $_ * 8] = '(PUSH PC >> 8), (PUSH PC & 0xff), (BRA IMM16) ' . $cc[$_] for 0..7; # ccc
440$op[0xcd] = '(PUSH PC >> 8), (PUSH PC & 0xff), (BRA IMM16)'; # call
441
442$op[0xc0 + $_ * 8] = 'BRA POP + POP * 256 ' . $cc[$_] for 0..7; # rcc
443$op[0xc9] = 'JMP POP + POP * 256'; # ret
444
445$op[0xc7 + $_ * 8] = "JMP $_ * 8" for 0..7; # rst
446
447$op[0xe9] = 'JMP $H * 256 + $L'; # pchl
448# f9 SPHL NYI
449
450$op[0x37] = '$FC = 1 '; # stc
451$op[0x3f] = '$FC = !$FC'; # cmc
452
453$op[0xd3] = 'OUT'; # out
454$op[0xdb] = 'IN'; # in
455
456$op[0xeb] = '($D, $E, $H, $L) = ($H, $L, $D, $E)'; # xchg
457
458# e3 xthl NYI # @ 917b, hl <-> (sp)
342 459
343$op[0x20] = '$A = $INTPEND * 16 + $INTMASK + ($IFF && 8)'; # rim (incomplete) 460$op[0x20] = '$A = $INTPEND * 16 + $INTMASK + ($IFF && 8)'; # rim (incomplete)
344$op[0x30] = '$INTMASK = $A & 7 if $A & 8'; # sim (incomplete) 461$op[0x30] = '$INTMASK = $A & 7 if $A & 8'; # sim (incomplete)
345 462
346$op[0x22] = '($M[IMM16], $M[IMM16 + 1]) = ($L, $H)'; # shld 463$op[0xf3] = '$IFF = 0'; # DI
347$op[0x2a] = '($L, $H) = ($M[IMM16], $M[IMM16 + 1])'; # lhld 464$op[0xfb] = '$IFF = 1'; # EI
348 465
349# yeah, the fucking setup screens actually use daa... 466# yeah, the fucking setup screens actually use daa...
350$op[0x27] = ' 467$op[0x27] = '
351 my ($h, $l); 468 my ($h, $l);
352 469
353 ($h, $l) = ($A >> 4, $A & 15); 470 ($h, $l) = ($A >> 4, $A & 15);
354 471
355 if ($l > 9 || $FA) { 472 if ($l > 9 || $FA) {
356 $A = sf $A + 6; 473 sf $A += 6;
357 ($h, $l) = ($A >> 4, $A & 15); 474 ($h, $l) = ($A >> 4, $A & 15);
358 } 475 }
359 476
360 if ($h > 9 || $FC) { 477 if ($h > 9 || $FC) {
361 $h += 6; 478 $h += 6;
362 $A = ($h * 16 + $l) & 0xff; 479 $A = ($h * 16 + $l) & 0xff;
363 } 480 }
364'; # daa, almost certainly borked, also, acarry not set by sf 481'; # daa, almost certainly borked, also, acarry not set by sf
365 482
366$op[0x2f] = '$A ^= 0xff'; # cma
367
368$op[0x37] = '$FC = 1 '; # stc
369$op[0x3f] = '$FC = !$FC'; # cmc
370
371$op[0x76] = 'die "HLT"'; # hlt
372
373$op[0x80 + $_] = '$A = sf $A + ' . $reg[$_] for 0..7; # add
374$op[0x88 + $_] = '$A = sf $A + $FC + ' . $reg[$_] for 0..7; # adc
375$op[0x90 + $_] = '$A = sf $A - ' . $reg[$_] for 0..7; # sub
376$op[0x98 + $_] = '$A = sf $A - $FC - ' . $reg[$_] for 0..7; # sbb
377$op[0xa0 + $_] = '$A = sf $A & ' . $reg[$_] for 0..7; # ana
378$op[0xa8 + $_] = '$A = sf $A ^ ' . $reg[$_] for 0..7; # xra
379$op[0xb0 + $_] = '$A = sf $A | ' . $reg[$_] for 0..7; # ora
380$op[0xb8 + $_] = ' sf $A - ' . $reg[$_] for 0..7; # cmp
381# possible todo: optimize ora a, maybe xra a
382
383$op[0xc6 + $_] = '$A = sf $A + IMM8'; # adi
384$op[0xd6 + $_] = '$A = sf $A - IMM8'; # sui
385$op[0xe6 + $_] = '$A = sf $A & IMM8'; # ani
386$op[0xee + $_] = '$A = sf $A ^ IMM8'; # xri
387$op[0xf6 + $_] = '$A = sf $A | IMM8'; # ori
388$op[0xfe + $_] = ' sf $A - IMM8'; # cpi
389
390$op[0xc1] = '($C, $B) = (POP, POP)'; # pop
391$op[0xd1] = '($E, $D) = (POP, POP)'; # pop
392$op[0xe1] = '($L, $H) = (POP, POP)'; # pop
393$op[0xf1] = '($x, $A) = (POP, POP); ($FS, $FZ, $FA, $FP, $FC) = (!!($x & 0x80), !!($x & 0x40), !!($x & 0x10), !!($x & 0x04), !!($x & 0x01))'; # pop psw
394
395$op[0xeb] = '($D, $E, $H, $L) = ($H, $L, $D, $E)'; # xchg
396
397$op[0xc2 + $_ * 8] = 'BRA IMM16 ' . $cc[$_] for 0..7; # jcc
398$op[0xc3] = 'JMP IMM16'; # jmp
399
400$op[0xc4 + $_ * 8] = '(PUSH PC >> 8), (PUSH PC & 0xff), (BRA IMM16) ' . $cc[$_] for 0..7; # ccc
401$op[0xcd] = '(PUSH PC >> 8), (PUSH PC & 0xff), (BRA IMM16)'; # call
402
403$op[0xc7 + $_ * 8] = "JMP $_ * 8" for 0..7; # rst
404
405$op[0xc0 + $_ * 8] = 'BRA POP + POP * 256 ' . $cc[$_] for 0..7; # rcc
406$op[0xc9] = 'JMP POP + POP * 256'; # ret
407
408$op[0xc5] = 'PUSH $B; PUSH $C';
409$op[0xd5] = 'PUSH $D; PUSH $E';
410$op[0xe5] = 'PUSH $H; PUSH $L';
411$op[0xf5] = 'PUSH $A; PUSH +($FS && 0x80) | ($FZ && 0x40) | ($FA && 0x10) | ($FP && 0x04) | ($FC && 0x01)'; # psw
412
413$op[0xd3] = 'OUT'; # out
414$op[0xdb] = 'IN'; # in
415
416# e3 xthl @ 917b, hl <-> (sp)
417
418$op[0xe9] = 'JMP $H * 256 + $L'; # pchl
419
420$op[0xf3] = '$IFF = 0'; # DI
421$op[0xfb] = '$IFF = 1'; # EI
422
423@ops = @op; # for debugging #d#
424
425############################################################################# 483#############################################################################
484# print cpu status for debugging purposes
426 485
427# print cpu status, for debugging 486# print cpu status, for debugging
428sub status { 487sub status {
429 my $PC = shift || $PC; 488 my $PC = shift || $PC;
430 489
434 ($FZ ? "1" : "0") 493 ($FZ ? "1" : "0")
435 . ($FS ? "1" : "0") 494 . ($FS ? "1" : "0")
436 . ($FC ? "1" : "0") 495 . ($FC ? "1" : "0")
437 . ($FA ? "1" : "0") 496 . ($FA ? "1" : "0")
438 . ($FP ? "1" : "0"), 497 . ($FP ? "1" : "0"),
439 $M[$PC], $ops[$M[$PC]]; 498 $M[$PC], $op[$M[$PC]];
440} 499}
441 500
442############################################################################# 501#############################################################################
502# video emulation
443 503
444my @chr = ( 504my @CHARMAP = (
445 " " , "\x{29eb}", "\x{2592}", "\x{2409}", 505 " " , "\x{29eb}", "\x{2592}", "\x{2409}",
446 "\x{240c}", "\x{240d}", "\x{240a}", "\x{00b0}", 506 "\x{240c}", "\x{240d}", "\x{240a}", "\x{00b0}",
447 "\x{00b1}", "\x{2424}", "\x{240b}", "\x{2518}", 507 "\x{00b1}", "\x{2424}", "\x{240b}", "\x{2518}",
448 "\x{2510}", "\x{250c}", "\x{2514}", "\x{253c}", 508 "\x{2510}", "\x{250c}", "\x{2514}", "\x{253c}",
449 "\x{23ba}", "\x{23bb}", "\x{2500}", "\x{23bc}", 509 "\x{23ba}", "\x{23bb}", "\x{2500}", "\x{23bc}",
451 "\x{252c}", "\x{2502}", "\x{2264}", "\x{2265}", 511 "\x{252c}", "\x{2502}", "\x{2264}", "\x{2265}",
452 "\x{03c0}", "\x{2260}", "\x{00a3}", "\x{00b7}", 512 "\x{03c0}", "\x{2260}", "\x{00a3}", "\x{00b7}",
453 (map chr, 0x020 .. 0x7e), 513 (map chr, 0x020 .. 0x7e),
454); 514);
455 515
456utf8::encode $_ for @chr; 516utf8::encode $_ for @CHARMAP;
457 517
458my @sgr; # sgr sequences for attributes 518my @SGR; # sgr sequences for attributes
459 519
460for (0x00 .. 0xff) { 520for (0x00 .. 0xff) {
461 my $sgr = ""; 521 my $sgr = "";
522
523 # ~1 sgr 5 blink
524 # ~2 sgr 4 underline
525 # ~4 sgr 1 bold
526 # 0x80 in attr, sgr 7, reversed
462 527
463 $sgr .= ";5" unless $_ & 0x01; 528 $sgr .= ";5" unless $_ & 0x01;
464 $sgr .= ";4" unless $_ & 0x02; 529 $sgr .= ";4" unless $_ & 0x02;
465 $sgr .= ";1" unless $_ & 0x04; 530 $sgr .= ";1" unless $_ & 0x04;
466 $sgr .= ";7" if $_ & 0x80; 531 $sgr .= ";7" if $_ & 0x80;
467 532
468 $sgr[$_] = "\e[${sgr}m"; 533 $SGR[$_] = "\e[${sgr}m";
469} 534}
470 535
471sub prscr { 536my @LED = $VT102
537 ? qw(L1 INSERT DSR CTS LOCKED LOCAL SCAN BEEP)
538 : qw(L4 L3 L2 L1 LOCKED LOCAL SCAN BEEP);
539
540# display screen
541sub display {
472 my $i = 0x2000; 542 my $i = 0x2000;
473 543
544 my $leds = join " ", map $KSTATUS & 2**$_ ? "\e[7m$LED[$_]\e[m" : "$LED[$_]", reverse 0 .. $#LED;
545
474 my $scr = sprintf "\e[H--- KBD %08b CLK %d\e[K\n", $KSTATUS, $CLK; 546 my $scr = sprintf "\e[H--- LED [ %s ] CLK %d\e[K\n", $leds, $CLK;
475 547
476 $scr .= "\e[?5" . ($DC11_REVERSE ? "h" : "l"); 548 $scr .= "\e[?5" . ($DC11_REVERSE ? "h" : "l");
477 549
478 line: 550 line:
479 for my $y (0 .. 25) { # ntsc, two vblank delay lines, up to 24 text lines 551 for my $y (0 .. 25) { # ntsc, two vblank delay lines, up to 24 text lines
493 $i = 0x2000 + (($a1 * 256 + $a0) & 0xfff); 565 $i = 0x2000 + (($a1 * 256 + $a0) & 0xfff);
494 566
495 next line; 567 next line;
496 } 568 }
497 569
498 my $sgr = $sgr[ ($M[$i++ + 0x1000] & 15) | ($c & 0x80)]; 570 my $sgr = $SGR[ ($M[$i++ + 0x1000] & 15) | ($c & 0x80)];
499
500 # ~1 sgr 5 blink
501 # ~2 sgr 4 underline
502 # ~4 sgr 1 bold
503 # 0x80 in attr, sgr 7, reversed
504 571
505 $scr .= $prev_sgr = $sgr if $sgr ne $prev_sgr; 572 $scr .= $prev_sgr = $sgr if $sgr ne $prev_sgr;
506 573
507 $scr .= $chr[$c & 0x7f]; 574 $scr .= $CHARMAP[$c & 0x7f];
508 } 575 }
509 576
510 $scr .= "\e[K\nvideo overflow\e[K\n"; 577 $scr .= "\e[K\nvideo overflow\e[K\n";
511 last; 578 last;
512 } 579 }
513 580
514 $scr .= "\e[m"; 581 $scr .= "\e[m\e[J";
515
516 if (0) {
517 $scr .= "\e[K\n";
518 for my $o (0x200 .. 0x232) {
519 $scr .= sprintf "%04x:", $o * 16;
520 for (0..15) {
521 $scr .= sprintf " %02x", $M[$o * 16 + $_];
522 }
523 $scr .= "\e[K\n";
524 }
525 }
526
527 $scr .= "\e[J";
528 582
529 syswrite STDOUT, $scr; 583 syswrite STDOUT, $scr;
530} 584}
531 585
532############################################################################# 586#############################################################################
533 587# keyboard handling
534if (@ARGV) {
535 require IO::Pty;
536 $PTY = IO::Pty->new;
537
538 my $slave = $PTY->slave;
539
540 $PTY->set_winsize (24, 80);
541
542 unless (fork) {
543 $ENV{TERM} = $VT102 ? "vt102" : "vt100";
544
545 close $PTY;
546
547 open STDIN , "<&", $slave;
548 open STDOUT, ">&", $slave;
549 open STDERR, ">&", $slave;
550
551 system "stty ixoff erase ^H";
552
553 $PTY->make_slave_controlling_terminal;
554 $PTY->close_slave;
555
556 exec @ARGV;
557 }
558
559 $PTY->close_slave;
560
561} else {
562 open $PTY, "</dev/null" or die;#d
563}
564
565#############################################################################
566
567# initial key input, to set up online mode etc.
568@KQUEUE = (
569 0x7b, -0x7b, # setup
570 0, # delay
571 0x28, -0x28, # 4, toggle local/online
572 0x38, -0x38, # 5, setup b
573 0, # delay
574 (0x10, -0x10) x 2, # cursor right
575 0x37, -0x37, # 6 toggle soft scroll
576 (0x10, -0x10) x 1, # cursor right
577 0x37, -0x37, # 6 toggle autorepeat off
578 (0x10, -0x10) x 8, # cursor right
579 0x37, -0x37, # 6 toggle keyclick
580 (0x10, -0x10) x 1, # cursor right
581 $VT102 ? () : (0x37, -0x37), # 6 toggle ansi/vt52
582 (0x10, -0x10) x 7, # cursor right
583 0x37, -0x37, # 6 toggle wrap around
584 0x7b, -0x7b, # leave setup
585);
586
587#############################################################################
588 588
589# 0x080 shift, 0x100 ctrl 589# 0x080 shift, 0x100 ctrl
590my %KEYMAP = ( 590my %KEYMAP = (
591 # these get overwritten by generic control codes, but both work, so i have no priority
592 # tid fix these.
593 "\t" => 0x3a, 591 "\t" => 0x3a,
594 "\r" => 0x64, 592 "\r" => 0x64,
595 "\n" => 0x44, 593 "\n" => 0x44,
596 594
597 "\x00" => 0x77 | 0x100, # CTRL-SPACE 595 "\x00" => 0x77 | 0x100, # CTRL-SPACE
622 "\e[11~" => 0x42, # F2 620 "\e[11~" => 0x42, # F2
623 "\e[11~" => 0x31, # F3 621 "\e[11~" => 0x31, # F3
624 "\e[11~" => 0x41, # F4 622 "\e[11~" => 0x41, # F4
625); 623);
626 624
627@KEYMAP{map chr, 0x20..0x40} = unpack "C*", pack "H*", 625@KEYMAP{map chr, 0x20 .. 0x40, 0x5b .. 0x7e} = unpack "C*", pack "H*",
628 "779ad5a9a8b8a755a6b5b6b466256575" . "351a3929283837273626d656e634e5f5" . "b9"; 626 "779ad5a9a8b8a755a6b5b6b466256575" . "351a3929283837273626d656e634e5f5" . "b9" # 20..40
629
630@KEYMAP{map chr, 0x5b .. 0x7e} = unpack "C*", pack "H*",
631 "154514b7a5" . "244a6879591949485816574746766706" . "050a185a0817780969077a95c594a4"; 627 . "154514b7a5" . "244a6879591949485816574746766706" . "050a185a0817780969077a95c594a4"; # 5b..7e
632 628
633$KEYMAP{"\x1f" & $_} ||= $KEYMAP{$_} | 0x100 for "a" .. "z"; # ctrl 629$KEYMAP{"\x1f" & $_} ||= $KEYMAP{$_} | 0x100 for "a" .. "z"; # ctrl
634$KEYMAP{uc $_} ||= $KEYMAP{$_} | 0x080 for "a" .. "z"; # shift 630$KEYMAP{"\x20" ^ $_} ||= $KEYMAP{$_} | 0x080 for "a" .. "z"; # shift
635 631
636my $KEYMATCH = join "|", map quotemeta, reverse sort keys %KEYMAP; 632my $KEYMATCH = join "|", map quotemeta, reverse sort keys %KEYMAP;
637$KEYMATCH = qr{^($KEYMATCH)}s; 633$KEYMATCH = qr{^($KEYMATCH)}s;
638 634
635my %KMOD;
636
639sub key { 637sub key {
640 my ($key) = @_; 638 my ($key) = @_;
641 639
642 state %MOD;
643
644 push @KQUEUE, -0x7c if !($key & 0x100) && delete $MOD{0x7c}; # ctrl-up 640 push @KQUEUE, -0x7c if !($key & 0x100) && delete $KMOD{0x7c}; # ctrl-up
645 push @KQUEUE, -0x7d if !($key & 0x080) && delete $MOD{0x7d}; # shift-up 641 push @KQUEUE, -0x7d if !($key & 0x080) && delete $KMOD{0x7d}; # shift-up
646 642
647 push @KQUEUE, 0x7c if $key & 0x100 && !$MOD{0x7c}++; # ctrl-down 643 push @KQUEUE, 0x7c if $key & 0x100 && !$KMOD{0x7c}++; # ctrl-down
648 push @KQUEUE, 0x7d if $key & 0x080 && !$MOD{0x7d}++; # shift-down 644 push @KQUEUE, 0x7d if $key & 0x080 && !$KMOD{0x7d}++; # shift-down
649 645
650 $key &= 0x7f; 646 $key &= 0x7f;
651 push @KQUEUE, $key, -$key; 647 push @KQUEUE, $key, -$key;
652} 648}
653 649
666 eval q{ sub END { system "stty sane" } }; 662 eval q{ sub END { system "stty sane" } };
667 $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub { exit 1 }; 663 $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub { exit 1 };
668} 664}
669 665
670############################################################################# 666#############################################################################
667# initial key input, to set up online mode etc.
668# could be done via nvram defaults
669
670@KQUEUE = (
671 0x7b, -0x7b, # setup
672 0, # delay
673 0x28, -0x28, # 4, toggle local/online
674 0x38, -0x38, # 5, setup b
675 0, # delay
676 (0x10, -0x10) x 2, # cursor right
677 0x37, -0x37, # 6 toggle soft scroll
678 (0x10, -0x10) x 1, # cursor right
679 0x37, -0x37, # 6 toggle autorepeat off
680 (0x10, -0x10) x 8, # cursor right
681 0x37, -0x37, # 6 toggle keyclick
682 (0x10, -0x10) x 1, # cursor right
683 $VT102 ? () : (0x37, -0x37), # 6 toggle ansi/vt52
684 (0x10, -0x10) x 7, # cursor right
685 0x37, -0x37, # 6 toggle wrap around
686 0x7b, -0x7b, # leave setup
687);
688
689#############################################################################
690# process/pty management
691
692require IO::Pty;
693$PTY = IO::Pty->new;
694
695my $slave = $PTY->slave;
696
697$PTY->set_winsize (24, 80);
698
699unless (fork) {
700 $ENV{TERM} = $VT102 ? "vt102" : "vt100";
701
702 close $PTY;
703
704 open STDIN , "<&", $slave;
705 open STDOUT, ">&", $slave;
706 open STDERR, ">&", $slave;
707
708 system "stty ixoff erase ^H";
709
710 $PTY->make_slave_controlling_terminal;
711 $PTY->close_slave;
712
713 @ARGV = "sh" unless @ARGV;
714 exec @ARGV;
715}
716
717$PTY->close_slave;
718
719#############################################################################
720# the actual hardware simulator
671 721
672my @ICACHE; # compiled instruction cache 722my @ICACHE; # compiled instruction cache
673 723
674# the cpu
675while () { 724while () {
676
677 # execute extended basic blocks 725 # execute extended basic blocks
678 $PC = ($ICACHE[$PC] ||= do { 726 $PC = ($ICACHE[$PC] ||= do {
679 my $pc = $PC; 727 my $pc = $PC;
680 728
681 my $insn = ""; 729 my $insn = "";
682 730
683 # the jit compiler 731 # the jit compiler
684 for (0..15) { 732 for (0..31) {
685
686 # optional tracing support
687 if (0) {
688 $insn .= qq<
689 if (\$PRSTATUS) {
690 status $pc;
691 die unless --\$PRSTATUS;
692 }
693 >;
694 }
695
696 my $imm; 733 my $imm;
697 my $op = $op[$M[$pc++]]; 734 my $op = $op[$M[$pc++]];
698 735
699 for ($op) { 736 for ($op) {
700 s/\bPUSH\b/\$M[--\$SP] =/g; # push byte to stack 737 s/\bPUSH\b/\$M[--\$SP] =/g; # push byte to stack
725 762
726 # things we do from time too time only 763 # things we do from time too time only
727 unless ($CLK & 0xf) { 764 unless ($CLK & 0xf) {
728 # do I/O 765 # do I/O
729 766
730 unless ($CLK & 0x7ff) { 767 unless ($CLK & 0xfff) {
731 768
732 # pty/serial I/O 769 # pty/serial I/O
733 unless (@PUSARTRECV || @KQUEUE || !$PTY) { 770 unless ((@PUSARTRECV >= 128) || @KQUEUE || !$PTY) {
734 my $rin = ""; (vec $rin, fileno $PTY, 1) = 1; 771 my $rin = ""; (vec $rin, fileno $PTY, 1) = 1;
735 772
736 if (select $rin, undef, undef, 0) { 773 if (select $rin, undef, undef, 0) {
737 sysread $PTY, my $buf, 256; 774 sysread $PTY, my $buf, 256;
738 push @PUSARTRECV, unpack "C*", $buf; 775 push @PUSARTRECV, unpack "C*", $buf;
759 unless ($CLK & 0x1ff) { 796 unless ($CLK & 0x1ff) {
760 $RST |= 4; # vertical retrace 797 $RST |= 4; # vertical retrace
761 } 798 }
762 799
763 # handle video hardware 800 # handle video hardware
764
765 unless ($CLK & 0x1fff) { 801 unless ($CLK & 0x3fff) {
766 prscr; 802 display;
767 } 803 }
768 } 804 }
769 805
770 # the interrupt logic 806 # the interrupt logic
771 $x = $INTPEND & ~$INTMASK; 807 if (($RST || ($INTPEND & ~$INTMASK)) && $IFF) {
772 if (($RST || $x) && $IFF) {
773 # rst 1 kbd data available 808 # rst 1 kbd data available
774 # rst 2 pusart xmit+recv flag 809 # rst 2 pusart xmit+recv flag
775 # rst 4 vertical retrace 810 # rst 4 vertical retrace
776 # 5.5 vt125 mb7 trans ready (serial send?) 811 # 5.5 vt125 mb7 trans ready (serial send?)
777 # 6.5 vt125 mb7 read ready (something modem?) 812 # 6.5 vt125 mb7 read ready (something modem?)
778 # 7.5 vt125 mb7 vblank h(?) 813 # 7.5 vt125 mb7 vblank h(?)
779 # trap vt125 mbi init h(?) 814 # trap vt125 mbi init h(?)
780 my $vec; 815 my $vec;
781 816
817 $x = $INTPEND & ~$INTMASK;
818
782 if ($x & 1) { $vec = 0x2c; $INTPEND &= ~1; 819 if ($x & 1) { $vec = 0x2c; $INTPEND &= ~1;
783 } elsif ($x & 2) { $vec = 0x34; $INTPEND &= ~2; 820 } elsif ($x & 2) { $vec = 0x34; $INTPEND &= ~2;
784 } elsif ($x & 4) { $vec = 0x3c; $INTPEND &= ~4; 821 } elsif ($x & 4) { $vec = 0x3c; $INTPEND &= ~4;
785# } elsif ($RST ) { $vec = $RST * 8; $RST = 0; # for some reason, this breaks vt102 822# } elsif ($RST ) { $vec = $RST * 8; $RST = 0; # the vt102 firmware doesn't like combined interrupts
786 } elsif ($RST & 1) { $vec = 0x08; $RST &= ~1; # separate is better for vt102 823 } elsif ($RST & 1) { $vec = 0x08; $RST &= ~1; # separate is better for vt102
787 } elsif ($RST & 2) { $vec = 0x10; $RST &= ~2; 824 } elsif ($RST & 2) { $vec = 0x10; $RST &= ~2;
788 } elsif ($RST & 4) { $vec = 0x20; $RST &= ~4; 825 } elsif ($RST & 4) { $vec = 0x20; $RST &= ~4;
789 } else { 826 } else {
790 die; 827 die;
795 $PC = $vec; 832 $PC = $vec;
796 833
797 $IFF = 0; 834 $IFF = 0;
798 } 835 }
799} 836}
837
838#############################################################################
839# roms in the data section + one newline
840#
841# vt100 @ 0x0000+0x0800 23-032E2
842# vt100 @ 0x0800+0x0800 23-061E2
843# vt100 @ 0x1000+0x0800 23-033E2
844# vt100 @ 0x1800+0x0800 23-034E2
845#
846# vt102 @ 0x0000+0x8000 23-226E4
847# vt102 @ 0x8000+0x8000 23-225E4
848#
849# vt131 @ 0xa000+0x0800 23-280E2
850#
800 851
801__DATA__ 852__DATA__
8021N ;0>b/BWog<Gӂ,O$ O[xI,ڥ#€€yOtͤ[zW>/2!b>>g$>% !h w-!h >-4!j pO:{ y:! u:x!_yA[>y >yA[>?y@ :x!žyA[P>>O[>>[Î:!ʵyA>>OlyAPÇ!:!S!h ~ ~ : O͓: Ô!20!2!!!yAG~"&=w< w:!/!!A:!Ey2!~1N ! ~eBi<2!͢:P =2S!~6ʘ!!6 8531N ;0>b/BWog<Gӂ,O$ O[xI,ڥ#€€yOtͤ[zW>/2!b>>g$>% !h w-!h >-4!j pO:{ y:! u:x!_yA[>y >yA[>?y@ :x!žyA[P>>O[>>[Î:!ʵyA>>OlyAPÇ!:!S!h ~ ~ : O͓: Ô!20!2!!!yAG~"&=w< w:!/!!A:!Ey2!~1N ! ~eBi<2!͢:P =2S!~6ʘ!!6
8032!0* w4ʘ> 2! ~î!N ̓/2!! "R !""  8542!0* w4ʘ> 2! ~î!N ̓/2!! "R !"" 
804! ͋!2[ 2v!!"I!>2s >2 B>2y >2!2!&l" >@:X!:!͔>2!b:!K>G:| !p ^!p" :!x:! u> 855! ͋!2[ 2v!!"I!>2s >2 B>2y >2!2!&l" >@:X!:!͔>2!b:!K>G:| !p ^!p" :!x:! u>
908 959
909.y' &%&5>LGxWdkͨwͨ/w!e!6#}vnͨwͨ ڐWzʁÚ#}v>‡ :,!ڢy2!:!OW!e!oһ$zW>0)1!2@3#4$5%6^7&8*9(-_=+`~[{]};:/?'",<.>\| poytwq][iure1`-9743=08652 Ѱ 960.y' &%&5>LGxWdkͨwͨ/w!e!6#}vnͨwͨ ڐWzʁÚ#}v>‡ :,!ڢy2!:!OW!e!oһ$zW>0)1!2@3#4$5%6^7&8*9(-_=+`~[{]};:/?'",<.>\| poytwq][iure1`-9743=08652 Ѱ
910\lkgfa';jhds .,nbx* :B!4 961\lkgfa';jhds .,nbx* :B!4
911!O!,ͳʄmÝ 962!O!,ͳʄmÝ
912! 0>2ͳʥ†">02I y>c}" 2. y2N!~2/ z#ͫ:/ w:N!O:/ O#:. <õ!N!蝾:&0> 2 !{!>!q{" ÎWaitp!O!'6#'M_! 0R_:B!7N  963! 0>2ͳʥ†">02I y>c}" 2. y2N!~2/ z#ͫ:/ w:N!O:/ O#:. <õ!N!蝾:&0> 2 !{!>!q{" ÎWaitp!O!'6#'M_! 0R_:B!7N 
9138>2\0͍2\0:y!ʟ25!24!̞D!;!~G6̞:70xˆ!F!~ɞ˞w:5!ڞ:4!ឯ͆;:<!Bʾ:B!.ڇ!!~#;:!;D!!"!F#ux‡2A0:{!4R*|!x7fÇ:%0H:l :5!S*6!:4!k!wf##]~#fo:K 2\0 )şZşG>2\0:70ʫx!z!«!F!~ w!B0~w:40x·!l 62\0+2\012 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 9648>2\0͍2\0:y!ʟ25!24!̞D!;!~G6̞:70xˆ!F!~ɞ˞w:5!ڞ:4!ឯ͆;:<!Bʾ:B!.ڇ!!~#;:!;D!!"!F#ux‡2A0:{!4R*|!x7fÇ:%0H:l :5!S*6!:4!k!wf##]~#fo:K 2\0 )şZşG>2\0:70ʫx!z!«!F!~ w!B0~w:40x·!l 62\0+2\012 vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv^y5k6!
965"~ACŠ>Bw2"!z"pv"x">Cw2"!n"pv"l"!!~< N[>2,!NAp##!(0S{}ˠ>w# »xE##ö6T]#zpw#sX6#N|p}Hpv"x"7:
966"C*C!(0:!@W ==}wï2C!2D!z5*b Q!{!| gH:d G| gW]>6#k<|eoozW>Ê

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines