Skip to content

Instantly share code, notes, and snippets.

@lpproj
Created March 6, 2019 15:05
Show Gist options
  • Save lpproj/323cb5121252f345e4a860321718ebef to your computer and use it in GitHub Desktop.
Save lpproj/323cb5121252f345e4a860321718ebef to your computer and use it in GitHub Desktop.
diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp
--- a/src/raspberrypi/rascsi.cpp
+++ b/src/raspberrypi/rascsi.cpp
@@ -887,6 +887,19 @@ int main(int argc, char* argv[])
// セレクション信号が無ければ無視
bus->Aquire();
+#if defined(USE_SEL_EVENT_ENABLE)
+ if (bus->GetSEL() && !bus->GetIO() && bus->GetBSY()) {
+ // アービトレーションフェーズ→セレクションフェーズへの入りかけ(?)
+ // BSYがまだアサートされている場合は0になるまで待つ
+ // (何かタイムアウト処理が必要かも…)
+ do {
+# if !defined(BAREMETAL)
+ usleep(0);
+# endif // !BAREMETAL
+ bus->Aquire();
+ } while(bus->GetSEL() && !bus->GetIO() && bus->GetBSY());
+ }
+#endif
if (!bus->GetSEL() || bus->GetBSY()) {
#if !defined(USE_SEL_EVENT_ENABLE) && !defined(BAREMETAL)
usleep(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment