-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b5a4d2
commit c217b81
Showing
8 changed files
with
78 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changes | ||
|
||
## Version 0.0.1 | ||
- CPU実装完了 (APIはまだ全部揃っていない) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "vgscpu_internal.h" | ||
|
||
int vgsapi_noop(struct vgscpu_context* c) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "tp.h" | ||
|
||
int test(struct vgscpu_context *c) | ||
{ | ||
unsigned char op1[] = {VGSCPU_OP_LD_D_1, 0xff, VGSCPU_OP_VGS, VGSCPU_OP_BRK}; | ||
unsigned char op2[] = {VGSCPU_OP_LD_D_1, 0xff, VGSCPU_OP_VGS, 0x00, VGSCPU_OP_BRK}; | ||
|
||
vgscpu_load_program(c, op1, sizeof(op1)); | ||
TEST(__FILE__, __LINE__, vgscpu_run(c), -1); | ||
TEST(__FILE__, __LINE__, strcmp(c->error, "OUT OF PROGRAM MEMORY: $00000004"), 0); | ||
|
||
vgscpu_load_program(c, op2, sizeof(op2)); | ||
TEST(__FILE__, __LINE__, vgscpu_run(c), 0); | ||
TEST(__FILE__, __LINE__, c->r.d, 0); | ||
return 0; | ||
} | ||
|
||
int main() | ||
{ | ||
struct vgscpu_context *c = (struct vgscpu_context *)vgscpu_create_context(); | ||
if (!c) return -1; | ||
int result = -1; | ||
|
||
if (test(c)) goto END_TEST; | ||
|
||
result = 0; | ||
puts("success"); | ||
END_TEST: | ||
vgscpu_release_context(c); | ||
return result; | ||
} |