Comments (5)
Oh, good that it runs --- the Apple II disk system is notoriously touchy.
Regarding making the BIOS bigger: the answer is, I'm not sure. We get up to one track loaded for us automatically, which is currently all we need. Loading another track would mean calling into the Apple II ROM as the disk driver isn't ready yet. That would also mean allocating another track from the already rather small disks for the extra BIOS --- but given that the minimum block size in CP/M is 2kB, we'd have to do that anyway.
The other thing is to build the BIOS twice, once for 40-column machines and once for 80-column machines (I guess you're trying to autodetect whether the card's installed?). That's a bit suboptimal but might be the easiest option.
from cpm65.
The code for the 40 and 80 column mode is not that different, just some address calculations differ and the switching
between the two text pages, so this can easily be done with an #ifdef.
I think I found a solution for the memory problem: I followed the ideas in the atari800 port: I'm keeping a very simple
TTY driver in bdos.sys
, which can run in 40/80 columns mode depending on the Apple model. Then there is a
SCRNDRV.COM
which loads an extended TTY/SCREEN driver on top which can be as big as it wants (ok, less than the
size of a floppy disk perhaps).
This should be ok, as the BIOS bootup and the CCP should work just fine with the first TTY driver. Before using anything
which requires a working SCREEN driver one can simply load it with SCRNDRV.COM
.
Switches are in apple2e.inc
and I can set the model in build.py
to
cflags=["-DAPPLE2E"],
cflags=["-DAPPLE2PLUS"],
(not sure if that is the smartest thing to do, will see)
There is some trouble ahead, because in principle I would like to call the old TTY driver from the new one (for instance
to stop the disk motor). But I need the same cursorx
, etc. variables in the TTY and the SCREEN driver. One option would
be to put them in well known places in the zero page. I tried in an older commit to have a common.S
file to share
the variables between bdos.sys
and scrndrv.com
, but then realised that the first one gets relocated and the second one
loaded into user space, so they cannot share variables this way.
from cpm65.
Very nice!
Re exposing BIOS data: I hadn't thought about that. I think there are probably two ways to do it; the first is to add extra calls to the BIOS strategy table, but this is a little fraught because the numbers must be sequential and it would cause problems if new BIOS calls were ever to be added. The second is to create a driver. Allocating an ID for 'internal BIOS use' would be easy, and then you could add whatever entrypoints you like. The downside there is that there is some overhead for a driver, although it's not a lot --- twenty bytes plus the name, plus two bytes per entrypoint.
Also, it's very easy to persuade the build system to make something twice with different flags. That is, indeed, the whole reason it exists...
from cpm65.
Didn't tackle the BIOS variable sharing thing yet, as I still have a lot of bugs in the screen driver itself I want to test and fix first.
I added a simple tetris from https://codeberg.org/eu/tetris.git, seems ok from the license point of view and is really small.
This tests the timeout parameter of the screen_getchar in a natural way (the tetris pieces should move down also when you don't press a key). :-)
Some interesting questions arise:
- A non-waiting
screen_getchar
was missing (there is ascreen_waitchar
inlib/screen.h
,lib/screen.S
) which is able to report a timeout (also inscreentest.asm
the code doesn't check for the carry bit and just checks the key). In assembly we can check the carry flag, this translates to cpm_error or so for "normal" system calls (in cpm-65 in llvm-mos).
I was wondering whether to go the C route and use an int16_t for that and passing '-1' to indicate timeout inscreen_getchar
? - Where to get randomness from (I know that Applesoft Basic did it by increasing some KEYIN counter in the zero page)
Putting that into the screen/tty driver feels a little bit awkward. Currently the seed is42
in tetris.c which makes gaming
somewhat predictable. ;-)
(I also realize that randomness is a dirty side effect and would not end up in a CP/M syscall probably).
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
- Arrow-key constants HOT 2
- cpm.h header file needed HOT 2
- munmap_chunk(): invalid pointer HOT 4
- Suggestion: have the CCP zero out the bss for transient commands
- Thoughts on sound, timer, and joystick drivers HOT 1
- 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 5
- 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.