Giter Site home page Giter Site logo

transistorfet / moa Goto Github PK

View Code? Open in Web Editor NEW
52.0 4.0 4.0 12.62 MB

An emulator for various m68k and z80 based computers, written in Rust. Currently it has support for the Sega Genesis, TRS-80, and Computie (my own project), with Macintosh support in the works

Home Page: https://jabberwocky.ca/projects/moa/

License: GNU General Public License v3.0

Rust 99.40% Shell 0.10% HTML 0.11% JavaScript 0.29% CSS 0.06% Just 0.04%
emulator 68k rust m68k 68000 sega-genesis sega-mega-drive trs-80 emulation z80

moa's People

Contributors

transistorfet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

moa's Issues

Add some way to trace program read/writes

Hello,

first of all I really love this project. I use it to simulate/trace the program code of an old dmx light controller (MA LightCommander 12/2) which uses the MC68008, reading the assembly is one thing but it is much nicer to let it run and actually see how it works.

To trace memory access better I tried to find a way to somehow get the current program counter in the read and write methods of Addressable devices, to be able to print out not only what address was read or written but also from where in the program it took place.

Sadly, after multiple tries I did not succeed in finding a good way, so I am now asking you if you have a suggestion how to make it work.
I tried adding a write with program counter command to run_command of the M68k, however to use it I would need mutable access to system in my device, which I couldn't make work.
Then I tried storing the log message in the device and call a print out method after every step with the current program counter, however that needs access to the cpu outside of the device, which I was unable to get without unsafe casting from the device.
Additionally I thought about adding a new error type which would add the program counter to the inner string, but that also stops the execution of the cpu, which I wanted to avoid.

My final idea (which I haven't tried yet) would be to instead of clock add a context variable to the read and write methods. It would be passed by reference through all addressable methods that currently have clock. The context variable would be a struct with at least the program counter and the clock in them. It would be created in the cpu on read/write and passed through every addressable in the chain (M68kBusPort -> Bus -> Any addressable device)
That way and device that supports addressable can also log some access information if it needs to. It could also help to create better error messages when a read/write address is outside of the valid segments

If this idea sounds workable to you I'm happy to write a PR as well

Best, Jomer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.