Jump to content
IGNORED

Intellivoice detection


Recommended Posts

You might be interested in this thread: http://atariage.com/forums/topic/271515-intybasic-intellivoice-detect/

 

There isn't a lot of point saving the Intellivoice-presence in a variable. You'd be better off with a DEF FN:

.

DEF FN voiceon = PEEK($80) <> -1

.

That way, you can rewrite the example from the other thread as follows:

.

DEF FN voiceon = PEEK($80) <> -1

IF voiceon THEN
    PRINT AT 0 COLOR 7, "Voice is present"
ELSE
    PRINT AT 0 COLOR 7, "Voice is absent"
END IF

.

I'm at work, so I can't actually try it right now. But looking at the assembly code generated by it, it looks like it should work.

  • Like 3
Link to comment
Share on other sites

Actually, I suppose if you wanted to allow someone to disable voice after detecting voice was present, that could be a reason to keep it in a variable.

 

If you really, really want to spend a variable on voice present/absent:

.

voiceon = -(PEEK($80) <> -1)

.

That doesn't really buy you much in terms of execution time elsewhere.

 

Also, I did one more tweak: If you want to use the DEF FN form, the following generates slightly better code, it appears:

 

.

DEF FN voiceon = PEEK($80) + 1

.

This will return non-zero if voice is present, and zero if there's no Intellivoice. It generates 2 instructions:

.

    MVI 128,R0
    INCR R0

.

I can't run it in the emulator (or on real hardware), as I'm at work. I only have a text-only link back to my Linux box at home. :-)

Link to comment
Share on other sites

  • 1 month later...

BTW, the latest jzIntv will now carry the "enable Intellivoice" flag from an IntyBASIC program through to jzIntv, even when using .ROM format files.

 

To force Intellivoice off for testing purposes, add the flag "-v0" to the command line.

 

I notice that it also enables ECS by default now - I'm having to turn it off manually for testing. Is that normal?

Link to comment
Share on other sites

Yes. That must be IntyBASIC being "helpful". Good for most people, slightly cumbersome for what I'm doing. No big deal though, as long as I know what's triggering it :)

 

I guess it's the combination of IntyBASIC and jzIntv being helpful. :-) Setting the default behavior in either direction means someone will need a flag eventually.

Link to comment
Share on other sites

 

I guess it's the combination of IntyBASIC and jzIntv being helpful. :-) Setting the default behavior in either direction means someone will need a flag eventually.

 

True. I do believe that for most people it would be useful to have it on by default. However, I wonder if this should be a job more of the IntyBASIC SDK rather than the compiler itself (that it should set a flag by default to enable ECS and Voice). I mean, the SDK is more for newbies; while compiling by hand is more of a power-user thing.

 

It's just a suggestion to improve usability, but others should know better -- I don't use IntyBASIC so it doesn't really matter to me.

 

-dZ.

Link to comment
Share on other sites

Which aspect? The variables "ecs = 1" or "voice = 1" exist independently of IntyBASIC, and so it makes sense for jzIntv to honor these flags for games like Mind Strike and Space Spartans.

 

It also makes sense for IntyBASIC to declare what features it's using. If you ask for ECS or Intellivoice functionality in your program, it makes total sense for IntyBASIC to declare it's using those things.

 

FWIW, if those features are optional enhancements, as opposed to mandatory, it is possible to state that level of granularity in the CFG file, by saying "ecs_compat = 2" or "voice_compat = 2". Still, jzIntv will default to turning ECS and Intellivoice on when it sees those flags. :-)

 

If these enhancements are truly optional enhancements, it's up to developers to test in both modes: feature on and feature off. Whatever default end-to-end behavior you have for these flags, testing both modes will require some set of tests with a manual override to force the feature the other way. If jzIntv leaves the feature off by default, then you'll also have to test by forcing it on. If jzIntv turns the feature on for you by default, then you'll also have to test by forcing it off. There's no escaping a manual override for part of your testing if you want to support an optional feature.

 

For features such as JLP flash save—that's a tough one to code as an optional feature. IntyBASIC declares the JLP parameters, and jzIntv picks them up and uses them. Seems like a good model. For the sake of consistency, I'd say the ECS and Intellivoice variables work the same way by default.

Link to comment
Share on other sites

Which aspect? The variables "ecs = 1" or "voice = 1" exist independently of IntyBASIC, and so it makes sense for jzIntv to honor these flags for games like Mind Strike and Space Spartans.

 

It also makes sense for IntyBASIC to declare what features it's using. If you ask for ECS or Intellivoice functionality in your program, it makes total sense for IntyBASIC to declare it's using those things.

 

FWIW, if those features are optional enhancements, as opposed to mandatory, it is possible to state that level of granularity in the CFG file, by saying "ecs_compat = 2" or "voice_compat = 2". Still, jzIntv will default to turning ECS and Intellivoice on when it sees those flags. :-)

 

If these enhancements are truly optional enhancements, it's up to developers to test in both modes: feature on and feature off. Whatever default end-to-end behavior you have for these flags, testing both modes will require some set of tests with a manual override to force the feature the other way. If jzIntv leaves the feature off by default, then you'll also have to test by forcing it on. If jzIntv turns the feature on for you by default, then you'll also have to test by forcing it off. There's no escaping a manual override for part of your testing if you want to support an optional feature.

 

For features such as JLP flash savethat's a tough one to code as an optional feature. IntyBASIC declares the JLP parameters, and jzIntv picks them up and uses them. Seems like a good model. For the sake of consistency, I'd say the ECS and Intellivoice variables work the same way by default.

Perhaps I misunderstood, but I thought that IntyBASIC was setting those flags in the CFG file unconditionally and by default.

 

Of course, if they are in the CFG file, jzIntv should honor them; and of course, if the programmer requested to use ECS or Intellivoice, intyBASIC should flag the CFG file accordingly.

 

My impression was that it was doing this regardless of configuration, forcing programmers who don't intent to use them to go through the extra step of disabling the devices manually.

 

If this was wrong, then my mistake, sorry.

 

dZ.

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...
 Share

  • Recently Browsing   0 members

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