logo elektroda
logo elektroda
X
logo elektroda
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • For some time now I have been developing a certain system, which I have tentatively named Virtual Machine for 8-bit systems. The name seems to me, at least for now, to reflect well what it is intended to be used for. ;) .
    Development board with STM32H7 microcontroller featuring labeled connectors and pins. .
    The project is based on the STM32H750, although in principle it can be ported to almost any Cortex-ARM, which I think I will probably do in the future. For now, it's on this chip because it basically meets my needs at least at the moment.
    What this chip does, at the moment it simulates a computer with a 65816 processor. This processor was the most advanced development version of a family of processors derived from the MOS6502 known from ATARI 8-bit computers, COMMODORE, or NES consoles.
    Currently, the system simulates a 65816 processor and can execute its code at a speed equivalent to a 65816 processor with a clock of about 4.5MHz.
    At this point I have run the 65816 compatibility test, which passes in its entirety including simulation of all known 65816 anomalies.;)
    By the way, I managed to run j. BASIC and a simple operating system, exactly it is EhBASIC2.22, which runs on many DIY systems based on 6502.
    In the video is a fractal drawing program written in the dialect of this BASIC.
    I am also attaching a listing, maybe someone would like to help and run it on their 8-bit computer, which might help me to better estimate the performance of this machine of mine.
    Porting the program shouldn't be too complicated, as it uses text mode and simple calculations. In order for the test to make any sense, I ask that you do not make any changes that might distort the results, such as not removing spaces or combining several lines into one to increase its execution speed. It is best to run as is or, if necessary, make only the necessary changes for the dialect if the program in this version would not run on the machine in question. if the system does not show the time you can remove lines 290 and 510.
    As of today, the chip provides access to 2 serial ports and several 8/16-bit parallel ports.
    It has a built-in program to track the TRACE of the emulated system. All in all, for its operation it is sufficient to connect to some serial terminal.
    I want to develop the system by adding simulators for more processors.
    The system at the moment has 3 blocks of RAM 512kB, 384kB and 64kB.
    And it has 2 serial hardware ports for communication. Their number can be expanded if required. In principle, it is supposed to be possible to map all STM32 I/O chips.
    The program in BASIC and a video of how it works attached, as I had trouble adjusting the format of the video to make it visible in the message.

    If anyone has any ideas what should be included in such a system, please write. The Virtual Machine is still under construction ;) .




    Cool? Ranking DIY
    About Author
    gregor124
    Level 26  
    Offline 
    gregor124 wrote 1029 posts with rating 427, helped 73 times. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 21277202
    gulson
    System Administrator
    Thanks for sharing the information about starting to build an emulator. I've noticed on foreign language portals that it always sparks interest to run some game, or program popular at the time. A video + pictures and suddenly there is a flock of interested parties. I would be happy to translate the topic into English. I have posted the video from your attachment.

    As for further ideas, maybe emulation of some peripheral chips, or support for file formats of the time.
    Also always nice to have some kind of user interface.

    Other processors I don't know, maybe a Z80 Spectrum.

    Everyone's going into retro games lately, but I don't know if the market isn't heavily saturated, you can buy a console for 150£ that emulates basically everything.
    And somehow everyone has forgotten about emulating good old utilities (you'd just have to check the licences).
  • ADVERTISEMENT
  • #3 21277333
    gregor124
    Level 26  
    The initial aim of the project was an accelerator for my Apple II computer. During implementation, due to ad hoc needs, mainly to find bugs in the emulation, other modules were gradually added.
    For example, I had to add a processor status viewer, which in turn entailed adding serial ports and transferring the WOZ monitor from the Apple computer to the ARM processor. The project is slowly being built. I know there are quite a few emulators on the market, but what has always bothered me about them is the limited access, or rather practical lack of it, to the resources of the controller/computer on which it runs. The system is being created in assembler language and does not use RAM for its needs (something like microcode), I want to be able to access all the peripherals of the STM32 in such a way that a person familiar with 6502, 8080, 65816, in the future maybe 6809 etc can use this platform programming like a familiar 8-bit computer.

    Of course the potential for a user interface is there, as I wrote, the performance of the 65816 is already around 4MHz there is also more RAM 512kB, and that is more than the first version of the Apple IIGS 2.8MHz and 256kB RAM ;) I expect that e.g. the 8080 or Z80 being simpler should work with much higher performance. I'm starting to work on emulating the 8080 and running a CP/M system, or perhaps better CP/Junior if it can be found somewhere ;) .
    The system has already proven itself in practice and it helps to find a bug in a very good program Smith Simulator for simulation of processors of the 65xx family which has proved very powerful for me ;) .
  • ADVERTISEMENT
  • #4 21277504
    Belialek
    Level 22  
    A very interesting topic, but unfortunately very overdue - now for a few hundred bucks you can buy ready-made chips on FPGAs that hardware-encompass emulation of everything from x86 inclusive (up to 486 speed), without introducing any latency with respect to the originals, offer analogue image outputs, etc.

    But my compliments - from a programming point of view, it's a piece of work!
  • ADVERTISEMENT
  • #5 21279958
    acctr
    Level 38  
    gregor124 wrote:
    If anyone has any ideas what such a system should contain, please write. Virtual Machine is still under construction
    .
    Unfortunately, this is the plight of modern DIY - toys with great capabilities are available but no idea what to do on them.
    DOOM has already been fired up on pregnancy tests :D .
    Helpful post? Buy me a coffee.
  • #6 21289877
    gregor124
    Level 26  
    Today I managed to compile the Supermon 816. In order to get it working, I had to add some I/O routines. In general, the program uses 2 serial ports for communication, one to communicate with the VT-100 terminal and the other to read/write data in Motorola S-record format.
    Although the programme is owned by BCS Technology Limited, it allows non-commercial use.
    Supermon 816 allows debugging programs for the 65816 processor in Native mode (16-bit), and its syntax is very similar to that of the Commodore computer monitors (Jim Butterfield's SuperMon).
ADVERTISEMENT