home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
u
/
uae
/
Docs
/
README_PRO
< prev
next >
Wrap
Text File
|
1997-06-06
|
17KB
|
314 lines
You can help to make this program better. If you fix bugs or implement new
features, I'd be grateful if you send me patches. For a list of interesting
projects, and for a brief summary on how UAE works, see below.
A few guidelines for anyone who wants to help:
- Please contact me first before you implement major new features. Someone
else might be doing the same thing already. This has already happened :-(
Even if no one else is working on this feature, there might be alternative
and better/easier/more elegant ways to do it.
- If you have more than one Kickstart, try your code with each one.
- Patches are welcome in any form, but diff -u or diff -c output is preferred.
If I get whole source files, the first thing I do is to run diff on it. You
can save me some work here (and make my mailbox smaller).
Some possible projects, in order of estimated difficulty:
- Someone running *BSD on a x86 might want to try using X86.S on such a
system. It's likely that only configure needs to be modified.
- Add gamma correction
- Repair support of the serial interface. Sending data seems to work,
receiving does not. Maybe this has to be implemented in a completely
different way (a serial.device? If you do that, don't do it native. At least
not all of it. Amiga libraries shouldn't be implemented completely native
in UAE, the parts which are not speed critical should be Amiga native so
they can call other 68k code safely).
- Someone with a 68020 data sheet might check whether all opcodes are
decoded correctly and whether all instructions really do what they are
supposed to do (I'm pretty sure it's OK by now, but you never know...).
- Add 2.0 packets to filesys.c
- Multi-thread support is there now, it just needs someone to test it on a SMP
machine and to fix it so it improves speed instead of slowing the thing
down.
- Improve the Kickstart replacement to boot more demos.
- Snapshots as in CPE. Will need to collect all the variables containing
important information. Fairly easy, but boring. (Use core dumps instead :-)
_If_ someone attempts this, please be more clever than the various CPC
emulators and dump state only at one fixed point in the frame, preferrably
the vsync point.
- Find out why uae.device has to be mounted manually with Kick 1.3.
The problem seems to be that we don't have a handler for it. I _think_ what
we need is the seglist of the standard filesystem handler. Problem is,
DOS hasn't been started when the devices are initialized and so we can't get
to the DosBase->RootNode->FileHandlerSeg pointer, and then there is the
confusing matter of BCPL GlobVecs and other weird stuff...
- Some incompatibilities might be fixed with user-modifiable fudge variables
the same way it's done in various C64 emulators.
- With the new display code, it would probably be easier than before to
implement ECS resolutions - however, a lot of places rely on the OCS timing
parameters and display sizes.
- Figure out a diskfile format that supports every possible non-standard
format.
- Implement 68551 MMU. I have docs now. Not among the most necessary things.
Difficult, at least without using C++ exception handling.
- Implement AGA support. Some bits and pieces exist.
- Reimplement Amiga OS. (Well-behaved) Amiga programs could then be made
to use the X Window System as a "public screen". Of course, not all the
OS would have to be re-done, only Intuition/GFX/Layers (which is enough).
[Started, look at gfxlib.c - not usable yet.]
- Find some extremely clever ways to optimize the smart update methods. Some
ideas:
a) Always use memcmpy() to check for bitplane differences. If no differences
are found, see if BPLxDELAY got modified, if so, scroll.
Problems:
* You'd still have to draw a few pixels around the DIW borders. Not very
hard.
* Scrolling with memcpy in video memory can be terribly slow (no, I
shouldn't have bought the cheaper video card with DRAMs)
* At least every 15 pixels a full update has to be done since the
bitplane pointers get updated after that. And that's with the slowest
scrolling - if the playfield scrolls faster, the benefit converges
against zero.
You could also do vertical scrolling tests, but similar problems arise -
where should one check? One line above/below? What about faster
scrolling? You could use the bitplane pointers as hints, but with
double/triple buffering this gets problematic, too.
On the whole, I don't think it would be worth the effort, even if it
works very well for a few games.
b) Well, there is no b). If I thought of something I forgot it while
writing a).
- Port it to Java and Emacs Lisp
- A formal proof of correctness would be nice.
Source file layout
src/ contains (mostly) machine-independent C code.
include/ contains header files included by C code.
md-*/ CPU and compiler dependent files, linked to machdep by configure
od-*/ operating system dependent files, linked to osdep by configure
td-*/ thread library dependent files, linked to threaddep by configure
sd-*/ Sound code. sd-* is only for sound systems which are not OS specific
or for which no "od-*" directory exists. Linked to sounddep
targets/ Contains header files which contain some information about which
options a specific port of UAE understands.
Coding style
As long as your code is hidden in a file buried in md-*/ or od-*/ where I
never have a look at it, you can probably get away with not following these
guidelines.
* Do not include CR characters.
* Do not use GNU C extensions if you can't hide them in a macro or in a
system-specific file so that an alternative implementation is available
when GNU C is not used.
This applies to _all_ OS/CPU/compiler specific details. Basically, nothing
of that sort should appear in src/*.c (we're a bit away from that goal at
the moment, but it's getting better).
* Make sure your code does not make assumption about type sizes other than
the minimum widths allowed by C. If you need specific type sizes, use the
uae_u32 type and its friends.
* Set up your editor so that tab characters round up to the next position
where ((cursorx-1) % 8) == 0, i.e. 8 space tabs. Do not use 4 space tabs,
that makes the code awful to read on other machines and worse to edit.
* Lines can be up to 132 characters wide. Use SVGATextMode for the Linux
console, or use a windowing system in a high resolution.
* Indentation - look at some code in custom.c and try to follow it. Don't
use GNU 2-space-in-weird-places indentation, I find it awful. But _do_
follow the GNU rules for adding whitespace in expressions, and those for
breaking up multiple-line if statements.
Fixed indentation rules almost never make sense - break the rules if that
makes your code more readable.
Hint: Get jed from space.mit.edu, /pub/davis. It can indent your code
automatically. Put the following into your .jedrc, and it will come out
right:
C_INDENT = 4;
C_BRACE = 0;
C_BRA_NEWLINE = 0;
C_Colon_Offset = 1;
C_CONTINUED_OFFSET = 4;
How it works
Let's start with the memory emulation. All addressable memory is split into
banks of 64K each. Each bank can define custom routines accessing bytes,
words, and longwords. All banks that really represent physical memory just
define these routines to write/read the specified amount of data to a chunk
of memory. This memory area is organized as an array of uae_u8, which means
that those parts of the emulator that want to access memory in a linear
fashion can get a (uae_u8 *) pointer and use it to circumvent the overhead of
the put_*() and get_*() calls. That is done, for example, in the
pfield_doline() function which handles screen refreshes.
Memory banks that represent hardware registers (such as the custom chip bank
at 0xDF0000) can trap reads/writes and take any necessary actions.
In some places, this scheme is abused: The uae.device and unixfs.device are
stored in a segment at 0xF00000 containing a ROMtag structure, so it is
recognized at bootup. Since this is a ROM area, writes shou