mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-08-10 06:24:59 +00:00
viacuda: properly initialize VIA registers.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
DingusPPC - The Experimental PowerPC Macintosh emulator
|
DingusPPC - The Experimental PowerPC Macintosh emulator
|
||||||
Copyright (C) 2018-20 divingkatae and maximum
|
Copyright (C) 2018-21 divingkatae and maximum
|
||||||
(theweirdo) spatium
|
(theweirdo) spatium
|
||||||
|
|
||||||
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
||||||
@@ -36,14 +36,24 @@ using namespace std;
|
|||||||
ViaCuda::ViaCuda() {
|
ViaCuda::ViaCuda() {
|
||||||
this->name = "ViaCuda";
|
this->name = "ViaCuda";
|
||||||
|
|
||||||
/* FIXME: is this the correct
|
// VIA reset clears all internal registers to logic 0
|
||||||
VIA initialization? */
|
// except timers/counters and the shift register
|
||||||
this->via_regs[VIA_A] = 0x80;
|
// as stated in the 6522 datasheet
|
||||||
this->via_regs[VIA_DIRB] = 0xFF;
|
this->via_regs[VIA_A] = 0;
|
||||||
this->via_regs[VIA_DIRA] = 0xFF;
|
this->via_regs[VIA_B] = 0;
|
||||||
|
this->via_regs[VIA_DIRB] = 0;
|
||||||
|
this->via_regs[VIA_DIRA] = 0;
|
||||||
|
this->via_regs[VIA_IER] = 0;
|
||||||
|
this->via_regs[VIA_ACR] = 0;
|
||||||
|
this->via_regs[VIA_PCR] = 0;
|
||||||
|
this->via_regs[VIA_IFR] = 0;
|
||||||
|
|
||||||
|
// load maximum value into the timer registers for safety
|
||||||
|
// (not prescribed in the 6522 datasheet)
|
||||||
this->via_regs[VIA_T1LL] = 0xFF;
|
this->via_regs[VIA_T1LL] = 0xFF;
|
||||||
this->via_regs[VIA_T1LH] = 0xFF;
|
this->via_regs[VIA_T1LH] = 0xFF;
|
||||||
this->via_regs[VIA_IER] = 0x7F;
|
this->via_regs[VIA_T2CL] = 0xFF;
|
||||||
|
this->via_regs[VIA_T2CH] = 0xFF;
|
||||||
|
|
||||||
// PRAM is part of Cuda
|
// PRAM is part of Cuda
|
||||||
this->pram_obj = std::unique_ptr<NVram> (new NVram("pram.bin", 256));
|
this->pram_obj = std::unique_ptr<NVram> (new NVram("pram.bin", 256));
|
||||||
|
Reference in New Issue
Block a user