- [NEW] Càrrega "instantànea" de TAPs
This commit is contained in:
24
zx_tape.cpp
24
zx_tape.cpp
@@ -1,6 +1,7 @@
|
||||
#include "zx_tape.h"
|
||||
#include "zx_ula.h"
|
||||
#include "zx_screen.h"
|
||||
#include "zx_mem.h"
|
||||
#include "z80debug.h"
|
||||
#include "z80.h"
|
||||
#include <vector>
|
||||
@@ -36,7 +37,7 @@ namespace zx_tape
|
||||
|
||||
bool playing = false;
|
||||
bool loaded = false;
|
||||
bool options[ZXTAPE_NUM_OPTIONS] = { false, true };
|
||||
bool options[ZXTAPE_NUM_OPTIONS] = { true, true };
|
||||
|
||||
std::vector<block_t> blocks;
|
||||
uint8_t current_block = 0;
|
||||
@@ -244,6 +245,27 @@ namespace zx_tape
|
||||
printf("tape loading: %i%\n", percent);
|
||||
}
|
||||
|
||||
uint16_t fastLoad(const uint8_t block_type, const uint16_t address, const uint16_t length)
|
||||
{
|
||||
block_pos=0;
|
||||
current_bit=0;
|
||||
current_section = PULSE_PILOT;
|
||||
current_pulse = 0;
|
||||
pulse_pos = 0;
|
||||
pulse_level = 0;
|
||||
|
||||
if (blocks[current_block].data[0] != block_type ||
|
||||
blocks[current_block].length != length+2) {
|
||||
printf("ERROR: Tape data not consistent with expectation\n");
|
||||
z80debug::stop();
|
||||
}
|
||||
for (int i=0;i<length;++i) {
|
||||
mem::writeMem(address+i, blocks[current_block].data[i+1]);
|
||||
}
|
||||
current_block++;
|
||||
return address + length;
|
||||
}
|
||||
|
||||
const bool getOption(const int option)
|
||||
{
|
||||
return options[option];
|
||||
|
||||
Reference in New Issue
Block a user