Skip to content

Commit

Permalink
move a5 handling back to own handler.
Browse files Browse the repository at this point in the history
	modified:   .gitignore
	modified:   source/vm.c
  • Loading branch information
bsekisser committed Oct 17, 2021
1 parent 4c39488 commit 4bed4d3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build-*/*
*.i
*.o
*.out
private/*
*/private/*
*.s
13 changes: 0 additions & 13 deletions archive/private/main_config.h

This file was deleted.

28 changes: 21 additions & 7 deletions source/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,29 @@ void vm_reset(vm_p vm)
PC = 0xffff0000;
}

static int vm_step_a5(vm_p vm)
{
do {
IR = (IR << 8) | ld_code_ia(vm, &PC, 1);
}while((IR == 0xa5) | (IR == 0xa500));

INST_ESAC_LIST_MASKED_a5
switch(IR) {
default:
return(-1);
break;
INST_ESAC_LIST_a5
}

return(0);
}

void vm_step(vm_p vm)
{
int err = 0;

IP = PC;
IR = 0;

do {
IR = (IR << 8) | ld_code_ia(vm, &PC, 1);
}while((IR == 0xa5) | (IR == 0xa500));
IR = ld_code_ia(vm, &PC, 1);

code_trace_start(vm);

Expand All @@ -471,13 +484,14 @@ void vm_step(vm_p vm)
CYCLE++;

INST_ESAC_LIST_MASKED
INST_ESAC_LIST_MASKED_a5
switch(IR) {
case 0xa5:
err = vm_step_a5(vm);
break;
default:
err = -1;
break;
INST_ESAC_LIST
INST_ESAC_LIST_a5
}

code_trace_out(vm);
Expand Down

0 comments on commit 4bed4d3

Please sign in to comment.