Added mock behavior for the friend port

This commit is contained in:
Devine Lu Linvega 2023-05-02 10:31:33 -07:00
parent d2e054346f
commit 83ba7e05ea
3 changed files with 21 additions and 13 deletions

View File

@ -83,6 +83,13 @@ system_deo(Uxn *u, Uint8 *d, Uint8 port)
case 0x3:
system_cmd(u->ram, PEEK2(d + 2));
break;
case 0x5:
if(PEEK2(d + 4)){
Uxn friend;
uxn_boot(&friend, u->ram);
uxn_eval(&friend, PEEK2(d + 4));
}
break;
case 0xe:
system_inspect(u);
break;

View File

@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE.
*/
Uint16 deo_mask[] = {0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000};
Uint16 deo_mask[] = {0xc028, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000};
Uint16 dei_mask[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07ff, 0x0000, 0x0000, 0x0000};
Uint8
@ -53,8 +53,7 @@ main(int argc, char **argv)
if(!system_load(&u, argv[i++]))
return system_error("Load", "Failed");
u.dev[0x17] = argc - i;
if(!uxn_eval(&u, PAGE_PROGRAM))
return u.dev[0x0f] & 0x7f;
if(uxn_eval(&u, PAGE_PROGRAM)) {
for(; i < argc; i++) {
char *p = argv[i];
while(*p) console_input(&u, *p++, CONSOLE_ARG);
@ -64,5 +63,7 @@ main(int argc, char **argv)
int c = fgetc(stdin);
if(c != EOF) console_input(&u, (Uint8)c, CONSOLE_STD);
}
}
free(u.ram);
return u.dev[0x0f] & 0x7f;
}

View File

@ -41,7 +41,7 @@ WITH REGARD TO THIS SOFTWARE.
#define WIDTH 64 * 8
#define HEIGHT 40 * 8
#define PAD 4
#define PAD 2
#define TIMEOUT_MS 334
#define BENCH 0
@ -52,7 +52,7 @@ static SDL_AudioDeviceID audio_id;
static SDL_Rect gRect;
static SDL_Thread *stdin_thread;
Uint16 deo_mask[] = {0xff08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000};
Uint16 deo_mask[] = {0xff28, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000};
Uint16 dei_mask[] = {0x0000, 0x0000, 0x003c, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07ff, 0x0000, 0x0000, 0x0000};
/* devices */