Re: [cc65] 65tris on ATARI

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-12-19 19:48:32


Hi!

On Thu, Dec 19, 2002 at 04:52:49PM +0100, cas_at_strotmann.de wrote:
> One problem we have to find a solution is that the multijoy needs
> initialization. before first use, the 2nd ATARI Joystick port must be
> switched into write mode (6 instructions, 15 Byte) the init could be done
> every time a joystick is read, but  this is overhead for games.

15 bytes of additional code doesn't seem like anything we really need to worry
about. It could be decreased further by adding an "initialized" flag, which is
checked and the initialization code is only executed if this flag is not set.

> I'. thinking of an init_joy function. This function can return the number
> of joysticks attached, so it's also useful for normal joystick ports. The
> init routine could also be used to switch from normal joystick to multijoy
> or other input devices. The readjoy function would then read a global flag
> set by the init routine and branch to different code.

This would mean that we're about to change the API. Which is nothing bad per
se, but since I do not even know if this API will stay (see my recent comments
about loadable modules), I would like to avoid any changes right now.

So if possible, I would prefer a change that has no impact on the API resp.
other platforms.

Another thing we can do is to decide about the module stuff now. If we make
this decision now, we can either change the API (if we decide against loadable
joystick drivers) or use modules (which needs an API change anyway). So here
are the pros and cons:

Pro loadable modules:

  1. Drivers can be written and distributed by third parties and need not
     be part of the cc65 package.

  2. Code is only loaded when needed.

  3. Driver can be removed from memory at runtime to make room for other
     stuff.

  4. Only the code for the joystick needed is in memory, no need to link
     several different joystick routines to an application.

Contra loadable modules:

  1. Loadable modules need file i/o and the heap routines, so programs
     which wouldn't otherwise need these libraries will get bigger.

  2. Platforms without file i/o support cannot load drivers, so these
     machines cannot have joystick support.

  3. Applications need additional files on the disk.


Any votes or opinions?

> Is the use of function vectors supported by cc65? (Sorry if this is a dump
> question, I'm not a 'C' wizard)

Yes.

> I fear that this would lead to different "high-nibble-flags" on different
> hardware plattforms, so a 8 joystick multiplayer game would not be
> (easily) portable from ATARI to, for example C64 Joystrick extensions.

That is correct, but without auto-detection, we do always have different flags
passed to the init routine.

> I will work on a proposal and sample source for the "init" solution, which
> for my view gives least speed-penalty and no evil defines.

I would suggest deciding about the loadable module proposal first. If we use
loadable modules in the future, the API will change anyway and the drivers
will have install/deinstall entry points (as the TGI and EM drivers). 

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-12-19 19:48:56 CET