America Online APPLE II DEVELOPMENT FORUM CONFERENCE LOG Tuesday, December 15, 1992 10:00 p.m. Eastern Time Topic: C/Pas vs. Assembly, but mostly General Questions Forum Leader: Gary Jacobson (AFL GaryJ) AFL GaryJ Welcome to the Apple II Development Forum! AFL GaryJ Tonight, the *scheduled* topic is "Should I compile or Assemble?" The AFL GaryJ topic was intended for discussion on the advantages and disadvantages AFL GaryJ of either method of programming (assembly, or higher level languages), but AFL GaryJ we can also talk about what's on your mind. DanP18 Assembly (like, duh!) AFL GaryJ Of course assembly is the answer.... (sometimes :) AFA Jay it's the answer as much as C or Pascal is :) AFL GaryJ Assembly always works, but takes more development time (usually) AFC DYAJim ? (Re: Sound CDev and NL whenever) AFL GaryJ Go for it, Jim. Real questions are the best here :) AFC DYAJim First off.. I know the Sound CDev patches out the bell vector. But does it AFC DYAJim then call SysBeep? I don't think it does. Why not? AFC DYAJim I know there's probably a reason but I can't seem to think of any. Dave Lyons The Sound control panel does not generally call SysBeep from inside the bell vector, *because* Dave Lyons SysBeep *calls the bell vector*! It would be a circle. Dave Lyons Now, it's definitely weirder than that, Dave Lyons but I don't remember how. There may be a case where it does call SysBeep after setting a flag Dave Lyons so it knows what it's doing to avoid the circle. (Having a sound be "not assigned" & result in a Dave Lyons SysBeep is not the same thing as assigning a sound to "standard beep"...etc.) Dave Lyons ga AFC DYAJim You see, I'm trying to patch out all beeps and blips. AFC DYAJim I want to know when a program is beeping.. but I also have to do this in AFC DYAJim a way that can be REMOVED at any time. So right now I've got the tool AFC DYAJim dispatcher patched out for SysBeep and SysBeep2 calls, but I miss programs AFC DYAJim that go thru the bell vector (like AOL). I cant patch out the bell vector AFC DYAJim directly, because it couldn't be removed at any time if someone patched over AFC DYAJim me. Guess I'm stuck, unless there are any ideas I forgot.. Dave Lyons What? AOL calls the bell vector directly?? JWankerl Patch it, but when you leave, leave a stub behind that just goes to where it used to. AFC DYAJim Well I don't think AO uses sysbeep. AFC DYAJim hmm Joe? JWankerl You didn't follow that? AFC DYAJim not really.. how can you unpatch it? JWankerl Patch the vector, but when you unpatch, leave a little piece of code behind that simply JWankerl does a JMP >OLDVECTOR. Dave Lyons Hmmm, yeah, I bet $FBDD and Ctrl-Gs both wind up at the bell vector without going through SysBeep. AFC DYAJim Yeah, I think that's what happens with AO, Dave. Dave Lyons (To "leave code behind": GetNewID($1000), allocate some $C018-attribute memory with NewHandle using Dave Lyons the new ID, and copy your (address-independent) code into the handle.) AFL GaryJ I don't understand the AO problem... it's not picking up a SysBeep sound you've installed? AFC DYAJim Gary-I can't detect when AO is playing sounds because it doesn't use SysBeep. AFC DYAJim but wait a sec, Joe.. I stuffed my address in it, say.. AFC DYAJim then another program came along and patched over me. AFC DYAJim then I try to remove my patch. the address of my patch is no longer at AFC DYAJim bellvector but rather in the code that patched over me. AFC DYAJim so I have no way to change that address. AFC DYAJim I don't see how I could change that address, even just to do a JMP AFC DYAJim back to the old vector. JWankerl Um... you don't follow yet, Jim. You don't really unpatch anything, you just change the JWankerl patch code. Dave Lyons Jim, the code you "leave behind" would be allocated up front...to leave it behind you'd change that Dave Lyons code to quit jumping to your "interesting" code. AFL Marty I have a sysbeep sound assigned and AO uses it. How can it not be using AFL Marty Sysbeep? Dave Lyons Marty, because SysBeep calls the "bell vector" at $E1006C, and the Sound control panel calls the Dave Lyons Er, *patches* the bell vector. AFL Marty Thanks, Dave. JWankerl before you "unpatch" you have your custom code in, after you "unpatch" you simply have a piece of JWankerl code that JMPs to where the old vector (before you REALLY patched) was. AFC DYAJim oh - I think I'm starting to understand :) AFC DYAJim so I have to allocate this little stubble code seperatly from the BEGINNING AFC DYAJim and then when it is time to unpatch, I set a flag so the stubble stops calling AFC DYAJim me and it just stays in memory by itself from then on. JWankerl right. Or just change where the code jumps to. No flag needed. JWankerl Set up your stub first to go to you, then when you leave, make it go to the old vector. AFC DYAJim alright. thanks for the ideas, guys. I'll have to ponder the thought of AFC DYAJim leaving remanents of myself behind :) (but I do understand it now :) AFC DYAJim GA, and put me in for another ? at the end of everyone :) AFL GaryJ Maybe we can discuss the problem a little more later on, after we let other people AFL GaryJ have their turns. HURLANT I heard about a glue code entry point for the Toolbox in C. What is that? Dave Lyons There is a good technical note that explains it in detail. Basically, it's a 2nd tool-dispatch Dave Lyons point ($E10004), which is just like the regular one at $E10000, except it expects an extra return Dave Lyons address to be on the stack already. -- Using the Glue entry gives your compiler's library routines Dave Lyons a chance to post-process function results to put them in the compiler's preferred form (for example, HURLANT Is that the "inline" entry point? HURLANT I have heard about? Dave Lyons Pascal might post-process booleans toomake them all $0000 or $0001). Dave Lyons GS/OS has an "inline" entry and a "stack based" entry. Those are separate from the toolbox; Dave Lyons the toolbox has four entries: system, system glue, user, and user glue. That is, Regular and Glue Dave Lyons for the regular System tool sets, and another pair for the User tool sets, which people don't seem to Dave Lyons use much. I'll look up the technote # and instant-msg it to you. GA HURLANT I am done. AFL GaryJ Thanks, Dave HURLANT I would like to write a 3200 mode xcmd. HURLANT For Hypercard HURLANT I would like to know if I can disable interrupts for a few seconds. MikeF32 Well, if you're doing 3200, you have to... HURLANT And would it be possible to do paintworks animations with an xcmd? HURLANT In Hypercard? DYA Derek I released some code to do 3200 color picture display. it's in the DYA library DYA Derek if you want to see it. MikeF32 Paintworks animations are EASY HURLANT Orca/M? HURLANT Source code Derek? MikeF32 As for 3200s, with FinderView we made them a preferance (incase you had AFC DYAJim It's bad (to disable interrupts), but there isn't any way around it (is there?) MikeF32 AppleTalk)... In FV, we also use GetNextEvent with ints ON during VBLs on MikeF32 3200s, which turned out to be a -real- bad idea...just my $.02 AFL GaryJ 3200 kind of needs the non-interupted environment. That's why I didn't think it was AFL GaryJ a likely candidate for an xcmd MikeF32 Well, do xcmnds need ints on? MikeF32 Most things can -live- with ints off MikeF32 MikeF32 JWankerl You can always experiment and see... :-) DYA Derek FinderView doesn't turn off the cursor, btw. I think it should for 3200s. MikeF32 No, it does...the problem with mouse movement is that it DOES call MikeF32 GNE... MikeF32 This is something that will change in 3.1 DYA Derek ah - I see. AFL GaryJ Ok, did you have anything to add in follow up, Hurlant? HURLANT I was just wondering if Hypercard was more touchy than most in regard to 3200. AFL GaryJ Well, I'm not sure that Hypercard *requires* any kind of interrupt, I would think that AFL GaryJ it would not not be good idea due to the nature of the environment. AFL GaryJ But, I have not tried it to see what happens, so I'm just guessing :) AFL GaryJ Some users may not be happy with interrupts being turned off,, depending on what they AFL GaryJ have installed. MikeF32 Problem is: How are you going to know when to quit showing the 3200? MikeF32 AFL GaryJ Exactly. AFL Marty Jonah Stich did a 3200 color display xcmd for HyperCard IIGS some time ago... AFL Marty It was never finished, however. I'm not sure if anyone has the source code AFL Marty (other than Jonah) but I'll try to find out. HURLANT I have posted to him AFL GaryJ It's been a long time since I've seen Jonah around here :) JWankerl Anyone know where Jonah vanished to? AFL Marty As I recall, it had problems with restoring the palette once you AFL Marty were finished viewing the picture. HURLANT on Genie and AOL, no response. AFC DYAJim I have a lot of Jonah source, but none to the 3200 xcmd AFL GaryJ Ok, Jim, we'll let you go ahead with your other question now :) AFC DYAJim Alright.. this is in regard to niftylist.. AFC DYAJim the "`" eval command AFC DYAJim I think it would be excellent if you could say do: AFC DYAJim `1234+56l and have the evaluated argument passed to the next command, AFC DYAJim so $128a would be listed in this example.. AFC DYAJim in fact, I thought you COULD do this, but then I kept wondering why I was AFC DYAJim getting screwed up :) I thought I typed in the wrong number or something, AFC DYAJim and eventually noticed that you couldn't use ` like this JWankerl (I think it'd be great if you could to "\bString" or "\wString" (not \p, to be consistant with JWankerl ORCA/C 2.0 ;-) LL AndyW You can do that in the the call itself.. AFC DYAJim (ga) Dave Lyons Ick, they use \b for "byte string"? \p is pseudo-standard.... LL AndyW \p is for pointer in ANSI C.. JWankerl Yup - it's \b now since ANSI actually uses \p. Dave Lyons On ` expressions....yeah, I should stuff the result as the current-address, at least. Hmmm, does it Dave Lyons do that already (if you put the next cmd on the next line)? AFC DYAJim let me check Dave AFC DYAJim nope Dave Lyons What, I don't understand \p = pointer...this is separate from %p = pointer in printf(), right? LL AndyW Right... AFC DYAJim (the "`" command would be infinitely more useful if it worked like this :) LL AndyW Wait a sec.. It isn't \p to \b, it's %p to %b... JWankerl It is? Oh well. So much for my memory... :-) I knew *something* changed... Dave Lyons Good, so I can keep \p and not incur the wrath of the ANSIgods? MikeF32 LL AndyW Right Dave.. Spottysoft (tell them you had it first Dave :) LL AndyW I'v been having a problem with the serial port firmware. LL AndyW At first, I was getting system death error $01 (65535 unclaimed ints). LL AndyW Now, it just locks up on me. LL AndyW In setting this thing up, I'v been assuming that the convention of passing LL AndyW a nil pointer when there's no interrupt handler is the proper thing to do, so LL AndyW I'm issuing the setintinfo call with bit settings of 0 and completion routine LL AndyW pointer of 0. Should I be doing this when I want the firmware to handle all LL AndyW the ints? or is there another way I should be doing it? AFL GaryJ I'm looking at my manual, Andy.... trying to remember how I did it.... LL AndyW The info in the firmware ref is scanty at best.. LL AndyW I'v tried it with and without allocating an interrupt buffer (16k) LL AndyW Maybe I should be doing a getintinfo to get the current pointer first, then LL AndyW pass that back to it? LL AndyW Anything from the Apple people here? (Dave, Matt) LL AndyW Only thing I'v found in the tech notes is about direct SCC access.. Matt DTS I try to stay away from the serial firmware, sorry. :) LL AndyW I'll bet you do Matt.. LL AndyW BTW, I'm doing this from P8.. AFL GaryJ I don't remember ever using SetIntInfo in my program, yet I used the AFL GaryJ built in buffering. Let me look some more here, Andy, and if I see something AFL GaryJ that pops out at me, I'll let you know. MikeF32 Ok, well, I was just going to ask about ORCA/C 2.0. What's it's deal? MikeF32 I heard it wasn't done yet...but he's been hyping it... LL AndyW What do you mean Mike? You looking for advance info about C 2.0? MikeF32 Someone told my today it was shipping...but I guess it's not... when will it be? LL AndyW He had a conference on GEnie last night, and he said we can talk about it after LL AndyW the conference. There is no release date yet. AFA Jay I got stuff in the mail last week about Orca/C 2.0 MikeF32 Ok, what's new with it? LL AndyW That's a tough one. There's a lot of bug fixes. Also, Prizm has been updated LL AndyW to work with an unpdatd shell 2.0. AFA Jay faster compile, better optimizations LL AndyW I wouldn't say faster compiling.. LL AndyW Slower when it's creating the header file. MikeF32 Any library improvements? AFA Jay prototyped headers. AFC DYAJim Mike's upgrades never feature faster compiling (ASM65816 2.0, CC 2.0..) guess AFC DYAJim the only exception to this is Linker 2.0 which was superfast over 1.x.. DYA Derek (speaking of C compilers - anything happen with lcc?) Jim Murphy Ummm, if you guys don't mind the conflict of interest ( :-) ), I can upload the GEnie RTC transcript. LL AndyW The library has been changed. There are additional pragmas to support various LL AndyW system specific things that the libraries now support. LL AndyW Also, there's no ORCALIB/ORCAGLIB any more. The #pragme memorymodel does it LL AndyW all for you.. MikeF32 GOOD!!!! MikeF32 AFC DYAJim That's how it should have been in the first place (re: memorymodel) LL AndyW The compiler is more ANSI conforming too. Some of the optimizations are better LL AndyW than before, some (IMO) aren't as good as before. MikeF32 In other words: ORCA/C 2.0: everything 1.0 should have been... LL AndyW But the best part, with Prizm, you can see the values and such in structs as LL AndyW well as simple variables.. AFC DYAJim nifty.. AFL GaryJ Andy, it's been two years since I've looked at my modem code... AFL GaryJ I'm trying to figure out how I implemented the serial initialization. AFL GaryJ You're not trying to change the buffer size or anything like that, are you? LL AndyW The init's working fine. It's only when the modem answers the ring that the LL AndyW system hangs.. LL AndyW I'v tried allocating a buffer, and not allocating a buffer. Same problem LL AndyW either way.. LL AndyW You can't change the buffer size.. Only give it a new one.. LL AndyW Of course, you can issue a ChangeHandleSize, then reinstall the buffer I guess. LL AndyW Gary, is there any other info besides that in the FW ref?? AFL GaryJ The firmware ref is about it.... LL AndyW Maybe there's a technote I missed somewhere.. LL AndyW (Where's Jawaid when there's a ? he might have been able to answer) :) AFL GaryJ I thought the firmware ref helped me out well enough.... but... I guess AFL GaryJ I must have been lucky :) I did read it over and over about 50 times before AFL GaryJ I understood what was going on, though, but now I seem to have LL AndyW Well, there's not much info on the get/setIntInfo stuff.. AFL GaryJ forgotten everything :) AFL GaryJ I think I'm just resetting my control panel settings, and working that LL AndyW Like, it says nothing about what to do if you want the firmware to handle all LL AndyW interrupts.. AFL GaryJ way in my routine. I believe I required that the control panel setting be AFL GaryJ set to buffering. LL AndyW Well, mine is set to buffer, but it still hangs.. LL AndyW Well, I guess it's time to plug in the DDT-16, and find out what's going on..! LL AndyW Well, I gotta get going.. Should have been somewhere 1/2 hour ago.. Bye!!