This directory contains some simple tests for vbcc/6502
that can be run on a C64, PET, NES, Atari, BBC, MEGA65,
Oric Atmos, SNES, Apple I, Apple II or X16.

mandelbrot.c (all):

A simple mandelbrot generator taken from the cc65 samples.
The graphics routines from cc65 have been replaced by a
simple character buffer. For the C64, a version using
coloured blocks can be compiled using -DC64. The other
versions are using characters.


fmandelbrot.c (all):

The same generator, but the fixed point arithmetic has
been replaced by floating point. The result with wozfp
or IEEE (where available) is much slower but it produces
a visibly better result. The MSBASIC versions are much
faster. Versions using the ROM libraries are also
available for some targets (VIC-20, C16, PET, ATMOS).


dhry* (all):

The standard dhrystone test. The timing routines have
been adjusted to the C64. Not sure if timing is correct
for all targets. When in doubt, use a stop clock and
manually calculate dhrystones/s.

The loop counter has been changed to unsigned int to
allow more than 30000 iterations. Otherwise machines
like MEGA65 would be too fast to deliver measurable
results.

The NES version is compiled to use a smaller array size
to make up for its limited RAM. This should not affect
execution time.

To get dhrystones compiled with cc65, I had to add some more
declarations (not sure why). Also the result does not
seem to work without static-locals (which is a bit of
cheating). Furthermore, the output of cc65 does not seem
to be fully correct, but I have not investigated those
issues further.

I get about 75 dhrystones/s for cc65 and ~246 for vbcc on C64.


calc.c (all):

Another floating point test. It parses arithmetic
expressions and calculates the result, e.g.

> 1.3e4 + 2 * (3.5+4)

It can be observed that the numerical precision of wozfp
is not that great.

The IEEE version offers great precision, but it needs
much memory (mostly due to the unoptimized printf/scanf)
and is only available for targets with enough unbanked
memory.

The MSBASIC version offers good precision and is available
for all targets. Versions using the ROM libraries are also
available for some targets (VIC-20, C16, PET, ATMOS).

lazyNES:

Several demos for the NES using the lazyNES libraries
kindly provided by Matthias "lazycow" Bock. Those libs
provide all crucial functionality needed to write games for
the NES.
Have a look at the README-lazynes.txt in this subdirectory.


bank1-3:

Some small tests/examples testing banking with automated
bank switching on the NES (two different mappers), C64 with
REU, BBC (with sideways RAM in banks 1-3) and MEGA65.

Those examples demonstrate different features like calling
code in different banks, accessing data from other banks or
using far pointers.

Consult the banking section in the vclib documentation of
your target for details on how to run the banked code.


reuflat.c:

A small demo for the preliminary flat banking support for
C64 REU.


argv (C64, C128, C16, VIC-20, PET, MEGA65, X16, bbc, atmos):

A small demo using the argv-parser. If compiled with the
+c64r/+m65r/+x16r configuration it can be started multiple
times.

C64 etc.:   RUN:REM arg1 arg2 ...
BBC:        *RUN argv arg1 arg2 ...


files (C64, C128, C16, VIC-20, MEGA65, bbc, Apple II, X16):

A demo demonstrating using file I/O. It can be used to read
and write files as well as perform some file operations.

Have a look at the documentation on vclib for the corresponding
target to see what limitations might apply.
