Browse Source

Minor cleanup

tags/0.3.0
Jake Wakeling 5 months ago
parent
commit
24cdc47d45
9 changed files with 34 additions and 47 deletions
  1. 2
    8
      .gitignore
  2. 14
    16
      CMakeLists.txt
  3. 1
    1
      LICENCE
  4. 10
    5
      README.md
  5. 0
    4
      build/BUILD_LINUX.sh
  6. 0
    4
      build/BUILD_WIN64.bat
  7. 1
    4
      build/CMAKE_WIN64.bat
  8. 4
    3
      src/main.c
  9. 2
    2
      src/main.h

+ 2
- 8
.gitignore View File

@@ -1,11 +1,5 @@
bin/*

CMakeFiles/*
CMakeCache.txt

res/C8E.APS

build/*
!build/BUILD_LINUX.sh
!build/BUILD_WIN64.bat
!build/CMAKE_WIN64.bat
lib/*
res/C8E.APS

+ 14
- 16
CMakeLists.txt View File

@@ -1,36 +1,34 @@
# CMakeLists.txt
# CMakeLists file for C8E
# Copyright (c) 2019, Jake Wakeling
# All rights reserved.

cmake_minimum_required(VERSION 3.6) # CMake Minimum Required Version
cmake_minimum_required(VERSION 3.9) # CMake Minimum Required Version
project(C8E) # Project Name
set(CMAKE_C_STANDARD 11) # C Standard

# Output Directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)

link_directories( # Library Directories
lib/x64/
/lib/x64/
C:/Programs/SDL2/lib/x64/
)

add_executable(C8E src/main.c) # Build Target
file(GLOB SOURCES src/* include/*) # Add Source Files
add_executable(c8e ${SOURCES}) # Build Target

target_include_directories( # Target Include Directories
C8E PUBLIC
include/
target_include_directories(c8e PUBLIC # Target Include Directories
/include/
C:/Programs/SDL2/include/
)
target_link_libraries( # Target Libraries
C8E
target_link_libraries(c8e # Target Libraries
SDL2.lib
SDL2main.lib
)

# Visual Studio Startup Project
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT C8E)
set_property( # Visual Studio Startup Project
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
PROPERTY VS_STARTUP_PROJECT c8e
)

+ 1
- 1
LICENCE View File

@@ -1,7 +1,7 @@
OMKOV Open Source Licence 1.1
Based on the UIUC Licence

Copyright (c) 2019, Jake Wakeling
Copyright (c) 2019, Jakob Wakeling
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of

+ 10
- 5
README.md View File

@@ -1,4 +1,4 @@
## C8E
# C8E
C8E is a threaded emulator for the Chip-8 platform written in C. C8E is designed
to be lightweight, efficient and threaded, while being cross-platform and
supporting all possible features.
@@ -7,7 +7,7 @@ Currently, C8E is unfinished. The only functional build script is CMAKE_WIN64.
Program is actively developed and tested using Visual Studio on Windows, all
code *should* be portable, and thus work correctly across Operating Systems.

### Windows
## Windows
#### Requirements
* SDL 2.0: Can be downloaded from https://www.libsdl.org/download-2.0.php

@@ -18,11 +18,11 @@ target_include_directories options.

To run the compiled binary, SDL runtime libraries must also be installed.

#### Build Instructions
### Build Instructions
On Windows, C8E can either be built by running either CMAKE_WIN64.bat or
BUILD_WIN64.bat in the project build directory.

### Linux
## Linux
#### Requirements
* SDL 2.0: Can be installed with distribution package manager
* Arch: sdl2-hg
@@ -32,8 +32,13 @@ To run the compiled binary, SDL runtime libraries must also be installed.
* Arch: sdl2
* Ubuntu: libsdl2

#### Build Instructions
### Build Instructions
On Linux, C8E can be built by running BUILD_LINUX.sh.

Currently, the build scripts are incomplete and do not link any headers or
libraries.

## Meta
Copyright (C) 2019, Jakob Wakeling
All rights reserved.
[OMKOV Open Source Licence](https://www.omkov.net/licences/ooss)

+ 0
- 4
build/BUILD_LINUX.sh View File

@@ -1,4 +0,0 @@
#!/bin/bash

echo "Building LC3Emulator..."
clang -o bin/C8E.bin src/main.c

+ 0
- 4
build/BUILD_WIN64.bat View File

@@ -1,4 +0,0 @@
@echo off

echo Building LC3Emulator...
clang -o bin/C8E.exe src/main.c

+ 1
- 4
build/CMAKE_WIN64.bat View File

@@ -1,6 +1,3 @@
@echo off

cmake ../ -DCMAKE_GENERATOR_PLATFORM=x64
cmake --build . --config Release

rmdir ..\bin\Release
cmake --build . --config Release

+ 4
- 3
src/main.c View File

@@ -1,10 +1,9 @@
#define _CRT_SECURE_NO_WARNINGS
// main.c
// Main source file for C8E
// Copyright (c) 2019, Jake Wakeling
// Copyright (c) 2019, Jakob Wakeling
// All rights reserved.

#include "main.h"
#define _CRT_SECURE_NO_WARNINGS

#include <stdint.h>
#include <stdio.h>
@@ -13,6 +12,8 @@
#include <SDL_audio.h>
#include <time.h>

#include "main.h"

uint8_t V[16]; // Registers (V0-VF)
uint8_t M[4096]; // Memory (4KiB)


+ 2
- 2
src/main.h View File

@@ -1,6 +1,6 @@
// main.h
// Main header file for C8E
// Copyright (c) 2019, Jake Wakeling
// Copyright (c) 2019, Jakob Wakeling
// All rights reserved.

#ifndef MAIN_H
@@ -20,4 +20,4 @@ void UpdateTimers(void);
void MakeBeep(void);
void AudioCallback();

#endif
#endif // MAIN_H

Loading…
Cancel
Save