Jump to content
IGNORED

Mindlord built a little a few GCC doodads.


mindlord

Recommended Posts

My current plan is to make a game similar to Adventure for the 2600 / Legend of Zelda / Guardian Legend.

Overworld Exploration with stuff to fight + Dungoens / Puzzles / minigames. That is if I can cram enough in.

Tursi's LIBTI99 laid some really good groundwork, but I'm trying to extend that with some really useful routines.

  • Software Sprites (This is the big one - because it will mean more enemies on the screen and no flicker)
  • Per-Pixel character blitting routines
  • Per-Pixel character scrolling
  • Coherent noise (al-la libnoise)
  • 8x8 and 16x16 character 90° rotation
  • 8x8 and 16x16 character flipping
  • linear/bilinear interpolation for acceleration/deceleration and stuff
  • Layered sprites (A framework that takes a software sprite and layers a hardware sprite or two on top to create multi-color characters) Like this:
    post-43109-0-61434000-1462639112.png
    The shadow is just normal characters that use the software sprite routine to move around and the colors are two hardware sprites on top, but they are all tied together with one STRUCT to manage position and animation frames.

Just stuff that any game programmer would appreciate. Ideally some high speed routines would make it easier to cram more game in since you wouldn't have to have so much ram taken up by character data since you can quickly and easily flip and rotate stuff. I'm not an Assembly language genius or anything, and I'm sure there's plenty of room for improvement in my routines, but I think it's a good start so far.

Coherent Noise can be used to seed level data and procedurally generate maps and enemy behavior instead of storing *ALL* the level data in RAM on on Disk.

  • Like 4
Link to comment
Share on other sites

Sorry to be dumb, but what is the LIBTI99?

LIBTI99 is Turi's library of basic functions for GCC development. Together with TMS9900-GCC from Insomnia it makes developing C applications and games for real TI hardware pretty easy. Well, a lot easier than learning straight assembly.

The library handles the bare metal stuff, like setting up the display and pushing bytes to and from the VDP. Surprisingly easy to get a handle on. If you are familiar with stuff like SDL or Allegro you can probably use LIBTI99 to make games or applications for the TI.

  • Like 1
Link to comment
Share on other sites

It's just something I add to when I do dev myself... by making it public domain I figured I absolved myself of needing to do proper updates or support. ;) But it's always nice to hear it's useful to someone else.

 

I also have a port of it to the ColecoVision, in hopes that eventually my work will be portable between the two systems. libti99coleco ;)

Edited by Tursi
Link to comment
Share on other sites

Here's the source to my LIBTI99 extensions.

Header follows so you can see what's included (So far).

I welcome suggestions.

// VDP_help header for the TI-99/4A by Sean James aka Mindlord
// 5/15/2016
// This code and library released into the Public Domain
// You can copy this file and use it at will 

#ifndef VDP_HELP.H

#define VDP_HELP.H

// *** UTILITIES ------------------------------------------------------------------***

// ***reverse ***
// utility function for revrese the order of bits in byte n.

unsigned char reverse(unsigned char n);

// *** Noise3D ***
// Given 3 variables and a seed will always return the same random number with same
// inputs. Close numbers tend to generate close results, but is still pretty random.

unsigned long Noise3D (int x, int y, int z, int seed);

// *** Noise ***
// Returns a random integer from the seed number n. The same n always returns the same
// result.
unsigned long Noise (long n);

//*** -----------------------------------------------------------------------------***


//*** Functions--------------------------------------------------------------------***
// *** char_blit ***
// takes an ASCII Character buffer (a=95, "space"=32, etc..) and clears it, and the
// next four characters and "blits" bytes into it at the specified xoffset and yoffset.
// generally used internally for software sprites, but can also be used externally for
// animation effects like opening doors. Bits that fall outside of the border of the
// buffer characters are truncated automatically.
void char_blit(int buffer, int xoffset, int yoffset, const unsigned char *bytes);

// *** char_flip ***
// Takes an ASCII Character source (a=95, "space"=32, etc..) and flips it horizontally
// NOTE: I intend to extend this function to include vertical flips as well.
void char_flip(int source);

// *** char_pattern ***
// Takes a "long long int" as a single numeric value and transforms it into a unsigned
// char* for pumping into VDP memory. Totally unnecessary, but makes code a little cleaner.
void char_pattern(int destination, unsigned long long bytes);

// *** char_push ***
// Takes an ASCII Character source (a=95, "space"=32, etc..) and pushes it offset pixels
// into ASCII Character target. The dir parameter indicates the direction and type of PUSH
// and accepts enumerated types of "push_dir." 0-3 "pushes" the pixels from source to target
// and moves target pixels along with the offset as well, adavancing all pixels by the offset.
// 4-7 "shoves" the pixels from source to target overwriting the existing pixels and the target
// pixels don't move in response.
void char_push(int source, int target, int dir, int offset);

// *** char_rotate ***
// takes an ASCII Character buffer (a=95, "space"=32, etc..) and rotates it.
// the dir parameter should be 0 for counter-clockwise (left) or 1 for clockwise (right).
void char_rotate(int source, int dir);

// *** sprite_motion
// Set a sprite's auto motion variables
void sprite_motion(int n, int x, int y);

// *** sprite_position
// set a sprite's position variables
void sprite_position(int n, int x, int y);

// *** sprite_pattern
// set a sprite's pattern variable
void sprite_pattern(int n, int ch);

// *** sprint_color
// set a sprite's color
void sprite_color(int n, int col);

// *** get_sprite
// fills the variables with the sprite information
void get_sprite(int n, int *ch, int *col, int *x, int *y);
#endif

 

vdp_help.zip

  • Like 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...