A tile-based game engine for the Apple IIgs written in 65816 asssembly language
Go to file
Lucas Scharenbroich af1c728303 Fix table entries
2021-11-23 00:17:02 -06:00
.github/images Add cheezy logo 2021-11-22 21:47:41 -06:00
.vscode Update skeleon to show a pictire on-screen 2020-08-19 00:35:30 -05:00
archive
demos Use the 'f' key to have the SPRITE_HIDE flag set every other frame for a flashing effect 2021-11-22 13:27:27 -06:00
emu Final reorg; all projects build into a unified disk image for testing 2021-08-26 17:15:44 -05:00
macros Optimize the simple mixed BG0/BG1 handler 2021-11-22 16:56:53 -06:00
ref Reorg files; focus on S16 artifact 2021-03-21 21:59:54 -05:00
src Remove some dead code 2021-11-22 16:53:47 -06:00
tools Fix mask generation bug; mask was reversed 2021-11-20 11:09:57 -06:00
.gitignore Tweak ignore files 2021-08-30 22:13:24 -05:00
README.md Fix table entries 2021-11-23 00:17:02 -06:00


Generic Tile Engine for the Apple IIgs

A high-performance library for writing tile-based games for the Apple IIgs personal computer in 65816 assembly langugage. Unlock the full, 16-bit potential of the last machine of the Apple ][ line.

Introduction

The Generic Tile Engine (GTE) project is a tile engine built to exploit the unique hardware capabilities of the Apple IIgs personal computer. It supports the Apple IIgs super hires graphics mode (320x200, 16/256 colors) and provides two full-screen independent scrolling layers along with software sprites. The API and core functionality of the library is inspired by the graphics hardware of the NES/SMS/SNES/Genesis console era.

Getting Started

Initialization

Starting up GTE only requires a single subroutine call to GTEStartUp. This subroutine will take care of starting up the necessary Toolboxes and allocating any necessary memory. GTE heavily leverages memory for its speed. A total of 4MB is RAM is recommended, with a 2MB as the minimum.

; Initialize the graphics engine
        jsl      EngineStartUp
        bcs      exit

; Main code here...

; When finished, shut down the engine

        jsl      EngineShutDown

exit    _QuitGS  qtRec
qtRec   adrl     $0000
        da       $00

Setting up the play field

Once the engine is initialized, the play field must be set up. The play field defines a rectangular area of the physical graphics screen that is managed by the Tile Engine.

The size of the play field can be set directly by passing the width and height in the x and y registers. Also, there are 9 predefined1 screen sizes that correspond to well-known Apple IIgs software titles and hardware of the era which can be selected by the x register argument.

; Main code here...

        ldx      #WIDTH
        ldy      #HEIGHT
        jsl      SetScreenMode

; Alternatively, pick a predefined size

        ldx      #0                   ; 0 = full screen (320x200)
        jsl      SetScreenMode

; When finished, shut down the engine

        jsl      EngineShutDown

By default, the play field will be centered on the graphics screen. If a custom placement of the play field is desired, then the SetScreenRect subroutine can be used directly to set a specific area of the graphics screen as the managed area.

API

GTE provides the following capabilities

References


  1. Table of predefined SetScreenMode sizes

    Play Field Id Width Height Size (bytes) Percent of Full Screen
    0 320 200 Full Screen 32,000 100%
    1 272 192 Sword of Sodan 26,112 81.6%
    2 256 200 NES (approx.) 25,600 80.0%
    3 256 176 Task Force 22,528 70.4%
    4 280 160 Defender of the World 22,400 70.0%
    5 256 160 Rastan 20,480 64.0%
    6 240 160 Game Boy Advanced 19,200 60.0%
    7 288 128 Ancient Land of Y's 18,432 57.6%
    8 160 144 Game Boy Color 11,520 36.0%
    ↩︎