- Codi mega ampastrat, treballant en el jittering del só, en que s'update un poc la pantalla en berserk mode, i està petant el zx_tape i no se com ho fà, pero me gonne a casa...
This commit is contained in:
20
zx_tape.cpp
20
zx_tape.cpp
@@ -1,5 +1,6 @@
|
||||
#include "zx_tape.h"
|
||||
#include "zx_ula.h"
|
||||
#include "zx_screen.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -114,6 +115,7 @@ namespace zx_tape
|
||||
current_pulse = 0;
|
||||
pulse_level = 1;
|
||||
current_section = PULSE_SYNC1;
|
||||
printf("going to pulse_sync1...\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,6 +127,7 @@ namespace zx_tape
|
||||
pulse_pos -= PULSE_LEN_SYNC1;
|
||||
pulse_level = 0;
|
||||
current_section = PULSE_SYNC2;
|
||||
printf("going to pulse_sync2...\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +138,7 @@ namespace zx_tape
|
||||
pulse_pos -= PULSE_LEN_SYNC2;
|
||||
pulse_level = 1;
|
||||
current_section = PULSE_DATA;
|
||||
printf("going to pulse_data...\n");
|
||||
}
|
||||
}
|
||||
static int level[2] = {0, 0};
|
||||
@@ -161,6 +165,7 @@ namespace zx_tape
|
||||
{
|
||||
block_pos = 0;
|
||||
current_section = PULSE_SYNC3;
|
||||
printf("going to pulse_sync3...\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -195,6 +200,7 @@ namespace zx_tape
|
||||
pulse_pos -= PULSE_LEN_SYNC3;
|
||||
pulse_level = 0;
|
||||
current_section = PULSE_WAIT;
|
||||
printf("going to pulse_wait...\n");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -208,11 +214,18 @@ namespace zx_tape
|
||||
current_section = PULSE_PILOT;
|
||||
pulse_level = 1;
|
||||
current_block++;
|
||||
|
||||
if (current_block>=blocks.size())
|
||||
{
|
||||
printf("end\n");
|
||||
stop();
|
||||
rewind();
|
||||
}
|
||||
else
|
||||
{
|
||||
zxscreen::fullrefresh();
|
||||
printf("going to pulse_pilot on block %i...\n", current_block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,4 +235,11 @@ namespace zx_tape
|
||||
void setberserk(const bool value) { berserk_mode = value; }
|
||||
const bool getberserk() { return berserk_mode; }
|
||||
const bool getplaying() { return playing; }
|
||||
|
||||
void report()
|
||||
{
|
||||
if (current_block >= blocks.size()) return;
|
||||
const int percent = (float(block_pos)/float(blocks[current_block].length))*100;
|
||||
printf("tape loading: %i%\n", percent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user