mirror of
https://github.com/TomHarte/CLK.git
synced 2024-08-16 16:28:59 +00:00
Merge pull request #136 from TomHarte/ZX8081Options
Finally adjusts ZX80/81 tape loading so that the fast loading hack is optional as per the GUI
This commit is contained in:
commit
f2a6bcf2a8
@ -21,7 +21,8 @@ Machine::Machine() :
|
|||||||
vsync_(false),
|
vsync_(false),
|
||||||
hsync_(false),
|
hsync_(false),
|
||||||
nmi_is_enabled_(false),
|
nmi_is_enabled_(false),
|
||||||
tape_player_(ZX8081ClockRate) {
|
tape_player_(ZX8081ClockRate),
|
||||||
|
use_fast_tape_hack_(false) {
|
||||||
set_clock_rate(ZX8081ClockRate);
|
set_clock_rate(ZX8081ClockRate);
|
||||||
tape_player_.set_motor_control(true);
|
tape_player_.set_motor_control(true);
|
||||||
clear_all_keys();
|
clear_all_keys();
|
||||||
@ -118,7 +119,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
|||||||
case CPU::Z80::PartialMachineCycle::ReadOpcodeStart:
|
case CPU::Z80::PartialMachineCycle::ReadOpcodeStart:
|
||||||
case CPU::Z80::PartialMachineCycle::ReadOpcodeWait:
|
case CPU::Z80::PartialMachineCycle::ReadOpcodeWait:
|
||||||
// Check for use of the fast tape hack.
|
// Check for use of the fast tape hack.
|
||||||
/* if(address == tape_trap_address_) { // TODO: && fast_tape_hack_enabled_
|
if(use_fast_tape_hack_ && address == tape_trap_address_) {
|
||||||
int next_byte = parser_.get_next_byte(tape_player_.get_tape());
|
int next_byte = parser_.get_next_byte(tape_player_.get_tape());
|
||||||
if(next_byte != -1) {
|
if(next_byte != -1) {
|
||||||
uint16_t hl = get_value_of_register(CPU::Z80::Register::HL);
|
uint16_t hl = get_value_of_register(CPU::Z80::Register::HL);
|
||||||
@ -127,7 +128,7 @@ int Machine::perform_machine_cycle(const CPU::Z80::PartialMachineCycle &cycle) {
|
|||||||
set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1);
|
set_value_of_register(CPU::Z80::Register::ProgramCounter, tape_return_address_ - 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
is_opcode_read = true;
|
is_opcode_read = true;
|
||||||
|
|
||||||
case CPU::Z80::PartialMachineCycle::Read:
|
case CPU::Z80::PartialMachineCycle::Read:
|
||||||
|
@ -62,6 +62,8 @@ class Machine:
|
|||||||
void set_key_state(uint16_t key, bool isPressed);
|
void set_key_state(uint16_t key, bool isPressed);
|
||||||
void clear_all_keys();
|
void clear_all_keys();
|
||||||
|
|
||||||
|
inline void set_use_fast_tape_hack(bool activate) { use_fast_tape_hack_ = activate; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<Video> video_;
|
std::shared_ptr<Video> video_;
|
||||||
std::vector<uint8_t> zx81_rom_, zx80_rom_;
|
std::vector<uint8_t> zx81_rom_, zx80_rom_;
|
||||||
@ -90,6 +92,8 @@ class Machine:
|
|||||||
bool nmi_is_enabled_;
|
bool nmi_is_enabled_;
|
||||||
int vsync_start_cycle_, vsync_end_cycle_;
|
int vsync_start_cycle_, vsync_end_cycle_;
|
||||||
uint8_t latched_video_byte_;
|
uint8_t latched_video_byte_;
|
||||||
|
|
||||||
|
bool use_fast_tape_hack_;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -101,4 +101,13 @@
|
|||||||
|
|
||||||
- (NSString *)userDefaultsPrefix { return @"zx8081"; }
|
- (NSString *)userDefaultsPrefix { return @"zx8081"; }
|
||||||
|
|
||||||
|
#pragma mark - Options
|
||||||
|
|
||||||
|
- (void)setUseFastLoadingHack:(BOOL)useFastLoadingHack {
|
||||||
|
@synchronized(self) {
|
||||||
|
_useFastLoadingHack = useFastLoadingHack;
|
||||||
|
_zx8081.set_use_fast_tape_hack(useFastLoadingHack ? true : false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user