6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 10:00 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Sun Feb 20, 2022 8:28 am 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
TLDR: find some Py65 enhancements on my GitHub including support for the 65816, a real-time debug window and a few basic VIA and ACIA interrupts.

As a frequent reader I've gotten a lot of great information for my 6502 builds from the forum. Thanks to everyone for making this a great resource for hobbyists. I thought I'd share a few things I've done recently.

On the emulation side of things, I've worked with Py65 to help develop a version of Forth for my 6502 build. I wouldn't have had the patience to debug the program on my hardware, so Py65 was indispensable. I got my first introduction to Python by modifying Py65 to simulate mass storage access to test my Forth's Block word set.

With some Python experience under my belt, I decided adding some basic VIA and ACIA interrupt support so I could use my hardware binary directly in Py65. Maintaining a separate version of my code for Py65 was actually easier than modifying Py65 to handle the interrupts I was using. I'd say in most cases that's the way to go, but I haven't missed maintaining two versions of my code.

At this point, just for fun, I decided to add a real-time debug window to Py65. This is useful to examine what's going on while your program is running and without messing up your program's console I/O. See a sample screenshot here.

At this point my focus was shifting toward the 65816 but I was hesitant to get too far into a build without having an emulator. Given my experience with modifying Py65, I decided to take a stab at adding support for the 65816. I figured this would be fairly straight forward, but it was a lot of work (and it still isn't complete).

I've consolidated all of these enhancements into a local package that works alongside Py65. You can find out more at my py65816 repository. The features are pretty rough right now. I'm not sure if Py65 is being worked on anymore or if my enhancements have much appeal generally, but if so, perhaps someday they'll be of sufficient quality to be included.

I'd appreciate any suggestions for improvement.

Thanks
Terrance


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 21, 2022 7:31 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Nice one Terrance, thanks for sharing! (And welcome!)


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 22, 2022 8:01 pm 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
BigEd wrote:
Nice one Terrance, thanks for sharing! (And welcome!)


Thanks for the welcome!


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 28, 2022 6:33 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I wonder, did you try running with Pypy? It's a faster Python than the usual one.


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 28, 2022 7:47 am 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
I'm not familiar with Pypy. I'll have to check it out.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 03, 2023 2:20 pm 
Offline
User avatar

Joined: Sat Dec 01, 2018 1:53 pm
Posts: 730
Location: Tokyo, Japan
BTW, you can probably get a significant speedup by using a bytearray instead of an int[] for the memory. That made for a very noticeable speedup in my Python 6800 simulator. That said, I don't think I've tried this with py65, and I don't know what knock-on effects this might have.

As far as the coding side of things, you might consider pytest. My unit tests for the 6800 instructions are less than 20% the length of those for py65 (1109 lines vs. 6065) and I think overall a lot clearer and easier to read; much of that is due to the facilities offered by pytest (particularly the ability to write one test and have it run with many different test vectors).

_________________
Curt J. Sampson - github.com/0cjs


Top
 Profile  
Reply with quote  
PostPosted: Thu May 04, 2023 7:43 am 
Offline

Joined: Sat Feb 19, 2022 10:14 pm
Posts: 147
I've ported the py65 engine core to Typescript which greatly improved performance. I've also developed a Debug Adapter which allows debugging within Visual Studio Code. More detail at my Github db65xx.

For testing, I've just directly run the Klaus Dormann 6502 functional tests. This misses the 65816 side of things, but I'm ok with that.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: