- [NEW] Càrrega "instantànea" de TAPs

This commit is contained in:
2025-07-29 12:51:40 +02:00
parent 2a0febc6b7
commit 2775da3d53
4 changed files with 33 additions and 4 deletions

View File

@@ -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];