Commit e0b33a55 authored by Sergio Costas's avatar Sergio Costas

Shows screen but still doesn't work fine

parent 119a2ce3
CC=g++ -c -O2
CPP=g++ -c -O2
LN=g++ -O2
CC=g++ -c -O2 -g
CPP=g++ -c -O2 -g
LN=g++ -O2 -g
CFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
CPPFLAGS += `pkg-config --cflags sdl libpulse-simple alsa` -D D_SOUND_PULSE -D D_SOUND_ALSA -D D_SOUND_OSS
LDFLAGS += `pkg-config --libs sdl libpulse-simple alsa`
fbzx: cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o mouse.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o
fbzx: cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o mouse.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o
$(LN) -o fbzx cargador.o cmdline.o computer.o emulator.o keyboard.o llscreen.o llsound.o menus.o microdrive.o mouse.o osd.o screen.o signals.o spk_ay.o tape.o Z80free.o Z80free_codes.o Z80free_codesCB.o Z80free_codesED.o Z80free_codesDD.o Z80free_codesFD.o Z80free_codesDDCB.o Z80free_codesFDCB.o $(LDFLAGS)
Z80free.o: z80free/Z80free.c z80free/Z80free.h
......@@ -78,4 +78,3 @@ spk_ay.o: spk_ay.cpp spk_ay.hh llsound.hh computer.hh screen.hh signals.hh llscr
tape.o: tape.cpp z80free/Z80free.h tape.hh signals.hh emulator.hh screen.hh osd.hh computer.hh llscreen.hh
$(CPP) $(CPPFLAGS) -o tape.o tape.cpp
......@@ -130,7 +130,7 @@ void computer::emulate (int tstados) {
void computer::do_contention() {
if (!this->contended_zone) {
/*if (!this->contended_zone) {
return;
}
......@@ -142,9 +142,12 @@ void computer::do_contention() {
if (ccicles>5) {
return;
}
}*/
this->emulate(6-ccicles);
while(this->contended_zone) {
this->emulate(1);
}
//this->emulate(6-ccicles);
}
// resets the computer and loads the right ROMs
......@@ -351,7 +354,7 @@ byte Z80free_In (word Port) {
byte pines;
extra_contention();
if (((Port&0x0001)==0)||((Port>=0x4000)&&(Port<0x8000))) {
if (((Port&0x0001)==0) || ((Port>=0x4000)&&(Port<0x8000))) {
if (ordenador->current_mode != MODE_P3) {
ordenador->do_contention();
}
......@@ -423,13 +426,15 @@ byte Z80free_In (word Port) {
}
}
if ((temporal_io == 0xFFFD)&&(spk_ay->ay_emul))
if ((temporal_io == 0xFFFD)&&(spk_ay->ay_emul)) {
return (spk_ay->get_value());
}
// Microdrive access
if(((Port & 0x0018) != 0x0018) && (microdrive->mdr_active))
if(((Port & 0x0018) != 0x0018) && (microdrive->mdr_active)) {
return(microdrive->in(Port));
}
pines=ordenador->bus_empty();
......
......@@ -44,7 +44,6 @@ char salir;
char path_snaps[2049];
char path_taps[2049];
char path_mdrs[2049];
unsigned int jump_frames, curr_frames;
string filenames[5];
string load_a_rom(string *filenames) {
......@@ -438,9 +437,6 @@ int main(int argc,char *argv[]) {
gamefile = "";
jump_frames = parse.jump;
curr_frames = 0;
printf("Computer init\n");
printf("Modo: %d\n",ordenador->current_mode);
......
......@@ -34,7 +34,6 @@ extern Z80FREE procesador;
extern char path_snaps[2049];
extern char path_taps[2049];
extern char path_mdrs[2049];
extern unsigned int jump_frames,curr_frames;
void load_rom(char);
void load_main_game(const char *nombre);
......
This diff is collapsed.
......@@ -21,6 +21,7 @@ class Screen {
unsigned int translate[6144],translate2[6144];
unsigned int *p_translt,*p_translt2;
unsigned char *pixel; // current address
unsigned char *max_pixel; // max address
unsigned char *base_pixel;
char flash;
int currline,currpix;
......@@ -29,6 +30,9 @@ class Screen {
int next_line; // cuantity to add when we reach the end of line to go to next line
int next_scanline; // cuantity to add to pass to the next scanline
int first_line; // first line to start to paint
int last_line;
int first_column;
int last_column;
int next_pixel; // next pixel
int jump_pixel;
......@@ -38,15 +42,18 @@ class Screen {
int tstados_counter2; // counts tstates for empty bus
int int_counter; // counts the interrupt duration
int pixancho,pixalto; // maximum pixel value for width and height
int pixborde_top; // number of scanlines in border top
int tstates_bordertop;
int tstates_borderbottom;
int tstate_contention;
int tstate_contention2;
int tstates_screen;
bool screen_snow; // 0-> no emulate snow; 1-> emulate snow
uint8_t ulaplus_reg; // contains the last selected register in the ULAPlus
void paint_pixels (uint8_t octet,uint8_t ink, uint8_t paper);
uint8_t bus_value;
uint8_t bus_value2;
uint8_t bus_value_old;
uint8_t bus_value2_old;
uint8_t user_ink;
uint8_t user_paper;
uint8_t user_pixels;
......
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