Comments (7)
Um. This bit of vdfs.s isn't particularly encouraging:
\ ------------------------------
\ Filing System Command Routines
\ ------------------------------
.F2toXY
TYA:CLC:ADC &F2:TAX:LDA &F3:ADC #0:TAY:RTS
.access :RTS
.back :LDA #&D5:STA PORT_CMD:RTS :\ Pass to host and return
.backup :RTS
.compact :RTS
.copy :RTS
.delete :RTS
.destroy :RTS
.dir :LDA #&D7:STA PORT_CMD:RTS :\ Pass to host and return
.drive :RTS
.enable :RTS
.ex :JSR F2toXY:LDA #&09:JMP CallFSCV
.form :RTS
.free :RTS
.info :JSR F2toXY:LDA #&0A:JMP CallFSCV
.lib :LDA #&D8:STA PORT_CMD:RTS :\ Pass to host and return
.mount :RTS
.rename :JSR F2toXY:LDA #&0C:JMP CallFSCV
.rescan :LDA #&D9:STA PORT_CMD:RTS :\ Pass to host and return
.wipe :RTS
.title :RTS
.verify :RTS
It looks like jgh's version at http://mdfs.net/Apps/Emulators/BBC/ implements these by using emulator command 0x08 (which seems to be 'execute star command'). I'm not sure that's a good idea, at least for deleting files, as OSFILE 0x06 would need implementing to. (I'm rather surprised not to be able to find a MOS call for renaming files. Was that only ever supported via the * command?)
So I think this may need ROM changes, which I reckon is too much work.
from b-em.
There is a non-command way to rename a file (on a filing system that implements it) but it involves calling function 12 (&0C) of FSCV. There is no address you can JSR to directly in the same way as the other OS API calls but you can include an indirect jump via the FSCV vector in your own code and then call that. That is exactly what the code in the VDFS ROM is doing for the RENAME command - see the one instruction subroutine CallFSCV. As FSCV function 12 takes the pair of filenames exactly as they appear after the *RENAME part of the command, that is all the ROM needs to do to implement the *RENAME command so the VDFS C code just needs to implement function 12.
The *DELETE case would require a small ROM change because OSFILE takes a control block rather than the address of the filename in XY. It would not be a big change, though, because most of the control block does not appear relevant to deleting a file - only the address of the filename in the first two bytes of the control block. Such a control block could be set up in a handful of instructions and then that would also be a case of needing the VDFS C code to implement the correct OSFILE function.
I will have a go at the necessary assembler change to the ROM and then look at the C changes.
from b-em.
Ok, so with the assembler in the VDFS ROM for "DELETE" changed to:
.delete :JSR F2toXY:STX &B0:STY &B1:LDX #&B0:LDY #&00:LDA #&06:JMP OSFILE
attempting to delete a file gives this message in b-emlog.txt (with debug messages turned on):
12/11/2017 22:06:43 DEBUG vdfs: osfile unimplemented for a=6, x=176, y=0
likewise attempting to rename a file gives:
12/11/2017 22:10:07 DEBUG vdfs: osfsc unimplemented for a=12, x=6, y=7
so hopefully that's the assembler bit done, just the C code to go now.
from b-em.
So the new ROM in both source and assembled versions are now on branch issue28.
from b-em.
Initial implementation of the OSFILE delete in vdfs.c, and therefore *DELETE is now in the Issue28 branch.
from b-em.
The latest code pushed to the issue#28 branch implement rename too.
from b-em.
Latest code, now in master, implements delete, rename and *CDIR.
from b-em.
Related Issues (20)
- choosing a new folder for VDFS doesn't start at the existing one on windows. HOT 4
- NMOS and CMOS 6502 emulations fail self-modifying JSR test HOT 1
- jstest: same name as another program + executables question
- Disable auto-pause when the debugger is active? HOT 1
- VDFS: OPENUP creates a new file if it doesn't already exist HOT 4
- Integra-B: CTRL-@-BREAK is not triggering reset HOT 4
- Add support for other Z80 CoPro ROM versions? HOT 8
- Improved memory handling for 68K co-pro HOT 16
- Emulation speed wrong and Screen is a flickering mess HOT 23
- Compiler error on macOS HOT 2
- Tube ULA: 2-byte R3 transfers misbehaving HOT 9
- Core dump on startup with e624e51 HOT 3
- Change in behaviour with bit-banged sound between releases 8761065 and 608eb15 HOT 8
- Request for help with an SDL Sound Issue
- Nula issues
- segmentation fault HOT 4
- Seg fault when selecting 32016 co-pro HOT 2
- LED bar to small on 4K display
- @-symbol not mapped with logical keyboard
- libssp-0.dll missing from release
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 b-em.