일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- CS/자료구조/Queue
- tree
- Tree/AVL/Deletion
- reversing
- Tree/AVL
- CS/자료구조/Linked_List
- 코드엔진
- CS/자료구조/Stack
- Tree/Traversal
- codeengn
- CS/자료구조/Circular_Queue
- CS/자료구조/Circular_Linked_List
- Tree/AVL/Insertion
- Tree/RBTree/Deletion
- CS/자료구조/Doubly_Linked_List
- 리버싱
- forensic
- UTCTF
- CS/자료구조/Singly_Linked_List
- Tree/RBTree/Insertion
- Tree/RBTree
- CS/자료구조/Priority_Queue
- ctf
- Tree/BST
- Tree/Binary_Search_Tree
- Tree/Binary_Tree
- Today
- Total
목록Emulator[에뮬레이터] (5)
SuperVingo
// Initialize GLUTglutInit(&argc, argv);glutInitWindowPosition(100, 100);glutInitWindowSize(64 * PIXEL, 32 * PIXEL);glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);glutCreateWindow("Chip 8 Emulator - Screen"); // Event FunctionglutDisplayFunc(mainLoop);glutIdleFunc(mainLoop);glutKeyboardFunc(KeyboardDown);glutKeyboardUpFunc(KeyboardUp);glut에서 DisplayFunc로 설정하면 계속 그리는 것이라 생각했는데,IdleFunc에 추가하지 않으면..
Initializevoid Chip8::Initialize(){ // Random Initialize srand(time(NULL)); // Reset the status of chip8 pc = 0x200; opcode = 0; I = 0; sp = 0; // Copy Hex Sprite to Interpreter Area for (int i = 0; i Cycle Codevoid Chip8::ChipCycle(){ // Fetch opcode from [pc], 2bytes opcode = mem[pc] > 8] == (opcode & 0x00FF)) pc += 4; else pc += 2; break; } case 0x4000: // 0x4xkk - SNE Vx, kk { // Skip..

CHIP-8 Memory - 4KB0x000 ~ 0x1FF -> Interpreter, Reserved, Hex Font 0x200 ~ 0xFFF -> Programs, PC will start in 0x200 Hex Font는 0부터 F까지 3x5 크기의 문자를 저장해둔 것이다. CPU General Purpose Register V0 - V16// General Purpose Registersunsigned char V[16]; Index Register I// Index Registerunsigned short I;Program Counter// Program Counterunsigned short pc;unsigned short opcode; Stack// Stack and Stack Poin..
CPU는 1단계: fetch2단계: decode3단계: execute4단계: writeback순서로 진행이 된다. Fetch에서 명령어를 인출하고,Decode에서 어떤 명령어인지 해독하고,Execute로 실행하고,Writeback을 통해서 결과 등을 메모리에 저장하는 과정으로 진행이 되는데, Writeback은 제외하고Fetch - Decode - Execute 순서로 진행된다. CPU_Initialize();// Cycleswhile(true){ // Fetch // Decode & Execute}큰 흐름으로 잡아보면 다음과 같다.
Reference : http://devernay.free.fr/hacks/chip8/C8TECH10.HTMhttps://multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/ How to write an emulator (CHIP-8 interpreter) – Multigesture.net multigesture.net 평소 에뮬레이터를 제작해보고 싶은 마음이 있어서한번 시도 해볼겸 여러 정보를 찾아보니까시작으로 하기 좋은 것은 CHIP-8이 간단하고 쉽다길래한번 시작해보려고 한다.