2.2.0 beta3

parent d57e527f
......@@ -12,7 +12,7 @@ be sufficient to allow you to use most popular AmigaOS network
clients, such as web browsers and mail readers.
To enable the bsdsocket.library emulation (assuming you are using a
version of E-UAE with this feature compiled in), add the option
version of PUAE with this feature compiled in), add the option
bsdsocket_emu=true
......@@ -28,6 +28,6 @@ emulated Amiga environment. For example, Amiga software will not be
able to bind to ports already in use by host software, and your host
operating system may impose access controls on certain ranges of ports.
Older versions of E-UAE required that a bsdsocket.library wrapper file
Older versions of PUAE required that a bsdsocket.library wrapper file
be installed somewhere in the LIBS: path in your Amiga environment.
This is no longer the case, and this file should now be removed.
Command line options for E-UAE
Command line options for PUAE
==============================
E-UAE supports the following command-line options. Note that, where
PUAE supports the following command-line options. Note that, where
applicable, these will over-ride any similar options specified in the
default configuration file.
......@@ -28,7 +28,7 @@ This document (like the rest of the documentation) is a work-in-progress.
-s ntsc=true
to start E-UAE in NTSC mode.
to start PUAE in NTSC mode.
See configuration.txt for supported options.
......@@ -60,6 +60,7 @@ This document (like the rest of the documentation) is a work-in-progress.
2: 68020
3: 68020/68881
4: 68040
6: 68060
-w<n>
......@@ -90,7 +91,7 @@ This document (like the rest of the documentation) is a work-in-progress.
-c4
will cause E-UAE to emulate 2 MB of Chip memory.
will cause PUAE to emulate 2 MB of Chip memory.
-b<n>
......@@ -164,12 +165,12 @@ Options specific to the X11 graphics driver
-L
Use "low-bandwidth" mode, which may reduce the amount of data transferred
between E-UAE and the X server. That's particularly an advantage when these
between PUAE and the X server. That's particularly an advantage when these
are running on two different machines in a network.
-T
Use the MIT-SHM extension. This may not be available on all machines, and
it will not work if E-UAE and the X server are not running on the same
it will not work if PUAE and the X server are not running on the same
machine. In all other configurations, turning on this option will give you
a huge speed improvement.
......
Compiling E-UAE
Compiling PUAE
===============
E-UAE should be able to compile on any platform with a POSIX-like shell
PUAE should be able to compile on any platform with a POSIX-like shell
environment, a C compiler and make. Version 2.95 or newer of the GNU C
Compiler is recommended as is GNU make, but alternative compilers and
versions of make may work. Some features may be GCC-specific, however.
......@@ -9,15 +9,26 @@ Currently, for example, the JIT - the compiler which dynamically
translate 68k opcodes to x86 opcodes - does require GCC (and GAS, the
GNU assembler).
Currently zlib is also required to build E-UAE for all supported
Currently zlib is also required to build PUAE for all supported
platforms. This isn't much of hardship since zlib is available
everywhere, but shout loudly enough and I'll fix this.
Required Stuff
==============
(for debian based Linux)
apt-get install build-essential
apt-get install automake
apt-get install zlib1g
apt-get install libsdl1.2-dev
apt-get install libgtk2.0-dev
apt-get install xorg-core
Configuring
===========
The first step to compiling E-UAE is to generate a makefile suitable
The first step to compiling PUAE is to generate a makefile suitable
for your intended target system. This is done by running the configure
script.
......@@ -85,6 +96,10 @@ selecting what features are built into UAE. Here's a selection:
bsdsocket.library). This works only on Unix platforms at the moment
(including Linux, Solaris and OS X).
--enable-gccopt
Enable CPU specific optimization parameters. Script will check for your CPU's
features and set additional compile flags.
--with-caps
Build with support for IPF (CAPS) images. This requires the IPF
development files from http://www.caps-project.org/
......@@ -130,22 +145,22 @@ box.
Building the SCSI emulation
---------------------------
E-UAE's SCSI emulation may use libscg, the SCSI transport layer from
PUAE's SCSI emulation may use libscg, the SCSI transport layer from
the cdrtools project (see http://cdrecord.berlios.de). Note, however,
due to a license change in the cdrtools project, only versions of
cdrtools up to 2.01.01a08 inclusive may be used.
If libscg is not available on your build system, download a recent
version of cdrecord and compile it. Then run the ./src/install_libscg
script in the E-UAE source archive to move the relevant files from
cdrecord to the E-UAE source directory.
script in the PUAE source archive to move the relevant files from
cdrecord to the PUAE source directory.
If your system has the libscg headers and library installed in a
non-standard location, you can pass the --with-libscg-prefix option or
the --with-libscg-includedir and --with-libscg-libdir options to the
configure script to specify where these are installed.
On Linux systems, if libscg is not available, E-UAE tries to use a
On Linux systems, if libscg is not available, PUAE tries to use a
Linux-specific SCSI emulation that is based on some ioctl() commands.
......
Configuring E-UAE
Configuring PUAE
=================
E-UAE may be configured via options supplied in a plain-text configuration
PUAE may be configured via options supplied in a plain-text configuration
file. This configuration file contains options of the form <key>=<value> and
each new option must begin a new line. Blanks lines are ignored, and lines
beginning with a '#' character are treated as comments and thus also
ignored.
When E-UAE is started it tries to load a default configuration file. Where
When PUAE is started it tries to load a default configuration file. Where
it looks for this file is platform-dependent, but typically it will look for
a file called '.uaerc' in the current directory and (on multi-user
platforms) in the user's home directory. On MacOS X, the default is called
'default.uaerc' instead since 'dot files' are not visible in Finder,
the OS X file manager.
You may tell E-UAE to load a configuration file in addition to the default by
passing the '-f' switch to E-UAE on the command line. Any options found in
You may tell PUAE to load a configuration file in addition to the default by
passing the '-f' switch to PUAE on the command line. Any options found in
this file will override the values of the same options in the default file.
The '-s' switch may also be used to specify a single <key>=<value> option on
the command line, which, again, will override options found in the default
file.
The default values for E-UAE's configuration options will cause E-UAE to
The default values for PUAE's configuration options will cause PUAE to
emulate a 68000-based ECS system with 512 KB of Chip memory and 512 KB of
Slow memory. The only option you absolutely need to specify is the path to
the Kickstart image you want to use (unless you wish to use E-UAE's minimal
the Kickstart image you want to use (unless you wish to use PUAE's minimal
Kickstart emulation, in which case you must instead supply the path to a
floppy disk image to boot from).
In the following descriptions of E-UAE's configuration options, the template
In the following descriptions of PUAE's configuration options, the template
<n> refers to an integer value, <boolean> to a value of 'true' or 'false',
and <path> refers to a file path using whatever conventions the host platform
uses to specify paths.
......@@ -40,7 +40,7 @@ General options
===============
The following options all have a prefix of the form <target>. The value of
<target> corresponds to the host platform on which you are running E-UAE.
<target> corresponds to the host platform on which you are running PUAE.
Target Platform
------ --------
......@@ -79,16 +79,16 @@ use_gui=<boolean> (default=true)
Open a configuration GUI at start-up before starting the emulation proper.
This option is ignored on platforms without a configuration GUI or if
E-UAE has been built without such a GUI.
PUAE has been built without such a GUI.
use_debugger=<boolean> (default=false)
Open the built-in debugger when the emulation starts. This option is
ignored if E-UAE has been built without debugging support or if the
ignored if PUAE has been built without debugging support or if the
debugger cannot be opened due to platform-specific restrictions (at
the moment the debugger requires a terminal/console window, so it
typically only works if you start E-UAE from a shell terminal).
typically only works if you start PUAE from a shell terminal).
Host CPU-specific options
......@@ -97,10 +97,10 @@ Host CPU-specific options
x86.use_tsc=<boolean> (default=true)
On x86 machines, if this option is true then the processor's timestamp
counter will be used for timing in E-UAE. This used to be a problem for
counter will be used for timing in PUAE. This used to be a problem for
machines which did power-saving by scaling down the CPU's clock frequency,
but with E-UAE 0.8.28 and above this should no longer be an issue on
Linux. If you are running E-UAE on some other x86 platform which
but with PUAE 0.8.28 and above this should no longer be an issue on
Linux. If you are running PUAE on some other x86 platform which
does frequency scaling, then set this option to false. Performance
will suffer, but at least timing won't be affected by changes in CPU
frequency.
......@@ -114,9 +114,9 @@ amd64.use_tsc=<boolean> (default=true)
ppc.use_tbc=<boolean> (default=true)
On PPC machines, if this option is true then use the processor's timebase
register for timing in E-UAE. Since the PPC's TBC isn't affected by
register for timing in PUAE. Since the PPC's TBC isn't affected by
frequency scaling, this option is of little use and is supported only for
completeness. It may be useful if E-UAE misdetects or miscalibrates your
completeness. It may be useful if PUAE misdetects or miscalibrates your
machine's timebase frequency (if it does, please let me know).
......@@ -144,13 +144,13 @@ cpu_speed=<speed> (default=real)
relative to the Amiga chipset. This may have the value 'real', 'max' or
can be an integer between 1 and 20.
If set to 'real', E-UAE will try to emulate the performance of an original
If set to 'real', PUAE will try to emulate the performance of an original
7MHz 68000-based Amiga such as an A500. That is, the relative balance of
time spent emulating the CPU and the Amiga chipset will be similar to the
performance of a real Amiga and E-UAE will try do the same amount of CPU
performance of a real Amiga and PUAE will try do the same amount of CPU
work per display frame as a real 68000-based Amiga. Additionally, if
any time is left over after emulating the A500's CPU and chipset in
each display frame, then E-UAE will wait until until the next
each display frame, then PUAE will wait until until the next
display frame is due.
Thus, the setting 'real' is recommended for games designed to run on
......@@ -158,7 +158,7 @@ cpu_speed=<speed> (default=real)
many classic Amiga games.
If set to 'max', the CPU emulation will run at the maximum speed that the
host CPU can achieve. E-UAE will spend as much time as it can
host CPU can achieve. PUAE will spend as much time as it can
emulating the 68000 CPU and will not wait at all per frame.
Integer values for <speed> adjust the relative amounts of time devoted to
......@@ -180,7 +180,7 @@ finegrain_cpu_speed=<n> (default=N/A)
cpu_compatible=<boolean> (default=false)
If enabled, E-UAE will use a slower but more compatible version of the CPU
If enabled, PUAE will use a slower but more compatible version of the CPU
emulation. This may be necessary to run some some demos and games
correctly.
......@@ -189,7 +189,7 @@ cpu_compatible=<boolean> (default=false)
cpu_cycle_exact=<boolean> (default=false)
If enabled, E-UAE will employ a CPU emulation which tries to fully
If enabled, PUAE will employ a CPU emulation which tries to fully
emulate the relative timing of CPU and chipset cycles. This is much more
demanding even than the "compatible" CPU emulation, but more accurate -
and so may be necessary to correctly run software which aggressively uses
......@@ -294,11 +294,11 @@ ROM options
kickstart_rom_file=<path>
The file path of a Kickstart ROM image to load. <path> may either be an
absolute path or a path relative to the current directory when E-UAE was
absolute path or a path relative to the current directory when PUAE was
run. The token '$(FILE_PATH)' at the start of a path will be expanded to
the path specified by the <target>.rom_path= option.
If <path> is empty, E-UAE will use its built-in Kickstart emulation rather
If <path> is empty, PUAE will use its built-in Kickstart emulation rather
than a real Kickstart image. This requires a valid floppy disk to boot
from mounted in the emulated DF0: drive. The Kickstart emulation is
sufficient to play many classic Amiga games.
......@@ -315,7 +315,7 @@ kickstart_key_file=<path>
Kickstart ROM images provided by Cloanto in its Amiga Forever
distribution are encrypted. This option specifies the key file required
to decrypt such an image. <path> may either be an absolute path to the ROM
key file or a path relative to the current directory when E-UAE was run.
key file or a path relative to the current directory when PUAE was run.
The token '$(FILE_PATH)' at the start of a path will be expanded to the
path specified by the <target>.rom_path= option.
......@@ -332,11 +332,11 @@ kickstart_ext_rom_file=<path>
This option specifies the file path of an extended ROM image to load.
<path> may either be an absolute path or a path relative to the current
directory when E-UAE was run. The token '$(FILE_PATH)' at the start of a
directory when PUAE was run. The token '$(FILE_PATH)' at the start of a
path will be expanded to the path specified by the <target>.rom_path=
option.
If E-UAE has been compiled without support for emulating the CDTV or CD32,
If PUAE has been compiled without support for emulating the CDTV or CD32,
then this option will be ignored.
......@@ -350,7 +350,7 @@ kickshifter=<boolean> (default=false)
If enabled, the Kickstart ROM image will be patched after it is loaded into
memory to support the running of Shapeshifter, the software-based classic Mac
emulation for AmigaOS, within E-UAE.
emulation for AmigaOS, within PUAE.
RAM options
......@@ -362,7 +362,7 @@ chipmem_size=<n> (default=1, that is, 512 KB)
chipset). The valid range of values for <n> is between 1 and 16, that is,
from 512 KB to 8 MB.
Note that E-UAE must emulate an ECS ("Fat") Agnus to be able to use 1 MB
Note that PUAE must emulate an ECS ("Fat") Agnus to be able to use 1 MB
of Chip memory or more. Also note that Fast memory cannot be used if you
select more than 2MB of Chip memory.
......@@ -384,7 +384,7 @@ bogomem_size=<n> (default=2, that is, 512 KB)
Fast memory, this memory cannot be accessed by the CPU when the custom
chipset is busy - hence the term "Slow".
Some old games and demos may require this type of memory. If E-UAE
Some old games and demos may require this type of memory. If PUAE
reports strange exceptions occuring when booting a floppy or weird
accesses to custom chip registers, then try adding some "Slow" memory.
Really old games may fail when "Slow" memory is added.
......@@ -400,7 +400,7 @@ z3mem_size=<n> (default=0)
Emulate <n> MB of Zorro III Fast memory.
E-UAE must emulate a 32-bit CPU (a 68020 or better, not an 68ec020) to
PUAE must emulate a 32-bit CPU (a 68020 or better, not an 68ec020) to
support the emulation of Zorro III memory.
......@@ -410,7 +410,7 @@ gfxcard_size=<n> (default=0)
greater than 0, enables the graphics card or so-called 'Picasso96'
emulation. A maximum of 32 MB of graphics card memory may be emulated.
E-UAE must emulate a 32-bit CPU (a 68020 or better, not an 68ec020) to
PUAE must emulate a 32-bit CPU (a 68020 or better, not an 68ec020) to
support the graphics card emulation.
......@@ -423,7 +423,7 @@ corresponding to the AmigaDOS devices DF0: to DF3:, respectively. Drive 0 is
the first drive, and drive in which you would typically insert a floppy disk
to boot from.
E-UAE supports file-based images of Amiga floppy disks in a number of
PUAE supports file-based images of Amiga floppy disks in a number of
different file formats (see floppies.txt).
......@@ -431,7 +431,7 @@ floppy<drive>=<path>
Specifies the path of a floppy disk image to mount in drive DF<drive>:.
<path> may either be an absolute path or a path relative to the current
directory when E-UAE was run. The token '$(FILE_PATH)/' at the start of a
directory when PUAE was run. The token '$(FILE_PATH)/' at the start of a
path will be expanded to the path specified by the <target>.floppy_path=
option.
......@@ -457,7 +457,7 @@ floppy<drive>type=<type> (default=0 for drives 0 and 1, -1 for drives 2 and 3)
floppy_speed=<speed> (default=100)
E-UAE's floppy drive emulation will work at <speed> per cent of a real
PUAE's floppy drive emulation will work at <speed> per cent of a real
Amiga floppy drive (relative to the speed of the rest of the emulation).
Valid values are from '100' to '800', that is 1x to 8x the speed of a
standard Amiga floppy drive.
......@@ -470,7 +470,7 @@ floppy_speed=<speed> (default=100)
Hard disk options
=================
E-UAE may emulate hard drive partitions (AmigaOS volumes) or full,
PUAE may emulate hard drive partitions (AmigaOS volumes) or full,
partitionable hard disks. Two basic types of emulation are supported: the
virtual filesystem and the hard file.
......@@ -586,8 +586,8 @@ gfx_framerate=<n> (default=1)
do), but decreases the quality of the display output.
For example, when emulating a PAL display (50 Hz), for full-quality output
(gfx_framerate=1), E-UAE must update its display 50 times a
second. Setting gfx_framerate=4 will cause E-UAE to draw only 1
(gfx_framerate=1), PUAE must update its display 50 times a
second. Setting gfx_framerate=4 will cause PUAE to draw only 1
frame in 4 and thus its display will updated only 12.5 times a second.
......@@ -596,19 +596,19 @@ gfx_height_windowed=<n> (default=568)
gfx_width_fullscreen=<n> (default=800)
gfx_height_fullscreen=<n> (defaullt=600)
Specify the dimensions of the E-UAE display for graphical output from the
Specify the dimensions of the PUAE display for graphical output from the
Amiga chipset.
Ideally, the gfx_*_windowed options should specify the dimensions when
E-UAE is running in a window on your desktop and the gfx_*_fullscreen
PUAE is running in a window on your desktop and the gfx_*_fullscreen
options will apply when running full-screen. However, this is not supported
yet, and E-UAE will use the gfx_*_windowed dimensions in both windowed and
yet, and PUAE will use the gfx_*_windowed dimensions in both windowed and
full-screen modes.
To emulate a high-resolution, fully overscanned PAL screen - either
non-interlaced with line-doubling, or interlaced - you need to use a
display of at least 720 by 568 pixels. If you specify a smaller size,
E-UAE's display will be clipped to fit (and you can use the gfx_center_*
PUAE's display will be clipped to fit (and you can use the gfx_center_*
options - see below - to centre the clipped region of the display).
Similarly, to fully display an over-scanned lo-res PAL screen, you need a
display of 360 by 284 pixels.
......@@ -623,7 +623,7 @@ gfx_height=<n>
gfx_fullscreen_amiga=<bool> (default=false)
E-UAE will open it's display for Amiga screens in full-screen mode by
PUAE will open it's display for Amiga screens in full-screen mode by
default - not as a window on the desktop.
This option is not supported on all platforms.
......@@ -632,9 +632,9 @@ gfx_fullscreen_amiga=<bool> (default=false)
gfx_lores=<boolean> (default=false)
Determines the fundamental horizontal resolution of output. If true, then
E-UAE will emulate a low-resolution output; high-res Amiga screens will
PUAE will emulate a low-resolution output; high-res Amiga screens will
have their horizontal resolution halved (only every other horizontal pixel
will be drawn). If false, E-UAE will emulate a high-resolution output;
will be drawn). If false, PUAE will emulate a high-resolution output;
low-resolution Amiga screens will have their horizontal resolution doubled.
Most classic games employ low-resolution screens; Workbench uses a
......@@ -656,7 +656,7 @@ gfx_linemode=<type> (default=double)
gfx_correct_aspect=<boolean> (default=false)
If set to true and the emulated Amiga screen has a larger vertical size
than the display window, E-UAE will fit the screen to the display by
than the display window, PUAE will fit the screen to the display by
leaving out certain lines. This is useful, for example, if you wish
to fit a 640x512 Amiga screen into a 640x480 window.
......@@ -665,7 +665,7 @@ gfx_correct_aspect=<boolean> (default=false)
gfx_center_horizontal=<type> (default=none)
If the Amiga screen emulated is wider than the E-UAE display, then this
If the Amiga screen emulated is wider than the PUAE display, then this
option will try to cause the screen to be rendered centred on the display.
Type Description
......@@ -678,18 +678,18 @@ gfx_center_horizontal=<type> (default=none)
gfx_center_vertical=<type> (default=none)
Similar to gfx_center_horizontal, but centres the screen vertically within
the E-UAE display.
the PUAE display.
show_leds=<bool> (default=false)
If true, show drive activity and power LEDs at the bottom right corner of
the E-UAE display.
the PUAE display.
hide_cursor=<bool> (default=true)
If this option is set to true and E-UAE is displaying in windowed mode,
If this option is set to true and PUAE is displaying in windowed mode,
then the host window manager's cursor is hidden; otherwise it is shown.
This option may not be implemented on all platforms yet.
......@@ -752,7 +752,7 @@ sound_latency=<t> (default=100)
sound_max_buff=<n>
From E-UAE 0.8.29, this option is obsolete and has been replaced by the
From PUAE 0.8.29, this option is obsolete and has been replaced by the
option sound_latency.
......@@ -760,7 +760,7 @@ sound_interpol=<type> (default=none)
Selects the sound interpolation mode used for audio output (only supported
when audio output is in 16-bit resolution). Interpolation is a technique
which "smoothes out" the audio waveform generated by E-UAE and thus may
which "smoothes out" the audio waveform generated by PUAE and thus may
lead to higher quality audio output. Supported values for <type> are:
none - no interpolation.
......@@ -805,7 +805,7 @@ joyport1=<mode>
SCSI emulation options
======================
E-UAE can provide direct access to a host optical drive like a CD-ROM drive
PUAE can provide direct access to a host optical drive like a CD-ROM drive
to AmigaOS via an Exec device wrapper called uaescsi.device. The SCSI device
emulation is not supported on all platforms. See the SCSI emulation section
of the documentation for more details.
......@@ -824,9 +824,9 @@ scsi_device=<config>
Network emulation
=================
E-UAE can provide network access to AmigaOS applications via an emulated
PUAE can provide network access to AmigaOS applications via an emulated
bsdsocket.library. This emulated bsdsocket.library is simply a wrapper
around the host's networking stack. The AmigaOS environment within E-UAE
around the host's networking stack. The AmigaOS environment within PUAE
will share the same IP address as the host. The bsdsocket.library emulation
is not supported on all platforms. See the bsdsocket emulation section of
the documentation for more details.
......@@ -839,7 +839,7 @@ bsdsocket_emu=<bool> (default=false)
X11-specific options
====================
The following options apply when E-UAE has been built with the X11 graphics
The following options apply when PUAE has been built with the X11 graphics
driver.
x11.map_raw_keys=<bool> (default=false)
......@@ -857,16 +857,16 @@ x11.map_raw_keys=<bool> (default=false)
x11.low_bandwidth=<bool> (default=false)
If this option is set to true, then E-UAE will try to minimize the amount
If this option is set to true, then PUAE will try to minimize the amount
of data sent to the X server by only redrawing areas of the amiga screen
that have changed. This may increase frame rate on slow machines or when
running E-UAE on a separate host from the X server.
running PUAE on a separate host from the X server.
x11.use_mitshm=<bool> (default=true)
If this option is set to true, your X server supports the MITSHM extension
and E-UAE is running on the same host as the server, then E-UAE will use
and PUAE is running on the same host as the server, then PUAE will use
memory shared between itself and the server for display buffers. This will
increase display refresh speed.
......@@ -879,7 +879,7 @@ x11.hide_cursor=<bool>
SDL-specific options
====================
The following options apply when E-UAE has been built with the SDL graphics
The following options apply when PUAE has been built with the SDL graphics
driver.
sdl.map_raw_keys=<bool> (default=false)
......@@ -899,22 +899,22 @@ sdl.use_gl=<bool> (default=false)
AmigaOS-specific options
========================
The following options apply when E-UAE has been built for AmigaOS (or
The following options apply when PUAE has been built for AmigaOS (or
similar platform) with the AmigaOS graphics driver.
amiga.screen_type=<type> (default=public)
Specifies the type of screen that E-UAE will open it's display on. Valid
Specifies the type of screen that PUAE will open it's display on. Valid
values for <type> are:
Type Description
---- -----------
public The display will be a window on the default or named public
screen.
custom E-UAE will open a custom screen for its display. The best
custom PUAE will open a custom screen for its display. The best
screenmode matching the configured dimensions will be used.
ask E-UAE will present you with a requester to select the screenmode
to use for display. If this requester is cancelled, E-UAE will
ask PUAE will present you with a requester to select the screenmode
to use for display. If this requester is cancelled, PUAE will
use a window on the default or named public screen.
......@@ -940,7 +940,7 @@ amiga.use_grey=<bool> (default=false)
ALSA-specific options
=====================
The following options apply when E-UAE has been built with the ALSA audio
The following options apply when PUAE has been built with the ALSA audio
driver.
alsa.device=<device> (default=default)
......
Floppy drive emulation
======================
E-UAE emulates up to four floppy drives. Standard PC floppy drives cannot
PUAE emulates up to four floppy drives. Standard PC floppy drives cannot
read Amiga floppies, so floppy disks are currently supported as image files
(support for Catweasel hardware, a floppy controller which can read Amiga
floppies - and other unusual disk formats - will be added in a future
version).
E-UAE supports a number of floppy image formats, optionally compressed by
PUAE supports a number of floppy image formats, optionally compressed by
gzip or packed inside a Zip archive.
ADF
......@@ -20,7 +20,7 @@ formatted contents.
DMS
---
DMS was a popular disk image cruncher. E-UAE can transparently read DMS
DMS was a popular disk image cruncher. PUAE can transparently read DMS
images.
......
......@@ -3,13 +3,13 @@ Joystick port emulation
An Amiga has two joystick ports. Port 0 typically has a mouse attached to it
and port 1 may have a digital joystick, joypad or some other device
connected. E-UAE can emulate Amiga mice and joysticks using either input
connected. PUAE can emulate Amiga mice and joysticks using either input
from a physical mouse or joystick or by using specific key presses on the
keyboard to synthesize mouse and joystick movements or button clicks.
The device connected to port 0 can be configured with the joyport0=<mode>
configuration file option and the device at port 1 with joyport1=<mode>.
Additionally, some versions of E-UAE may supply a GUI controls to configure
Additionally, some versions of PUAE may supply a GUI controls to configure
the joystick.
Here <mode> can be one of:
......@@ -19,7 +19,7 @@ none - no device is connected to this port.
mouse - a mouse will be emulated on this port using the host's default
mouse (usually the device you use to move the mouse pointer on your
desktop). Up to three mouse buttons are supported and a scroll
wheel is currently supported when using E-UAE's X11 or SDL
wheel is currently supported when using PUAE's X11 or SDL
graphics drivers.
joy0 - a digital joystick will be emulated on this port using input from
......@@ -78,7 +78,7 @@ joystick input - they will not produce normal key presses.
Emulating a CD32 controller
===========================
When emulating a CD32 (to do this, E-UAE must be booted with CD32 ROMs) the
When emulating a CD32 (to do this, PUAE must be booted with CD32 ROMs) the
joystick configured to port 1 may emulate a CD32 controller. The buttons on
the joystick will be mapped to CD32 controller buttons as follows:
......
Keyboard emulation
==================
E-UAE emulates an Amiga keyboard layout by a straightforward mapping - where
PUAE emulates an Amiga keyboard layout by a straightforward mapping - where
possible - of host keys to Amiga keys. In general, the alphanumeric keys,
function keys, numbers, punctuation, cursor keys, numeric keypad, etc.
should work as expected (that is, the symbol on the key cap should be
......@@ -23,14 +23,14 @@ keyboard, Amiga keys on an Amiga keyboard, etc. Note that most Mac keyboards
don't differentiate between left and right Option keys, and both will
produce a Left Amiga.
Currently, E-UAE's keyboard mapping is not user-configurable. This will be
Currently, PUAE's keyboard mapping is not user-configurable. This will be
addressed in a future release.
International keyboards
=======================
If you are using E-UAE built with the X11 or SDL graphics drivers then you
If you are using PUAE built with the X11 or SDL graphics drivers then you
may set the kbd_lang= option to specify your keyboard layout (you also need
to pick an appropriate keyboard driver in AmigaOS).
......@@ -51,7 +51,7 @@ Support for some layouts is currently poor - for example, numeric and
punctuation keys are interchanged on the French layout - and SDL poorly
supports international keys.
A partial solution is to use E-UAE's raw key mapping (see below).
A partial solution is to use PUAE's raw key mapping (see below).
Command key sequences
......@@ -126,10 +126,10 @@ your keymap settings to produce (if your keymap is correct) a value which
actually does correspond to the symbol painted on the physical key on your
keyboard.
If E-UAE tries to work with this translated key symbol, it then has to
If PUAE tries to work with this translated key symbol, it then has to
somehow convert that back into a raw keycode appropriate to if that key
were pressed on an Amiga keyboard (and then AmigaOS will use its keymap
settings to translate it into a key symbol again). This requires that E-UAE
settings to translate it into a key symbol again). This requires that PUAE
know about international keyboard layouts, and requires the graphics system
to report unique events for all host keys (SDL does not completely support
some international layouts, for example).
......@@ -148,14 +148,14 @@ logically or even physically identical keys.
The upshot of all this is that raw key-mapping is currently (optionally)
supported when:
a) E-UAE is built with the X11 graphics driver, your X server supports the
a) PUAE is built with the X11 graphics driver, your X server supports the
XKB extension and you are using a keyboard which produces xfree86
keycodes (e.g., PC and Mac keyboards with XFree86 on Linux do);
b) E-UAE is built with the SDL graphics driver and you are running it on
b) PUAE is built with the SDL graphics driver and you are running it on
Linux on XFree86 with a PC or Mac keyboard, on MacOS X, on BeOS or on
AmigaOS (or an AmigaOS clone);
c) E-UAE is built with the BeOS graphics driver; or
d) E-UAE is built with the AmigaOS graphics driver.
c) PUAE is built with the BeOS graphics driver; or
d) PUAE is built with the AmigaOS graphics driver.
As I said above, raw key-mapping better supports international keyboards, so
is recommended for most users, although its not terribly well tested and
......@@ -175,7 +175,7 @@ x11.map_raw_keys=true
Both the SDL and X11 graphics driver will try to enable raw key-mapping by
default if they can support it on your host platform.
Note that the AmigaOS version of E-UAE when built with native AmigaOS
Note that the AmigaOS version of PUAE when built with native AmigaOS
graphic support and the BeOS version when built with native BeOS graphics
support both always do raw key mapping, so no comparable config options is
supported or required in these situations. Note also, however, that the
......
......@@ -2,7 +2,7 @@ make_hdf
========
make_hdf is a command-line tool for creating unformatted hard disk
images (hard files) for E-UAE (and other versions of UAE). It will
images (hard files) for PUAE (and other versions of UAE). It will
also print a config option that can be added to a UAE config file to
mount the created disk image.
......
SCSI emulation
==============
E-UAE's SCSI emulation allows any CD-ROM drives on the host machine to be
PUAE's SCSI emulation allows any CD-ROM drives on the host machine to be
used as Amiga SCSI devices within the emulation. You can use this to fully
support CD-ROMs, audio discs, CD-writing, etc. in AmigaOS. SCSI emulation is
also required to emulate a CD-TV or CD32.
In general, to enable SCSI emulation simply add the 'scsi=true' option to
your config file. Any useable CD or DVD devices that E-UAE finds will be
your config file. Any useable CD or DVD devices that PUAE finds will be
available to AmigaOS via the device driver 'uaescsi.device' on consecutive
unit numbers starting at unit 0. However, depending on your host platform,
there may a number of host configuration issues which can make using the
SCSI emulation problematic.
I'll start with the easy stuff. If you're running E-UAE on AmigaOS (or a
I'll start with the easy stuff. If you're running PUAE on AmigaOS (or a
clone) or BeOS, then don't worry. The SCSI emulation works transparently.
Just set the 'scsi=true' config option and away you go.
......@@ -21,7 +21,7 @@ Just set the 'scsi=true' config option and away you go.
Linux
-----
Starting with version 0.8.29, E-UAE's SCSI emulation can directly
Starting with version 0.8.29, PUAE's SCSI emulation can directly
communicate with the Linux kernel's CD-ROM driver to access a single
CD/DVD drive (it currently doesn't support multiple drives, unlike the
libscg back-end).
......@@ -31,13 +31,13 @@ option 'scsi_device=' (as well as, obviously, 'scsi=true'. For example:
scsi_device=/dev/hdc
You should ensure that the account you use to run E-UAE has permission
You should ensure that the account you use to run PUAE has permission
to access this device file.
You may run into problems if your Linux distribution has the HAL
daemon installed. This software continually polls your removable media
drives to detect insertion/removal of discs, and this activity may
interfere with E-UAE's SCSI emulation. A solution to this problem
interfere with PUAE's SCSI emulation. A solution to this problem
needs to be investigated.
This Linux-native SCSI back-end is less well-tested than the libscg
......@@ -64,9 +64,9 @@ we'll come to that in a minute.)
If you're using sg or ide-scsi and sg, then your devices are accessed via
device nodes of the form /dev/sg0, /dev/sg1, etc. You need read and write
permission on all of these for SCSI emulation in E-UAE to work (Note that
permission on all of these for SCSI emulation in PUAE to work (Note that
cdrecord is typically installed SUID root, so typically the default
permissions on the /dev/sgx nodes will not be sufficient. Installing E-UAE as
permissions on the /dev/sgx nodes will not be sufficient. Installing PUAE as
SUID root is one possibility, but not a terribly good idea security-wise.
One solution to this is to set the owner of the /dev/sgx nodes as the group
'cdrom' and add you own user account to that group. For example, as root, do
......@@ -80,9 +80,9 @@ If your system doesn't have the adduser command, you can always manually
edit the /etc/group file or use some whizz-bang, GUI-based user/group
configuration utility to do the job.
If you log in as yourself again and start E-UAE (remember to add 'scsi=true'
If you log in as yourself again and start PUAE (remember to add 'scsi=true'
to your config file first), then the SCSI emulation should work. If so you'll
see something like this logged to the console when E-UAE starts up.
see something like this logged to the console when PUAE starts up.
scsibus0:
0,0,0 0 'BTC ' 'BCE1610IM ' 'A.20' CD-ROM
......@@ -96,7 +96,7 @@ scsibus0:
SCSIDEV: 1 devices found
support_scsi = 1 support_ioctl = 0
If you're using a 2.6 kernel, E-UAE can access ATAPI devices on the host
If you're using a 2.6 kernel, PUAE can access ATAPI devices on the host
directly via the kernel ide-cd driver without the sg kernel module. To do
this on older 2.6 kernels, add the config option
......@@ -116,7 +116,7 @@ scsi_device=/dev/hdc
MacOS X
-------
Now we get to the real problems. SCSI emulation with E-UAE on OS X is
Now we get to the real problems. SCSI emulation with PUAE on OS X is
currently a real pig, due to some features and limitations of OS X. The big
problem is that you need a writable device - a CD or DVD burner - for SCSI
emulation to work at all. This is because the OS X kernel will only let you
......
......@@ -126,22 +126,23 @@ static int automountunit = -1;
#define DEVNAMES_PER_HDF 32
typedef struct {
int open;
char *devname; /* device name, e.g. UAE0: */
bool open;
TCHAR *devname; /* device name, e.g. UAE0: */
uaecptr devname_amiga;
uaecptr startup;
char *volname; /* volume name, e.g. CDROM, WORK, etc. */
TCHAR *volname; /* volume name, e.g. CDROM, WORK, etc. */
int volflags; /* volume flags, readonly, stream uaefsdb support */
char *rootdir; /* root native directory/hdf. empty drive if invalid path */
TCHAR *rootdir; /* root native directory/hdf. empty drive if invalid path */
struct zvolume *zarchive;
char *rootdirdiff; /* "diff" file/directory */
int readonly; /* disallow write access? */
TCHAR *rootdirdiff; /* "diff" file/directory */
bool readonly; /* disallow write access? */
bool locked; /* action write protect */
int bootpri; /* boot priority. -128 = no autoboot, -129 = no mount */
int devno;
int controller;
int wasisempty; /* if true, this unit was created empty */
int canremove; /* if true, this unit can be safely ejected and remounted */
int configureddrive; /* if true, this is drive that was manually configured */
bool wasisempty; /* if true, this unit was created empty */
bool canremove; /* if true, this unit can be safely ejected and remounted */
bool configureddrive; /* if true, this is drive that was manually configured */
struct hardfiledata hf;
......@@ -160,7 +161,7 @@ typedef struct {
int rdb_cylblocks;
uae_u8 *rdb_filesysstore;
int rdb_filesyssize;
char *filesysdir;
TCHAR *filesysdir;
} UnitInfo;
......@@ -266,14 +267,14 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
}
if (my_getvolumeinfo (uci->rootdir) < 0)
return -1;
mi->ismedia = 1;
mi->ismedia = true;
return FILESYS_VIRTUAL;
} else {
ui->hf.readonly = 1;
ui->hf.readonly = true;
ui->hf.blocksize = uci->blocksize;
if (!hdf_open (&ui->hf, uci->rootdir)) {
mi->ismedia = 0;
mi->ismounted = 1;
mi->ismedia = false;
mi->ismounted = true;
if (uci->reserved == 0 && uci->sectors == 0 && uci->surfaces == 0) {
if (ui->hf.flags & 1)
return FILESYS_HARDDRIVE;
......@@ -281,7 +282,7 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
}
return -1;
}
mi->ismedia = 1;
mi->ismedia = true;
if (ui->hf.drive_empty)
mi->ismedia = 0;
hdf_close (&ui->hf);
......@@ -290,9 +291,9 @@ int get_filesys_unitconfig (struct uae_prefs *p, int index, struct mountedinfo *
if (!ui->controller || (ui->controller && p->cs_ide)) {
mi->ismounted = 1;
if (uci->ishdf)
mi->ismedia = ui->hf.drive_empty ? 0 : 1;
mi->ismedia = ui->hf.drive_empty ? false : true;
else
mi->ismedia = 1;
mi->ismedia = true;
}
}
mi->size = ui->hf.virtsize;
......@@ -338,6 +339,7 @@ static void fixcharset (char *s)
if (!s)
return;
//ua_fs_copy (tmp, MAX_DPATH, s, '_');
strcpy (tmp, s);
au_fs_copy (s, strlen (tmp) + 1, tmp);
}
......@@ -360,9 +362,9 @@ char *validatedevicename (char *s)
char *filesys_createvolname (const char *volname, const char *rootdir, const char *def)
{
char *nvol = NULL;
TCHAR *nvol = NULL;
int i, archivehd;
char *p = NULL;
TCHAR *p = NULL;
archivehd = -1;
if (my_existsfile (rootdir))
......@@ -393,7 +395,7 @@ char *filesys_createvolname (const char *volname, const char *rootdir, const cha
nvol = my_strdup (p + i);
}
if (!nvol && archivehd >= 0) {
char *s = NULL;
TCHAR *s = NULL;
if (volname && _tcslen (volname) > 0)
nvol = my_strdup (volname);
else
......@@ -441,14 +443,14 @@ static int set_filesys_volume (const char *rootdir, int *flags, int *readonly, i
}
static int set_filesys_unit_1 (int nr,
char *devname, char *volname, const char *rootdir, int readonly,
TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, int donotmount, int autoboot,
char *filesysdir, int hdc, int flags)
int blocksize, int bootpri, bool donotmount, bool autoboot,
TCHAR *filesysdir, int hdc, int flags)
{
UnitInfo *ui;
int i;
int emptydrive = 0;
bool emptydrive = false;
if (hdc)
return -1;
......@@ -493,6 +495,7 @@ static int set_filesys_unit_1 (int nr,
ui->volname = 0;
ui->hf.readonly = readonly;
if (!hdf_open (&ui->hf, rootdir) && !readonly) {
write_log ("Attempting to open in read-only mode\n");
ui->hf.readonly = readonly = 1;
hdf_open (&ui->hf, rootdir);
}
......@@ -548,10 +551,10 @@ err:
}
int set_filesys_unit (int nr,
char *devname, char *volname, const char *rootdir, int readonly,
TCHAR *devname, TCHAR *volname, const TCHAR *rootdir, bool readonly,
int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, int donotmount, int autoboot,
char *filesysdir, int hdc, int flags)
int blocksize, int bootpri, bool donotmount, bool autoboot,
TCHAR *filesysdir, int hdc, int flags)
{
int ret;
......@@ -561,10 +564,10 @@ int set_filesys_unit (int nr,
return ret;
}
int add_filesys_unit (char *devname, char *volname, const char *rootdir, int readonly,
int add_filesys_unit (char *devname, char *volname, const char *rootdir, bool readonly,
int secspertrack, int surfaces, int reserved,
int blocksize, int bootpri, int donotmount, int autoboot,
char *filesysdir, int hdc, int flags)
int blocksize, int bootpri, bool donotmount, bool autoboot,
TCHAR *filesysdir, int hdc, int flags)
{
int ret;
......@@ -814,8 +817,8 @@ typedef struct key {
typedef struct notify {
struct notify *next;
uaecptr notifyrequest;
char *fullname;
char *partname;
TCHAR *fullname;
TCHAR *partname;
} Notify;
typedef struct exallkey {
......@@ -848,7 +851,7 @@ typedef struct _unit {
/* Native stuff */
uae_s32 unit; /* unit number */
UnitInfo ui; /* unit startup info */
char tmpbuf3[256];
TCHAR tmpbuf3[256];
/* Dummy message processing */
uaecptr dummy_message;
......@@ -878,63 +881,63 @@ typedef struct _unit {
int volflags;
uae_u32 lockkey;
int inhibited;
int canremovable;
bool inhibited;
bool canremovable;
int mountcount;
struct zvolume *zarchive;
int reinsertdelay;
TCHAR *newvolume;
TCHAR *newrootdir;
int newreadonly;
bool newreadonly;
int newflags;
} Unit;
static uae_u32 a_uniq, key_uniq;
typedef uae_u8 *dpacket;
#define PUT_PCK_RES1(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp_Res1), (v)); } while (0)
#define PUT_PCK_RES2(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp_Res2), (v)); } while (0)
#define GET_PCK_TYPE(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Type))))
#define GET_PCK_RES1(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Res1))))
#define GET_PCK_RES2(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Res2))))
#define GET_PCK_ARG1(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg1))))
#define GET_PCK_ARG2(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg2))))
#define GET_PCK_ARG3(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg3))))
#define GET_PCK_ARG4(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg4))))
#define GET_PCK_ARG5(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp_Arg5))))
#define PUT_PCK64_RES0(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp64_Res0), (v)); } while (0)
#define PUT_PCK64_RES1(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp64_Res1), (((uae_u64)v) >> 32)); do_put_mem_long ((uae_u32 *)((p) + dp64_Res1 + 4), ((uae_u32)v)); } while (0)
#define PUT_PCK64_RES2(p,v) do { do_put_mem_long ((uae_u32 *)((p) + dp64_Res2), (v)); } while (0)
#define GET_PCK64_TYPE(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp64_Type))))
#define GET_PCK64_RES0(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp64_Res0))))
#define GET_PCK64_RES1(p) ( (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Res1)))) << 32) | (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Res1 + 4)))) << 0) )
#define GET_PCK64_ARG1(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg1))))
#define GET_PCK64_ARG2(p) ( (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg2)))) << 32) | (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg2 + 4)))) << 0) )
#define GET_PCK64_ARG3(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg3))))
#define GET_PCK64_ARG4(p) ((uae_s32)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg4))))
#define GET_PCK64_ARG5(p) ( (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg5)))) << 32) | (((uae_s64)(do_get_mem_long ((uae_u32 *)((p) + dp64_Arg5 + 4)))) << 0) )
typedef uaecptr dpacket;
#define PUT_PCK_RES1(p,v) do { put_long ((p) + dp_Res1, (v)); } while (0)
#define PUT_PCK_RES2(p,v) do { put_long ((p) + dp_Res2, (v)); } while (0)
#define GET_PCK_TYPE(p) ((uae_s32)(get_long ((p) + dp_Type)))
#define GET_PCK_RES1(p) ((uae_s32)(get_long ((p) + dp_Res1)))
#define GET_PCK_RES2(p) ((uae_s32)(get_long ((p) + dp_Res2)))
#define GET_PCK_ARG1(p) ((uae_s32)(get_long ((p) + dp_Arg1)))
#define GET_PCK_ARG2(p) ((uae_s32)(get_long ((p) + dp_Arg2)))
#define GET_PCK_ARG3(p) ((uae_s32)(get_long ((p) + dp_Arg3)))
#define GET_PCK_ARG4(p) ((uae_s32)(get_long ((p) + dp_Arg4)))
#define GET_PCK_ARG5(p) ((uae_s32)(get_long ((p) + dp_Arg5)))
#define PUT_PCK64_RES0(p,v) do { put_long ((p) + dp64_Res0, (v)); } while (0)
#define PUT_PCK64_RES1(p,v) do { put_long ((p) + dp64_Res1, (((uae_u64)v) >> 32)); put_long ((p) + dp64_Res1 + 4, ((uae_u32)v)); } while (0)
#define PUT_PCK64_RES2(p,v) do { put_long ((p) + dp64_Res2, (v)); } while (0)
#define GET_PCK64_TYPE(p) ((uae_s32)(get_long ((p) + dp64_Type)))
#define GET_PCK64_RES0(p) ((uae_s32)(get_long ((p) + dp64_Res0)))
#define GET_PCK64_RES1(p) ( (((uae_s64)(get_long ((p) + dp64_Res1))) << 32) | (((uae_s64)(get_long ((p) + dp64_Res1 + 4))) << 0) )
#define GET_PCK64_ARG1(p) ((uae_s32)(get_long ((p) + dp64_Arg1)))
#define GET_PCK64_ARG2(p) ( (((uae_s64)(get_long ((p) + dp64_Arg2))) << 32) | (((uae_s64)(get_long ((p) + dp64_Arg2 + 4))) << 0) )
#define GET_PCK64_ARG3(p) ((uae_s32)(get_long ((p) + dp64_Arg3)))
#define GET_PCK64_ARG4(p) ((uae_s32)(get_long ((p) + dp64_Arg4)))
#define GET_PCK64_ARG5(p) ( (((uae_s64)(get_long ((p) + dp64_Arg5))) << 32) | (((uae_s64)(get_long ((p) + dp64_Arg5 + 4))) << 0) )
static int flush_cache (Unit *unit, int num);
static char *char1 (uaecptr addr)
{
static uae_char buf[1024];
static char bufx[1024];
static TCHAR bufx[1024];
unsigned int i = 0;
do {
buf[i] = get_byte (addr);
addr++;
} while (buf[i++] && i < sizeof(buf));
} while (buf[i++] && i < sizeof (buf));
return au_fs_copy (bufx, sizeof (bufx) / sizeof (TCHAR), buf);
}
static TCHAR *bstr1 (uaecptr addr)
{
static char bufx[257];
static TCHAR bufx[257];
static uae_char buf[257];
int i;
int n = get_byte (addr);
......@@ -962,7 +965,7 @@ static char *bstr (Unit *unit, uaecptr addr)
static char *bstr_cut (Unit *unit, uaecptr addr)
{
char *p = unit->tmpbuf3;
TCHAR *p = unit->tmpbuf3;
int i, colon_seen = 0, off;
int n = get_byte (addr);
uae_char buf[257];
......@@ -983,7 +986,7 @@ static char *bstr_cut (Unit *unit, uaecptr addr)
static Unit *units = 0;
static Unit*
find_unit (uaecptr port)
find_unit (uaecptr port)
{
Unit* u;
for (u = units; u; u = u->next)
......@@ -1170,13 +1173,13 @@ static void filesys_delayed_change (Unit *u, int frames, const TCHAR *rootdir, c
write_log ("FILESYS: delayed insert %d: '%s' ('%s')\n", u->unit, volume ? volume : "<none>", rootdir);
}
int filesys_media_change (const char *rootdir, int inserted, struct uaedev_config_info *uci)
int filesys_media_change (const TCHAR *rootdir, int inserted, struct uaedev_config_info *uci)
{
Unit *u;
UnitInfo *ui;
int nr = -1;
char volname[MAX_DPATH], *volptr;
char devname[MAX_DPATH];
TCHAR volname[MAX_DPATH], *volptr;
TCHAR devname[MAX_DPATH];
if (!mountertask)
return 0;
......@@ -1232,7 +1235,7 @@ int filesys_media_change (const char *rootdir, int inserted, struct uaedev_confi
/* new volume inserted and it was previously mounted? */
if (nr >= 0) {
if (!filesys_isvolume (u)) /* not going to mount twice */
return filesys_insert (nr, volptr, rootdir, -1, -1);
return filesys_insert (nr, volptr, rootdir, false, -1);
return 0;
}
if (inserted < 0) /* -1 = only mount if already exists */
......@@ -1277,10 +1280,10 @@ int hardfile_remount (int nr)
return 1;
}
int filesys_insert (int nr, TCHAR *volume, const TCHAR *rootdir, int readonly, int flags)
int filesys_insert (int nr, TCHAR *volume, const TCHAR *rootdir, bool readonly, int flags)
{
struct uaedev_config_info *uci;
int emptydrive = 0;
bool emptydrive = false;
UnitInfo *ui;
Unit *u;
......@@ -1338,7 +1341,7 @@ int filesys_insert (int nr, TCHAR *volume, const TCHAR *rootdir, int readonly, i
ui->volflags = u->volflags = u->ui.volflags = flags;
_tcscpy (uci->volname, ui->volname);
_tcscpy (uci->rootdir, rootdir);
if (readonly >= 0)
if (flags >= 0)
uci->readonly = ui->readonly = u->ui.readonly = readonly;
put_byte (u->volume + 44, 0);
put_byte (u->volume + 172 - 32, 1);
......@@ -1484,7 +1487,7 @@ static void recycle_aino (Unit *unit, a_inode *new_aino)
flush_cache (unit, 50);
#if 0
{
char buffer[40];
TCHAR buffer[40];
sprintf (buffer, "%d ainos reaped.\n", i);
TRACE ((buffer));
}
......@@ -1512,9 +1515,9 @@ static void update_child_names (Unit *unit, a_inode *a, a_inode *parent)
int l0 = _tcslen (parent->nname) + 2;
while (a != 0) {
char *name_start;
char *new_name;
char dirsep[2] = { FSDB_DIR_SEPARATOR, '\0' };
TCHAR *name_start;
TCHAR *new_name;
TCHAR dirsep[2] = { FSDB_DIR_SEPARATOR, '\0' };
a->parent = parent;
name_start = _tcsrchr (a->nname, FSDB_DIR_SEPARATOR);
......@@ -1522,7 +1525,7 @@ static void update_child_names (Unit *unit, a_inode *a, a_inode *parent)
write_log ("malformed file name");
}
name_start++;
new_name = xmalloc (char, _tcslen (name_start) + l0);
new_name = xmalloc (TCHAR, _tcslen (name_start) + l0);
_tcscpy (new_name, parent->nname);
_tcscat (new_name, dirsep);
_tcscat (new_name, name_start);
......@@ -1634,19 +1637,19 @@ static a_inode *lookup_aino (Unit *unit, uae_u32 uniq)
return a;
}
char *build_nname (const char *d, const char *n)
TCHAR *build_nname (const TCHAR *d, const TCHAR *n)
{
char dsep[2] = { FSDB_DIR_SEPARATOR, 0 };
char *p = xmalloc (char, _tcslen (d) + _tcslen (n) + 2);
TCHAR dsep[2] = { FSDB_DIR_SEPARATOR, 0 };
TCHAR *p = xmalloc (TCHAR, _tcslen (d) + _tcslen (n) + 2);
_tcscpy (p, d);
_tcscat (p, dsep);
_tcscat (p, n);
return p;
}
char *build_aname (const char *d, const char *n)
TCHAR *build_aname (const TCHAR *d, const TCHAR *n)
{
char *p = xmalloc (char, _tcslen (d) + _tcslen (n) + 2);
TCHAR *p = xmalloc (TCHAR, _tcslen (d) + _tcslen (n) + 2);
_tcscpy (p, d);
_tcscat (p, "/");
_tcscat (p, n);
......@@ -1654,13 +1657,17 @@ char *build_aname (const char *d, const char *n)
}
/* This gets called to translate an Amiga name that some program used to
* a name that we can use on the native filesystem. */
static char *get_nname (Unit *unit, a_inode *base, char *rel,
char **modified_rel)
* a name that we can use on the native filesystem. */
static TCHAR *get_nname (Unit *unit, a_inode *base, TCHAR *rel,
TCHAR **modified_rel)
{
char *found;
TCHAR *found;
TCHAR *p = 0;
*modified_rel = 0;
if (unit->volflags & MYVOLUMEINFO_ARCHIVE) {
return 0;
}
aino_test (base);
......@@ -1691,9 +1698,9 @@ static char *get_nname (Unit *unit, a_inode *base, char *rel,
return build_nname (base->nname, found);
}
static char *create_nname (Unit *unit, a_inode *base, char *rel)
static TCHAR *create_nname (Unit *unit, a_inode *base, TCHAR *rel)
{
char *p;
TCHAR *p;
aino_test (base);
/* We are trying to create a file called REL. */
......@@ -1702,7 +1709,7 @@ static char *create_nname (Unit *unit, a_inode *base, char *rel)
* need a new unique nname. */
if (fsdb_name_invalid (rel) || fsdb_used_as_nname (base, rel)) {
#if 0
oh_dear:
oh_dear:
#endif
if (currprefs.filesys_no_uaefsdb && !(base->volflags & MYVOLUMEINFO_STREAMS)) {
write_log ("illegal filename '%s', no stream supporting filesystem and uaefsdb disabled\n", rel);
......@@ -1727,7 +1734,7 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
{
if (0 /*u->volflags & MYVOLUMEINFO_ARCHIVE*/) {
int isdir, flags;
char *comment;
TCHAR *comment;
zfile_fill_file_attrs_archive (c->nname, &isdir, &flags, &comment);
c->dir = isdir;
c->amigaos_mode = 0;
......@@ -1752,7 +1759,7 @@ static int fill_file_attrs (Unit *u, a_inode *base, a_inode *c)
* figure out that this is supposed to be the file "foobar.inf".
* DOS sucks...
*/
static char *get_aname (Unit *unit, a_inode *base, char *rel)
static TCHAR *get_aname (Unit *unit, a_inode *base, TCHAR *rel)
{
return my_strdup (rel);
}
......@@ -1795,10 +1802,10 @@ static void init_child_aino (Unit *unit, a_inode *base, a_inode *aino)
aino_test (aino);
}
static a_inode *new_child_aino (Unit *unit, a_inode *base, char *rel)
static a_inode *new_child_aino (Unit *unit, a_inode *base, TCHAR *rel)
{
char *modified_rel;
char *nn;
TCHAR *modified_rel;
TCHAR *nn;
a_inode *aino = NULL;
int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
......@@ -1834,7 +1841,7 @@ static a_inode *new_child_aino (Unit *unit, a_inode *base, char *rel)
return aino;
}
static a_inode *create_child_aino (Unit *unit, a_inode *base, char *rel, int isdir)
static a_inode *create_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int isdir)
{
a_inode *aino = xcalloc (a_inode, 1);
if (aino == 0)
......@@ -1860,7 +1867,7 @@ static a_inode *create_child_aino (Unit *unit, a_inode *base, char *rel, int isd
return aino;
}
static a_inode *lookup_child_aino (Unit *unit, a_inode *base, char *rel, uae_u32 *err)
static a_inode *lookup_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int *err)
{
a_inode *c = base->child;
int l0 = _tcslen (rel);
......@@ -1889,7 +1896,7 @@ static a_inode *lookup_child_aino (Unit *unit, a_inode *base, char *rel, uae_u32
}
/* Different version because for this one, REL is an nname. */
static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, char *rel, uae_u32 *err)
static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, TCHAR *rel, uae_u32 *err)
{
a_inode *c = base->child;
int l0 = _tcslen (rel);
......@@ -1938,10 +1945,10 @@ static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, char *r
return c;
}
static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, int *err)
static a_inode *get_aino (Unit *unit, a_inode *base, const TCHAR *rel, int *err)
{
char *tmp;
char *p;
TCHAR *tmp;
TCHAR *p;
a_inode *curr;
int i;
......@@ -1969,7 +1976,7 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, int *err)
} else {
a_inode *next;
char *component_end;
TCHAR *component_end;
component_end = _tcschr (p, '/');
if (component_end != 0)
*component_end = '\0';
......@@ -1994,7 +2001,7 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const char *rel, int *err)
}
static uae_u32 notifyhash (char *s)
static uae_u32 notifyhash (TCHAR *s)
{
uae_u32 hash = 0;
while (*s)
......@@ -2002,7 +2009,7 @@ static uae_u32 notifyhash (char *s)
return hash % NOTIFY_HASH_SIZE;
}
static Notify *new_notify (Unit *unit, char *name)
static Notify *new_notify (Unit *unit, TCHAR *name)
{
Notify *n = xmalloc (Notify, 1);
uae_u32 hash = notifyhash (name);
......@@ -2147,8 +2154,8 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context)
uaecptr arg2 = get_long (pkt + dp_Arg2);
uaecptr devnode;
int i;
char *devname = bstr1 (get_long (pkt + dp_Arg1) << 2);
char *s;
TCHAR *devname = bstr1 (get_long (pkt + dp_Arg1) << 2);
TCHAR *s;
Unit *unit;
UnitInfo *uinfo;
int late = 0;
......@@ -2194,7 +2201,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context)
unit = startup_create_unit (uinfo, i);
unit->volflags = uinfo->volflags;
/* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/
/* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/
write_log ("FS: %s (flags=%08X,E=%d,ED=%d,EF=%d,native='%s') starting..\n",
unit->ui.volname, unit->volflags, uinfo->wasisempty, ed, ef, unit->ui.rootdir);
......@@ -2255,7 +2262,7 @@ static void
}
put_long (info, 0); /* errors */
put_long (info + 4, unit->unit); /* unit number */
put_long (info + 8, unit->ui.readonly ? 80 : 82); /* state */
put_long (info + 8, unit->ui.readonly || unit->ui.locked ? 80 : 82); /* state */
put_long (info + 12, fsu.fsu_blocks ); /* numblocks */
put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */
put_long (info + 20, 1024); /* bytesperblock */
......@@ -2266,17 +2273,17 @@ static void
}
static void
action_disk_info (Unit *unit, dpacket packet)
action_disk_info (Unit *unit, dpacket packet)
{
TRACE(("ACTION_DISK_INFO\n"));
do_info(unit, packet, GET_PCK_ARG1 (packet) << 2);
do_info (unit, packet, GET_PCK_ARG1 (packet) << 2);
}
static void
action_info (Unit *unit, dpacket packet)
action_info (Unit *unit, dpacket packet)
{
TRACE(("ACTION_INFO\n"));
do_info(unit, packet, GET_PCK_ARG2 (packet) << 2);
do_info (unit, packet, GET_PCK_ARG2 (packet) << 2);
}
static void free_key (Unit *unit, Key *k)
......@@ -2321,7 +2328,7 @@ static Key *lookup_key (Unit *unit, uae_u32 uniq)
static Key *new_key (Unit *unit)
{
Key *k = xcalloc(Key, 1);
Key *k = xcalloc (Key, 1);
k->uniq = ++key_uniq;
k->fd = NULL;
k->file_pos = 0;
......@@ -2332,7 +2339,7 @@ static Key *new_key (Unit *unit)
}
static void
dumplock (Unit *unit, uaecptr lock)
dumplock (Unit *unit, uaecptr lock)
{
a_inode *a;
TRACE(("LOCK: 0x%lx", lock));
......@@ -2353,7 +2360,7 @@ dumplock (Unit *unit, uaecptr lock)
TRACE((" }\n"));
}
static a_inode *find_aino (Unit *unit, uaecptr lock, const char *name, int *err)
static a_inode *find_aino (Unit *unit, uaecptr lock, const TCHAR *name, int *err)
{
a_inode *a;
......@@ -2454,12 +2461,12 @@ static void notify_check (Unit *unit, a_inode *a)
}
static void
action_add_notify (Unit *unit, dpacket packet)
action_add_notify (Unit *unit, dpacket packet)
{
uaecptr nr = GET_PCK_ARG1 (packet);
int flags;
Notify *n;
char *name, *p, *partname;
TCHAR *name, *p, *partname;
TRACE(("ACTION_ADD_NOTIFY\n"));
......@@ -2507,7 +2514,7 @@ action_add_notify (Unit *unit, dpacket packet)
PUT_PCK_RES1 (packet, DOS_TRUE);
}
static void
action_remove_notify (Unit *unit, dpacket packet)
action_remove_notify (Unit *unit, dpacket packet)
{
uaecptr nr = GET_PCK_ARG1 (packet);
Notify *n;
......@@ -2558,7 +2565,7 @@ static void free_lock (Unit *unit, uaecptr lock)
}
static void
action_lock (Unit *unit, dpacket packet)
action_lock (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
uaecptr name = GET_PCK_ARG2 (packet) << 2;
......@@ -2643,7 +2650,7 @@ static uaecptr
}
static void
action_dup_lock (Unit *unit, dpacket packet)
action_dup_lock (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
TRACE(("ACTION_DUP_LOCK(0x%lx)\n", lock));
......@@ -2669,11 +2676,11 @@ static void
#if !defined TARGET_AMIGAOS || !defined WORDS_BIGENDIAN
/* convert time_t to/from AmigaDOS time */
const int secs_per_day = 24 * 60 * 60;
const int diff = (8 * 365 + 2) * (24 * 60 * 60);
static const int secs_per_day = 24 * 60 * 60;
static const int diff = (8 * 365 + 2) * (24 * 60 * 60);
static void
get_time (time_t t, long* days, long* mins, long* ticks)
get_time (time_t t, long* days, long* mins, long* ticks)
{
/* time_t is secs since 1-1-1970 */
/* days since 1-1-1978 */
......@@ -2715,7 +2722,7 @@ get_time (time_t t, long* days, long* mins, long* ticks)
* of the Unix epoch
*/
static time_t
put_time (long days, long mins, long ticks)
put_time (long days, long mins, long ticks)
{
time_t t;
......@@ -2827,7 +2834,7 @@ found:
* before this happens because of something else. */
uniq = 1;
}
unit->next_exkey = uniq+1;
unit->next_exkey = uniq + 1;
ek->aino = aino;
ek->curr_file = 0;
ek->uniq = uniq;
......@@ -2856,13 +2863,13 @@ static void move_exkeys (Unit *unit, a_inode *from, a_inode *to)
}
static void
get_fileinfo (Unit *unit, dpacket packet, uaecptr info, a_inode *aino)
get_fileinfo (Unit *unit, dpacket packet, uaecptr info, a_inode *aino)
{
struct _stat64 statbuf;
long days, mins, ticks;
int i, n, entrytype;
int fsdb_can = fsdb_cando (unit);
char *xs;
TCHAR *xs;
char *x, *x2;
memset (&statbuf, 0, sizeof statbuf);
......@@ -2915,11 +2922,11 @@ get_fileinfo (Unit *unit, dpacket packet, uaecptr info, a_inode *aino)
#else
put_long (info + 116, fsdb_can ? aino->amigaos_mode : fsdb_mode_supported (aino));
put_long (info + 124, statbuf.st_size > MAXFILESIZE32 ? MAXFILESIZE32 : statbuf.st_size);
# ifdef HAVE_ST_BLOCKS
#ifdef HAVE_ST_BLOCKS
put_long (info + 128, statbuf.st_blocks);
# else
#else
put_long (info + 128, (statbuf.st_size + 511) / 512);
# endif
#endif
get_time (statbuf.st_mtime, &days, &mins, &ticks);
put_long (info + 132, days);
put_long (info + 136, mins);
......@@ -2947,7 +2954,7 @@ get_fileinfo (Unit *unit, dpacket packet, uaecptr info, a_inode *aino)
PUT_PCK_RES1 (packet, DOS_TRUE);
}
int get_native_path (uae_u32 lock, char *out)
int get_native_path (uae_u32 lock, TCHAR *out)
{
int i = 0;
for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) {
......@@ -3112,7 +3119,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp
struct dirent *ok;
uae_u32 err;
struct fs_dirhandle *d;
char fn[MAX_DPATH];
TCHAR fn[MAX_DPATH];
if (lock != 0)
base = lookup_aino (unit, get_long (lock + 4));
......@@ -3363,7 +3370,7 @@ static void populate_directory (Unit *unit, a_inode *base)
TRACE(("Populating directory, child %p, locked_children %d\n",
base->child, base->locked_children));
for (;;) {
char fn[MAX_DPATH];
TCHAR fn[MAX_DPATH];
struct dirent *ok;
uae_u32 err;
......@@ -3458,7 +3465,7 @@ static void action_examine_next (Unit *unit, dpacket packet)
do_examine (unit, packet, ek, info);
return;
no_more_entries:
no_more_entries:
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES);
}
......@@ -3472,7 +3479,7 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
Key *k;
struct fs_filehandle *fd;
int err;
char openmode;
char *openmode;
int aino_created = 0;
int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
......@@ -3505,14 +3512,14 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
return;
}
if (create != 2) {
if ((((mode & aino->amigaos_mode) & A_FIBF_WRITE) != 0 || unit->ui.readonly)
if ((((mode & aino->amigaos_mode) & A_FIBF_WRITE) != 0 || unit->ui.readonly || unit->ui.locked)
&& fallback)
{
mode &= ~A_FIBF_WRITE;
}
/* Kick 1.3 doesn't check read and write access bits - maybe it would be
* simpler just not to do that either. */
if ((mode & A_FIBF_WRITE) != 0 && unit->ui.readonly) {
if ((mode & A_FIBF_WRITE) != 0 && (unit->ui.readonly || unit->ui.locked)) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -3547,7 +3554,9 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
prepare_for_open (aino->nname);
openmode = ((mode & A_FIBF_READ) == 0 ? "wb" : (mode & A_FIBF_WRITE) == 0 ? "rb" : "r+b");
openmode = ((mode & A_FIBF_READ) == 0 ? "wb"
: (mode & A_FIBF_WRITE) == 0 ? "rb"
: "r+b");
if (create) openmode = "w+b";
fd = fs_open (unit, aino->nname, openmode);
......@@ -3570,7 +3579,7 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
if (create && isarch)
fsdb_set_file_attrs (aino);
put_long (fh+36, k->uniq);
put_long (fh + 36, k->uniq);
if (create == 2) {
aino->elock = 1;
// clear comment if file already existed
......@@ -3587,14 +3596,14 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
}
static void
action_fh_from_lock (Unit *unit, dpacket packet)
action_fh_from_lock (Unit *unit, dpacket packet)
{
uaecptr fh = GET_PCK_ARG1 (packet) << 2;
uaecptr lock = GET_PCK_ARG2 (packet) << 2;
a_inode *aino;
Key *k;
struct fs_filehandle *fd;
char openmode;
char *openmode;
int mode;
int isarch = unit->volflags & MYVOLUMEINFO_ARCHIVE;
......@@ -3620,14 +3629,14 @@ action_fh_from_lock (Unit *unit, dpacket packet)
: "r+b"));
/* the files on CD really can have the write-bit set. */
if (unit->ui.readonly)
if (unit->ui.readonly || unit->ui.locked)
openmode = "rb";
fd = fs_open (unit, aino->nname, openmode);
if (fd == NULL) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
return;
}
k = new_key (unit);
......@@ -3645,31 +3654,31 @@ action_fh_from_lock (Unit *unit, dpacket packet)
}
static void
action_find_input (Unit *unit, dpacket packet)
action_find_input (Unit *unit, dpacket packet)
{
do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 0, 1);
do_find (unit, packet, A_FIBF_READ | A_FIBF_WRITE, 0, 1);
}
static void
action_find_output (Unit *unit, dpacket packet)
action_find_output (Unit *unit, dpacket packet)
{
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
}
do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 2, 0);
do_find (unit, packet, A_FIBF_READ | A_FIBF_WRITE, 2, 0);
}
static void
action_find_write (Unit *unit, dpacket packet)
action_find_write (Unit *unit, dpacket packet)
{
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
}
do_find(unit, packet, A_FIBF_READ|A_FIBF_WRITE, 1, 0);
do_find (unit, packet, A_FIBF_READ | A_FIBF_WRITE, 1, 0);
}
/* change file/dir's parent dir modification time */
......@@ -3686,7 +3695,7 @@ static void updatedirtime (a_inode *a1, int now)
if (stat (a1->nname, &statbuf) == -1)
return;
get_time (statbuf.st_mtime, &days, &mins, &ticks);
ut.actime = ut.modtime = put_time(days, mins, ticks);
ut.actime = ut.modtime = put_time (days, mins, ticks);
utime (a1->parent->nname, &ut);
} else {
utime (a1->parent->nname, NULL);
......@@ -3695,7 +3704,7 @@ static void updatedirtime (a_inode *a1, int now)
}
static void
action_end (Unit *unit, dpacket packet)
action_end (Unit *unit, dpacket packet)
{
Key *k;
TRACE(("ACTION_END(0x%lx)\n", GET_PCK_ARG1 (packet)));
......@@ -3755,11 +3764,12 @@ static void
PUT_PCK_RES2 (packet, 0);
} else if (actual < 0) {
PUT_PCK_RES1 (packet, 0);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
} else {
PUT_PCK_RES1 (packet, actual);
k->file_pos += actual;
}
flush_dcache (addr, size);
} else {
uae_u8 *buf;
off_t old, filesize;
......@@ -3783,7 +3793,7 @@ static void
if (actual < 0) {
PUT_PCK_RES1 (packet, 0);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
} else {
int i;
PUT_PCK_RES1 (packet, actual);
......@@ -3797,7 +3807,7 @@ static void
}
static void
action_write (Unit *unit, dpacket packet)
action_write (Unit *unit, dpacket packet)
{
Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
uaecptr addr = GET_PCK_ARG2 (packet);
......@@ -3815,7 +3825,7 @@ action_write (Unit *unit, dpacket packet)
gui_flicker_led (LED_HD, unit->unit, 2);
TRACE(("ACTION_WRITE(%s,0x%lx,%ld)\n",k->aino->nname,addr,size));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -3854,13 +3864,13 @@ action_write (Unit *unit, dpacket packet)
}
static void
action_seek (Unit *unit, dpacket packet)
action_seek (Unit *unit, dpacket packet)
{
Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
long pos = (uae_s32)GET_PCK_ARG2 (packet);
long mode = (uae_s32)GET_PCK_ARG3 (packet);
off_t res;
long old;
uae_s64 res;
uae_s64 old;
int whence = SEEK_CUR;
if (k == 0) {
......@@ -3879,8 +3889,8 @@ action_seek (Unit *unit, dpacket packet)
old = fs_lseek (k->fd, 0, SEEK_CUR);
{
uae_s32 temppos;
long filesize = fs_lseek64 (k->fd, 0, SEEK_END);
uae_s64 temppos;
uae_s64 filesize = fs_lseek64 (k->fd, 0, SEEK_END);
fs_lseek (k->fd, old, SEEK_SET);
if (whence == SEEK_CUR)
......@@ -3891,7 +3901,7 @@ action_seek (Unit *unit, dpacket packet)
temppos = filesize + pos;
if (filesize < temppos) {
res = -1;
PUT_PCK_RES1 (packet,res);
PUT_PCK_RES1 (packet, res);
PUT_PCK_RES2 (packet, ERROR_SEEK_ERROR);
return;
}
......@@ -3910,7 +3920,7 @@ action_seek (Unit *unit, dpacket packet)
}
static void
action_set_protect (Unit *unit, dpacket packet)
action_set_protect (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG2 (packet) << 2;
uaecptr name = GET_PCK_ARG3 (packet) << 2;
......@@ -3920,7 +3930,7 @@ action_set_protect (Unit *unit, dpacket packet)
TRACE(("ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n", lock, bstr (unit, name), mask));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -3952,11 +3962,11 @@ static void action_set_comment (Unit * unit, dpacket packet)
uaecptr lock = GET_PCK_ARG2 (packet) << 2;
uaecptr name = GET_PCK_ARG3 (packet) << 2;
uaecptr comment = GET_PCK_ARG4 (packet) << 2;
char *commented = NULL;
TCHAR *commented = NULL;
a_inode *a;
int err;
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -3971,7 +3981,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
}
if (_tcslen (commented) > 0) {
TCHAR *p = commented;
commented = xmalloc (char, 81);
commented = xmalloc (TCHAR, 81);
_tcsncpy (commented, p, 80);
commented[80] = 0;
} else {
......@@ -3985,7 +3995,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, err);
maybe_free_and_out:
maybe_free_and_out:
if (commented)
xfree (commented);
return;
......@@ -4005,7 +4015,7 @@ static void action_set_comment (Unit * unit, dpacket packet)
}
static void
action_same_lock (Unit *unit, dpacket packet)
action_same_lock (Unit *unit, dpacket packet)
{
uaecptr lock1 = GET_PCK_ARG1 (packet) << 2;
uaecptr lock2 = GET_PCK_ARG2 (packet) << 2;
......@@ -4021,7 +4031,7 @@ action_same_lock (Unit *unit, dpacket packet)
}
static void
action_change_mode (Unit *unit, dpacket packet)
action_change_mode (Unit *unit, dpacket packet)
{
#define CHANGE_LOCK 0
#define CHANGE_FH 1
......@@ -4084,7 +4094,7 @@ action_change_mode (Unit *unit, dpacket packet)
}
static void
action_parent_common (Unit *unit, dpacket packet, unsigned long uniq)
action_parent_common (Unit *unit, dpacket packet, unsigned long uniq)
{
a_inode *olda = lookup_aino (unit, uniq);
if (olda == 0) {
......@@ -4109,7 +4119,7 @@ action_parent_common (Unit *unit, dpacket packet, unsigned long uniq)
}
static void
action_parent_fh (Unit *unit, dpacket packet)
action_parent_fh (Unit *unit, dpacket packet)
{
Key *k = lookup_key (unit, GET_PCK_ARG1 (packet));
if (!k) {
......@@ -4121,7 +4131,7 @@ action_parent_fh (Unit *unit, dpacket packet)
}
static void
action_parent (Unit *unit, dpacket packet)
action_parent (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
......@@ -4137,7 +4147,7 @@ action_parent (Unit *unit, dpacket packet)
}
static void
action_create_dir (Unit *unit, dpacket packet)
action_create_dir (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
uaecptr name = GET_PCK_ARG2 (packet) << 2;
......@@ -4146,7 +4156,7 @@ action_create_dir (Unit *unit, dpacket packet)
TRACE(("ACTION_CREATE_DIR(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -4174,7 +4184,7 @@ action_create_dir (Unit *unit, dpacket packet)
if (mkdir (aino->nname, 0777) == -1) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
return;
}
aino->shlock = 1;
......@@ -4187,7 +4197,7 @@ action_create_dir (Unit *unit, dpacket packet)
}
static void
action_examine_fh (Unit *unit, dpacket packet)
action_examine_fh (Unit *unit, dpacket packet)
{
Key *k;
a_inode *aino = 0;
......@@ -4214,7 +4224,7 @@ action_examine_fh (Unit *unit, dpacket packet)
* This implementation tries to mimic the behaviour of the Kick 3.1 ramdisk
* (which seems to match the Autodoc description). */
static void
action_set_file_size (Unit *unit, dpacket packet)
action_set_file_size (Unit *unit, dpacket packet)
{
Key *k, *k1;
off_t offset = GET_PCK_ARG2 (packet);
......@@ -4283,14 +4293,14 @@ static int relock_do(Unit *unit, a_inode *a1)
return wehavekeys;
}
static void relock_re(Unit *unit, a_inode *a1, a_inode *a2, int failed)
static void relock_re (Unit *unit, a_inode *a1, a_inode *a2, int failed)
{
Key *k1, *knext;
for (k1 = unit->keys; k1; k1 = knext) {
knext = k1->next;
if (k1->aino == a1 && k1->fd) {
char mode = (k1->dosmode & A_FIBF_READ) == 0 ? "wb" : (k1->dosmode & A_FIBF_WRITE) == 0 ? "rb" : "r+b";
char *mode = (k1->dosmode & A_FIBF_READ) == 0 ? "wb" : (k1->dosmode & A_FIBF_WRITE) == 0 ? "rb" : "r+b";
//mode |= O_BINARY;
if (failed) {
/* rename still failed, restore fd */
......@@ -4317,7 +4327,7 @@ static void relock_re(Unit *unit, a_inode *a1, a_inode *a2, int failed)
}
static void
action_delete_object (Unit *unit, dpacket packet)
action_delete_object (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG1 (packet) << 2;
uaecptr name = GET_PCK_ARG2 (packet) << 2;
......@@ -4326,7 +4336,7 @@ action_delete_object (Unit *unit, dpacket packet)
TRACE(("ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -4354,13 +4364,13 @@ action_delete_object (Unit *unit, dpacket packet)
fsdb_dir_writeback (a);
if (my_rmdir (a->nname) == -1) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
return;
}
} else {
if (my_unlink (a->nname) == -1) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, dos_errno());
PUT_PCK_RES2 (packet, dos_errno ());
return;
}
}
......@@ -4377,7 +4387,7 @@ action_delete_object (Unit *unit, dpacket packet)
}
static void
action_set_date (Unit *unit, dpacket packet)
action_set_date (Unit *unit, dpacket packet)
{
uaecptr lock = GET_PCK_ARG2 (packet) << 2;
uaecptr name = GET_PCK_ARG3 (packet) << 2;
......@@ -4388,7 +4398,7 @@ action_set_date (Unit *unit, dpacket packet)
TRACE(("ACTION_SET_DATE(0x%lx,\"%s\")\n", lock, bstr (unit, name)));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -4414,7 +4424,7 @@ action_set_date (Unit *unit, dpacket packet)
}
static void
action_rename_object (Unit *unit, dpacket packet)
action_rename_object (Unit *unit, dpacket packet)
{
uaecptr lock1 = GET_PCK_ARG1 (packet) << 2;
uaecptr name1 = GET_PCK_ARG2 (packet) << 2;
......@@ -4428,7 +4438,7 @@ action_rename_object (Unit *unit, dpacket packet)
TRACE(("ACTION_RENAME_OBJECT(0x%lx,\"%s\",", lock1, bstr (unit, name1)));
TRACE(("0x%lx,\"%s\")\n", lock2, bstr (unit, name2)));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -4535,7 +4545,7 @@ static void
TRACE(("ACTION_RENAME_DISK(\"%s\")\n", bstr (unit, name)));
if (unit->ui.readonly) {
if (unit->ui.readonly || unit->ui.locked) {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, ERROR_DISK_WRITE_PROTECTED);
return;
......@@ -4578,7 +4588,7 @@ static void
{
PUT_PCK_RES1 (packet, DOS_TRUE);
flush_cache (unit, 0);
unit->inhibited = GET_PCK_ARG1 (packet);
unit->inhibited = GET_PCK_ARG1 (packet) != 0;
TRACE(("ACTION_INHIBIT(%d:%d)\n", unit->unit, unit->inhibited));
}
......@@ -4588,14 +4598,14 @@ static void
TRACE(("ACTION_WRITE_PROTECT()\n"));
PUT_PCK_RES1 (packet, DOS_TRUE);
if (GET_PCK_ARG1 (packet)) {
if (!(unit->ui.readonly & 2)) {
unit->ui.readonly |= 2;
if (!unit->ui.locked) {
unit->ui.locked = true;
unit->lockkey = GET_PCK_ARG2 (packet);
}
} else {
if (unit->ui.readonly & 2) {
if (unit->ui.locked) {
if (unit->lockkey == GET_PCK_ARG2 (packet) || unit->lockkey == 0) {
unit->ui.readonly &= ~2;
unit->ui.locked = false;
} else {
PUT_PCK_RES1 (packet, DOS_FALSE);
PUT_PCK_RES2 (packet, 0);
......@@ -4756,7 +4766,7 @@ static void action_get_file_size64 (Unit *unit, dpacket packet)
}
/* We don't want multiple interrupts to be active at the same time. I don't
* know whether AmigaOS takes care of that, but this does. */
* know whether AmigaOS takes care of that, but this does. */
static uae_sem_t singlethread_int_sem;
static uae_u32 REGPARAM2 exter_int_helper (TrapContext *context)
......@@ -4992,19 +5002,19 @@ static void *filesys_thread (void *unit_v)
uae_set_thread_priority (2);
for (;;) {
uae_u8 *pck;
uae_u8 *msg;
dpacket pck;
uaecptr msg;
uae_u32 morelocks;
pck = (uae_u8 *)read_comm_pipe_pvoid_blocking (ui->unit_pipe);
msg = (uae_u8 *)read_comm_pipe_pvoid_blocking (ui->unit_pipe);
pck = read_comm_pipe_u32_blocking (ui->unit_pipe);
msg = read_comm_pipe_u32_blocking (ui->unit_pipe);
morelocks = (uae_u32)read_comm_pipe_int_blocking (ui->unit_pipe);
if (ui->reset_state == FS_GO_DOWN) {
if (pck != 0)
continue;
/* Death message received. */
uae_sem_post ((uae_sem_t *)&ui->reset_sync_sem);
uae_sem_post (&ui->reset_sync_sem);
/* Die. */
return 0;
}
......@@ -5016,13 +5026,13 @@ static void *filesys_thread (void *unit_v)
PUT_PCK_RES2 (pck, ERROR_ACTION_NOT_KNOWN);
}
/* Mark the packet as processed for the list scan in the assembly code. */
do_put_mem_long ((uae_u32 *)(msg + 4), -1);
put_long (msg + 4, 0xffffffff);
/* Acquire the message lock, so that we know we can safely send the
* message. */
ui->self->cmds_sent++;
/* The message is sent by our interrupt handler, so make sure an interrupt
* happens. */
do_uae_int_requested ();
do_uae_int_requested();
/* Send back the locks. */
if (get_long (ui->self->locklist) != 0)
write_comm_pipe_int (ui->back_pipe, (int)(get_long (ui->self->locklist)), 0);
......@@ -5039,16 +5049,12 @@ static uae_u32 REGPARAM2 filesys_handler (TrapContext *context)
Unit *unit = find_unit (m68k_areg (regs, 5));
uaecptr packet_addr = m68k_dreg (regs, 3);
uaecptr message_addr = m68k_areg (regs, 4);
uae_u8 *pck;
uae_u8 *msg;
if (! valid_address (packet_addr, 36) || ! valid_address (message_addr, 14)) {
write_log ("FILESYS: Bad address %x/%x passed for packet.\n", packet_addr, message_addr);
goto error2;
}
pck = get_real_address (packet_addr);
msg = get_real_address (message_addr);
do_put_mem_long ((uae_u32 *)(msg + 4), -1);
put_long (message_addr + 4, 0xffffffff);
if (!unit || !unit->volume) {
write_log ("FILESYS: was not initialized.\n");
goto error;
......@@ -5064,23 +5070,23 @@ static uae_u32 REGPARAM2 filesys_handler (TrapContext *context)
put_long (get_long (morelocks), 0);
/* The packet wasn't processed yet. */
do_put_mem_long ((uae_u32 *)(msg + 4), 0);
write_comm_pipe_pvoid (unit->ui.unit_pipe, (void *)pck, 0);
write_comm_pipe_pvoid (unit->ui.unit_pipe, (void *)msg, 0);
put_long (message_addr + 4, 0);
write_comm_pipe_u32 (unit->ui.unit_pipe, packet_addr, 0);
write_comm_pipe_u32 (unit->ui.unit_pipe, message_addr, 0);
write_comm_pipe_int (unit->ui.unit_pipe, (int)morelocks, 1);
/* Don't reply yet. */
return 1;
}
#endif
if (! handle_packet (unit, pck)) {
error:
PUT_PCK_RES1 (pck, DOS_FALSE);
PUT_PCK_RES2 (pck, ERROR_ACTION_NOT_KNOWN);
if (! handle_packet (unit, packet_addr)) {
error:
PUT_PCK_RES1 (packet_addr, DOS_FALSE);
PUT_PCK_RES2 (packet_addr, ERROR_ACTION_NOT_KNOWN);
}
TRACE(("reply: %8lx, %ld\n", GET_PCK_RES1 (pck), GET_PCK_RES2 (pck)));
error2:
error2:
return 0;
}
......@@ -5242,7 +5248,7 @@ static uae_u32 REGPARAM2 filesys_diagentry (TrapContext *context)
resaddr = bsdlib_startup (resaddr);
#endif
#ifdef SCSIEMU
resaddr = scsidev_startup(resaddr);
resaddr = scsidev_startup (resaddr);
#endif
#ifdef SANA2
resaddr = netdev_startup (resaddr);
......@@ -5339,7 +5345,7 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context)
}
/* Remember a pointer AmigaOS gave us so we can later use it to identify
* which unit a given startup message belongs to. */
* which unit a given startup message belongs to. */
static uae_u32 REGPARAM2 filesys_dev_remember (TrapContext *context)
{
int no = m68k_dreg (regs, 6);
......@@ -5461,7 +5467,7 @@ static void dump_partinfo (const char *name, int num, uaecptr pp, int partblock)
static int rdb_mount (UnitInfo *uip, int unit_no, unsigned int partnum, uaecptr parmpacket)
{
unsigned int lastblock = 63, blocksize, readblocksize;
int driveinitblock, badblock;
int badblock, driveinitblock;
uae_u8 bufrdb[FILESYS_MAX_BLOCKSIZE], *buf = 0;
uae_u8 *fsmem = 0;
unsigned int rdblock, partblock, fileblock, i;
......@@ -5806,26 +5812,37 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context)
get_new_device (type, parmpacket, &uip[unit_no].devname, &uip[unit_no].devname_amiga, unit_no);
uip[unit_no].devno = unit_no;
put_long (parmpacket, uip[unit_no].devname_amiga);
put_long (parmpacket + 4, type != FILESYS_VIRTUAL ? ROM_hardfile_resname : fsdevname);
put_long (parmpacket + 8, uip[unit_no].devno);
put_long (parmpacket + 12, 0); /* Device flags */
put_long (parmpacket + 16, 16); /* Env. size */
put_long (parmpacket + 20, uip[unit_no].hf.blocksize >> 2); /* longwords per block */
put_long (parmpacket + 24, 0); /* unused */
put_long (parmpacket + 28, uip[unit_no].hf.surfaces); /* heads */
put_long (parmpacket + 32, 1); /* sectors per block */
put_long (parmpacket + 36, uip[unit_no].hf.secspertrack); /* sectors per track */
put_long (parmpacket + 40, uip[unit_no].hf.reservedblocks); /* reserved blocks */
put_long (parmpacket + 44, 0); /* unused */
put_long (parmpacket + 48, 0); /* interleave */
put_long (parmpacket + 52, 0); /* lowCyl */
put_long (parmpacket + 56, uip[unit_no].hf.nrcyls <= 0 ? 0 : uip[unit_no].hf.nrcyls - 1); /* hiCyl */
put_long (parmpacket + 60, 50); /* Number of buffers */
put_long (parmpacket + 64, 0); /* Buffer mem type */
put_long (parmpacket + 68, 0x7FFFFFFF); /* largest transfer */
put_long (parmpacket + 72, ~1); /* addMask (?) */
put_long (parmpacket + 76, uip[unit_no].bootpri); /* bootPri */
put_long (parmpacket + 80, 0x444f5300); /* DOS\0 */
if (type == FILESYS_VIRTUAL) {
put_long (parmpacket + 4, fsdevname);
put_long (parmpacket + 20, 1024 >> 2); /* longwords per block */
put_long (parmpacket + 28, 15); /* heads */
put_long (parmpacket + 32, 1); /* sectors per block */
put_long (parmpacket + 36, 127); /* sectors per track */
put_long (parmpacket + 40, 2); /* reserved blocks */
put_long (parmpacket + 52, 0); /* lowCyl */
put_long (parmpacket + 56, 1); /* hiCyl */
} else {
put_long (parmpacket + 4, ROM_hardfile_resname);
put_long (parmpacket + 20, uip[unit_no].hf.blocksize >> 2); /* longwords per block */
put_long (parmpacket + 28, uip[unit_no].hf.surfaces); /* heads */
put_long (parmpacket + 32, 1); /* sectors per block */
put_long (parmpacket + 36, uip[unit_no].hf.secspertrack); /* sectors per track */
put_long (parmpacket + 40, uip[unit_no].hf.reservedblocks); /* reserved blocks */
put_long (parmpacket + 52, 0); /* lowCyl */
put_long (parmpacket + 56, uip[unit_no].hf.nrcyls <= 0 ? 0 : uip[unit_no].hf.nrcyls - 1); /* hiCyl */
}
if (type == FILESYS_HARDFILE)
type = dofakefilesys (&uip[unit_no], parmpacket);
if (uip[unit_no].bootpri < -127)
......@@ -5885,7 +5902,7 @@ void filesys_install (void)
fsdevname = ds ("uae.device"); /* does not really exist */
ROM_filesys_diagentry = here();
ROM_filesys_diagentry = here ();
calltrap (deftrap2 (filesys_diagentry, 0, "filesys_diagentry"));
dw(0x4ED0); /* JMP (a0) - jump to code that inits Residents */
......@@ -6546,7 +6563,8 @@ uae_u8 *restore_filesys (uae_u8 *src)
int type, devno;
UnitInfo *ui;
TCHAR *devname = 0, *volname = 0, *rootdir = 0, *filesysdir = 0;
int bootpri, readonly;
int bootpri;
bool readonly;
if (restore_u32 () != 2)
return src;
......@@ -6557,7 +6575,7 @@ uae_u8 *restore_filesys (uae_u8 *src)
volname = restore_string ();
filesysdir = restore_string ();
bootpri = restore_u8 ();
readonly = restore_u8 ();
readonly = restore_u8 () != 0;
ui = &mountinfo.ui[devno];
ui->startup = restore_u32 ();
filesys_configdev = restore_u32 ();
......@@ -6568,7 +6586,7 @@ uae_u8 *restore_filesys (uae_u8 *src)
}
if (set_filesys_unit (devno, devname, volname, rootdir, readonly,
ui->hf.secspertrack, ui->hf.surfaces, ui->hf.reservedblocks, ui->hf.blocksize,
bootpri, 0, 1, filesysdir[0] ? filesysdir : NULL, 0, 0) < 0) {
bootpri, false, true, filesysdir[0] ? filesysdir : NULL, 0, 0) < 0) {
write_log ("filesys '%s' failed to restore\n", rootdir);
goto end;
}
......
......@@ -47,8 +47,8 @@ extern uaecptr need_uae_boot_rom (void);
struct mountedinfo
{
uae_u64 size;
int ismounted;
int ismedia;
bool ismounted;
bool ismedia;
int nrcyls;
};
......@@ -59,7 +59,7 @@ struct mountedinfo
extern char *validatedevicename (char *s);
extern char *validatevolumename (char *s);
int filesys_insert(int nr, char *volume, const char *rootdir, int readonly, int flags);
int filesys_insert (int nr, TCHAR *volume, const TCHAR *rootdir, bool readonly, int flags);
int filesys_eject(int nr);
int filesys_media_change (const char *rootdir, int inserted, struct uaedev_config_info *uci);
......
......@@ -9,7 +9,7 @@
typedef union {
int i;
uae_u32 u32;
const void *pv;
void *pv;
} uae_pt;
/* These currently require the maximum size to be known at initialization
......@@ -128,7 +128,7 @@ STATIC_INLINE uae_u32 read_comm_pipe_u32_blocking (smp_comm_pipe *p)
return foo.u32;
}
STATIC_INLINE const void *read_comm_pipe_pvoid_blocking (smp_comm_pipe *p)
STATIC_INLINE void *read_comm_pipe_pvoid_blocking (smp_comm_pipe *p)
{
uae_pt foo = read_comm_pipe_pt_blocking (p);
return foo.pv;
......@@ -148,7 +148,7 @@ STATIC_INLINE void write_comm_pipe_u32 (smp_comm_pipe *p, int data, int no_buffe
write_comm_pipe_pt (p, foo, no_buffer);
}
STATIC_INLINE void write_comm_pipe_pvoid (smp_comm_pipe *p, const void *data, int no_buffer)
STATIC_INLINE void write_comm_pipe_pvoid (smp_comm_pipe *p, void *data, int no_buffer)
{
uae_pt foo;
foo.pv = data;
......
......@@ -13,14 +13,14 @@
#define UAE_STRING_H
#ifdef HAVE_STRINGS_H
# include <strings.h>
#include <strings.h>
#endif
#ifdef HAVE_STRING_H
# include <string.h>
#include <string.h>
#endif
#ifdef HAVE_STRDUP
# define my_strdup strdup
#define my_strdup strdup
#else
extern char *my_strdup (const char *s);
#endif
......
......@@ -486,7 +486,7 @@ void setmouseactive (int active)
char *au_fs_copy (char *dst, int maxlen, const char *src)
{
int i;
unsigned int i;
for (i = 0; src[i] && i < maxlen - 1; i++)
dst[i] = src[i];
......
......@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes
configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc9SecbZ.o: In function `main':
/tmp/ccBiDfLi.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status
configure:4350: $? = 1
......@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes
configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccXI8Zie.o: In function `main':
/tmp/ccpI9QLu.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status
configure:4364: $? = 1
......@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no
configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccaQV0Wi.o: In function `main':
/tmp/cc94CjOB.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status
configure:4364: $? = 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment