Dragon emulator written in Python ???

A place to discuss everything Dragon related that doesn't fall into the other categories.
Post Reply
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

xroar -trace is really helpfull!

I hacked a compare function in DragonPy: Compare line for line with the xroar trace file... So i have found some bugs and fixed them. But there are still some leaved...

Looks like this:

Code: Select all

fffe| b3b4        [RESET]
b3b4| 31   LEAY   Y=0000 ea:b39b              cc=50 a=00 b=00 dp=00 x=0000 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
b3b7| 7e   JMP    ea:8000                     cc=50 a=00 b=00 dp=00 x=0000 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
8000| 7e   JMP    ea:bb40                     cc=50 a=00 b=00 dp=00 x=0000 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb40| cc   LDD    D=0000 ea:bb41 m:34         cc=50 a=00 b=34 dp=00 x=0000 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb43| 8e   LDX    X=0000 ea:bb44 m:ff00       cc=58 a=00 b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb46| a7   STA    A=00 ea:ff01 m:b3           cc=54 a=00 b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb48| a7   STA    A=00 ea:ff03 m:35           cc=54 a=00 b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb4a| a7   STA    A=00 ea:ff00 m:0            cc=54 a=00 b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb4c| 43   COMA   A=00                        cc=59 a=ff b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=1
bb4d| a7   STA    A=ff ea:ff02 m:0            cc=59 a=ff b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=1
bb4f| e7   STB    B=34 ea:ff01 m:b3           cc=51 a=ff b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=1
bb51| e7   STB    B=34 ea:ff03 m:35           cc=51 a=ff b=34 dp=00 x=ff00 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=1
bb53| 8e   LDX    X=ff00 ea:bb54 m:ff20       cc=59 a=ff b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=1
bb56| 6f   CLR    ea:ff21 m:34                cc=54 a=ff b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb58| 6f   CLR    ea:ff23 m:37                cc=54 a=ff b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb5a| 4a   DECA   A=ff                        cc=58 a=fe b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb5b| a7   STA    A=fe ea:ff20 m:1            cc=58 a=fe b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb5d| 86   LDA    A=fe ea:bb5e m:f8           cc=58 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb5f| a7   STA    A=f8 ea:ff22 m:0            cc=58 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb61| e7   STB    B=34 ea:ff21 m:34           cc=50 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb63| e7   STB    B=34 ea:ff23 m:37           cc=50 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb65| 6f   CLR    ea:ff20 m:1                 cc=54 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb67| 6f   CLR    ea:ff22 m:0                 cc=54 a=f8 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb69| a6   LDA    A=f8 ea:ff22 m:0            cc=54 a=00 b=34 dp=00 x=ff20 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb6b| 8e   LDX    X=ff20 ea:bb6c m:ffc0       cc=58 a=00 b=34 dp=00 x=ffc0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=1 Z=0 V=0 C=0
bb6e| c6   LDB    B=34 ea:bb6f m:10           cc=50 a=00 b=10 dp=00 x=ffc0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffc0 m:7e           cc=54 a=00 b=10 dp=00 x=ffc2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=10                        cc=50 a=00 b=0f dp=00 x=ffc2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0f dp=00 x=ffc2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffc2 m:7e           cc=54 a=00 b=0f dp=00 x=ffc4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0f                        cc=50 a=00 b=0e dp=00 x=ffc4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0e dp=00 x=ffc4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffc4 m:7e           cc=54 a=00 b=0e dp=00 x=ffc6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0e                        cc=50 a=00 b=0d dp=00 x=ffc6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0d dp=00 x=ffc6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffc6 m:7e           cc=54 a=00 b=0d dp=00 x=ffc8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0d                        cc=50 a=00 b=0c dp=00 x=ffc8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0c dp=00 x=ffc8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffc8 m:7e           cc=54 a=00 b=0c dp=00 x=ffca y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0c                        cc=50 a=00 b=0b dp=00 x=ffca y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0b dp=00 x=ffca y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffca m:7e           cc=54 a=00 b=0b dp=00 x=ffcc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0b                        cc=50 a=00 b=0a dp=00 x=ffcc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=0a dp=00 x=ffcc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffcc m:7e           cc=54 a=00 b=0a dp=00 x=ffce y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=0a                        cc=50 a=00 b=09 dp=00 x=ffce y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=09 dp=00 x=ffce y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffce m:7e           cc=54 a=00 b=09 dp=00 x=ffd0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=09                        cc=50 a=00 b=08 dp=00 x=ffd0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=08 dp=00 x=ffd0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffd0 m:7e           cc=54 a=00 b=08 dp=00 x=ffd2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=08                        cc=50 a=00 b=07 dp=00 x=ffd2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=07 dp=00 x=ffd2 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffd2 m:7e           cc=54 a=00 b=07 dp=00 x=ffd4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=07                        cc=50 a=00 b=06 dp=00 x=ffd4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=06 dp=00 x=ffd4 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffd4 m:7e           cc=54 a=00 b=06 dp=00 x=ffd6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=06                        cc=50 a=00 b=05 dp=00 x=ffd6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=05 dp=00 x=ffd6 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffd6 m:7e           cc=54 a=00 b=05 dp=00 x=ffd8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=05                        cc=50 a=00 b=04 dp=00 x=ffd8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=04 dp=00 x=ffd8 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffd8 m:7e           cc=54 a=00 b=04 dp=00 x=ffda y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=04                        cc=50 a=00 b=03 dp=00 x=ffda y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=03 dp=00 x=ffda y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffda m:7e           cc=54 a=00 b=03 dp=00 x=ffdc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=03                        cc=50 a=00 b=02 dp=00 x=ffdc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=02 dp=00 x=ffdc y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffdc m:7e           cc=54 a=00 b=02 dp=00 x=ffde y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=02                        cc=50 a=00 b=01 dp=00 x=ffde y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=50 a=00 b=01 dp=00 x=ffde y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
bb70| a7   STA    A=00 ea:ffde m:7e           cc=54 a=00 b=01 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb72| 5a   DECB   B=01                        cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb73| 26   BNE    ea:bb70 m:a7                cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb75| f7   STB    B=00 ea:ffc9 m:7e           cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb78| 85   BITA   A=00 ea:bb79 m:4            cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb7a| 27   BEQ    ea:bb81 m:f7                cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb81| f7   STB    B=00 ea:ffdd m:7e           cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb84| 1f   TFR    ea:bb85 m:9b                cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
bb86| 1f   TFR    ea:bb87 m:25                cc=54 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=0000 | CC: E=0 F=1 H=0 I=1 N=0 Z=1 V=0 C=0
b39c| 10ce LDS    S=0000 ea:b39d m:3d7        cc=50 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
trace: b39b| 10ce03d7    LDS     #$03d7              cc=50 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
own..: b39c| 10ce LDS    S=0000 ea:b39d m:3d7        cc=50 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
address ('b39c' != 'b39b') not the same as trace reference!

b39b| 10   PAGE1+                             cc=50 a=00 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
b39f| 86   LDA    A=00 ea:b3a0 m:37           cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
b3a1| b7   STA    A=37 ea:ff23 m:37           cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
b3a4| 96   LDA    A=37 ea:71 m:71             cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
trace: b3a4| 9671        LDA     <$71                cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
own..: b3a4| 96   LDA    A=37 ea:71 m:71             cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
registers ('cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7' != 'cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7') not the same as trace reference!

b3a6| 81   CMPA   A=71 ea:b3a7 m:55           cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
trace: b3a6| 8155        CMPA    #$55                cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
own..: b3a6| 81   CMPA   A=71 ea:b3a7 m:55           cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7 | CC: E=0 F=1 H=0 I=1 N=0 Z=0 V=0 C=0
registers ('cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7' != 'cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7') not the same as trace reference!

...
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

I have a question about the last line from this XRoar trace line, a few trace lines after startup:

Code: Select all

b39f| 8637        LDA     #$37                cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
b3a1| b7ff23      STA     $ff23               cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
b3a4| 9671        LDA     <$71                cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
Why is there A set to ff ?
b3a4| 9671 LDA <$71 cc=58 a=ff b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
It should be $71, isn't it?

The DragonPy debug output from the same position is this:

Code: Select all

b39f| 86   LDA    A=00 ea:b3a0 m:37           cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
b3a1| b7   STA    A=37 ea:ff23 m:37           cc=50 a=37 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
b3a4| 96   LDA    A=37 ea:71 m:71             cc=50 a=71 b=00 dp=00 x=ffe0 y=b39b u=0000 s=03d7
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
sixxie
Posts: 1142
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Dragon emulator written in Python ???

Post by sixxie »

If $FF is the data at address $0071 (direct addressing, DP=$00, <$71), it should be $FF.
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

Thanks for reply!

My fault: The direct addressing mode was wrong. Fixed with: https://github.com/jedie/DragonPy/commi ... 61b18aaff1
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

The area $0400-05ff (Default Text screen) doesn't use ASCII. Where can i find a "translation" table for it?

EDIT: Found the answer -> viewtopic.php?f=8&t=4451
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

The first success! finally!

I get a output using Simple6809 ROM after the last bugfix in PUS/PUL ( https://github.com/jedie/DragonPy/tree/ ... b816a0e376 ):
db3c| (15218) read from RS232 address: $a000
db1c| (15269) write to RS232 address: $a001 value: $36 (dez.: 54) ASCII: '6'
db3c| (15380) read from RS232 address: $a000
db1c| (15431) write to RS232 address: $a001 value: $38 (dez.: 56) ASCII: '8'
db3c| (15542) read from RS232 address: $a000
db1c| (15593) write to RS232 address: $a001 value: $30 (dez.: 48) ASCII: '0'
db3c| (15704) read from RS232 address: $a000
db1c| (15755) write to RS232 address: $a001 value: $39 (dez.: 57) ASCII: '9'
db3c| (15866) read from RS232 address: $a000
db1c| (15917) write to RS232 address: $a001 value: $20 (dez.: 32) ASCII: ' '
db3c| (16028) read from RS232 address: $a000
db1c| (16079) write to RS232 address: $a001 value: $45 (dez.: 69) ASCII: 'E'
db3c| (16190) read from RS232 address: $a000
db1c| (16241) write to RS232 address: $a001 value: $58 (dez.: 88) ASCII: 'X'
db3c| (16352) read from RS232 address: $a000
db1c| (16403) write to RS232 address: $a001 value: $54 (dez.: 84) ASCII: 'T'
db3c| (16514) read from RS232 address: $a000
db1c| (16565) write to RS232 address: $a001 value: $45 (dez.: 69) ASCII: 'E'
db3c| (16676) read from RS232 address: $a000
db1c| (16727) write to RS232 address: $a001 value: $4e (dez.: 78) ASCII: 'N'
db3c| (16838) read from RS232 address: $a000
db1c| (16889) write to RS232 address: $a001 value: $44 (dez.: 68) ASCII: 'D'
db3c| (17000) read from RS232 address: $a000
db1c| (17051) write to RS232 address: $a001 value: $45 (dez.: 69) ASCII: 'E'
db3c| (17162) read from RS232 address: $a000
db1c| (17213) write to RS232 address: $a001 value: $44 (dez.: 68) ASCII: 'D'
db3c| (17324) read from RS232 address: $a000
db1c| (17375) write to RS232 address: $a001 value: $20 (dez.: 32) ASCII: ' '
db3c| (17486) read from RS232 address: $a000
db1c| (17537) write to RS232 address: $a001 value: $42 (dez.: 66) ASCII: 'B'
db3c| (17648) read from RS232 address: $a000
db1c| (17699) write to RS232 address: $a001 value: $41 (dez.: 65) ASCII: 'A'
db3c| (17810) read from RS232 address: $a000
db1c| (17861) write to RS232 address: $a001 value: $53 (dez.: 83) ASCII: 'S'
db3c| (17972) read from RS232 address: $a000
db1c| (18023) write to RS232 address: $a001 value: $49 (dez.: 73) ASCII: 'I'
db3c| (18134) read from RS232 address: $a000
db1c| (18185) write to RS232 address: $a001 value: $43 (dez.: 67) ASCII: 'C'
db3c| (18296) read from RS232 address: $a000
17236.76 cycles/sec.
db3c| (18375) read from RS232 address: $a000
db2d| (18413) write to RS232 address: $a001 value: $d (dez.: 13) ASCII: '\r'
db3c| (18441) read from RS232 address: $a000
db34| (18479) write to RS232 address: $a001 value: $a (dez.: 10) ASCII: '\n'
db3c| (18561) read from RS232 address: $a000
db1c| (18612) write to RS232 address: $a001 value: $28 (dez.: 40) ASCII: '('
db3c| (18723) read from RS232 address: $a000
db1c| (18774) write to RS232 address: $a001 value: $43 (dez.: 67) ASCII: 'C'
db3c| (18885) read from RS232 address: $a000
db1c| (18936) write to RS232 address: $a001 value: $29 (dez.: 41) ASCII: ')'
db3c| (19047) read from RS232 address: $a000
db1c| (19098) write to RS232 address: $a001 value: $20 (dez.: 32) ASCII: ' '
db3c| (19209) read from RS232 address: $a000
db1c| (19260) write to RS232 address: $a001 value: $31 (dez.: 49) ASCII: '1'
db3c| (19371) read from RS232 address: $a000
db1c| (19422) write to RS232 address: $a001 value: $39 (dez.: 57) ASCII: '9'
db3c| (19533) read from RS232 address: $a000
db1c| (19584) write to RS232 address: $a001 value: $38 (dez.: 56) ASCII: '8'
db3c| (19695) read from RS232 address: $a000
db1c| (19746) write to RS232 address: $a001 value: $32 (dez.: 50) ASCII: '2'
db3c| (19857) read from RS232 address: $a000
db1c| (19908) write to RS232 address: $a001 value: $20 (dez.: 32) ASCII: ' '
db3c| (20019) read from RS232 address: $a000
db1c| (20070) write to RS232 address: $a001 value: $42 (dez.: 66) ASCII: 'B'
db3c| (20181) read from RS232 address: $a000
db1c| (20232) write to RS232 address: $a001 value: $59 (dez.: 89) ASCII: 'Y'
db3c| (20343) read from RS232 address: $a000
db1c| (20394) write to RS232 address: $a001 value: $20 (dez.: 32) ASCII: ' '
db3c| (20505) read from RS232 address: $a000
db1c| (20556) write to RS232 address: $a001 value: $4d (dez.: 77) ASCII: 'M'
db3c| (20667) read from RS232 address: $a000
db1c| (20718) write to RS232 address: $a001 value: $49 (dez.: 73) ASCII: 'I'
db3c| (20829) read from RS232 address: $a000
db1c| (20880) write to RS232 address: $a001 value: $43 (dez.: 67) ASCII: 'C'
db3c| (20991) read from RS232 address: $a000
db1c| (21042) write to RS232 address: $a001 value: $52 (dez.: 82) ASCII: 'R'
db3c| (21153) read from RS232 address: $a000
db1c| (21204) write to RS232 address: $a001 value: $4f (dez.: 79) ASCII: 'O'
db3c| (21315) read from RS232 address: $a000
db1c| (21366) write to RS232 address: $a001 value: $53 (dez.: 83) ASCII: 'S'
db3c| (21477) read from RS232 address: $a000
db1c| (21528) write to RS232 address: $a001 value: $4f (dez.: 79) ASCII: 'O'
db3c| (21639) read from RS232 address: $a000
db1c| (21690) write to RS232 address: $a001 value: $46 (dez.: 70) ASCII: 'F'
db3c| (21801) read from RS232 address: $a000
db1c| (21852) write to RS232 address: $a001 value: $54 (dez.: 84) ASCII: 'T'
3505.40 cycles/sec.
db3c| (21963) read from RS232 address: $a000
db3c| (22042) read from RS232 address: $a000
db2d| (22080) write to RS232 address: $a001 value: $d (dez.: 13) ASCII: '\r'
db3c| (22108) read from RS232 address: $a000
db34| (22146) write to RS232 address: $a001 value: $a (dez.: 10) ASCII: '\n'
db3c| (22228) read from RS232 address: $a000
db3c| (22307) read from RS232 address: $a000
db2d| (22345) write to RS232 address: $a001 value: $d (dez.: 13) ASCII: '\r'
db3c| (22373) read from RS232 address: $a000
db34| (22411) write to RS232 address: $a001 value: $a (dez.: 10) ASCII: '\n'
db3c| (23170) read from RS232 address: $a000
db1c| (23221) write to RS232 address: $a001 value: $4f (dez.: 79) ASCII: 'O'
db3c| (23332) read from RS232 address: $a000
db1c| (23383) write to RS232 address: $a001 value: $4b (dez.: 75) ASCII: 'K'
db3c| (23494) read from RS232 address: $a000
db3c| (23573) read from RS232 address: $a000
db2d| (23611) write to RS232 address: $a001 value: $d (dez.: 13) ASCII: '\r'
db3c| (23639) read from RS232 address: $a000
db34| (23677) write to RS232 address: $a001 value: $a (dez.: 10) ASCII: '\n'

Well, what stands there? ;)

Now I have used pyserial properly.
I started here: https://github.com/jedie/DragonPy/blob/ ... 809.py#L29
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

It's alive... well, almost.

I created a Tkinter console window for RS232 interface.
Getting text and sending works, basicly.

But sending something will only reply/echo back. Nothing more.

Looks like this:
Attachments
Simple6809_TK_01.PNG
Simple6809_TK_01.PNG (12.78 KiB) Viewed 2248 times
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

Have made some updates. But can't get Simple6809 fully working: After a text line endered the CPU reads in a loop into out of memory area...
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
jedie
Posts: 634
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Dragon emulator written in Python ???

Post by jedie »

Have some bug fixed and implement some ops: https://github.com/jedie/DragonPy/commi ... 094543f706

I can send "PRINT 123" and see that the commands table for PRINT accessed. He jumps to de38:

Code: Select all

                        *
                        * DISPATCH TABLE FOR COMMANDS TOKEN #
                        CMD_TAB
...
0085                    TOK_IF    EQU  *-CMD_TAB/2+$7F
de36 e1 8d                        FDB  DATA                        86
0086                    TOK_DATA  EQU  *-CMD_TAB/2+$7F
de38 eb 6a                        FDB  PRINT                       87
0087                    TOK_PRINT EQU  *-CMD_TAB/2+$7F
de3a e1 ef                        FDB  ON                          88
see: https://github.com/jedie/DragonPy/blob/ ... M.LST#L708

He must have recognized the PRINT properly, isn't it?

The jumps comes from:

Code: Select all

                        * HERE IS WHERE WE BRANCH TO DO A 'COMMAND'
e08f 6e 94                        JMP  [,X]                       GO DO A COMMAND
see: https://github.com/jedie/DragonPy/blob/ ... .LST#L1060

A failure seems to be, that he interpreted the DISPATCH TABLE FOR COMMANDS as code. Looks like this:

Code: Select all

e08f| 6e   JMP    ea:de38                     cc=57 a=00 b=0e dp=00 x=de38 y=dd35 u=00f7 s=7f32 | .F.I.ZVC
de38| eb   ADDB   B=0e ea:7f3c m:0            cc=50 a=00 b=0e dp=00 x=de38 y=dd35 u=00f7 s=7f32 | .F.I....
de3a| e1   CMPB   B=0e ea:e29c m:c6           cc=53 a=00 b=0e dp=00 x=de38 y=dd35 u=00f7 s=7f32 | .F.I..VC
de3e| e0   SUBB   B=0e ea:deff m:25           cc=53 a=00 b=e9 dp=00 x=de38 y=dd35 u=00f7 s=7f32 | .F.I..VC
...
That must be wrong, isn't it?


How does the commands table work?
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

Re: Dragon emulator written in Python ???

Post by tormod »

jedie, you need to implement indirect indexed address mode. Note the brackets around ,X in JMP [,X]. It should jump to the address stored at the location pointed to by X, not jump to where X is pointing.
Post Reply