Page 9 of 11
Re: Dragon emulator written in Python ???
Posted: Sat Jul 12, 2014 9:06 pm
by jedie
jedie wrote:Update, after last bugfixes:
Code: Select all
6809 EXTENDED BASIC
(C) 1982 BY MICROSOFT
OK
10 FOR I=1 TO 3
20 PRINT STR$(I)+" DRAGONPY"
30 NEXT I
RUN
.0/////909 DRAGONPY
.0/////909 DRAGONPY
OK
Strange
I found the Bug, i found the bug, i found the buuuuuug...
Code: Select all
6809 EXTENDED BASIC
(C) 1982 BY MICROSOFT
OK
10 FOR I=1 TO 3
20 PRINT STR$(I)+" DRAGONPY"
30 NEXT I
RUN
1 DRAGONPY
2 DRAGONPY
3 DRAGONPY
OK
And the bug was... ...ADC doesn't store the result back into the register
Bugfix commit:
https://github.com/jedie/DragonPy/commi ... c498c62262
But maybe there are some undiscovered Bug. e.g.:
XRoar:
IMHO a good idea to compare the traces with my tools
But not today
Re: Dragon emulator written in Python ???
Posted: Sun Jul 13, 2014 11:04 am
by jedie
I have found this bug and get the same output in DragonPy, now. Commit:
https://github.com/jedie/DragonPy/commi ... 4fac528353
Re: Dragon emulator written in Python ???
Posted: Tue Jul 15, 2014 5:36 pm
by jedie
IMHO neally all bugs should be catched in the CPU...
I add some tests with the monitor ROM from sbc09...
And i add a console script (witch not used socket interprocess communication) for fast tests.
Just run:
Code: Select all
...path/to/DragonPy$ python2 console_6809_test.py
or use PyPy:
Code: Select all
...path/to/DragonPy$ pypy console_6809_test.py
New performance values with this script:
With CPython there is round about 490.000 CPU cycles/sec. (ca. half as fast as the real Hardware)
With PyPy round about 6.900.000 - 8.000.000 CPU cycles/sec. (~8 times faster as the real Hardware
)
Current screenshot with TkInter:
Re: Dragon emulator written in Python ???
Posted: Fri Jul 18, 2014 10:05 am
by jedie
Short update:
I work on a better multiprocessing solution in a branch:
https://github.com/jedie/DragonPy/compa ... rocessing2
Only Simple6809 with Tkinter GUI works, yet. It seems that it is a good performance boost.
The concept of the new implementation can be seen in these two files:
https://github.com/jedie/DragonPy/blob/ ... process.py
https://github.com/jedie/DragonPy/blob/ ... process.py
Re: Dragon emulator written in Python ???
Posted: Wed Jul 23, 2014 9:36 pm
by jedie
I have now merged the branch, because it seems to work good
It looks now like this:
Code: Select all
process_main.py process_sub.py
+-------------------------+ +-----------------------+
| | | |
| BusCommunicationThread<--->multiprocessing.Queue<--------->Memory |
| + ^ | | + ^ |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| v + | | v + |
| periphery | | 6809 CPU Thread |
| + ^ | | + ^ |
| | | | | | | |
| | | | | | | |
| | | | | v + |
| v + | | http control server |
| GUI mainloop | | |
| | | |
+-------------------------+ +-----------------------+
Next thing would like to use
http://bottlepy.org as the CPU http server.
Re: Dragon emulator written in Python ???
Posted: Sun Jul 27, 2014 9:26 pm
by jedie
I'm happy!!!! Because i see with
https://github.com/jedie/DragonPy/commi ... b54296fc15 this:
Code: Select all
````hCi`qyxr`DRAGON`DATA`LTD````````qvK`BASIC`INTERPRETER`qnp```````hCi`qyxr`BY`MICROSOFT```````````````````````````````````````````OK`
It's just a
char = chr(byte), so only a few characters are right. But hey, this is the first time that i see the copyright info from the Dragon ROM. To get the right text, i must use my old Information from
http://archive.worldofdragon.org/index. ... le=CharMap resp.
https://gist.github.com/jedie/6975555
Currently it's the Dragon 64 ROM, because of the better ROM info, from:
viewtopic.php?f=5&t=4370&start=10#p11378
The SAM/PIA implementation does nothing. Just dummy write/read functionality. I hope that is enough for playing with BASIC in text mode. That was was my first goal
EDIT: Just hacked cha charmap stuff and see:
(C) 1982 DRAGON DATA LTD
16K BASIC INTERPRETER 1.0
(C) 1982 BY MICROSOFT
OK
Re: Dragon emulator written in Python ???
Posted: Sat Aug 02, 2014 10:58 pm
by jedie
Now after the keyboard matrix / PIA stuff works, i have implemented a simple Text Mode display with "PyGame"...
So Dragon 32 / 64 Text mode is now a little bit useable:
You can input something and run. You see the cursor blinking. You can do "CLS 3" or other colors, and see colors like on real hardware:
But there is a problem: scrolling doesn't work right. It moves only every second char one line above
EDIT: Ah! I have mapped "read/write word" to "read/write byte"
Re: Dragon emulator written in Python ???
Posted: Sun Aug 03, 2014 4:18 pm
by jedie
jedie wrote:But there is a problem: scrolling doesn't work right. It moves only every second char one line above
EDIT: Ah! I have mapped "read/write word" to "read/write byte"
Yes, it was my mistake that i don't split byte/word in periphery probably
Re: Dragon emulator written in Python ???
Posted: Mon Aug 04, 2014 11:02 pm
by jedie
I'm work on the GUI... I have removed Pygame and use Tk only...
Now it looks like this:
(RUN output here:
viewtopic.php?f=5&t=4909&p=11571#p11571 )
Big TODO is to cleanup all the code and bring the CLI back...
I have try some of my BASIC listings (per copy clipboard) and they work good.
Re: Dragon emulator written in Python ???
Posted: Tue Aug 05, 2014 5:46 pm
by jedie
With
https://github.com/jedie/DragonPy/commi ... 41e9772eb4 i started to add a CoCo, too. But don't know much about CoCo. Seems that CoCo 1 and 2 are very similar to the Dragon Hardware, but CoCo 3 is more advanced.
At least i have to change the keyboard matrix.
I just used the CoCo "Color BASIC v1.3" ROM... It's "boots up" and i see the color animated cursor... But input doesn't work yet. Maybe the PIA kerboard polling is a little bit changed, than the Dragon ROM code...