Skip to content
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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

danielinux
Copy link
Member

No description provided.

@danielinux danielinux force-pushed the console_clear_load_start branch from 787af20 to 3f9b77c Compare September 24, 2022 11:13
@danielinux
Copy link
Member Author

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) {
Copy link
Collaborator

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)) {
Copy link
Collaborator

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?

Comment on lines +23 to 26
console_socket_check(&ge130);
ge_clear(&ge130);
ge_load(&ge130, &test_program, 1);
ge_start(&ge130);
Copy link
Collaborator

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);
Copy link
Collaborator

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)
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants