-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework PyBeeb into a reusable system, with host interfaces #5
base: master
Are you sure you want to change the base?
Commits on Nov 24, 2023
-
Replace DOS line endings; strip trailing spaces.
The files appear to be formatted for DOS line endings, and had trailing spaces on some lines. These have now been stripped with: for i in *.py */*.py ; do echo $i ; sed -E -i '' 's/ *\r?$//g' $i done
Configuration menu - View commit details
-
Copy full SHA for affbd62 - Browse repository at this point
Copy the full SHA affbd62View commit details
Commits on Nov 25, 2023
-
There's now an interface that's similar in style to the Unicorn interface. The intention is that whilst this won't be a drop in for Unicorn, the expectations that you might have from Unicorn, such as the means of accessing registers and memory, and executing code, are similar.
Configuration menu - View commit details
-
Copy full SHA for e33331c - Browse repository at this point
Copy the full SHA e33331cView commit details -
Move the entire emulation system into a package.
In order to be reusable in other systems, it is better if the whole emulation system be in a package, rather than at the top level of the namespace. This change moves everything into a `pybeeb` package.
Configuration menu - View commit details
-
Copy full SHA for 453e5b6 - Browse repository at this point
Copy the full SHA 453e5b6View commit details -
Fix up tests to run with the new structure.
The tests hadn't been updated to run in the new packaged structure.
Configuration menu - View commit details
-
Copy full SHA for 65335c1 - Browse repository at this point
Copy the full SHA 65335c1View commit details -
Make the executable code executable.
The PyBeeb, PyBeebU and test files are now executable under unix systems and given shebang lines.
Configuration menu - View commit details
-
Copy full SHA for 9e8a67a - Browse repository at this point
Copy the full SHA 9e8a67aView commit details -
Move execution hooks to just before execution.
The execution hook was happening before the start of the decode because there wasn't an easy way to inject after it. This meant that it was not possible to report the instruction length. It might not be a big problem, but it did mean that we couldn't call the hook as easily. We now call the hook with the right details by having a class that inherits from the Dispatcher do the hook calls.
Configuration menu - View commit details
-
Copy full SHA for b24b2cd - Browse repository at this point
Copy the full SHA b24b2cdView commit details -
Fix for BRK not dispatching to the IRQ handler.
The last address in the memory map regions would not be supplied - the check for whether the memory was in the mapped object was not allowing for the inclusive end address of the mapping. This meant that the IRQ entry point (which is used by BRK) would be called with the high address byte being returned from the standard memory, which was 0. Instead of calling &DC1C, it was calling &001C. We now check the memory region inclusively.
Configuration menu - View commit details
-
Copy full SHA for 005547f - Browse repository at this point
Copy the full SHA 005547fView commit details -
Standardise instruction exceptions.
The instruction exceptions are now standarised to use an Exception for the instructions, rather than a BaseException. The undefined instructions are also reported as exceptions now, as well.
Configuration menu - View commit details
-
Copy full SHA for 472abbb - Browse repository at this point
Copy the full SHA 472abbbView commit details -
Update Registers to have a useful __repr__.
The __repr__ for Registers now includes their values.
Configuration menu - View commit details
-
Copy full SHA for ef80517 - Browse repository at this point
Copy the full SHA ef80517View commit details
Commits on Nov 26, 2023
-
Fix for readBytes/writeBytes interface not terminating.
The readBytes and writeBytes interfaces hadn't stopped when they reached the end of the requested region because of a failure to account of the end of mapped regions.
Configuration menu - View commit details
-
Copy full SHA for 777a57d - Browse repository at this point
Copy the full SHA 777a57dView commit details -
Fix PyBeebicorn's handling of register writes; hooks can now reset PC.
The register writes in the PyBeebicorn interface were always being AND'd with 255, even for the PC. The value stored is checked in each writer function now. The execution hooks are now able to reset the PC value when they are run, preventing the execution of the instruction that was decoded.
Configuration menu - View commit details
-
Copy full SHA for deb9acc - Browse repository at this point
Copy the full SHA deb9accView commit details -
Minor clean up to the dispatch handler.
The BRK now returns the address to call, and reset has a variable instead of just calling a magic address.
Configuration menu - View commit details
-
Copy full SHA for c22fca4 - Browse repository at this point
Copy the full SHA c22fca4View commit details -
Add console handling - RDCH is able to work.
The RDCH entry point is replaced by a key reader from the console. This uses the console code that I wrote for RISC OS Pyromaniac, modified to be independant on Pyro. This allows the RDCH entry point to be modified to handle the key input. It's not great because we lose *Exec handling, but since we don't have a filesystem or any other interfaces, that's not a big deal right now.
Configuration menu - View commit details
-
Copy full SHA for 718043b - Browse repository at this point
Copy the full SHA 718043bView commit details -
Fix for timeout being None not being handled.
The timeout value of None means 'wait forever', but it wasn't actually working because it had never been tested. We now check this more carefully.
Configuration menu - View commit details
-
Copy full SHA for 77cbeb6 - Browse repository at this point
Copy the full SHA 77cbeb6View commit details -
Removed stray debug in PyBeebicorn.
A debug had been left in the PyBeebicorn interface when the PC was set.
Configuration menu - View commit details
-
Copy full SHA for c4bf2e6 - Browse repository at this point
Copy the full SHA c4bf2e6View commit details -
Update the PyBeebU to handle lack of input.
If there's no input, we could return None. This might happen if there had been input but no characters were actually read, or the timeout occurred.
Configuration menu - View commit details
-
Copy full SHA for f66c406 - Browse repository at this point
Copy the full SHA f66c406View commit details -
Update the handling of backspace to delete characters.
We can now delete characters in the character input handler, and they will be output properly.
Configuration menu - View commit details
-
Copy full SHA for d89e473 - Browse repository at this point
Copy the full SHA d89e473View commit details -
Add support for memory access hooks.
The memory access hooks allow us to report when reads or writes happen to memory. They may be problematic at the moment as the store operations appear to read the values from the memory as well, before they then go and store to the locations.
Configuration menu - View commit details
-
Copy full SHA for 9658662 - Browse repository at this point
Copy the full SHA 9658662View commit details -
Add support for Escape in the RDCH function.
The RDCH function was not reading the escape key properly, because we weren't setting the C flag. It also appears that unless you set the error condition in zero-page, the system won't report the error properly.
Configuration menu - View commit details
-
Copy full SHA for 00184d8 - Browse repository at this point
Copy the full SHA 00184d8View commit details
Commits on Nov 28, 2023
-
Update the console.py module with full version from Pyromaniac.
I had originally cut down the console.py to be a limited, POSIX only, version of the console.py implementation. However, there's no reason why this cannot be used on Windows so I may as well include the Windows version. It should work reasonably well, but it's not as polished as the POSIX version.
Configuration menu - View commit details
-
Copy full SHA for 7154399 - Browse repository at this point
Copy the full SHA 7154399View commit details
Commits on Dec 4, 2023
-
Add support for disassembling the 6502 code as it executes.
There is now a simple disassembler (more than the original one) in the PyBeebicorn code, which can disassemble the code as it is executed. This can be used in a hook to trace only certain sections of the code.
Configuration menu - View commit details
-
Copy full SHA for b62b89d - Browse repository at this point
Copy the full SHA b62b89dView commit details
Commits on Dec 5, 2023
-
Add code coverage for the tests that we have.
We can now exercise the code in some tests that can be run in a Makefile. Only the coverage run is explicitly supported right now, and it'll fail if the tests fail, so it's a combined coverage and test reporter. We mix the unit tests and the integration tests at the moment, and the output from the integration test isn't checked for regressions.
Configuration menu - View commit details
-
Copy full SHA for 49f46a3 - Browse repository at this point
Copy the full SHA 49f46a3View commit details -
Add github workflow to run the coverage/tests on pushes.
There is a simple workflow here to run the coverage and tests on push. We're only running under Python 2, still, but it should be sufficient to make it work for us.
Configuration menu - View commit details
-
Copy full SHA for c8df945 - Browse repository at this point
Copy the full SHA c8df945View commit details
Commits on Dec 7, 2023
-
Rework the OSInterfaces in the example program.
The PyBeepicorn example program now has some more abstracted interface entry points. These are set up in such a way that we can use them without (in theory) having the knowledge of the underlying system. They should be easy to extend for the other APIs.
Configuration menu - View commit details
-
Copy full SHA for afe9090 - Browse repository at this point
Copy the full SHA afe9090View commit details -
Add an OSCLI handler to allow exiting.
We now have a very simple OSCLI handler so that we can trap *QUIT and exit the emulator. If we don't recognise the command it is passed to the rest of the handler system.
Configuration menu - View commit details
-
Copy full SHA for 5e8ec79 - Browse repository at this point
Copy the full SHA 5e8ec79View commit details
Commits on Dec 8, 2023
-
Add OSBYTE and OSWORD hooked classes.
We now have classes which are hookable so that we can replace the OSBYTE and OSWORD implementations. This allows us to provide some interfaces to the host system which override the BBC implementation.
Configuration menu - View commit details
-
Copy full SHA for d368369 - Browse repository at this point
Copy the full SHA d368369View commit details -
Move all the host interfaces for the BBC MOS to a package.
The host interfaces have now moved into a package so that they can be used more generically if people want. Specific routines that interface with the host are separate from the base implementations so that they don't have to be the way that you communicate with the system.
Configuration menu - View commit details
-
Copy full SHA for 17d5702 - Browse repository at this point
Copy the full SHA 17d5702View commit details
Commits on Dec 9, 2023
-
Add initial support for filesystem interfaces.
The filesystem interfaces OSFILE, OSARGS, OSBPUT, OSBGET, OSFIND have been given base implementations which dispatch to different routines. They're not especially well suited to being overridden because each class is independant. Ideally we'd allow a common interface to be provided for the filesystem, which those classes could access.
Configuration menu - View commit details
-
Copy full SHA for 7b7ceae - Browse repository at this point
Copy the full SHA 7b7ceaeView commit details -
Rework the base OS interfaces to be more flexible.
The base OS interfaces were duplicating some behaviour and not as common as you might like. The interfaces are a little easier to update now. It's not clear that they're actually going to make for a better general experience but they will allow some more flexibility. Also a few typos fixed.
Configuration menu - View commit details
-
Copy full SHA for 710238f - Browse repository at this point
Copy the full SHA 710238fView commit details
Commits on Dec 10, 2023
-
Initial implementation of OSGBPB.
OSGBPB's byte operations are now implemented in a base class. The other GBPB operations that handle the media name, and directory enumeration are not yet implemented.
Configuration menu - View commit details
-
Copy full SHA for 2204c0a - Browse repository at this point
Copy the full SHA 2204c0aView commit details
Commits on Dec 11, 2023
-
Allow the cursor key decoding to work when no timeout present.
When the timeout is absent, we weren't handling the cursor key decoding. This meant that they came out as escaped VT codes instead of BBC style codes.
Configuration menu - View commit details
-
Copy full SHA for 50d21d0 - Browse repository at this point
Copy the full SHA 50d21d0View commit details -
Most of the operations have now been updated so that they work with Python 3, allowing us to run the commands safely with Python 3.9 at least. The code still works with Python 2.7 as well.
Configuration menu - View commit details
-
Copy full SHA for 8181172 - Browse repository at this point
Copy the full SHA 8181172View commit details -
Add dispatcher for the remaining OSGBPB calls.
We now have the dispatcher handling OSGBPB calls for directory names and the reading of filenames.
Configuration menu - View commit details
-
Copy full SHA for fe4cd25 - Browse repository at this point
Copy the full SHA fe4cd25View commit details
Commits on Dec 12, 2023
-
Added base implementation of the OSFSC interface.
The OSFSC base implementation is now provided.
Configuration menu - View commit details
-
Copy full SHA for f35e493 - Browse repository at this point
Copy the full SHA f35e493View commit details
Commits on Dec 16, 2023
-
Add rudimetary host filesystem module and implementation of load/save.
We now have a host filesystem module, fsbbc.py, which provides a BBC-like interface to the host filesystem. It's not tested beyond being run through a few simple exercises, but the name translation is based on code from RISC OS Pyromaniac so it should have the right style of thing in it. The OSFILE load and OSFILE save operations are implemented and these allow BASIC to load files and save them.
Configuration menu - View commit details
-
Copy full SHA for ee17e65 - Browse repository at this point
Copy the full SHA ee17e65View commit details
Commits on Dec 18, 2023
-
Implement remaining OSFILE interfaces for host filesystem.
We now have the read/write file information and their variants, and the delete operation, implemented in the host filesystem version of OSFILE.
Configuration menu - View commit details
-
Copy full SHA for 88aa903 - Browse repository at this point
Copy the full SHA 88aa903View commit details -
Add simple implementation of host stream open and output.
OSFIND, OSBGET and OSBPUT are now implemented. This should hopefully do the right thing for us, although they're not well tested.
Configuration menu - View commit details
-
Copy full SHA for 587abc6 - Browse repository at this point
Copy the full SHA 587abc6View commit details -
Fix for incorrect data mode for ADC indexed Y access.
The data mode for ADC indexed Y access was listed as `imy` instead of `iny`.
Configuration menu - View commit details
-
Copy full SHA for 046a41b - Browse repository at this point
Copy the full SHA 046a41bView commit details -
Add simple implementation of the OSARGS calls.
We now implement some of the stream handling in OSARGS, allowing us to manipulate the pointer.
Configuration menu - View commit details
-
Copy full SHA for 73ff734 - Browse repository at this point
Copy the full SHA 73ff734View commit details
Commits on Dec 19, 2023
-
Update Makefile to clean away .pyc files.
The .pyc files can be cleaned away to make them get rebuilt. Useful if we're changing content.
Configuration menu - View commit details
-
Copy full SHA for 2bcfd52 - Browse repository at this point
Copy the full SHA 2bcfd52View commit details -
The hosttty.py file is there to operate only on the TTY, so we might as well name it as such.
Configuration menu - View commit details
-
Copy full SHA for 6f366a8 - Browse repository at this point
Copy the full SHA 6f366a8View commit details -
Add hosttty support for INKEY(+ve).
Reading a key within a time limit is now supported by the INKEY OSBYTE call.
Configuration menu - View commit details
-
Copy full SHA for f9391ca - Browse repository at this point
Copy the full SHA f9391caView commit details -
Add support for EOF to host FS implementation.
The EOF check now works, either when called through OSFSC or OSBYTE.
Configuration menu - View commit details
-
Copy full SHA for dca7658 - Browse repository at this point
Copy the full SHA dca7658View commit details
Commits on Dec 20, 2023
-
Fix for OSARGS not triggering.
Two hex digits in the code address for OSARGS had been transposed, meaning it was never called. And the EXT handler hadn't assigned the right variable.
Configuration menu - View commit details
-
Copy full SHA for ce3919f - Browse repository at this point
Copy the full SHA ce3919fView commit details -
Update OSRDCH to allow buffer and *exec to be used.
Buffering and *Exec are handled as part of OSRDCH, but we need to process the routing a little later, after all the code which retrieves from the file, and checks the buffer. That way, if there is buffered data, we'll use it.
Configuration menu - View commit details
-
Copy full SHA for 51d96ab - Browse repository at this point
Copy the full SHA 51d96abView commit details
Commits on Dec 22, 2023
-
Rename PyBeebicorn to Emulation; replace 'regs, memory' with 'pb'.
The PyBeebicorn interface is now a main interface, with the name Emulation, instead of PyBeebicorn. This allows it to be passed around more freely. As such, instead of referring throug the regs and memory objects which are passed in, we now pass through the emulator obejct `pb`.
Configuration menu - View commit details
-
Copy full SHA for bfbe5a7 - Browse repository at this point
Copy the full SHA bfbe5a7View commit details
Commits on Dec 23, 2023
-
Add MOS interfaces to call code; implement *CAT.
We now have a MOS interface that allows us to call 6502 code which is necessary to write characters to the display. And we use this with the *CAT interface. We also have a CWD in the filesystem now.
Configuration menu - View commit details
-
Copy full SHA for 9e57509 - Browse repository at this point
Copy the full SHA 9e57509View commit details -
We now support *DIR properly, and we have a number of fixes for command line uses.
Configuration menu - View commit details
-
Copy full SHA for e343cf4 - Browse repository at this point
Copy the full SHA e343cf4View commit details -
Fix for Python 3 support in the Host/base.py module.
Python 3 support had been broken when the CLI handling had been reworked.
Configuration menu - View commit details
-
Copy full SHA for d69f5bc - Browse repository at this point
Copy the full SHA d69f5bcView commit details -
Update documentation to reflect current state.
The documentation has been updated to reflect how the code has changed to focus on the new hooking system and the ability to interact with the host system. The old code has been moved to PyBeebMinimal.py as part of this.
Configuration menu - View commit details
-
Copy full SHA for 8849c81 - Browse repository at this point
Copy the full SHA 8849c81View commit details -
Coverage runs of the Memory tests hadn't been working at all. They were not invoking the unittest on the module. We now correctly invoke that and get better coverage because of it. The coverage had been confused on MacOS because PyBeeb.py and pybeeb/__init__.py are effectively the same module, so we were getting other references to modules that weren't really there. To avoid this problem, and to make it easier to understand the difference between the tool and the package, the command line program has been renamed to `RunBeeb.py`.
Configuration menu - View commit details
-
Copy full SHA for e6c0e36 - Browse repository at this point
Copy the full SHA e6c0e36View commit details -
Updated Python 3 support to cover filesystem interfaces.
The filesystem interfaces should now be reporting the filenames properly to the BBC and back out again to the host filesystem, when used in both Python 2 and Python 3.
Configuration menu - View commit details
-
Copy full SHA for 30cf7b9 - Browse repository at this point
Copy the full SHA 30cf7b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c155b0 - Browse repository at this point
Copy the full SHA 5c155b0View commit details
Commits on Jun 13, 2024
-
Allow *Exec to work with the host readline; ctrl-c=>escape in RDCH.
When *Exec is used and we're trying to read a line, don't call the host ReadLine interface. Instead we fall back to the standard ReadLine in the MOS which will read characters and insert them into the input from the file. When ctrl-c is pressed whilst waiting for a key press, we now treat this as an escape press.
Configuration menu - View commit details
-
Copy full SHA for 312c229 - Browse repository at this point
Copy the full SHA 312c229View commit details