Comments (2)
Very nice --- what's the performance like? (I'm guessing, not great...)
Regarding memory access: it'd be nice to have something cross-platform. Traditionally CP/M does extended memory access via a ramdisk. Reading and writing blocks is pretty cheap, although much slower than access via banking, of course. I wonder if some kind of virtual memory would be feasible?
Thinking out loud:
- take the top byte of the address, and with 0xc0, shift right four times.
- this is the offset into an array of 32 pointers in zero page, each of which points at a 2kB local block of memory.
- if the pointer is non-zero, that block is mapped in. Get the pointer, add the address, dereference, return.
- if it is zero, that block's not mapped in, so we follow a slow path to allocate a block and load it from a 64kB swapfile. This may involve evicting another block and writing it back to disk.
That would be something like...
lda vaddr+1
and #0xc0
lsr a
lsr a
tax
lda mappings+1
beq no_mapping
clc
lda vaddr+0
adc mappings+0, x
sta paddr+0
lda vaddr+1
and #0x3f
adc mappings+1, x
sta paddr+1
<derefence paddr here>
That's.. not that bad? It's more work than your current code but it's portable. Coming up with a cache eviction strategy would be tricky. LRU would require overhead for every memory access, but apparently some ARM chips would just evict a block at random and that was considered good enough...
from cpm65.
I'm afraid that will slow things down by at least a factor of two, not counting the load and save times to ramdisk. Most optimizations that I use can't be used, like the msb_to_bank and msb_to_adjusted tables, and checking for end of bank with the BIT instruction. Checks and adjustments that have to be done for almost each memory read or write (end-of-bank only during the optimized instruction fetcher).
But I see your point. It would be nice to have a cross-platform 8080.COM but IIUIC that would offload the bankswitching to a platform dependent ramdisk driver. IMHO it's better to keep the platform dependent code as close to the emulation as possible. It's slow enough as it is. Although it's faster than I had expected, I do not have a number yet. I need a proper benchmark program that I can run on a 2MHz or 4MHz 8080 and on the emulator to see how it performs. Do you know about such program?
I think I'll keep the bankswitching in for now. Later, if there's multiple drives and ramdisk support we can always change it or make it optional.
Regards,
Ivo
from cpm65.
Related Issues (20)
- VT52 waiting for valid escape sequence HOT 1
- Reusing a static FCB for several file operations HOT 3
- "REN"-like command for changing user ID HOT 2
- Multiple drive support HOT 6
- Reserving low memory by a TPA program HOT 5
- Release images HOT 2
- Memory banking issue in Apple 2e HOT 4
- request : Port this the the Neo6502 please HOT 19
- request: port this to the pC6502 HOT 3
- request: o65 6502 binary relocation format
- Cursor behaviour HOT 3
- Writing a new driver in assembly HOT 7
- Dependency on a certain version of llvm-mos HOT 1
- Failing to assemble .COMs on macOS (13.6) HOT 2
- Listing multiple lines in BEdit does not work
- ccp internal "ren" does not work HOT 2
- Build for Apple II 3.5" as well HOT 2
- Saving files with BEDIT on the Atari doesn't work HOT 3
- Updates to lib6502 breaks objdump HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpm65.