diff options
-rw-r--r-- | chip8.c | 15 | ||||
-rw-r--r-- | chip8.h | 15 | ||||
-rw-r--r-- | main.c | 45 |
3 files changed, 46 insertions, 29 deletions
@@ -1,3 +1,18 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + *(at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + #include "chip8.h" uint16_t opcode; // 2 byte opcode @@ -1,3 +1,18 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + *(at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + #ifndef CHIP8_H #define CHIP8_H @@ -1,3 +1,18 @@ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + *(at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + #include <stdio.h> #include <stdlib.h> #include <SDL2/SDL.h> @@ -205,41 +220,13 @@ int main(int argc, char *argv[]) init_video(); - const int fps = 900; + const int fps = 300; const int frame_delay = 1000/fps; uint32_t frame_start; uint32_t frame_time; int do_quit = 0; - /* - chip8_draw_sprite(0, 0, 0xD*5, 0x5); - chip8_draw_sprite(5, 0, 0xE*5, 0x5); - chip8_draw_sprite(10, 0, 0xA*5, 0x5); - chip8_draw_sprite(15, 0, 0xD*5, 0x5); - chip8_draw_sprite(20, 0, 0xB*5, 0x5); - chip8_draw_sprite(25, 0, 0xE*5, 0x5); - chip8_draw_sprite(30, 0, 0xE*5, 0x5); - chip8_draw_sprite(35, 0, 0xf*5, 0x5); - - chip8_draw_sprite(0, 9, 0xD*5, 0x5); - chip8_draw_sprite(5, 9, 0xE*5, 0x5); - chip8_draw_sprite(10, 9, 0xA*5, 0x5); - chip8_draw_sprite(15, 9, 0xD*5, 0x5); - chip8_draw_sprite(20, 9, 0xB*5, 0x5); - chip8_draw_sprite(25, 9, 0xE*5, 0x5); - chip8_draw_sprite(30, 9, 0xE*5, 0x5); - chip8_draw_sprite(35, 9, 0xf*5, 0x5); - - chip8_draw_sprite(0, 20, 0x200, 0x6); - chip8_draw_sprite(8, 20, 0x200, 0x6); - chip8_draw_sprite(16, 20, 0x200, 0x6); - chip8_draw_sprite(18, 20, 0x200, 0x6); - - chip8_draw_sprite(61, 25, 0x200, 0x6); - chip8_draw_sprite(50, 30, 0x200, 0x6); - */ - while(!do_quit) { frame_start = SDL_GetTicks(); |