Commit 6773f137 authored by Sergio Costas's avatar Sergio Costas

Primera version

parents
Although Amstrad is the current propietary of the copyright of the original
ZX Spectrum ROMs, they have kindly given their permission for its
redistribution with Spectrum emulators.
These are the conditions put by Amstrad to use and distribute the ROM files,
extracted from
http://groups.google.com/group/comp.sys.amstrad.8bit/msg/c092cc4d4943131e
--------------------------------------------------------------------------
1) What exactly do you have to do to use Sinclair ROMs in an emulator, such
as acknowledgements etc?"
Amstrad are happy for emulator writers to include images of our copyrighted
code as long as the (c)opyright messages are not altered and we appreciate
it if the program/manual includes a note to the effect that "Amstrad have
kindly given their permission for the redistribution of their copyrighted
material but retain that copyright".
"2) Can you charge a shareware fee for an emulator that uses the Sinclair
ROMs?"
No. No one should be charging for the ROM code because (as a result of the
point above) there are loads of freely available images anyway. If I ever
thought someone was charging for the ROM images then I'd make them available
as a free download on the www.amstrad.com web site. Naturally I imagine that
some emulator writers want to charge a shareware fee for the code they have
written and we have absolutely no problem with that as long as they aren't,
in any sense, charging for the parts of the code that are (c)Amstrad and (c)
Sinclair.
"3) Can you modify the ROMs, for instance to enable tape loading and saving,
and if so what are the requirements?"
The ROM code is simply a tool to let the emulator writers make a program
that works as close to the original machine as possible. If they choose to
modify the behaviour in any way then that's entirely up to them (I guess you
could say that that is exactly what an emulator IS doing (ie modifying the
screen output and keyboard input to go via the PC bits)!!)
"4) Can you distribute modified ROMs?"
If you like (with that (c) proviso).
WHAT EMULATES RIGHT IN FBZX?
-Screen timmings in 48K and 128K mode.
-Screen generation, so border efects and even attribute changing efects
should work fine.
-48K sound (included the low-pass filter efect of Tape out).
-128K sound (fully emulation of the AY-3-8912).
-Trash in the bus when reading from a non-existing port. This is right generated
(from the data being displayed in that moment) so games works right (like
SHORTCIRCUIT, that runs without flickering).
-Spectrum 48K Issue 2 and 3 efects in the EAR bit are correctly emulated.
-Priority of joystick over keyboard.
-Snow efect when I register points between 64 and 127.
-Emulation of Interface I and Microdrive (only one drive).
-Memory contention
-Emulates Spanish 128K from Investronica/Sinclair
This diff is collapsed.
cargador.d cargador.o: ../cargador.c ../z80free/Z80free.h ../computer.h \
../emulator.h ../cargador.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../cargador.h:
characters.d characters.o: ../characters.c ../characters.h ../emulator.h \
../z80free/Z80free.h ../computer.h
../characters.h:
../emulator.h:
../z80free/Z80free.h:
../computer.h:
computer.d computer.o: ../computer.c ../z80free/Z80free.h ../computer.h \
../emulator.h ../menus.h ../characters.h ../sound.h ../tape.h \
../microdrive.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../menus.h:
../characters.h:
../sound.h:
../tape.h:
../microdrive.h:
emulator.d emulator.o: ../emulator.c ../z80free/Z80free.h ../computer.h \
../emulator.h ../cargador.h ../characters.h ../menus.h ../sound.h \
../tape.h ../microdrive.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../cargador.h:
../characters.h:
../menus.h:
../sound.h:
../tape.h:
../microdrive.h:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include z80free/subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: fbzx
# Tool invocations
fbzx: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
gcc -o"fbzx" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(OBJS)$(C_DEPS)$(EXECUTABLES) fbzx
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
menus.d menus.o: ../menus.c ../z80free/Z80free.h ../computer.h \
../emulator.h ../cargador.h ../characters.h ../menus.h ../tape.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../cargador.h:
../characters.h:
../menus.h:
../tape.h:
File added
microdrive.d microdrive.o: ../microdrive.c ../microdrive.h \
../z80free/Z80free.h ../computer.h ../emulator.h
../microdrive.h:
../z80free/Z80free.h:
../computer.h:
../emulator.h:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=
sound.d sound.o: ../sound.c ../z80free/Z80free.h ../computer.h \
../emulator.h ../sound.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../sound.h:
File added
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
OBJS :=
C_DEPS :=
EXECUTABLES :=
# Every subdirectory with source files must be described here
SUBDIRS := \
z80free \
. \
spk_ay.d spk_ay.o: ../spk_ay.c ../emulator.h ../z80free/Z80free.h \
../computer.h ../sound.h
../emulator.h:
../z80free/Z80free.h:
../computer.h:
../sound.h:
File added
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../cargador.c \
../characters.c \
../computer.c \
../emulator.c \
../menus.c \
../microdrive.c \
../sound.c \
../spk_ay.c \
../tape.c
OBJS += \
./cargador.o \
./characters.o \
./computer.o \
./emulator.o \
./menus.o \
./microdrive.o \
./sound.o \
./spk_ay.o \
./tape.o
C_DEPS += \
./cargador.d \
./characters.d \
./computer.d \
./emulator.d \
./menus.d \
./microdrive.d \
./sound.d \
./spk_ay.d \
./tape.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
tape.d tape.o: ../tape.c ../z80free/Z80free.h ../computer.h ../emulator.h \
../menus.h ../tape.h
../z80free/Z80free.h:
../computer.h:
../emulator.h:
../menus.h:
../tape.h:
File added
z80free/Z80free.d z80free/Z80free.o: ../z80free/Z80free.c \
../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codes.d z80free/Z80free_codes.o: \
../z80free/Z80free_codes.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesCB.d z80free/Z80free_codesCB.o: \
../z80free/Z80free_codesCB.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesDD.d z80free/Z80free_codesDD.o: \
../z80free/Z80free_codesDD.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesDDCB.d z80free/Z80free_codesDDCB.o: \
../z80free/Z80free_codesDDCB.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesED.d z80free/Z80free_codesED.o: \
../z80free/Z80free_codesED.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesFD.d z80free/Z80free_codesFD.o: \
../z80free/Z80free_codesFD.c ../z80free/Z80free.h
../z80free/Z80free.h:
z80free/Z80free_codesFDCB.d z80free/Z80free_codesFDCB.o: \
../z80free/Z80free_codesFDCB.c ../z80free/Z80free.h
../z80free/Z80free.h:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../z80free/Z80free.c \
../z80free/Z80free_codes.c \
../z80free/Z80free_codesCB.c \
../z80free/Z80free_codesDD.c \
../z80free/Z80free_codesDDCB.c \
../z80free/Z80free_codesED.c \
../z80free/Z80free_codesFD.c \
../z80free/Z80free_codesFDCB.c \
../z80free/z80free_tester.c
OBJS += \
./z80free/Z80free.o \
./z80free/Z80free_codes.o \
./z80free/Z80free_codesCB.o \
./z80free/Z80free_codesDD.o \
./z80free/Z80free_codesDDCB.o \
./z80free/Z80free_codesED.o \
./z80free/Z80free_codesFD.o \
./z80free/Z80free_codesFDCB.o \
./z80free/z80free_tester.o
C_DEPS += \
./z80free/Z80free.d \
./z80free/Z80free_codes.d \
./z80free/Z80free_codesCB.d \
./z80free/Z80free_codesDD.d \
./z80free/Z80free_codesDDCB.d \
./z80free/Z80free_codesED.d \
./z80free/Z80free_codesFD.d \
./z80free/Z80free_codesFDCB.d \
./z80free/z80free_tester.d
# Each subdirectory must supply rules for building sources it contributes
z80free/%.o: ../z80free/%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
z80free/z80free_tester.d z80free/z80free_tester.o: \
../z80free/z80free_tester.c ../z80free/Z80free.h
../z80free/Z80free.h:
FBZX CAN'T INITIALIZATE THE SDL LIBRARY.
Is possible that you don't have the '/dev/mouse' symlink, or maybe, that
symlink (or the device pointed by) has no access permissions for the user you
are using. Just try (as root):
FBZX SAYS THAT IS RUNNING WITHOUT SOUND, AND TO READ THE FAQ
Currently FBZX uses ALSA, OSS or PulseAudio to generate the sound, and that
means that there can be only one sound source at each time in the system. If
you have a MP3 playing, without the PULSEAUDIO daemon launched, FBZX won't be
able to get access to the sound.
WHAT SPEED DO I NEED TO USE FBZX?
I'm not sure what's exactly the minimum speed, but I used it in an AMD K6-II
runing at 450 MHz and it worked at fully speed. Now, with the new OSS sound
*seems* to work even better, so maybe you could use it with an smaller
computer.
FBZX CAN BE USED FROM X-WINDOWS?
Since FBZX uses the SDL library, it can be used both from console and from X,
but, of course, in X it will need more system resources due to the fact that it
needs to emulate an 8-bit screen. Of course this was problematic with 2003
computers, but current systems can run FBZX under X without problems.
If you use it from console, it is strongly reccomended to use a native
FrameBuffer driver, in order to allow FBZX to change the current video mode
(see next question).
You can use the -fb option to make FBZX work in fullscreen mode.
I'M USING VESAFB IN MY (16-24 bits) CONSOLE, BUT FBZX WORKS SLOW...
That's because SDL is emulating an 8-bit screen for FBZX. The solution is to
change it for a FrameBuffer specific for your graphic card. If there's no
native driver (or it doesn't work reliably), you can use the SuperVESAfb
driver. This is a VESA driver that allows to change the resolution on-the-fly.
You can find it in:
http://www.rastersoft.com/supervesafb.html
This driver is only for 2.4 kernels. 2.6 versions have a new VESAFB driver
capable of switching the resolution.
MY COMPUTER DOESN'T HAVE FUNCTION KEYS (F1, F2...). HOW CAN I GET ACCESS TO
THE MENUS?
Just press the TAB key and you will see the message "Function key mode on".
Now you can use the number keys (0-9) to emulate the functions keys (F10 is '0',
F1 is '1', and so on, F11 is 'o' and F12 is 'p').
THERE'S A DELAY IN THE SOUND. HOW CAN I ELIMINATE IT?
Unfortunately, you can't. I have to use at least two buffers of 4096 bytes each
one in order to have an stable sound, and this means, at 48000 samples/sec,
0'17 seconds, and that's a perceptible delay for the human ear (with lower
sample rates it would became even worse; to avoid it, at sample rates lower
than 24000 samples/sec I reduce the buffer to 2048 bytes).
THERE ARE SOME GLITCHES IN THE SOUND
Maybe your CPU is too slow to run FBZX at full speed. But you can see with top
the load of each program, and give less priority to the ones that uses more
CPU. I do this with aMule, and the glitches dissapears.
I TRIED TO LOAD A .TZX FILE, BUT THE EMULATOR SHOWS A MESSAGE THAT
TELLS: "Unsuported TZX. Contact FBZX autor". WHAT'S HAPPEN?
Just read the file README.TZX.
I CHOOSE A .TZX FILE AND TYPE LOAD "", BUT NOTHING HAPPENS.
Fast load is available only with TAP files. If you want to load a TZX file,
you must press F6 in order to play the tape.
I TRIED TO LOAD A .TAP FILE IN FAST MODE, BUT IT FAILS AND THE EMULATOR
SHOWS THE MESSAGE "Block with right flag not found". WHAT'S HAPPENNING?
Each Spectrum's tape block has a flag byte that identify each one. Flag 0 is
for headers, and flag FF is for data blocks. A programmer can define its own
flag bytes if he wants.
If the program loader wants to load a block with a flag XX, but there isn't a
block in the TAP file with that flag, the fast loader will stop and show that
message (and will return a "Tape error" to the program loader). If I don't do
this, the fast loader should be reading the tape again and again, trying to
find a block with that flag, and the emulator should hang up (not really hang,
but it wouldn't be able to respond to keystrokes, even to the ESC key).
I CREATED A NEW MDR FILE, BUT WHEN I TRY TO WRITE TO IT, OR DO A CAT 1,
IT DOESN'T WORK, AND I HAVE TO PRESS BREAK (SHIFT + SPACE) TO STOP THE
COMMAND.
When you create a MDR file, it is created "in blank", so you must format the
medium before using it. To do it, just use:
FORMAT "m";1;"name"
changing 'name' with the name you want to give to the cartridge.
You can format a cartridge too if you want to erase a MDR file.
THE SYSTEM RETURNS THE MESSAGE DRIVE 'WRITE' PROTECTED. WHAT CAN I DO TO
UNPROTECT IT?
Just press F7 and change the 'Write protection' status with F3. Remember that
the status is stored with the cartridge, so if you exit the emulator and load
a MDR file again, it will have the same status you left it.
WHERE CAN I FIND INFO ABOUT HOW TO USE THE INTERFACE I AND THE MICRODRIVES?
In:
http://www.madhippy.com/8-bit/sinclair/zxif1micro.html
you can find the HTML version of the original manual of the Interface I and
Microdrive. There's ALL what you shoul need to know to work with it.
HOW TO INSTALL FBZX
If you want to install FBZX, you must compile your own version,
just typing as root:
make clean
make
make install
Be sure you have the SDL, libasound2 and libpulse libraries (both runtime and
headers).
HOW TO RUN FBZX
Just type
fbzx
If you don't want sound (or you haven't a sound card), you can run it with
fbzx -nosound
To know all the other FBZX options, just type
fbzx -h
or
fbzx --help
and enjoy!
CC = gcc -O2 -Wall -Wno-pointer-sign `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CCo = gcc `pkg-config --libs sdl libpulse-simple alsa`
fbzx: computer.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o emulator.o cargador.o characters.o menus.o sound.o tape.o spk_ay.o microdrive.o
$(CCo) -o fbzx computer.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o emulator.o cargador.o characters.o menus.o sound.o tape.o spk_ay.o microdrive.o
clean:
rm fbzx *.o *~
install:
rm -f /usr/bin/fbzx
cp fbzx /usr/local/bin
mkdir -p /usr/local/share/fbzx
mkdir -p /usr/local/share/spectrum-roms
mkdir -p /usr/share/applications
mkdir -p /usr/share/pixmaps
mkdir -p /usr/local/share/doc/fbzx
cp spectrum-roms/* /usr/local/share/spectrum-roms
cp keymap.bmp /usr/local/share/fbzx
cp fbzx.desktop /usr/share/applications
cp fbzx.svg /usr/share/pixmaps
cp AMSTRAD CAPABILITIES COPYING FAQ README README.TZX VERSIONS /usr/local/share/doc/fbzx/
uninstall:
rm -f /usr/local/bin/fbzx
rm -rf /usr/local/share/fbzx
rm -f /usr/share/applications/fbzx.desktop
rm -f /usr/share/pixmaps/fbzx.svg
rm -rf /usr/local/share/doc/fbzx
rm -rf /usr/local/share/spectrum-roms
spk_ay.o: spk_ay.c spk_ay.h emulator.h sound.h computer.h z80free/Z80free.h
$(CC) -c -o spk_ay.o spk_ay.c
microdrive.o: microdrive.c microdrive.h z80free/Z80free.h computer.h emulator.h z80free/Z80free.h
$(CC) -c -o microdrive.o microdrive.c
sound.o: sound.c sound.h computer.h emulator.h z80free/Z80free.h
$(CC) -c -o sound.o sound.c
emulator.o: emulator.c z80free/Z80free.h computer.h emulator.h characters.h menus.h cargador.h sound.h tape.h microdrive.h
$(CC) -c -o emulator.o emulator.c
computer.o: computer.c z80free/Z80free.h computer.h emulator.h characters.h menus.h cargador.h sound.h tape.h spk_ay.h microdrive.h
$(CC) -c -o computer.o computer.c
tape.o: tape.c z80free/Z80free.h computer.h emulator.h menus.h tape.h computer.h
$(CC) -c -o tape.o tape.c
cargador.o: cargador.c cargador.h computer.h emulator.h z80free/Z80free.h characters.h menus.h computer.h
$(CC) -c -o cargador.o cargador.c
characters.o: characters.c characters.h emulator.h computer.h
$(CC) -c -o characters.o characters.c
menus.o: menus.c menus.h characters.h computer.h emulator.h z80free/Z80free.h cargador.h tape.h
$(CC) -c -o menus.o menus.c
Z80free.o: z80free/Z80free.c z80free/Z80free.h
$(CC) -c -o Z80free.o z80free/Z80free.c
Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
$(CC) -c -o Z80free_codes.o z80free/Z80free_codes.c
Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
$(CC) -c -o Z80free_codesCB.o z80free/Z80free_codesCB.c
Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
$(CC) -c -o Z80free_codesED.o z80free/Z80free_codesED.c
Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
$(CC) -c -o Z80free_codesDD.o z80free/Z80free_codesDD.c
Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
$(CC) -c -o Z80free_codesFD.o z80free/Z80free_codesFD.c
Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
$(CC) -c -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
$(CC) -c -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
HOW TO PORT FBZX INTO OTHER O.S. AND ARQUITECTURES
FBZX uses the SDL library, so you must have it available in the
arquitecture/operating system where you want to port it. It's the only 'must
have'. Of course, is possible that you have to rewrite the Makefile, but that's
relatively easy (isn't it?).
The sound system is designed to be easily portable; currently it supports both
the OSS and ALSA arquitecture. In the file 'sound.c' are defined the three
functions needed to support it:
sound_init: initializates the sound system with the desired sound format,
speed, and so on, and fills the 'ordenador' struct with the parameters
needed to sincronize the emulation.
sound_play: plays the current sound buffer, and initializates
'ordenador.current_buffer' to the new buffer to be filled. It must not
return until the buffer has been played (this allows the sincronization).
sound_close: closes the sound device and frees all memory used.
That's all. Start to compile :)
FBZX
A ZX Spectrum emulator for FrameBuffer
DISCLAIMER
FBZX is distributed under the GPL license, version three or later, which means
that is distributed "as is", without warraty of any kind. To know more details,
read the file COPYING.
The old exception for the Z80 emulator has been removed because now FBZX uses
Z80FREE, a brand new, fully GPLv3, Z80 emulator. So finally FBZX is 100% free
software.
Amstrad have kindly given their permission for the redistribution of their
<