Ticket #8525: aos4_changes.patch

File aos4_changes.patch, 5.7 KB (added by SF/capehill, 18 years ago)

make aos4dist support, amigaos4-fs.cpp improvements

  • configure

     
    7878_zip="zip -q"
    7979_cp=cp
    8080_win32path="C:/scummvm"
     81_aos4path="Games:ScummVM_Snapshot"
    8182_sdlconfig=sdl-config
    8283_sdlpath="$PATH"
    8384_nasmpath="$PATH"
     
    14191424ZIP := $_zip
    14201425CP := $_cp
    14211426WIN32PATH=$_win32path
     1427AOS4PATH=$_aos4path
    14221428
    14231429BACKEND := $_backend
    14241430MODULES += $MODULES
  • backends/fs/amigaos4/amigaos4-fs.cpp

     
    3939#include "base/engine.h"
    4040#include "backends/fs/fs.h"
    4141
    42 #define ENTER() /* debug(6, "Enter\n") */
    43 #define LEAVE() /* debug(6, "Leave\n") */
     42#define ENTER() /* debug(6, "Enter") */
     43#define LEAVE() /* debug(6, "Leave") */
    4444
    4545
    4646const uint32 kExAllBufferSize = 40960; // TODO: is this okay for sure?
     
    120120
    121121        struct FileInfoBlock *fib = (struct FileInfoBlock *)IDOS->AllocDosObject(DOS_FIB, NULL);
    122122        if (!fib) {
    123                 debug(6, "fib == 0\n");
     123                debug(6, "FileInfoBlock is NULL");
    124124                LEAVE();
    125125                return;
    126126        }
    127127
    128         BPTR pLock = IDOS->Lock( (char *)_sPath.c_str(), SHARED_LOCK);
     128        BPTR pLock = IDOS->Lock((STRPTR)_sPath.c_str(), SHARED_LOCK);
    129129        if (pLock) {
    130130                if (IDOS->Examine(pLock, fib) != DOSFALSE) {
    131131                        if (fib->fib_EntryType > 0)
     
    155155
    156156        while (1) {
    157157                char *name = new char[bufSize];
    158                 if (IDOS->NameFromLock(pLock, name, bufSize) != DOSFALSE) {
     158                if (IDOS->NameFromLock(pLock, (STRPTR)name, bufSize) != DOSFALSE) {
    159159                        _sPath = name;
    160                         _sDisplayName = pDisplayName ? pDisplayName : IDOS->FilePart(name);
     160                        _sDisplayName = pDisplayName ? pDisplayName : IDOS->FilePart((STRPTR)name);
    161161                        delete [] name;
    162162                        break;
    163163                }
    164164
    165165                if (IDOS->IoErr() != ERROR_LINE_TOO_LONG) {
    166166                        _bIsValid = false;
    167                         debug(6, "Error\n");
     167                        debug(6, "IoErr() != ERROR_LINE_TOO_LONG");
    168168                        LEAVE();
    169169                        delete [] name;
    170170                        return;
     
    177177
    178178        struct FileInfoBlock *fib = (struct     FileInfoBlock *)IDOS->AllocDosObject(DOS_FIB, NULL);
    179179        if (!fib) {
    180                 debug(6, "fib == 0\n");
     180                debug(6, "FileInfoBlock is NULL");
    181181                LEAVE();
    182182                return;
    183183        }
     
    226226        FSList myList;
    227227
    228228        if (!_bIsValid) {
    229                 debug(6, "Invalid node\n");
     229                debug(6, "Invalid node");
    230230                LEAVE();
    231231                return myList; // Empty list
    232232        }
    233233
    234234        if (!_bIsDirectory) {
    235                 debug(6, "Not a directory\n");
     235                debug(6, "Not a directory");
    236236                LEAVE();
    237237                return myList; // Empty list
    238238        }
    239239
    240240        if (_pFileLock == 0) {
    241                 debug(6, "Root node\n");
     241                debug(6, "Root node");
    242242                LEAVE();
    243243                return listVolumes();
    244244        }
    245245
    246         //FSList *myList = new FSList();
    247 
    248246        struct ExAllControl *eac = (struct ExAllControl *)IDOS->AllocDosObject(DOS_EXALLCONTROL, 0);
    249247        if (eac) {
    250248                struct ExAllData *data = (struct ExAllData *)IExec->AllocVec(kExAllBufferSize, MEMF_ANY);
     
    252250                        BOOL bExMore;
    253251                        eac->eac_LastKey = 0;
    254252                        do {
     253                                // Examine directory
    255254                                bExMore = IDOS->ExAll(_pFileLock, data, kExAllBufferSize, ED_TYPE, eac);
    256255
    257256                                LONG error = IDOS->IoErr();
    258257                                if (!bExMore && error != ERROR_NO_MORE_ENTRIES)
    259                                         break;
     258                                        break; // Abnormal failure
    260259
    261260                                if (eac->eac_Entries == 0)
    262                                         continue;
     261                                        continue; // Normal failure, no entries
    263262
    264263                                struct ExAllData *ead = data;
    265264                                do {
    266                                         if ((mode == kListAll) || (EAD_IS_DRAWER(ead) && (mode == kListDirectoriesOnly)) ||
     265                                        if ((mode == kListAll) ||
     266                                                (EAD_IS_DRAWER(ead) && (mode == kListDirectoriesOnly)) ||
    267267                                                (EAD_IS_FILE(ead) && (mode == kListFilesOnly))) {
    268268                                                String full_path = _sPath;
    269269                                                full_path += (char*)ead->ed_Name;
    270270
    271                                                 BPTR lock = IDOS->Lock((char *)full_path.c_str(), SHARED_LOCK);
     271                                                BPTR lock = IDOS->Lock((STRPTR)full_path.c_str(), SHARED_LOCK);
    272272                                                if (lock) {
    273273                                                        AmigaOSFilesystemNode *entry = new AmigaOSFilesystemNode(lock, (char *)ead->ed_Name);
    274274                                                        if (entry) {
     
    298298        ENTER();
    299299
    300300        if (!_bIsDirectory) {
    301                 debug(6, "No directory\n");
     301                debug(6, "Not a directory");
    302302                LEAVE();
    303303                return 0;
    304304        }
    305305
    306306        if (_pFileLock == 0) {
    307                 debug(6, "Root node\n");
     307                debug(6, "Root node");
    308308                LEAVE();
    309309                return new AmigaOSFilesystemNode(*this);
    310310        }
     
    325325
    326326FSList AmigaOSFilesystemNode::listVolumes(void) const {
    327327        ENTER();
    328         //FSList *myList = new FSList();
     328
    329329        FSList myList;
    330330
    331331        const uint32 kLockFlags = LDF_READ | LDF_VOLUMES;
     
    333333
    334334        struct DosList *dosList = IDOS->LockDosList(kLockFlags);
    335335        if (!dosList) {
    336                 debug(6, "Cannot lock dos list\n");
     336                debug(6, "Cannot lock the DOS list");
    337337                LEAVE();
    338338                return myList;
    339339        }
     
    350350                        strcpy(name, volName);
    351351                        strcat(name, ":");
    352352
    353                         BPTR volumeLock = IDOS->Lock(name, SHARED_LOCK);
     353                        BPTR volumeLock = IDOS->Lock((STRPTR)name, SHARED_LOCK);
    354354                        if (volumeLock) {
    355355                                sprintf(name, "%s (%s)", volName, devName);
    356356                                AmigaOSFilesystemNode *entry = new AmigaOSFilesystemNode(volumeLock, name);
  • Makefile

     
    141141        cp /usr/local/bin/SDL.dll $(WIN32PATH)
    142142        u2d $(WIN32PATH)/*.txt
    143143
     144# Special target to create an AmigaOS snapshot installation
     145aos4dist: scummvm
     146        mkdir -p $(AOS4PATH)
     147        strip -R.comment $< -o $(AOS4PATH)/$<
     148        cp aos4icon.info $(AOS4PATH)/$<.info
     149        cp gui/themes/default-theme.ini $(AOS4PATH)
     150        cp gui/themes/default-theme.zip $(AOS4PATH)
     151        cp AUTHORS $(AOS4PATH)/AUTHORS.txt
     152        cp COPYING $(AOS4PATH)/COPYING.txt
     153        cp NEWS $(AOS4PATH)/NEWS.txt
     154        cp README $(AOS4PATH)/README.txt
     155        cp /sdk/local/documentation/SDL-1.2.9/README-SDL.txt $(AOS4PATH)
    144156
    145157.PHONY: deb bundle osxsnap win32dist dist install uninstall