Code Monkey home page Code Monkey logo

yatssd's Introduction

Yet Another Tilemap and Super Scaler Demo

Yet Another Tilemap and Super Scaler Demo for the Sega 32X

image

image

Features

  • works on real hardware
  • draws tilemap of arbitrary size, exported from Tiled
  • scrolls in any direction, avoiding redraw as much as possible using the dirty rectangles approach
  • uses the hardware screen shift-register for smooth scrolling
  • can handle an arbitrary number of clipped sprites
  • adjustable clipping region for sprites: see the draw_setScissor call
  • uses both CPUs to draw tiles and sprites
  • sprites can be flipped on X and Y axis and/or scaled
  • "imprecise" rendering: sprites can be scaled using a cheaper and faster algorithm, the X coordinate is also snapped to the nearest even value
  • the code also supports flipping of tiles, although the tilemap format would need to be extended for that
  • it can handle an arbitrary number of tile layers along with parallax
  • the sprites and tiles can be of any size in either dimension, although if you to plan to use scaling, the size should be a power of 2
  • sprites can be scaled to an arbitrary size
  • support for dedicated sprite tile layers
  • can use the two MD layers as bitmap layers with parallax

Tiled plugins

The extensions/ directory contains Javascript plugins for exporting Tilemaps and Tilesets in YATSSD format.

The plugins require Tiled version 1.5 or newer.

More information on Tiled plugins.

Building

Prerequisites

A posix system and Chilly Willy's Sega MD/CD/32X devkit is requred to build this demo.

VSCode + Remote Dev Container

Unless you already have the devkit built, using VSCode with Docker is one of the faster ways to get started. VSCode will offer to set up a Development Container the first time the project folder is opened.

More information on Developing with VSCode inside a Container

If you're using Windows 10/11, you must also install WSL 2 and Linux distribution before attempting to build from VSCode.

VSCode settings

We recommend installing the 'Makefile tools' extension and using the following VSCode settings.json for the project:

{
    "C_Cpp.default.includePath": [
        "/opt/toolchains/sega/sh-elf/include/",
        "/opt/toolchains/sega/m68k-elf/include/"
    ],
    "C_Cpp.default.compilerPath": "/opt/toolchains/sega/sh-elf/bin/sh-elf-gcc",
    "C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools",

    "makefile.configurations": [
        {
            "name": "release",
            "makeArgs": ["-j", "release"]
        },
        {
            "name": "debug",
            "makeArgs": ["-j", "debug"]
        },
        {
            "name": "clean",
            "makeArgs": ["clean"]
        }
    ]
}

License

If a source file does not have a license header stating otherwise, then it is covered by the MIT license.

The demo uses graphical assets from Little Game Engine: https://github.com/mills32/Little-Game-Engine-for-VGA

Credits

Original code by Victor Luchitz aka Vic

32X devkit by Joseph Fenton aka Chilly Willy

yatssd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yatssd's Issues

Sprite drawing crash

I replaced the display_sprites routine to draw four sprites on the screen, three are static and one moves around based on the Hw32xGetTicks value. However, strangely in the current version, the code crashes whenever the sprite crosses the screen boundaries, either horizontally or vertically.

Using Gens KMod, the horizontal crash seems to happen on address $06000B5C (it also causes the emulator to CTD) and the vertical crash seems to happen on address $06000BCC. Using a decompiler, I figured out that the issue seems to lie on the PIX_LOOP routines, the counter seems to underflow.

Thank you for the attention!

Exporting Tiles with Tiled

Whenever I try to export a tileset to a header file I get the following error: TypeError: Cannot call method 'toString' of undefined.

I get this error on both Linux and Windows versions of Tiled.

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.