Browse Source

Fixed issue with console vector

main
Devine Lu Linvega 1 year ago
parent
commit
9176845c6d
  1. 6
      src/devices/console.c
  2. 2
      src/devices/console.h
  3. 2
      src/uxncli.c
  4. 3
      src/uxnemu.c

6
src/devices/console.c

@ -17,14 +17,12 @@ WITH REGARD TO THIS SOFTWARE.
/* console registers */
static int rVECTOR;
int
console_input(int c, int type)
{
if(c == EOF) c = 0, type = 4;
uxn.dev[0x12] = c, uxn.dev[0x17] = type;
uxn_eval(rVECTOR);
uxn_eval(console_vector);
return type != 4;
}
@ -44,7 +42,7 @@ console_deo(Uint8 addr)
{
FILE *fd;
switch(addr) {
case 0x11: rVECTOR = PEEK2(&uxn.dev[0x10]); return;
case 0x11: console_vector = PEEK2(&uxn.dev[0x10]); return;
case 0x18: fd = stdout, fputc(uxn.dev[0x18], fd), fflush(fd); break;
case 0x19: fd = stderr, fputc(uxn.dev[0x19], fd), fflush(fd); break;
}

2
src/devices/console.h

@ -18,3 +18,5 @@ int console_input(int c, int type);
void console_arguments(int i, int argc, char **argv);
Uint8 console_dei(Uint8 addr);
void console_deo(Uint8 addr);
extern int console_vector;

2
src/uxncli.c

@ -48,7 +48,7 @@ main(int argc, char **argv)
{
int i = 1;
if(argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v')
return !fprintf(stdout, "Uxn(cli) - Varvara Emulator, 23 Jan 2025.\n");
return !fprintf(stdout, "Uxn(cli) - Varvara Emulator, 32 Jan 2025.\n");
else if(argc == 1)
return !fprintf(stdout, "usage: %s [-v] file.rom [args..]\n", argv[0]);
else if(!system_boot((Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)), argv[i++], argc > 2))

3
src/uxnemu.c

@ -45,6 +45,7 @@ WITH REGARD TO THIS SOFTWARE.
#define TIMEOUT_MS 334
Uxn uxn;
int console_vector;
static SDL_Window *emu_window;
static SDL_Texture *emu_texture;
@ -468,7 +469,7 @@ main(int argc, char **argv)
/* flags */
if(argc > 1 && argv[i][0] == '-') {
if(!strcmp(argv[i], "-v"))
return system_error("Uxn(gui) - Varvara Emulator", "21 Jan 2025.");
return system_error("Uxn(gui) - Varvara Emulator", "31 Jan 2025.");
else if(!strcmp(argv[i], "-2x"))
set_zoom(2, 0);
else if(!strcmp(argv[i], "-3x"))

Loading…
Cancel
Save