ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/AmigaOS/scsi_amiga.cpp
(Generate patch)

Comparing BasiliskII/src/AmigaOS/scsi_amiga.cpp (file contents):
Revision 1.1 by cebix, 1999-10-03T14:16:25Z vs.
Revision 1.5 by cebix, 2001-06-30T17:21:52Z

# Line 1 | Line 1
1   /*
2   *  scsi_amiga.cpp - SCSI Manager, Amiga specific stuff
3   *
4 < *  Basilisk II (C) 1997-1999 Christian Bauer
4 > *  Basilisk II (C) 1997-2001 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 44 | Line 44 | static struct MsgPort *the_port = NULL;
44  
45   static ULONG buffer_size;                               // Size of data buffer
46   static UBYTE *buffer = NULL;                    // Pointer to data buffer
47 + static ULONG buffer_memf;                               // Buffer memory flags
48  
49   static UBYTE cmd_buffer[12];                    // Buffer for SCSI command
50  
# Line 59 | Line 60 | void SCSIInit(void)
60   {
61          int id, lun;
62  
63 +        int memtype = PrefsFindInt32("scsimemtype");
64 +        switch (memtype) {
65 +                case 1:
66 +                        buffer_memf = MEMF_24BITDMA | MEMF_PUBLIC;
67 +                        break;
68 +                case 2:
69 +                        buffer_memf = MEMF_ANY | MEMF_PUBLIC;
70 +                        break;
71 +                default:
72 +                        buffer_memf = MEMF_CHIP | MEMF_PUBLIC;
73 +                        break;
74 +        }
75 +
76          // Create port and buffers
77          the_port = CreateMsgPort();
78 <        buffer = (UBYTE *)AllocMem(buffer_size = 0x10000, MEMF_CHIP | MEMF_PUBLIC);
78 >        buffer = (UBYTE *)AllocMem(buffer_size = 0x10000, buffer_memf);
79          sense_buffer = (UBYTE *)AllocMem(SENSE_LENGTH, MEMF_CHIP | MEMF_PUBLIC);
80          if (the_port == NULL || buffer == NULL || sense_buffer == NULL) {
81 <                ErrorAlert(GetString(STR_NO_MEM_ERR));
81 >                ErrorAlert(STR_NO_MEM_ERR);
82                  QuitEmulator();
83          }
84  
# Line 142 | Line 156 | static bool try_buffer(int size)
156          if (size <= buffer_size)
157                  return true;
158  
159 <        UBYTE *new_buffer = (UBYTE *)AllocMem(size, MEMF_CHIP | MEMF_PUBLIC);
159 >        UBYTE *new_buffer = (UBYTE *)AllocMem(size, buffer_memf);
160          if (new_buffer == NULL)
161                  return false;
162          FreeMem(buffer, buffer_size);
# Line 241 | Line 255 | bool scsi_send_cmd(size_t data_length, b
255          }
256  
257          // Process S/G table when reading
258 <        if (res == 0) {
258 >        if (reading && res == 0) {
259                  D(bug(" reading from buffer\n"));
260                  uint8 *buffer_ptr = buffer;
261                  for (int i=0; i<sg_size; i++) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines