Add power control port
This commit is contained in:
parent
3d1dff8495
commit
565685776a
10
src/bus.c
10
src/bus.c
|
@ -16,9 +16,11 @@
|
|||
#include "keyboard.h"
|
||||
#include "mouse.h"
|
||||
|
||||
bool bus_requests_exit = false;
|
||||
|
||||
extern struct timeval rtc_current_time;
|
||||
extern uint32_t rtc_uptime;
|
||||
|
||||
;
|
||||
extern fox32_vm_t vm;
|
||||
extern disk_controller_t disk_controller;
|
||||
extern mouse_t mouse;
|
||||
|
@ -220,6 +222,12 @@ int bus_io_write(void *user, uint32_t value, uint32_t port) {
|
|||
|
||||
break;
|
||||
};
|
||||
|
||||
case 0x80010000: { // power control port
|
||||
if (value == 0) {
|
||||
bus_requests_exit = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
fox32_vm_t vm;
|
||||
|
||||
extern bool bus_requests_exit;
|
||||
extern disk_controller_t disk_controller;
|
||||
|
||||
uint32_t tick_start;
|
||||
|
@ -95,7 +96,7 @@ int main(int argc, char *argv[]) {
|
|||
tick_start = SDL_GetTicks();
|
||||
tick_end = SDL_GetTicks();
|
||||
|
||||
while (!done) {
|
||||
while (!done && !bus_requests_exit) {
|
||||
main_loop();
|
||||
|
||||
tick_end = SDL_GetTicks();
|
||||
|
|
Loading…
Reference in New Issue
Block a user