+atari2600land Posted November 6, 2017 Share Posted November 6, 2017 Is there a way in INTYBasic to detect whether or not an Intellivoice is present and then make it a variable, like, for example, voiceon=1 would be a Intellivoice plugged in, while 0 would be no Intellivoice plugged in. Quote Link to comment Share on other sites More sharing options...
intvnut Posted November 6, 2017 Share Posted November 6, 2017 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. 3 Quote Link to comment Share on other sites More sharing options...
intvnut Posted November 6, 2017 Share Posted November 6, 2017 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. :-) Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted November 7, 2017 Author Share Posted November 7, 2017 The code in post #2 worked great! Thank you so much. Quote Link to comment Share on other sites More sharing options...
intvnut Posted November 7, 2017 Share Posted November 7, 2017 The code in post #2 worked great! Thank you so much. Awesome. You might want to upgrade to the minor tweak: . DEF FN voiceon = PEEK($80) + 1 . That shaves a slight bit of code size and a couple cycles. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted November 8, 2017 Share Posted November 8, 2017 In IntyBASIC v1.2.9 now you can use the syntax VOICE.AVAILABLE to check for Intellivoice available. 2 Quote Link to comment Share on other sites More sharing options...
intvnut Posted November 13, 2017 Share Posted November 13, 2017 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. 2 Quote Link to comment Share on other sites More sharing options...
freewheel Posted January 1, 2018 Share Posted January 1, 2018 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? Quote Link to comment Share on other sites More sharing options...
intvnut Posted January 1, 2018 Share Posted January 1, 2018 Is "ecs = 1" in your CFG? If so, then jzIntv will enable ECS automagically, and you need to say -s0 to force it off. Quote Link to comment Share on other sites More sharing options...
freewheel Posted January 8, 2018 Share Posted January 8, 2018 Is "ecs = 1" in your CFG? If so, then jzIntv will enable ECS automagically, and you need to say -s0 to force it off. 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 Quote Link to comment Share on other sites More sharing options...
intvnut Posted January 10, 2018 Share Posted January 10, 2018 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. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted January 15, 2018 Share Posted January 15, 2018 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. Quote Link to comment Share on other sites More sharing options...
intvnut Posted January 15, 2018 Share Posted January 15, 2018 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. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted January 15, 2018 Share Posted January 15, 2018 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. Quote Link to comment Share on other sites More sharing options...
intvnut Posted January 15, 2018 Share Posted January 15, 2018 My understanding is that it emits "ecs = 1" if you attempt to use the ECS's sound channels, and it emits "voice = 1" if you try to use voice. Otherwise, it does not emit those CFG variables. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted January 15, 2018 Share Posted January 15, 2018 My understanding is that it emits "ecs = 1" if you attempt to use the ECS's sound channels, and it emits "voice = 1" if you try to use voice. Otherwise, it does not emit those CFG variables. Your appreciation is right Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted January 15, 2018 Share Posted January 15, 2018 Your appreciation is right Aha, then, I was mistaken. Cool. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.