Giter VIP home page Giter VIP logo

Comments (5)

MustBeArt avatar MustBeArt commented on August 21, 2024 2

I've since tried this fix and it seems to work.

from runcpm.

MockbaTheBorg avatar MockbaTheBorg commented on August 21, 2024

This one:

int _sys_select(uint8 *disk) {
return((uint8)GetFileAttributes((LPCSTR)disk) & 0x10);
}

Should work too, right? Can you give it a try?
I am travelling and won't be able to touch RunCPM (unless on Windows) for weeks.

Thanks!

from runcpm.

MockbaTheBorg avatar MockbaTheBorg commented on August 21, 2024

Tried it here ... seems to work fine.
I will upload shortly. Thanks a lot!

from runcpm.

MustBeArt avatar MustBeArt commented on August 21, 2024

Since _sys_select() is always called in a boolean context, yes that should work the same.

However, with a bit more testing (and more careful reading of the WIN32API docs) I see it's not correct in the failure case. We need something like this:

int _sys_select(uint8 *disk) {
    uint32 attr = GetFileAttributes((LPCSTR)disk));
    return(attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY) != 0);
}

I've compiled and tested it (briefly), and it now works in both failure and success cases.

from runcpm.

MockbaTheBorg avatar MockbaTheBorg commented on August 21, 2024

Cool ... I have pushed the change regardless as it looks fine (apart from the extra parentheses on the second line ... :)
I will test more when I get back from my trip.

from runcpm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.