chip-8/src/main.c

34 lines
580 B
C
Raw Normal View History

2023-12-24 18:46:21 +01:00
#include "screen.h"
2023-12-25 07:24:17 +01:00
#include "mem.h"
#include "vcpu.h"
2023-12-24 17:56:58 +01:00
2023-12-25 15:03:22 +01:00
#include <stdio.h>
2023-12-24 17:56:58 +01:00
int main(int argc, char *argv[])
{
2023-12-25 15:03:22 +01:00
/* unsigned char byte=137; */
/* unsigned char u,t,h; */
/* VCPUDoubleDabble(byte,&u,&t,&h); */
/* printf("%d: %01d%01d%01d\n",byte,h,t,u); */
/* return 0; */
2023-12-24 18:20:11 +01:00
2023-12-25 07:24:17 +01:00
// Initialize
MemInit();
2023-12-25 15:03:22 +01:00
MemLoadROM("../roms/chip8-test-suite/3-corax+.ch8");
2023-12-25 09:11:45 +01:00
2023-12-24 18:53:13 +01:00
ScreenInit(800,400);
2023-12-25 07:24:17 +01:00
VCPUInit();
2023-12-25 09:11:45 +01:00
// MemDump();
int i=0;
2023-12-24 19:59:31 +01:00
2023-12-24 18:46:21 +01:00
while (!WindowShouldClose()){
2023-12-25 09:11:45 +01:00
VCPUFetch();
VCPUDecode();
VCPUExecute();
2023-12-24 18:46:21 +01:00
ScreenUpdate();
}
2023-12-24 22:06:22 +01:00
ScreenClose();
2023-12-24 17:56:58 +01:00
return 0;
}