Skip to content

Latest commit

 

History

History
98 lines (72 loc) · 2.48 KB

README.md

File metadata and controls

98 lines (72 loc) · 2.48 KB

HuDK examples

Build instructions

The examples can be built using Makefile or CMake. You can use whatever build system you want. Toolchain files for HuC/PCEas and cc65/ca65 are provided in the cmake directory.

HuC/PCEas toolchain

⚠️ You must use this HuC fork in order to build the examples.

Here's a quick tutorial on how to rebuild HuC/pceas from source.

You can either fork the git repository:

git clone [email protected]:BlockoS/huc.git

Or download a zip file of the master branch:

wget https://github.com/BlockoS/huc/archive/master.zip
unzip master.zip

Now you can build the compilers by runnnig Make with

make

Advanced or reckless users can use CMake.

mkdir build
cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=..
cmake --build .
cmake --build . --target install

All the generated executables will be located in the bin directory.

Examples

Using Makefile

Open your prefered terminal. Go to the <HUDK_PATH>/example directory, and simple run:

make HUDK_TOOLS_PATH=../build/install/bin/ \
     HUDK_INCLUDE_PATH=../include/ \
     HUC_PATH=<path to huc/pceas bin directory>

Don't forget to change DHUDK_TOOLS_PATH if you installed the HuDK tools in another directory.

The roms will be located in the build/asm and build/C directories.

Using CMake

Open your prefered terminal. Go to the <HUDK_PATH>/example directory, and create a build directory. Go to that directory and run CMake configuration pass.

cmake .. \
    -DCMAKE_TOOLCHAIN_FILE=../cmake/huc-toolchain.cmake \ 
    -DHUDK_TOOLS_PATH=../../build/install/bin/ \ -DHUDK_INCLUDE_PATH=../../include/ \
    -DHUC_PATH=<path to huc/pceas bin directory>

If you plan to build C example, don't forget to set the PCE_INCLUDE environment variable.

export PCE_INCLUDE=../../include

You can then build the examples by either typing

cmake --build .

or

make

The roms will be located in the asm directory.

Examples

  1. Hello world

  2. Custom font

  3. Map of 8 by 8 pixels tiles

  4. Map of 16 by 16 pixels tiles

  5. Joypad

  6. Sprites

  7. Scroll / Vertical split windows

  8. Clock

  9. Pong