aiie/apple/parallelcard.cpp

60 lines
931 B
C++
Raw Normal View History

2017-02-20 23:41:46 +00:00
#include "parallelcard.h"
#include <string.h>
#include "parallel-rom.h"
#include "fx80.h"
2020-07-04 11:41:32 +00:00
#ifdef TEENSYDUINO
#include "teensy-println.h"
#endif
2017-02-20 23:41:46 +00:00
ParallelCard::ParallelCard()
{
fx80 = new Fx80();
}
ParallelCard::~ParallelCard()
{
}
2017-12-30 20:20:34 +00:00
bool ParallelCard::Serialize(int8_t fd)
{
return true;
}
bool ParallelCard::Deserialize(int8_t fd)
{
return true;
}
2017-02-20 23:41:46 +00:00
void ParallelCard::Reset()
{
}
uint8_t ParallelCard::readSwitches(uint8_t s)
{
return 0xFF;
}
void ParallelCard::writeSwitches(uint8_t s, uint8_t v)
{
if (s == 0x00) {
fx80->input(v & 0x7F); // Note: not 8-bit clean!
2017-02-20 23:41:46 +00:00
} else {
// printf("unknown switch 0x%X\n", s);
}
}
void ParallelCard::loadROM(uint8_t *toWhere)
{
#ifdef TEENSYDUINO
2020-07-04 11:41:32 +00:00
println("loading parallel slot rom");
2017-02-20 23:41:46 +00:00
for (uint16_t i=0; i<=0xFF; i++) {
toWhere[i] = pgm_read_byte(&romData[i]);
}
#else
printf("loading parallel slot rom\n");
memcpy(toWhere, romData, 256);
#endif
}