Commit 3e0a4ae4 authored by Sergio Costas's avatar Sergio Costas

Moved code to SRC folder

First try to use C++

First incomplete version of the TAPE class
parent ad7b4b56
......@@ -4,31 +4,27 @@ else
PREFIX2=/usr/local
endif
CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -O2 -Wno-pointer-sign -Wall -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `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
$(CC) -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 $(LDFLAGS)
all:
cd src && $(MAKE)
clean:
rm -f fbzx *.o *~
rm -f src/fbzx src/*.o src/*~
install:
rm -f $(PREFIX2)/bin/fbzx
cp fbzx $(PREFIX2)/bin
cp src/fbzx $(PREFIX2)/bin
mkdir -p $(PREFIX2)/share/fbzx
mkdir -p $(PREFIX2)/share/spectrum-roms
mkdir -p $(PREFIX2)/share/applications
mkdir -p $(PREFIX2)/share/pixmaps
mkdir -p $(PREFIX2)/share/doc/fbzx
mkdir -p $(PREFIX2)/share/appdata
cp spectrum-roms/* $(PREFIX2)/share/spectrum-roms
cp keymap.bmp $(PREFIX2)/share/fbzx
cp fbzx.desktop $(PREFIX2)/share/applications
cp fbzx.svg $(PREFIX2)/share/pixmaps
cp data/spectrum-roms/* $(PREFIX2)/share/spectrum-roms
cp data/keymap.bmp $(PREFIX2)/share/fbzx
cp data/fbzx.desktop $(PREFIX2)/share/applications
cp data/fbzx.svg $(PREFIX2)/share/pixmaps
cp AMSTRAD CAPABILITIES COPYING FAQ README README.TZX VERSIONS $(PREFIX2)/share/doc/fbzx/
cp fbzx.appdata.xml $(PREFIX2)/share/appdata/
cp data/fbzx.appdata.xml $(PREFIX2)/share/appdata/
chmod 644 $(PREFIX2)/share/fbzx/*
chmod 644 $(PREFIX2)/share/spectrum-roms/*
chmod 644 $(PREFIX2)/share/doc/fbzx/*
......@@ -41,55 +37,3 @@ uninstall:
rm -rf $(PREFIX2)/share/doc/fbzx
rm -rf $(PREFIX2)/share/spectrum-roms
rm -f $(PREFIX2)/share/appdata/fbzx.appdata.xml
\ No newline at end of file
spk_ay.o: spk_ay.c spk_ay.h emulator.h sound.h computer.h z80free/Z80free.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o microdrive.o microdrive.c
sound.o: sound.c sound.h computer.h emulator.h z80free/Z80free.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -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) $(CFLAGS) -c -o computer.o computer.c
tape.o: tape.c z80free/Z80free.h computer.h emulator.h menus.h tape.h computer.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o cargador.o cargador.c
characters.o: characters.c characters.h emulator.h computer.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o menus.o menus.c
Z80free.o: z80free/Z80free.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free.o z80free/Z80free.c
Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codes.o z80free/Z80free_codes.c
Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesCB.o z80free/Z80free_codesCB.c
Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesED.o z80free/Z80free_codesED.c
Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesDD.o z80free/Z80free_codesDD.c
Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesFD.o z80free/Z80free_codesFD.c
Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
CC=g++
CPP=g++
CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -O2 -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -O2 -Wall -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl libpulse-simple alsa`
fbzx: tapep.o 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
$(CC) -o fbzx tapep.o 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 $(LDFLAGS)
spk_ay.o: spk_ay.c spk_ay.h emulator.h sound.h computer.h z80free/Z80free.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o microdrive.o microdrive.c
sound.o: sound.c sound.h computer.h emulator.h z80free/Z80free.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -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) $(CFLAGS) -c -o computer.o computer.c
tapep.o: tape.cpp z80free/Z80free.h computer.h emulator.h menus.h tape.hpp computer.h
$(CPP) $(CPPFLAGS) -c -o tapep.o tape.cpp
tape.o: tape.c z80free/Z80free.h computer.h emulator.h menus.h tape.h computer.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o cargador.o cargador.c
characters.o: characters.c characters.h emulator.h computer.h
$(CC) $(CFLAGS) -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) $(CFLAGS) -c -o menus.o menus.c
Z80free.o: z80free/Z80free.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free.o z80free/Z80free.c
Z80free_codes.o: z80free/Z80free_codes.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codes.o z80free/Z80free_codes.c
Z80free_codesCB.o: z80free/Z80free_codesCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesCB.o z80free/Z80free_codesCB.c
Z80free_codesED.o: z80free/Z80free_codesED.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesED.o z80free/Z80free_codesED.c
Z80free_codesDD.o: z80free/Z80free_codesDD.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesDD.o z80free/Z80free_codesDD.c
Z80free_codesFD.o: z80free/Z80free_codesFD.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesFD.o z80free/Z80free_codesFD.c
Z80free_codesDDCB.o: z80free/Z80free_codesDDCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesDDCB.o z80free/Z80free_codesDDCB.c
Z80free_codesFDCB.o: z80free/Z80free_codesFDCB.c z80free/Z80free.h
$(CC) $(CFLAGS) -c -o Z80free_codesFDCB.o z80free/Z80free_codesFDCB.c
......@@ -37,10 +37,10 @@ void printchar(unsigned char *memo, unsigned char carac, int x, int y, unsigned
lugar2=lugar;
for (bucle2=0;bucle2 < 16;bucle2++) {
if ((characters[carac-32][pos]) & bit_rot)
paint_one_pixel (colors + (int) (color), lugar2);
paint_one_pixel ((unsigned char*)(colors + (int) (color)), lugar2);
//*((unsigned int *)lugar2)=*(colors+(int)(color-16));
else if ((ordenador.text_mini==0)||((bucle1%2==0)&&(bucle2%2==0)))
paint_one_pixel (colors + (int) (back), lugar2);
paint_one_pixel ((unsigned char*)(colors + (int) (back)), lugar2);
//*((unsigned int *)lugar2)=*(colors+(int)(back-16));
if ((ordenador.text_mini==0)||(bucle2%2==1)) {
lugar2+=ordenador.bpp;
......@@ -64,7 +64,7 @@ void print_string(unsigned char *memo, char *cadena, int x, int y, unsigned char
int length, ncarac, bucle, xx;
int xxx, yyy;
int w,h;
unsigned char *str2;
char *str2;
if (ordenador.text_mini==1) {
if (x!=-1)
......
......@@ -28,12 +28,13 @@
#include <sys/types.h>
#include <signal.h>
#include <sys/wait.h>
#include "tape.h"
#include "microdrive.h"
#include "tape.h"
#include "spk_ay.h"
/* Returns the bus value when reading a port without a periferial */
inline byte bus_empty () {
byte bus_empty () {
if (ordenador.mode128k != 3)
return (ordenador.bus_value);
......@@ -44,7 +45,7 @@ inline byte bus_empty () {
/* calls all the routines that emulates the computer, runing them for 'tstados'
tstates */
inline void emulate (int tstados) {
void emulate (int tstados) {
if((procesador.I>=0x40)&&(procesador.I<=0x7F)) {
ordenador.screen_snow=1;
......@@ -67,6 +68,7 @@ void computer_init () {
int bucle;
ordenador.page48k = 0;
ordenador.bus_counter = 0;
ordenador.port254 = 0;
ordenador.issue = 3;
......@@ -416,6 +418,7 @@ void register_screen (SDL_Surface * pantalla) {
void set_memory_pointers () {
static unsigned int rom, ram;
static char last_st=-1;
// assign the offset for video page
......@@ -428,6 +431,7 @@ void set_memory_pointers () {
if ((ordenador.mode128k == 3)) {
if (ordenador.mport2 & 0x01) { // +2A/+3 special mode
ordenador.page48k = 0; // no 48K ROM paged in
ram = (unsigned int) (ordenador.mport1 & 0x06); // bits 1&2
switch (ram) {
case 0:
......@@ -435,25 +439,43 @@ void set_memory_pointers () {
ordenador.block1 = ordenador.memoria + 65536;
ordenador.block2 = ordenador.memoria + 65536;
ordenador.block3 = ordenador.memoria + 65536;
if (last_st != 0) {
printf("FullRAM 0\n");
last_st = 0;
}
break;
case 2:
ordenador.block0 = ordenador.memoria + 131072;
ordenador.block1 = ordenador.memoria + 131072;
ordenador.block2 = ordenador.memoria + 131072;
ordenador.block3 = ordenador.memoria + 131072;
if (last_st != 1) {
printf("FullRAM 1\n");
last_st = 1;
}
break;
case 4:
ordenador.block0 = ordenador.memoria + 131072;
ordenador.block1 = ordenador.memoria + 131072;
ordenador.block2 = ordenador.memoria + 131072;
ordenador.block3 = ordenador.memoria + 65536;
if (last_st != 2) {
printf("FullRAM 2\n");
last_st = 2;
}
break;
case 6:
ordenador.block0 = ordenador.memoria + 131072;
ordenador.block1 = ordenador.memoria + 163840;
ordenador.block2 = ordenador.memoria + 131072;
ordenador.block3 = ordenador.memoria + 65536;
if (last_st != 3) {
printf("FullRAM 3\n");
last_st = 3;
}
break;
default:
printf("FullRAM desconocido\n");
}
return;
} else { // ROMs for +2A/+3 normal mode
......@@ -464,12 +486,16 @@ void set_memory_pointers () {
rom += 2;
// assign the first block pointer to the right block bank
ordenador.block0 = ordenador.memoria + (16384 * rom);
ordenador.page48k = (rom==3) ? 1 : 0; // 48K ROM is in ROM page 3
}
} else { // ROMs for 128K/+2 mode
if (ordenador.mport1 & 0x10)
if (ordenador.mport1 & 0x10) {
ordenador.block0 = ordenador.memoria + 16384;
else
ordenador.page48k = 1;
} else {
ordenador.block0 = ordenador.memoria;
ordenador.page48k = 0;
}
}
// RAMs for 128K/+2 mode, and +2A/+3 in normal mode
......@@ -479,12 +505,16 @@ void set_memory_pointers () {
ram = 1 + ((unsigned int) (ordenador.mport1 & 0x07)); // RAM page for block3 plus 1
ordenador.block3 = ordenador.memoria + (16384 * ram); // page n minus 49152
if (last_st != ram+3) {
printf("Pagina superior %d\n",ram-1);
last_st = ram+3;
}
}
/* Paints the spectrum screen during the TSTADOS tstates that the Z80 used
to execute last instruction */
inline void show_screen (int tstados) {
void show_screen (int tstados) {
static unsigned char temporal, ink, paper, fflash, tmp2;
......@@ -613,9 +643,10 @@ inline void show_screen (int tstados) {
/* PAINT_PIXELS paints one byte with INK color for 1 bits and PAPER color
for 0 bits, and increment acordingly the pointer PIXEL */
inline void paint_pixels (unsigned char octet,unsigned char ink, unsigned char paper) {
void paint_pixels (unsigned char octet,unsigned char ink, unsigned char paper) {
static int bucle,valor,*p;
static int bucle,valor;
static unsigned int *p;
static unsigned char mask;
if ((ordenador.currpix < 16) || (ordenador.currpix >= 336)
......@@ -642,7 +673,7 @@ inline void paint_pixels (unsigned char octet,unsigned char ink, unsigned char p
}
}
inline void paint_one_pixel(unsigned char *colour,unsigned char *address) {
void paint_one_pixel(unsigned char *colour,unsigned char *address) {
#if __BYTE_ORDER == __LITTLE_ENDIAN
switch(ordenador.bpp) {
......@@ -679,7 +710,7 @@ inline void paint_one_pixel(unsigned char *colour,unsigned char *address) {
// Read the keyboard and stores the flags
inline void read_keyboard (SDL_Event *pevento2) {
void read_keyboard (SDL_Event *pevento2) {
unsigned int temporal_io;
SDL_Event evento,evento2,*pevento;
......
......@@ -22,6 +22,8 @@
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include "z80free/Z80free.h"
#include "tape.hpp"
// #define MUT
......@@ -144,7 +146,7 @@ struct computer {
unsigned int tape_pause_at_end;
FILE *tap_file;
unsigned char tape_fast_load; // 0 normal load; 1 fast load
unsigned char current_tap[2049];
char current_tap[2049];
unsigned char tape_current_bit;
unsigned int tape_block_level;
......@@ -160,7 +162,7 @@ struct computer {
// Microdrive global variables
FILE *mdr_file; // Current microdrive file
unsigned char mdr_current_mdr[2049]; // current path and name for microdrive file
char mdr_current_mdr[2049]; // current path and name for microdrive file
unsigned char mdr_active; // 0: not installed; 1: installed
unsigned char mdr_paged; // 0: not pagined; 1: pagined
unsigned int mdr_tapehead; // current position in the tape
......@@ -175,7 +177,7 @@ struct computer {
// OSD global variables
unsigned char osd_text[200];
char osd_text[200];
unsigned int osd_time;
// pagination global variables
......@@ -183,6 +185,7 @@ struct computer {
unsigned char mport1,mport2; // ports for memory management (128K and +3)
unsigned int video_offset; // 0 for page 5, and 32768 for page 7
unsigned char *block0,*block1,*block2,*block3; // pointers for memory access (one for each 16K block).
unsigned char page48k; // 1 if the 48K ROM page is currently paged into
// public
......@@ -193,22 +196,23 @@ struct computer {
unsigned char other_ret; // 0=no change; 1=memory returns RET (201)
unsigned char turbo;
Tape OOTape;
};
void computer_init();
void register_screen(SDL_Surface *);
inline void show_screen(int);
inline void paint_pixels(unsigned char, unsigned char, unsigned char);
inline void read_keyboard();
void show_screen(int);
void paint_pixels(unsigned char, unsigned char, unsigned char);
void read_keyboard(SDL_Event *pevento2);
void fill_audio(void *udata,Uint8 *,int);
void set_volume(unsigned char);
inline void play_sound(unsigned int);
inline void emulate(int);
void play_sound(unsigned int);
void emulate(int);
void ResetComputer();
inline byte bus_empty();
byte bus_empty();
void set_memory_pointers();
inline void play_ay();
inline void paint_one_pixel(unsigned char *colour,unsigned char *address);
void paint_one_pixel(unsigned char *colour,unsigned char *address);
void computer_set_palete();
void set_palete_entry(unsigned char entry, byte Value);
......
......@@ -32,8 +32,8 @@
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>
#include "sound.h"
#include "tape.h"
#include "microdrive.h"
#include "tape.h"
char debug_var=1;
......@@ -255,16 +255,12 @@ void init_screen(int resx,int resy,int depth,int fullscreen,int dblbuffer,int hw
// sound initialization
if (sound_type==SOUND_AUTOMATIC) {
ret2=sound_init(1); // check all sound systems
} else {
ret2=sound_init(0); // try with the one specified in command line
}
ret2=sound_init(); // check all sound systems
if(ret2==0) {
sound_aborted=0;
} else { // if fails, run without sound
sound_type=SOUND_NO;
sound_init(0);
sound_init();
sound_aborted=1;
}
printf("Init sound\n");
......@@ -619,7 +615,7 @@ int main(int argc,char *argv[]) {
SDL_WM_SetCaption("FBZX","");
ordenador.interr=0;
ordenador.screenbuffer=ordenador.screen->pixels;
ordenador.screenbuffer=(unsigned char *)ordenador.screen->pixels;
ordenador.screen_width=ordenador.screen->w;
// assign initial values for PATH variables
......@@ -703,7 +699,7 @@ int main(int argc,char *argv[]) {
/* if PC is 0x0556, a call to LD_BYTES has been made, so if
FAST_LOAD is 1, we must load the block in memory and return */
if((!ordenador.mdr_paged)&&(PC==0x0556) && (ordenador.tape_fast_load==1)&&(ordenador.tape_file_type==TAP_TAP)) {
if((!ordenador.mdr_paged) && (PC==0x0556) && (ordenador.tape_fast_load==1) && (ordenador.tape_file_type==TAP_TAP) && (ordenador.page48k == 1)) {
if(ordenador.tap_file!=NULL)
fastload_block(ordenador.tap_file);
else {
......
......@@ -30,9 +30,10 @@
#include <string.h>
#include "characters.h"
#include "menus.h"
#include "tape.h"
#include <SDL/SDL.h>
#include "tape.h"
// shows the settings menu
......@@ -50,7 +51,7 @@ void help_menu() {
unsigned char *fbuffer,fin;
int ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
clean_screen();
......@@ -154,10 +155,10 @@ int launch_menu(unsigned int key_pressed) {
void settings_menu() {
unsigned char *fbuffer,fin;
unsigned char texto[41];
char texto[41];
int ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
fin=1;
......@@ -375,10 +376,11 @@ void settings_menu() {
void do_poke() {
unsigned char *videomem,string[80];
unsigned char *videomem;
char string[80];
int ancho,retorno,address,old_value,new_value;
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -467,7 +469,7 @@ void tools_menu() {
unsigned char *fbuffer,fin;
int ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
fin=1;
do {
......@@ -517,7 +519,7 @@ void snapshots_menu() {
unsigned char *fbuffer,fin;
int ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
clean_screen();
......@@ -579,7 +581,7 @@ void taps_menu() {
unsigned char *fbuffer,fin;
int ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
fin=1;
do {
......@@ -666,11 +668,12 @@ void taps_menu() {
void select_tapfile() {
unsigned char *videomem,*filename;
unsigned char *videomem;
char *filename;
int ancho,retorno,retval;
unsigned char char_id[11];
char char_id[11];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -734,9 +737,9 @@ void create_tapfile() {
unsigned char *videomem;
int ancho,retorno;
unsigned char nombre2[1024];
char nombre2[1024];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -798,7 +801,7 @@ void microdrive_menu() {
unsigned char *fbuffer,fin;
int retval,ancho=screen->w;
fbuffer=screen->pixels;
fbuffer=(unsigned char *)screen->pixels;
fin=1;
do {
......@@ -865,11 +868,12 @@ void microdrive_menu() {
void select_mdrfile() {
unsigned char *videomem,*filename;
unsigned char *videomem;
char *filename;
int ancho,retorno,retval;
// unsigned char char_id[11];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -918,9 +922,9 @@ void create_mdrfile() {
unsigned char *videomem;
int ancho,retorno,bucle,retval;
unsigned char nombre2[1024];
char nombre2[1024];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -982,10 +986,10 @@ void create_scrfile() {
unsigned char *videomem;
int ancho,retorno,retval;
unsigned char nombre2[1024];
char nombre2[1024];
FILE *fichero;
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -1044,12 +1048,12 @@ void create_scrfile() {
int ask_filename(char *nombre_final,int y_coord,char *extension) {
int longitud,retorno;
unsigned char nombre[37],nombre2[38];
char nombre[37],nombre2[38];
unsigned char *videomem;
int ancho;
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
nombre[0]=127;
......@@ -1352,11 +1356,11 @@ int ask_filename(char *nombre_final,int y_coord,char *extension) {
int ask_value(int *final_value,int y_coord,int max_value) {
unsigned char nombre2[50];
char nombre2[50];
unsigned char *videomem;
int ancho,value,tmp,retorno;
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
retorno=0;
......@@ -1451,9 +1455,9 @@ void save_z80file() {
unsigned char *videomem;
int ancho,retorno;
unsigned char nombre2[1024];
char nombre2[1024];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -1493,10 +1497,11 @@ void save_z80file() {
void load_z80file() {
unsigned char *videomem,*filename;
unsigned char *videomem;
char *filename;
int ancho,retorno;
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -1536,12 +1541,13 @@ void load_z80file() {
void load_scrfile() {
unsigned char *videomem,*filename,value;
unsigned char *videomem,value;
char *filename;
int ancho,retorno,loop;
FILE *fichero;
unsigned char paleta_tmp[64];
videomem=screen->pixels;
videomem=(unsigned char *)screen->pixels;
ancho=screen->w;
clean_screen();
......@@ -1605,14 +1611,14 @@ struct fichero *read_directory(char *cpath,enum LOAD_FILE_TYPES kind) {
struct dirent *entry;
DIR *directory;
struct stat estado;
unsigned char path[2049],fichero[2049],extension[5],found;
char path[2049],fichero[2049],extension[5],found;
int bucle,length;
strcpy(path,cpath);
if('/'!=path[strlen(path)-1])
strcat(path,"/"); // add the final / to the path
listhead=malloc(sizeof(struct fichero));
listhead=(struct fichero *)malloc(sizeof(struct fichero));
strcpy(listhead->nombre,"..");
listhead->tipo=2;
listhead->next=NULL;
......@@ -1657,7 +1663,7 @@ struct fichero *read_directory(char *cpath,enum LOAD_FILE_TYPES kind) {
} else
found=0;
if(((found)||(S_ISDIR(estado.st_mode)))&&('.'!=entry->d_name[0])) { // is a directory. We must add it
listend->next=malloc(sizeof(struct fichero));
listend->next=(struct fichero *)malloc(sizeof(struct fichero));