-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft: connecting button signals #16
base: main
Are you sure you want to change the base?
Conversation
787af20
to
3f9b77c
Compare
Broken: do not merge. There is no way to read buttons from the console with the new peri layer, I'm leaving it like this for now, but it does not compile |
/* When pressing LOAD button, AINI is set. If AINI is set, the state 80 | ||
* (initialitiation) goes to state c8, starting the loading of the program | ||
* (of max 129 words) from one of the peripherc unit. */ | ||
if (ge->console.buttons.B_LOAD) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if checking the buttons here is the right approach.
Should this function in toto be called when the button is pressed? (or reproduce the side effects of pressing the button)
ge->halted = 0; | ||
ge->console.lamps.LP_HALT = 0; | ||
|
||
if ((ge->console.buttons.B_HALT_START) && (ge->halted)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above, should this function be invoked if the button is pressed?
console_socket_check(&ge130); | ||
ge_clear(&ge130); | ||
ge_load(&ge130, &test_program, 1); | ||
ge_start(&ge130); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should separate these two ways of running the emulator, I think we can have an option to enable the console, and in this case, clear/load/start are only managed through the console, otherwise, a simpler clear/load/start like the one we have now is used.
@@ -20,14 +20,17 @@ int main(int argc, char *argv[]) | |||
/* load with memory / and or setup peripherics */ | |||
|
|||
while(1) { | |||
console_socket_check(&ge130); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have something like:
ge_init();
while(1) {
while(ge->halted)
console_check_wait_signals();
ge_run_cycle() // <- this optional if console_check_wait_signal call ge_run()
}
@@ -36,7 +36,7 @@ static int console_socket_init(struct ge *ge, void *ctx) | |||
} | |||
|
|||
|
|||
static int console_socket_check(struct ge *ge, void *ctx) | |||
int console_socket_check(struct ge *ge, void *ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using some console_socket functions is a good way to interact with the console when ge isn't running.
No description provided.