Oric emulator in Python

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

Oric emulator in Python

Post by goyo »

I think it could be interesting for us to create an Oric emulator in Python language.

To do that it will be possible to base this project to the 'py65emu' library. And I think this work will be not very difficult with help of different python libraries.

In the first time it will be just neccesary to adapt this program with the Oric rom and handle the displaying and keyboard.

Code: Select all

from py65emu.cpu import CPU
from py65emu.mmu import MMU

f = open("program.rom", "rb")  # Open your rom

# define your blocks of memory.  Each tuple is
# (start_address, length, readOnly=True, value=None, valueOffset=0)
m = MMU([
        (0x00, 0x200), # Create RAM with 512 bytes
        (0x1000, 0x4000, True, f) # Create ROM starting at 0x1000 with your program.
])

# Create the CPU with the MMU and the starting program counter address
# You can also optionally pass in a value for stack_page, which defaults
# to 1, meaning the stack will be from 0x100-0x1ff.  As far as I know this
# is true for all 6502s, but for instance in the 6507 used by the Atari
# 2600 it is in the zero page, stack_page=0.
c = CPU(mmu, 0x1000)

# Do this to execute one instruction
c.step()

# You can check the registers and memory values to determine what has changed
print c.r.a     # A register
print c.r.x     # X register
print c.r.y     # Y register
print c.r.s     # Stack Pointer
print c.r.pc    # Program Counter

print c.r.getFlag('C') # Get the value of a flag from the flag register.

print mmu.read(0xff) # Read a value from memory
if someone would be interested by this projet i can open a github for that.


https://github.com/docmarionum1/py65emu


What do you think about this ? :shock: :wink:
User avatar
jbperin
Flight Lieutenant
Posts: 480
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Oric emulator in Python

Post by jbperin »

Sounds very interesting.

Moreover, you had already worked on an emulation of the graphic chip.
so it could be a good start.

What I am especially interested in is the possibility of automating some non regression test.

Recreating an Oricutrom looks ambitious.

But we can have some exclusive features with such a tool.
User avatar
goyo
Officer Cadet
Posts: 52
Joined: Sat Jan 12, 2019 10:16 am

Re: Oric emulator in Python

Post by goyo »

jbperin wrote: Mon Nov 01, 2021 6:51 am Sounds very interesting.

Moreover, you had already worked on an emulation of the graphic chip.
so it could be a good start.

What I am especially interested in is the possibility of automating some non regression test.

Recreating an Oricutrom looks ambitious.

But we can have some exclusive features with such a tool.
Yes It will be interesting. :D
I start to debug step by step Oric initialization vs python emulator initialization. Apparently it is necessary to have a good knowledge of basic Oric processes (I/O interrupts)
It necessary to implement specials threads python processes that manage the I / O in the memory in the Oric's bases pages space
Post Reply