Commit d0c9ec15 authored by Sergio Costas's avatar Sergio Costas

Contention now works better

parent 367a6623
......@@ -187,8 +187,8 @@ void Z80free_Wr (word Addr, byte Value) {
ordenador->do_contention();
}
ordenador->write_memory(Addr,Value);
ordenador->emulate(1);
ordenador->contended_cicles += 1;
ordenador->emulate(CONTENTION_WR);
ordenador->contended_cicles += CONTENTION_WR;
}
void computer::write_memory (uint16_t Addr, uint8_t Value) {
......@@ -231,8 +231,8 @@ byte Z80free_Rd (word Addr) {
if ((Addr & 0xC000) == 0x4000) {
ordenador->do_contention();
}
ordenador->emulate(1);
ordenador->contended_cicles += 1;
ordenador->emulate(CONTENTION_RD);
ordenador->contended_cicles += CONTENTION_RD;
return (ordenador->read_memory(Addr));
}
}
......@@ -267,6 +267,8 @@ void Z80free_Out (word Port, byte Value) {
// Microdrive access
register word maskport;
ordenador->emulate(CONTENTION_OUT);
ordenador->contended_cicles += CONTENTION_OUT;
if (((Port&0x0001)==0)||((Port>=0x4000)&&(Port<0x8000))) {
if (ordenador->current_mode != MODE_P3) {
......@@ -337,6 +339,8 @@ byte Z80free_In (word Port) {
static unsigned int temporal_io;
byte pines;
ordenador->emulate(CONTENTION_IN);
ordenador->contended_cicles += CONTENTION_IN;
if (((Port&0x0001)==0)||((Port>=0x4000)&&(Port<0x8000))) {
if (ordenador->current_mode != MODE_P3) {
ordenador->do_contention();
......
......@@ -31,6 +31,11 @@
// #define MUT
#define CONTENTION_RD 3
#define CONTENTION_WR 3
#define CONTENTION_IN 3
#define CONTENTION_OUT 4
extern char salir;
extern class computer *ordenador;
......
......@@ -1074,7 +1074,7 @@ public:
return this->next->save_block(file);
}
}
bool read_block(ifstream *file) {
bool load_block(ifstream *file) {
uint16_t length;
// read pilot pulse duration
......@@ -1424,7 +1424,6 @@ bool Tape::load_tzx(string filename) {
break;
case 0x20: // Pause block
block = new PauseBlock(this);
printf("Pause block\n");
break;
case 0x21: // group start
block = new GroupStartBlock();
......@@ -1445,7 +1444,7 @@ bool Tape::load_tzx(string filename) {
block = new InfoBlock();
break;
default:
printf("Block unknown: %X\n",block_type);
printf("Unknown block number: %X\n",block_type);
file->close();
delete (file);
return true;
......
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