Skip to content

Commit

Permalink
[#211]
Browse files Browse the repository at this point in the history
Floppy1581 in NextSystemCycle eingebunden.
  • Loading branch information
ThKattanek committed Aug 20, 2021
1 parent 24af60d commit 06ee829
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/c64_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ C64Class::C64Class(int *ret_error, int soundbuffer_size, VideoCrtClass *video_cr
floppy1581[i]->SetEnableFloppy(false);
}

// Testweise
floppy1581[0]->SetEnableFloppy(true);

/// Init Vars ///
c64_frequency = C64Takt;
c64_speed = 100;
Expand Down Expand Up @@ -3739,8 +3742,13 @@ void C64Class::NextSystemCycle()
floppy_iec_wire = 0;
for(int i=0; i<MAX_FLOPPY_NUM; i++)
{
// 1541
cpu_states[i+1] = floppy1541[i]->OneCycle();
floppy_iec_wire |= ~floppy1541[i]->FloppyIECLocal;

// 1581
cpu_states[i+5] = floppy1581[i]->OneCycle();
floppy_iec_wire |= ~floppy1581[i]->FloppyIECLocal;
}
floppy_iec_wire = ~floppy_iec_wire;

Expand Down
2 changes: 1 addition & 1 deletion src/c64_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class C64Class
bool one_cycle;
bool one_opcode;
int one_opcode_source;
bool cpu_states[5]; // true = Feetch / false = no Feetch ::: Index 0=C64 Cpu, 1-4 Floppy 1-4
bool cpu_states[9]; // true = Feetch / false = no Feetch ::: Index 0=C64 Cpu, 1-4 Floppy1541 1-4, 5-8 Floppy1581

bool warp_mode;

Expand Down
9 changes: 8 additions & 1 deletion src/floppy1581_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,12 @@ void Floppy1581::SetEnableFloppy(bool status)

FloppyEnabled = status;
if(!status)
FloppyIECLocal = 0xFF;
FloppyIECLocal = 0xff;
}

bool Floppy1581::OneCycle()
{
if(!FloppyEnabled) return true;

return true;
}
4 changes: 3 additions & 1 deletion src/floppy1581_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <functional>

#include "./structs.h"
#include "./mos6502_class.h"

class Floppy1581
{
Expand All @@ -34,6 +35,7 @@ class Floppy1581
void SetDeviceNumber(uint8_t number);
bool LoadDosRom(const char* filename);
void SetEnableFloppy(bool status);
bool OneCycle();

/// Variablen ///

Expand All @@ -44,7 +46,7 @@ class Floppy1581
private:
bool FloppyEnabled;

uint8_t RAM[0x0800]; // 2KB
uint8_t RAM[0x2000]; // 8KB
uint8_t ROM[0x8000]; // 32KB
};

Expand Down

0 comments on commit 06ee829

Please sign in to comment.