Comments (11)
I've not had any thoughts about adding far
support to any other machines - it was needed on the z88 because the OS was built around 3 byte pointers and provided allocation features (albeit only up to ~250 bytes).
For machines without such restrictions, and access to banks of contiguous memory, I think it's easier to just use Named address space
from z88dk.
Thank you for your answer. I've read your link. I'm developing for MSXDOS2, so I know how to manage the memory mapper by calling EXTBIO. But it's not clear to me the meaning of:
void setb0(void); // The function that sets the currently active memory bank to b0
void setb1(void); // The function that sets the currently active memory bank to b1
Moreover, I tried the linked example, but it seems that both files (bank1 and bank4) end on the same bank:
The first line ("Value in address space 1 is..") should be 89.
Thanks
from z88dk.
... my fault, I was using the emulator in 48k mode. With 128k it works!
Anyway, can you explain what does "sets the currently active memory bank to b0" mean for MSXDOS2? Thanks
from z88dk.
It means that we simply page in that bank into the memory space. In that example, I named the address spaces after the bank indices because I thought it was simpler and tied in with the general way banking is done within z88dk
For the MSX2, you'll need to maintain a map of physical to logical banks. So for allocation you've probably got code like this:
ld b,0 ;Primary mapper
ld a,0 ;Allocate user segment
call ALL_SEG
jp c,print_message_pop
; a = allocated segment
And then you'll need to keep track of logical to physical map:
; e = logical bank
; c = physical bank
ld hl,bank_mappings
ld d,0
add hl,de
ld (hl),c ;Save mapping
bank_mappings: defs 256
So to switch to implement setb0 and setb1 the code would look like this:
_setb0:
ld a,(bank_mappings)
call PUT_P2 ;page the bank into segment2
ret
_setb1:
ld a,(bank_mappings+1)
call PUT_P2 ;page the bank into segment2
ret
ALL_SEG
and PUT_P2
are obtained from EXTBIO:
xor a
ld de,$0401
call $FFCA ;EXTBIO
xor a
ld de,$0402
call $FFCA ;EXTBIO
and a
ld de,msg_nomapper
jp z,print_message
ld de,dos2_jump
ld bc,dos2_end - dos2_jump
ldir
The code snippets have been pulled out from lib/target/msx/classic/msxdos.asm - if you use the pre-existing banking support it will load code/data into the appropriate banks and maintain the logical-physical mapping for you. So all you'll need to do is to provide setb0, setb1 and add a cheeky PUBLIC bank_mappings
to msxdos.asm (I'll export an identifier by default so you won't need to do that forever)
from z88dk.
Thanks a lot!
from z88dk.
Hi @suborb ,
do you have any plan for the "I'll export an identifier by default" part? :-)
Thanks!
from z88dk.
To be honest, as you can probably guess I completely forgot!
from z88dk.
No problem! I hope you'll add it, when you'll have the time! :-D
from z88dk.
Just reopening so I don't forget again!
from z88dk.
Sorted - I've updated the example so that it works on msxdos as well. Hopefully your version looks at least somewhat similar!
from z88dk.
That's great! Thanks a lot!
from z88dk.
Related Issues (20)
- (z80asm) test fails in SNAPcraft HOT 1
- Merging the lib3d.lib into gfx HOT 16
- Support Tandy-Emeritus
- (z80asm) Pseudo instructions causing trouble HOT 3
- (sccz80) Const initialisation issue HOT 1
- 2.2 does not compile on Fedora 40 HOT 4
- [question] How is z88dk making it possible to parallely build several targets sharing some code? HOT 3
- [bug?] Z88DK versions from the same date: Linux version fails while Windows version is OK HOT 7
- [bug][zx81][wrx] When compiling for zx81 with wrx I now get `undefined symbol: hrg_phase` HOT 7
- Thank you 🙂 HOT 1
- msys2 issues: clang64 error compiling and compiler path errors HOT 3
- [feature] Support for Olivetti m10 (clone of m100) HOT 22
- (z80asm) Compile issue on msys2
- ASSERT on Z80asm HOT 2
- Compile error today (worked yesterday) HOT 1
- MacOS - zsdcc binary is r14210 HOT 3
- appmake +zx colliding with binaries of previous builds
- TMS9918 graphics improvements HOT 6
- [question][ti] What is the meaning of "Warning: Use of numbers in the variable name is not certain to work on all calculators!" ? HOT 2
- (sccz80) Support static __far data
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 z88dk.