Skip to content

Commit f56bd43

Browse files
committed
StandbyControl
1 parent fdaafae commit f56bd43

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

emulator/src/Peripheral/StandbyControl.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@
66
#include "../Logger.hpp"
77

88
namespace casioemu {
9+
// should be ignore read, but for the sake of debugging, this is easier to use.
910
void StandbyControl::Initialise() {
1011
region_stpacp.Setup(
11-
0xF008, 1, "StandbyControl/STPACP", this, MMURegion::IgnoreRead<0x00>, [](MMURegion *region, size_t, uint8_t data) {
12+
0xF008, 1, "StandbyControl/STPACP", this, MMURegion::DefaultRead<uint8_t>, [](MMURegion *region, size_t, uint8_t data) {
1213
StandbyControl *self = (StandbyControl *)(region->userdata);
13-
if ((data & 0xF0) == 0xA0 && (self->stpacp_last & 0xF0) == 0x50)
14+
if ((data & 0xF0) == 0xA0 && (self->stpacp_last & 0xF0) == 0x50) {
1415
self->stop_acceptor_enabled = true;
16+
logger::Info("StandbyControl: Stop acceptor enabled!");
17+
}
1518
self->stpacp_last = data;
1619
},
1720
emulator);
1821

1922
region_sbycon.Setup(
20-
0xF009, 1, "StandbyControl/SBYCON", this, MMURegion::IgnoreRead<0x00>, [](MMURegion *region, size_t, uint8_t data) {
23+
0xF009, 1, "StandbyControl/SBYCON", this, MMURegion::DefaultRead<uint8_t>, [](MMURegion *region, size_t, uint8_t data) {
2124
StandbyControl *self = (StandbyControl *)(region->userdata);
2225

2326
if (data & 0x01) {
27+
logger::Info("StandbyControl: Chipset halted!");
2428
self->emulator.chipset.Halt();
2529
return;
2630
}
2731

2832
if (data & 0x02 && self->stop_acceptor_enabled) {
33+
logger::Info("StandbyControl: Chipset stopped!");
2934
self->stop_acceptor_enabled = false;
3035
self->emulator.chipset.Stop();
3136
return;

0 commit comments

Comments
 (0)