Giter Club home page Giter Club logo

c64-non-sense's Introduction

C64 NonSense, the C64 Game Engine. Copyright (C) 2020-2022 Dirk "YouDirk" Lehmann

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

C64 NonSense

Welcome the C64 NonSense Game Engine :)

The progression of C64 NonSense is vlogged at Youtube here (German), too :)

The Screenshot

Features

  • Video
    PAL (optimized), NTSC (working, via src/Timer.h optimizable)
  • Graphic modes
    HiRes 320x200 with 2 colors/cell, Multicolor 160x200 with 4 colors/cell [WiP]
  • Sprites
    8x real-time configurable sprites, with collision detection and bitmap animations [WiP]
  • Input
    joysticks (port 2 and 1), keyboard (via scan codes and PETSCII characters)

Development toolchain

We are developing on Linux using a Debian distribution as host platform. You need the following tools to develop, which you are able to install using the Debian package manager apt

  • git To clone the source repository, i.e.
    $> git clone https://github.com/YouDirk/c64-non-sense.git c64-non-sense
  • make To build and run the stuff. See the section "Make targets" below. I.e. to compile and run in VICE type
    c64-non-sense/$> make run
  • cc65 Command cl65 for the C64 C cross-compiler collection.
  • vice Command c1541 for the disk-image tool and command x64 (optional) for the C64 emulator. Make sure to have contrib enabled in /etc/apt/sources.list! Additionally you need to install the Kernal/BASIC ROMs manually, see the section below.
  • pmount (optional) To automatically copy the D64 file to a removable disk (i.e. USB storage) using the make target $> make disk.
$> sudo apt-get install git make cc65 vice
$> sudo apt-get pmount               # optional

VICE/x64 (C64 emulator) Kernal/BASIC/CharGen ROMs

If you are using the Debian contrib package of vice then you need to download manually the Kernal, BASIC and CharGen ROMs of the emulator due to copyright purposes. Here an how-to:

Download the source tarball vice-3.x.tar.gz (replace 3.x with your installed VICE version as listed in $> dpkg -l 'vice*') from

Unpack it and copy it´s whole data/* directory into /usr/share/vice/.

tmp/$> tar zxf vice-3.x.tar.gz
tmp/$> sudo cp -rf vice-3.x/data/* /usr/share/vice/

Done, now you can run VICE using $> x64 :)

Make targets

all <default>: Compiles and packs the src/non-sense.d64 disk image file
recompile:     Runs 'clean' followed by 'all'
clean:         Deletes temporary files / prepare for recompilation
               Useful on 'Header file not found' compilation errors
clean-all:     Deletes all files which are not under version control
run:           Make 'all' and `RUN` NonSense in VICE, use PAL (VIC 6561)
run-ntsc:      Same as 'run', but using NTSC version of VIC (VIC 6560)
run-load:      Same as 'run', but just `LOAD"*",8,1` NonSense, no `RUN`
run-attach8:   Same as 'run', but no `LOAD`, no `RUN`
debug:         Make 'all', then as configured in makefile.config.mk set
               breakpoint and `RUN` NonSense with debugger attached (PAL)
debug-ntsc:    Same as 'debug', but using NTSC version of VIC emulated
disk:          Make 'all' and copy the D64 file to a removable disk
               (i.e. USB storage) as configured in makefile.config.mk
tags-all:      Make 'tags-ctags', 'tags-etags' and 'tags-ebrowse'
tags-ctags:    Runs 'ctags' indexer for TAB auto-completion
tags-etags:    Runs 'ebrowse' indexer for TAB auto-completion in Emacs
tags-ebrowse:  Runs 'etags' indexer for TAB auto-completion

Credits

  • Donators:
    Donate/Sponsor nobody1, nobody2, nobody3 D':

  • Regular contributors:
    Dirk "YouDirk" Lehmann


Appendix: Programmers references

c64-non-sense's People

Contributors

youdirk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

c64-non-sense's Issues

TODOs

  • Make it possible to disable sprite animations in EngineConfig
  • Add constants, such like PACE_PIXEL_PER_TICK for velocity_max, etc in Pace.h
  • Input.def.h: check if Input.joy_port1.axis_x.direction == 0 is just required when INPUT.SET.ENABLED = Input_joystick_port1_mask
  • Pace: uint6_t accel_rate in Pace_new()
  • Make calibration for NTSC in Timer.h using 60 Hz tick rate
  • Adapt Stream-Playlist in .github/...
  • Add something like SpriteAnimation_new_mirrored() in x and y axis...
  • AAAssets.c: Merge #defines for multicolor into master

Stuff TODO

  • Make: command x64 to optional dependency
  • rename irq to irq_isr on some places, namespacing
  • Double Buffering, check error fractals
  • implement a Timer module using Interrupts
  • Add a debugging option to show the render_isr time
  • Try out to use C preprocessor #define in assembler code to share header files between .c and .S files
  • Feature Request to cc65 for
    • -Dname option should pass by default to assembler, without -Wa option from cl65
    • C Preprocessor support for assembler ca65

Stuff todo...

  • Spelling in comment Graphix.set.charset_exit
  • void missing comment how to use Input.keyboard.petscii.character
  • Bug: Double pressed key, if on SHIFT+character-key SHIFT will be released first
  • Test if initially set FALSE Input.keyboard.petscii.changed
  • Add macros register_uint8(addr_hex, name), register_vector(addr_hex, name, type) to define.h
  • Renaming subtitle of C64 NonSense to something like "The C64 NonSense Game Engine."
  • Change Year of copyright consistent to "2020 - 2021" in all files
  • Prepare a Sprite-Module

Implement thread-safe versions of `Debug_{error,warn,note}`

If you get trouble during calling the _Debug_{error,warn,note} output functions in ISRs then it is required to backup the virtual zero-page registers of the CC65 runtime. Currently not implemented, because it´s just debugging stuff, it exist currently just one call from Timer_a_isr() which seems to work for now and the big overhead in run-time is unjustifyable for now. An example implemetation you can find in the CC65 sources

Another better solution is to implement an assembler version of _Debug_{error,warn,note}

Sprites abstract (brain strom)

  • Sprite module should be a 'Structure' constructed with Sprite_new() and ticking with Sprite_tick()
  • Global sprite settings goes into a new Graphix_buffer_sprites_t, such like sprite enable bits at 0xd015
  • Think about where to place the sprite buffers, think about replacing VICBANK (VIC-II DMA access), 0xc000 currently.
  • Graphix_rasterline_isr() must be adapted for sprite animations
  • Implementing a $> c64nonsense-cook -t sprite-gif my-character.gif -t music-goattracker music.sng -t level-png the-bigcastle.png assets.rel
  • AssetLoader module which is able to load assets from assets.rel
  • Adapting repository directory structure: assets-game/ makeinc/ src/ src-cook/ src-game/ trunk/
    • src-cook/ shall be compileable without to have cc65 installed
    • src/ make target is a src/c64nonsense.lib
    • src-game/ builds das-produkt.prg which is static linked to the src/c64nonsense.lib, which hopefully reduces prg file size (linker optimization)
    • assets-game/ runs the cooking process ../src-cook/c64nonsense-cook -t [...] das-produkt.rel
    • dependencies: src-cook/: gcc, src/: cc65, assets-game/: src-cook/c64nonsense-cook, src-game/: src/c64nonsense.lib assets-game/das-produkt.rel
  • Think about a concept for sprite multiplexing ...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.