draft: connecting button signals#16
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.
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.
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.
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.
| /* load with memory / and or setup peripherics */ | ||
|
|
||
| while(1) { | ||
| console_socket_check(&ge130); |
There was a problem hiding this comment.
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()
}
|
|
||
|
|
||
| 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.
I think using some console_socket functions is a good way to interact with the console when ge isn't running.
No description provided.