========================================================================= (C) 1994 by Atari Corporation, GEnie, and the Atari Roundtables. May be reprinted only with this notice intact. The Atari Roundtables on GEnie are *official* information services of Atari Corporation. To sign up for GEnie service, call (with modem) 800-638-8369. Upon connection type HHH (RETURN after that). Wait for the U#= prompt.Type XTX99437,GENIE and press [RETURN]. The system will prompt you for your information. ========================================================================== ************ Topic 31 Tue Dec 25, 1990 TOWNS [John@Atari] at 22:11 EST Sub: Ask _ANY_ Programming Question That's right.. Ask _any_ Programming Question. No question is considered dumb.. Read on! 200 message(s) total. ************ ------------ Category 3, Topic 31 Message 1 Sun Nov 14, 1993 S.FARSHIDGH [NIMA] at 14:14 EST Hi Everyone, I have a question in assembly, it is: When you call the supervisor mode, where is the return value stored, so that I could save it for the time I am coming back to the usermode again, e.g. ;to call superexec mode clr.l -(sp) ;or move.l #0,-(sp) move.w #$20,-(sp) trap 1 ; call gemdos with superexec opcode addq.l #6,sp ; now I want to save the return value, where is it stored? On the stack itself, or in d0/d1? ------------ Category 3, Topic 31 Message 2 Sun Nov 14, 1993 MIKE-ALLEN [NM~SysOp] at 20:01 EST Nima, First, your example is not Supexec(). Supexec is XBIOS call $26. Your example is GEMDOS call Super(). What you have done is place the 68k into the supervisor mode without changing to a new supervisor mode stack. No problem, the location of the supervisor stack when you placed the 68k is returned in d0. If you plan on using d0 while in supervisor mode, save it somewhere because you need it to return to user mode. I never count on being able to use the registers to pass info, except as documented, when using system calls. I guess one could use the stack, but I find it easier just to stash the values in the BSS, then when I return from supervisor mode, I just load them as needed. So, continuing your code segment: move.l d0,save_ptr ;save the supervisor mode stack ptr .... do what ever you need to do in supervisor mode. .... assume you have some results in d0 and d1 move.l d0,value_1 move.l d1,value_2 move.l save_ptr,-(sp) move.w #$20,-(sp) trap #1 addq.l #6,sp .... Now back in user mode and can continue. section BSS save_ptr: ds.l 1 value_1: ds.l 1 value_2: ds.l 1 This is probably a bit of a brute force approach and I'm sure some of the astute folks will come up with more elegant code. However, this works for me. Mike Allen ST HelpDesk~Sysop Written: 5:35 PM Mountain Time Sunday, November 14, 1993 ------------ Category 3, Topic 31 Message 3 Sun Nov 14, 1993 K.ESTES [Kenne@SFRT] at 21:53 EST I thought somebody already wrote a program to strip MacBinary Headers. ------------ Category 3, Topic 31 Message 4 Mon Nov 15, 1993 DMJ [dmj] at 02:04 EST Mike, Usually what I do when I use GEMDOS(32) goes something like this: clr.l -(a7) ; Going in... move.w #32,-(a7) ; _super trap #1 ; GEMDOS(32) addq.l #6,a7 ; Adjust stack. move.l d0,-(a7) ; Save old ssp on the stack. ... do supervisor stuff here ... move.w #32,-(a7) ; _super trap #1 ; GEMDOS(32) addq.l #6,a7 ; Adjust stack. When you call the operating system, you should ALWAYS assume that d0-d2 and a0- a2 are trashed. Usually, any return value is returned in d0. d3-d7 and a3-a7 are safe; I use these registers to store values that I need to keep across system calls, but don't want to use the BSS for. -dmj ------------ Category 3, Topic 31 Message 5 Mon Nov 15, 1993 R.WHITTAM [Ron - ABUG] at 02:34 EST >I thought somebody already wrote a program to strip MacBinary Headers. Yup. That's what MAC_SEE and MAC_READ do. However, I believe Peter is looking for a way to move MAC files from a MAC computer to an Atari running SPECTRE (the MAC emulator). He does NOT want the transfer program to strip the MacBinary Headers. Got a way to do that? Any MAC/Atari programmers out there? By the way, Peter, Dave Small has a topic in this RT for the MAC emulator Category 4 topic 44. Maybe you can get your answer from him, eh? Ron - ABUG ------------ Category 3, Topic 31 Message 6 Mon Nov 15, 1993 M.HERZIG [BeebleBrox] at 22:32 EST K.ESTES The Mac file header is the first 128 bytes of a Mac file and you can take it out with any monitor program. However, that's what I exactly need: A Mac EPSF file WITH a intact header. There are MANY ways of moving files between Mac and ST. As soon as my Spectre is back running that problem will be solved. However, there are still these LAN ports on LC III and MEGA STe that I would like to use... Peter ------------ Category 3, Topic 31 Message 7 Tue Nov 16, 1993 K.ESTES [Kenne@SFRT] at 00:49 EST Aha! ------------ Category 3, Topic 31 Message 8 Thu Nov 18, 1993 R.BOWEN1 [Bob, SLC, UT] at 04:44 EST Peter, have you tried using MS Dos disks? I know there are a couple of programs on the Mac that will enable to read and write to DOS disks then the atari can read them. Robert Bowen ------------ Category 3, Topic 31 Message 9 Thu Nov 18, 1993 M.HERZIG [BeebleBrox] at 23:26 EST Bob, SLC, UT Yes. That's how I do it now. Works quite flawless. But takes the mac file header out. Peter ------------ Category 3, Topic 31 Message 10 Fri Nov 19, 1993 A.FASOLDT [Al Fasoldt] at 08:43 EST Robert, All new Macs can read from and write to standard-format disks (so-called PC format disks). This is built into the Mac's hardware and software. Al ------------ Category 3, Topic 31 Message 11 Fri Nov 19, 1993 M.HERZIG [BeebleBrox] at 21:39 EST Al, Indeed all new Macs can do that. But to do this you use the Apple File Exchange software. This works with different 'conversion' files. Some will let you transfer data between particular applications on Mac/MS Dos. As far as I know there are about four or five transfer protocols available. As most things Mac, it's not so easy to write your own protocols. Peter ------------ Category 3, Topic 31 Message 12 Fri Nov 19, 1993 DMJ [dmj] at 23:37 EST That's funny, the Mac I have in the other room let me copy files directly onto a PC disk, no "Apple File Exchange" required. Just dragged the files onto the disk icon. It put the data fork(?) in the root directory, and the resource fork in a "resource.frk" subdirectory. Guess it depends on the Mac, and which version of the Mac System you're using. -dmj ------------ Category 3, Topic 31 Message 13 Sat Nov 20, 1993 A.FASOLDT [Al Fasoldt] at 06:09 EST Peter, Good point. I have been telling my users to go ahead and import from DOS disks (into Pagemaker and Freehand, mostly) by following the little help balloons, or whatever they get those days from Sy$tem 7.x, and no one has complained. Al ------------ Category 3, Topic 31 Message 14 Sat Nov 20, 1993 R.BOWEN1 [Bob, SLC, UT] at 11:58 EST Well peter, you could go the real roundabout way if all you need to transfer is a few files... Call you local BBS and E-mail them to yourself. Rob ------------ Category 3, Topic 31 Message 15 Sat Nov 20, 1993 M.HERZIG [BeebleBrox] at 20:10 EST DMJ That's indeed funny. What Mac do you have in the other room? Do you happen to have DOS mounter installed? That requires no Apple File Exchange. The hint about where it puts the resource fork is interesting - that may be the missing link to be able to reconstruct the complete file on the ATARI side. Bob, Thought about that, too. But this is getting out of hand - come to think of it, this 'programming question' was probably too dumb for this topic. Let's talk ATARI! Peter ------------ Category 3, Topic 31 Message 16 Sat Nov 20, 1993 R.WATSON15 [Wayne Watson] at 23:16 EST I need some help on the SCC serial chips and hoping someone can help. I can determine the Carrier Detect status ok but, that is as long as a modem is hook up to port 2 on my MSTE. If I do not have anything hooked up to the port, the call always returns a TRUE condition. What I have right now is something like... MOVE.B #0,$FF8C85 MOVE.B $FF8C85,d1 Only in GFA it is... SPOKE 0, &HFF8C85 ! &H just tells it the value is HEX. x%=PEEK(&HFF8C85) ! put the result of the read into x% PRINT BTST(x%,3) ! Check bit #3 of the variable and print ! the result (TRUE or FALSE). What else do I need to do to get the acurate status of the Carrier Detect line. Any help would be appreciated. ------------ Category 3, Topic 31 Message 17 Sun Nov 21, 1993 DMJ [dmj] at 01:48 EST BeebleBrox, The Mac is a Performa 600. It's not mine, and I don't use it very often, and I'm not a Mac freak, so I couldn't tell you all the relevant details... but yes, it does put the resource fork in a separate folder. I can only presume that if you then read the file back onto a Mac drive, it would look in that folder for the rest of the file. As a matter of fact, it would be a fairly trivial exercise to reconstruct the entire file with a MacBinary II header on it, with both parts provided. -dmj ------------ Category 3, Topic 31 Message 18 Tue Nov 23, 1993 M.HERZIG [BeebleBrox] at 18:56 EST DMJ, Do you have any concrete ideas of how to reconstruct the mac file on the ATARI. I loaded down a wealth of programming info on the Mac from the Mac Developers RT. But these files are still on my ATARI Harddisk, because I haven't found 'the way'. Talk about catch 22. Any ideas? ------------ Category 3, Topic 31 Message 19 Tue Nov 23, 1993 R.FEINMAN [R.FEINMAN] at 20:11 EST Hi! It's been a bad day, nothing worked. I'm trying to hack through a compiled program and I can't get anywhere with my usual tools. For some reason Templemon no longer recognizes the ALT-HELP sequence. Laser DB loads the program at an odd address, etc.. So I decided to try the version of Devpac that was on an ST Format disk this summer. Naturally there is absolutely _no_ documentation on how to run it. I figured out that some of the Alt, Control and regular keys do things, but not always what. Could someone with knowledge of MonST tell me a few of the more important things. For example, if you run in slow mode how do you stop? What keys allow single step and which allow running through a subroutine? What do "O" ^T, ^W, ^Y and ^Z do? If I can try this for awhile in a useful fashion, maybe I'll consider upgrading to version 3. Thanks... Bob Feinman ------------ Category 3, Topic 31 Message 20 Tue Nov 23, 1993 J.FRENCH2 [James French] at 21:14 EST Can anyone provide me with C source code on how use XBIOS 16-keytbl? I want to remap my keyboard to display some characters >ASCII 128. Thanks in advance. James ------------ Category 3, Topic 31 Message 21 Tue Nov 23, 1993 DMJ [dmj] at 23:27 EST BeebleBrox, It has been a long time since I looked at this stuff. If you still have Mac stuff on your Atari hard drive, you probably have them wrapped with MacBinary I or II wrappers. If not, you'd need to reconstruct those wrappers and the resource fork that the Mac needs. I'm not a Mac programmer (I'm hardly even a Mac user) so I have no concrete information for you. Sorry... -dmj ------------ Category 3, Topic 31 Message 23 Fri Dec 10, 1993 C.ROUNTREE2 [RoadKill] at 02:51 EST I'm having a problem dealing with PNT files. I'm loading a pic up and dithering it. To do so I have to have an accurate color pallete. Unfortunately PNT files save the VDI pen colors, and NOT the system specific colors. Is there anyway I can get the colors out of the system pens in the right order to connect them with the system specific graphics? I could be loading 2 bit graphics, or 8bit, I need to be able to deal with both. Also, anybody have a Packbits compression routine laying around? This is the compression system used for Dega PC1, IMGs, MAC paint files and PNTs. ------------ Category 3, Topic 31 Message 24 Fri Dec 10, 1993 J.STANFORD2 [John] at 18:55 EST To build a LookUp Table of vdi pen # to hardware register # do the following (in vdi pseudocode): p[0]=p[1]=p[2]=p[3]=0; for(pen=0;pen #include #include STACK(1024); char menu_title[] = " TEST "; void main(void) { int AP_ID; AP_ID = appl_init(); menu_register(AP_ID,menu_title); for(;;) { short msg[8], junk; } } Russ ------------ Category 3, Topic 31 Message 31 Mon Dec 13, 1993 E.MONACO [DataBasement] at 21:27 EST >Could someone tell me why this bombs? This is my first attempt > at prgming an ACC... > >#include #include #include STACK(1024); char >menu_title[] = " TEST "; void main(void) { > int AP_ID; > AP_ID = appl_init(); > menu_register(AP_ID,menu_title); > for(;;) > { > short msg[8], junk; > } } > >Russ >---------- Russ, Assuming your using the correct start up stub, and your not getting errors from the appl_init, and menu_register calls, I do see one problem if you've compiled it as above... When programming an acc you need to (at the minimum) have an infinite loop, inside this loop you have to wait for messages (specifically the AC_OPEN message) and then you have to handle the messages... The OS loads acc's into memory and starts them... when it gets the accs first evnt_XXXXXX call, it notes the call and continues with loading any/everything else. So not having an evnt_XXXXXX call in your infinite loop may be causing the problem. (course I would think this would just cause the machine to lock up ... maybe you should move your msg[8] & junk definitions outside of the infinite loop as well.) When you get the AC_OPEN message you'll open your window... display your form... or whatever... Here is an example from The "Kitty" Lock, a program available here on GEnie; /* Handles acc control */ void acc_main(void) { short msg[8]; /* AES message buffer */ init(); /* do initialization common to prg and acc */ if((menu_id = menu_register(_AESglobal[2]," The \"Kitty\" Lock")) == -1) exit(EXIT_FAILURE); /* register acc, exit on failure */ /* main acc loop */ while(1) /* infinite loop */ { evnt_mesag(msg); /* get current message */ handle_message(); /* handle any received message */ } /* end while */ } /* end of acc_main */ My program uses an autodetecting start up stub. If launched as an acc the above function is called from main()... thats pretty much it... handle_message() as it says, handles any AES messages the acc receives (like AC_OPEN). init() handles things like appl_init() and loading and fixing up the resource. Hope this helps. -=Erin @DataBasement Software ------------ Category 3, Topic 31 Message 32 Tue Dec 14, 1993 R.LUNSFORD2 at 05:03 EST Erin, Thanks much...fixed the problem, not sure what it was though :). now I have a new one...The acc, when activated, checks for AC mess's and W_TOP, etc....it also makes a call to another function which sends a coupla chars out the RS232 port every 2 mins....The only problem with it is the fact the the chars only get sent when I click on the window... I can sit there and stare at it for 2:30, click the window mover bar, then it sends the chars...I'm using Bconout for the output...I'm wondering if maybe I should have another case in my switch(msg[0]), tried default, but still won't work...ideas??? Russ ------------ Category 3, Topic 31 Message 33 Tue Dec 14, 1993 DMJ [dmj] at 20:12 EST Russ, Are you using a timer event to return control to your accessory every two minutes? If you are using evnt_mesag() in your endless loop, your accessory will only run when there is a *message* for it. You need to use evnt_multi(), so you can use a timer event as well as AES messages... set the timer for two minutes, and then when the timer event occurs, send your characters. -dmj ------------ Category 3, Topic 31 Message 34 Wed Dec 15, 1993 R.LUNSFORD2 at 02:52 EST dmj, drrrr....thanks. I was sitting there writing my own routines for timer control...didn't even think about what the os had to offer! Don't use evnt_multi very much so I excuse myself this time :^)... Thanks again... Russ ------------ Category 3, Topic 31 Message 35 Wed Dec 15, 1993 E.MONACO [DataBasement] at 05:15 EST Russ, Glad you fixed the problem... btw, having just an infinite loop where I don't get events and handle them ends up tying up the computer... It didn't bomb though. Ok as to your Bconout problem... I assume in your infinite loop that you are using evnt_multi() to wait for messages or a timer value of 120,000 milliseconds. Locount = 0xD4C0 : Hicount = 0x1 Then when the AES returns from evnt_multi, you check to see if its a message if so handle them, or if its the timer then jump to your RS232 output function... return to infinite loop and do it again. If you are just using messages I could see why your routine doesn't work till you click the move bar... (ie, generate an AES message). -=Erin @DataBasement Software ------------ Category 3, Topic 31 Message 36 Wed Dec 15, 1993 HISOFT at 13:17 EST Further to what John Stanford said in Msg 24 TT Low and Falcon 256 colour modes in fact use the same mapping of VDI colours to pixel values - it is only some video cards that do this differently to Atari. Dave Nutkins, HiSoft. ------------ Category 3, Topic 31 Message 37 Wed Dec 15, 1993 J.STANFORD2 [John] at 19:24 EST Dave: If thats the case then Atari changed it for the production machines. It is most decidedly _not_ true on the German developer machine I have. But none the less what I said holds true: _never_ assume the ordering. Video cards are here to stay whether you like it or not. John Stanford ------------ Category 3, Topic 31 Message 38 Thu Dec 16, 1993 R.LUNSFORD2 at 07:58 EST I assume that all you have to do to play a sound file on the falcon is the following: Setbuffer() Setmode() soundcmd() buffoper() of course with the relevant parameters...I have tried this in GFA, C, and assembler, and so far have only gotten it to work in GFA (no idea why)... Here's the assembler code that I have: READ sound file into file then.... move.l #file+20000,-(sp) move.l #file,-(sp) move.w #0,-(sp) move.w #setbuffer,-(sp) trap #14 lea 12(sp),sp move.w #2,-(sp) move.w #setmode,-(sp) trap #14 addq.l #4,-(sp) move.w #1,-(sp) move.w #6,-(sp) move.w #soundcmd,-(sp) trap #14 addq.l #6,sp move.w #1,-(sp) move.w #buffoper,-(sp) trap #14 addq.l #4,sp data even setbuffer equ $83 setmode equ $84 soundcmd equ $82 buffoper equ $88 BSS EVEN handle: ds.w 1 file: ds.b 20000 ========================================= And the C code: #include #include #include main() { const char filename [] = "c:\\sounds\\scream.avr"; short handle; long *buffer; long length; buffer = malloc(10000*sizeof(long)); handle = Fopen(filename,0); printf("opened file\n"); length = Fread(handle,10000,buffer); printf("read %d bytes\n",length); Fclose(handle); printf("%s\n",buffer); length = setbuffer(0, buffer+30, buffer+10000); if(length==0) printf("buffer set successfully\n"); length = setmode(2); if(length==0) printf("8-bit mono set\n"); length = soundcmd(6,1); if(length==0) printf("12.5 MHz set \n"); length = buffoper(1); if(length==0) printf("buffer play enabled\n"); return 0; } =================================== Why is it that neither of these methods work, but the equivalent in GFA works fine? Russ PS Sorry if the formatting's bad... ------------ Category 3, Topic 31 Message 39 Thu Dec 16, 1993 PG.MUSIC [PG-Kevin] at 12:08 EST R.LUNSFORD2, 12.5 MEGA Hz? :) --Kevin I saved the code. I'll try to look thru it in a spare moment... ------------ Category 3, Topic 31 Message 40 Thu Dec 16, 1993 R.LUNSFORD2 at 18:34 EST Kevin, Got me on that one...did some mindless copying from the Compendium. Didn't even notice what I typed...but hey, it's only a comment :^)... Russ ------------ Category 3, Topic 31 Message 41 Thu Dec 16, 1993 PG.MUSIC [PG-Kevin] at 19:31 EST Russ, For one... your program looks like it starts the sample playing and then immediately terminates, causing TOS to release the allocated memory to load stuff in over your sample. Also, I need to look at it closer. --Kevin ------------ Category 3, Topic 31 Message 42 Thu Dec 16, 1993 R.LUNSFORD2 at 21:31 EST Kevin, Sorry about that...I do wait for a keypress at the end of it now... I picked that up after looking at it a few times :)...thanks for the interest in my problem, Russ ------------ Category 3, Topic 31 Message 43 Fri Dec 17, 1993 E.MONACO [DataBasement] at 20:09 EST I have written this bus error handler; CSECT text,code XDEF _bus_error _bus_error: movem.l A1,-(A7) save reg A1 movea.l $3E8,A1 get pointer to our struct move.l A0,(A1)+ store fault address move.l #$01,(A1) buserr = TRUE movem.l (A7)+,A1 restore reg A1 addq.l #$8,A7 adjust stack pointer add.l #2,$2(A7) inc return address by 2 rte return from exception END Because I've had to modify the stack pointer and return address to insure that I'll return to the instruction after that which caused the error, I wonder if I am going about this the right way? In the above routine I had to inc the stack pointer by 8 bytes so it points to the status register which was saved at the time of the exception (bus error) according to my 68000 book, those 8 bytes shouldn't even be there, what gives? -=Erin @DataBasement Software ------------ Category 3, Topic 31 Message 44 Fri Dec 17, 1993 DMJ [dmj] at 23:11 EST Erin, I can't seem to locate the reference, but I remember seeing (somewhere) that the 68000 throws some extra stuff on the stack during a bus error (but not for any of the other "bomb" errors). -dmj ------------ Category 3, Topic 31 Message 45 Sat Dec 18, 1993 CBARRON at 02:29 EST DMJ - correct. Also 68000 & 68030 stack frames do differ, if I recall. !sure.. ------------ Category 3, Topic 31 Message 46 Sat Dec 18, 1993 MIKE-ALLEN [NM~SysOp] at 02:52 EST Erin, according to the "M68000 Family Programmer's Reference Manual," page B-2, four extra words are placed on the stack ahead of the status register and program counter for Bus and Address errors. Let's see if my ascii art is up to this: bit 15 5 4 3 2 0 |-------------------------------------| | |R/W|I/N|Function Code| |-------------------------------------| | Access Address High | |-------------------------------------| | Access Address Low | |-------------------------------------| | Instruction Register | |-------------------------------------| R/W (Read/Write): Write = 0, Read = 1. I/N (Instruction/Not): Instruction = 0, Not = 1. I'm not sure what the "function code" is. Mike Allen ST HelpDesk~Sysop Written: 12:34 AM Mountain Time Saturday, December 18, 1993 ------------ Category 3, Topic 31 Message 47 Sat Dec 18, 1993 DMJ [dmj] at 11:29 EST Carl, Yes, something about one of the registers (sr?) is pushed as a 32-bit value on an 030... makes a difference of two bytes. -dmj ------------ Category 3, Topic 31 Message 48 Sat Dec 18, 1993 E.MONACO [DataBasement] at 14:10 EST dmj, In my 68000 manual it says additional words (not how many!) are saved on the stack in the case of a reset, bus error, or illegal address error. It doesn't say however that its saved before the return address or status register... (to top that off the text says pc first then status register, the stack fig. however shows status reg first THEN pc.) Ok... so does this remain consistant on motorola's 680x0 series? same number of additional bytes and everything? Also since the stack does have extra words on it, I can't adjust the stack like I did in my example.... or must I somehow remove the 29 words + extras that get dumped on the stack at the time... the book just shows a shell where you save any regs. you need and restore them before you RTE. I have to assume that the 68000 handles tidying the stack, in which case the pointer becomes corrupt by my adding 8 to it in my previous example. 29 words + extra + 8 I advanced it... spells dangling pointer.... :) but wait... I HAD to add 8 to the stack AND inc the return address 2 bytes to get the RTE to take me to the instruction after the one that causes the BUS error... gads, well I'll play with the debugger a little more... gotta say its infinitely more pleasureable to use then the Assempro debugger. -=Erin ------------ Category 3, Topic 31 Message 49 Sat Dec 18, 1993 M.ABDULKAREE [ASX] at 16:32 EST I was wondering why SPL (ST Replay files) players tend to lock the entire system (including the mouse) when playing. I can understand taking up some cpu time for such things as playing frames within a sample, merging, etc.. but not the entire system! What gives? And is there any program to convert the SPL to MOD or AVR format (for the STE/TT)? ------------ Category 3, Topic 31 Message 50 Sat Dec 18, 1993 DMJ [dmj] at 22:53 EST Erin, Can't help you... I haven't done any bus error handler programming. Wish I had a 680x0 manual from Motorola... then I'd know for sure. ASX, The reason most digisound playback routines lock the computer during playback is simply a choice of programming. When writing one of these routines, the programmer determines what the maximum speed output is going to be. If it's something around 13kHz - 15kHz, then it's possible to write a playback routine that DOESN'T lock out the system. Doing it this way, however, will bog down the sound interrupt if the mouse is moved, because of how the interrupts are set up on the ST. If playback speeds of higher than 15kHz are needed, it's usually easier to write the routine to take complete control of the CPU. By doing so, the routine doesn't have to constantly save and restore registers (which takes time) or allow interrupts it doesn't want (like the keyboard, where the mouse is attached). By eliminating these things that take up time, playback speeds up to 32kHz on the ST can be achieved, or lesser speeds with some added digital effects. It can also simplify the interrupt programming a *lot*. Games usually use the first approach, as it doesn't freeze the game while sound plays. Sampler programs usually use the second approach, as they are more concerned with the higher speeds. They might also be influenced by the fact that a lot of the published code for playing digitized sound is of the second type. Playback on the STe can use the DMA, which leaves the CPU totally free to do anything else it likes. Yes, there is a program to convert samples from .SPL to .AVR. You can use Sound Lab to do it, and you'll find that Sound Lab can do a lot more than simply play sounds on the ST or STe. It's in the library by the name of SNDLB111.LZH (can't remember the number off the top of my head). -dmj ------------ Category 3, Topic 31 Message 51 Sun Dec 19, 1993 J.TRAUTSCHOL [jtrautschold] at 22:28 EST I'm working on my own object text field editor. I can't use form_do due to the complexity of the object I'm editing. I've written an object editor, using objc_edit(), etc. which works just fine as long as I'm editing the large character set. If I create an object using the small character set, objc_edit kicks in with a large cursor instead of a small cursor and also misplaces itself within the object. I've gone through the resource file and the TEDINFO structure for the object with the small text and everything looks ok. If I create a test object using small text and control it with form_do, it also works ok. As far as I know, form_do uses objc_edit internally for control of the text object so if it works under form_do it oughta work in my function too! :-) I can post the code if anyone wants to see it, but before I do that, is there something that I might be missing in setting up the object? Has anyone else tried handling the editing of a small text object? Did you have any problems? Solutions? Thanks! John Trautschold Missionware Software ------------ Category 3, Topic 31 Message 52 Mon Dec 20, 1993 C.OATES2 [Chris] at 03:09 EST Well, the vrt_cpyfm() is working for me, but I'm astill having problems actually getting at the image data... After hacking away at my code, I've got part of it that goes: load_rsc () { OBJECT *brick,*steel; if (!rsrc_load("DM.RSC")) form_alert (1, "[1][DM.RSC Missing!][Okay]"); else { bugger( rsrc_gaddr(R_OBJECT, BRICK, &brick), rsrc_gaddr(R_OBJECT, STEEL, &steel)); bugger(brick -> ob_type, steel -> ob_type); } } BRICK and STEEL are the names of two bitmap objects in the .rsc file. They load into the rsc editor fine, so I assume that they are okay. The "bugger" function is a little debugging function that simply throws up an alert with the 2 values passed to it. It is: bugger(a,b) int a,b; { char str[40]; sprintf (str, "[1][ %d %d ][OK]",a,b); form_alert(1,str); } Now, the values that come up when I run this code are: "1 1" for the first try (return values from rsrc_gaddr) and "32 30" for the second try, which is supposed to be the type of object returned! Funny, since both are Image data and not a menu item or a box, which the return values suggest... Also, just to check, I did add a menu bar item to the .rsc file, and it drew fine. What am I doing wrong?? ~Chris ------------ Category 3, Topic 31 Message 53 Mon Dec 20, 1993 J.STANFORD2 [John] at 07:31 EST Chris: Unless you have the bit_image objects as actual root objects in the resource file (which most editors won't let you do) then you cannot directly reference the structure of the object. The macros BRICK and STEEL refer to the objects index _within_ its parent tree. The problem is that all Trees start with a ROOT index of zero. Therefore if STEEL is defined as 5 there may be numerous trees all with objects having the index 5, and rsrc_gaddr doesn't know where to go. Instead you must get the address of the tree containing the bitimage objects, and then reference them from that object. so your code would look kinda like.... OBJECT *tree; OBJECT *brick; OBJECT *steel; // resource load rsrc_gaddr(R_TREE,ICON_TREE,&tree); brick=&(tree[BRICK]); steel=&(tree[STEEL]); bugger(brick -> ob_type, steel->ob_type); // this is identical to the previous line bugger(tree[BRICK].ob_type,tree[STEEL].ob_type); ------------ Category 3, Topic 31 Message 54 Thu Dec 23, 1993 LARRY.D [ST*LIBRARY] at 23:53 EST { *UP OK, it's official. I'm stuck, and can't figure out where the problem is. I wrote a desk accessory a few years ago that put up a calendar. Worked fine on the 1040 and the Mega, so I put the source code away and never really thought about it much. Didn't use the accessory - it was just a programming project used to learn. The other day, I was gonna show a guy how to use it, and found some problems with it on the TT. The desk accessory still works, but it's got some funny bugs. It's a simple calendar - opens a window with the current month and year, allows you to choose any year between 1800 and 2800, and any of the months, using vertical and horizontal sliders, respectively. Click on the PAGE UP/DOWN will change the calendar by 10 years, and the PAGE LEFT/RIGHT by single months, or you can use the sliders, or the arrows on the window to change by single years or single months. Again, it worked great on the ST. Now then - when I loaded it in the TT, the sliders worked, the window would move, but it didn't recognize any of the ARROW (message=24) commands. Actually, it DOES recognize them, but doesn't act on them UNTIL you do a window move or a slider - THEN it acts on the ARROWED message. Everything still works GREAT as a PROGRAM, but not as an accessory. Checking with MONTT, I see that the ARROWED message (24) is not generated to the accessory until ANOTHER command is done. Have I lost the flick entirely? What could be going wrong here? Larry ------------ Category 3, Topic 31 Message 55 Fri Dec 24, 1993 D.LIVINGST11 [ErnestBovine] at 03:06 EST to E.MONACO [DataBasement] > In my 68000 manual it says additional words (not how many!) are > saved on the stack in the case of a reset, bus error, or illegal > address error. > ... so does this remain consistant on motorola's 680x0 series? > same number of additional bytes and everything? No. On the 68020 and above, the first 4 words on the ssp, after any exception, are: 0(sp) -> SR 2(sp) -> PC high word 4(sp) -> PC low word 6(sp) -> format code (high 4 bits) and vector offset (b11..b0) Format code has several possible defined values. It basically tells you how many words have been pushed and what they are etc. For example, if the format code is $a, it means that 16 words have been pushed. Most exceptions use format 0, which is the simplest stack frame consisting of just the 4 words listed above. On the 68000, the address error or bus error stack frame is 0(sp) -> bit flags (get Steve Williams's books) 2(sp) -> erroneous address 6(sp) -> opcode that caused the exception 8(sp) -> SR $a(sp) -> PC total 14 words Other 68000 exceptions put the SR at 0(sp) and the PC at 2(sp). One thing you can do is see how your debugger does it. The bus error vector (at address $000008) will point to your debugger's exception-handling code. I got this from Steve Williams's books "Programmming the 68000" and "68030 Assembly Language Reference" which I recommend. All the details are there, laid out clearly. There's about 16 pages about these exceptions, mostly about the stack frames they create. ------------ Category 3, Topic 31 Message 56 Fri Dec 24, 1993 D.LIVINGST11 [ErnestBovine] at 03:07 EST So how can I get more info about the SCC chip, and how to use the "other" serial ports for non-standard things? Is there a file I can download maybe? Is there a topic about this? I got the file uploaded by ATARI.BENLUX [W. Kilwinger] which tells me that * SCC MEMORY MAP: * --------------- * SCC Channel A Control $FF8C81 (all are 1 byte long) * SCC Channel A Data $FF8C83 * SCC Channel B Control $FF8C85 * SCC Channel B Data $FF8C87 and that serial2 is channel A, and modem 2 is channel B, but no info about what bits do what, or where the DCD interrupt is vectored. Also, how can I set non-standard baud rates? For example, with the old MFP 68901, I can write directly to timer D's control and data registers, and even read the data register if I want really hi-res timing info. Do the SCC chips work something like the MFP 68901? ------------ Category 3, Topic 31 Message 57 Fri Dec 24, 1993 R.WATSON15 [Wayne Watson] at 06:22 EST ErnestBovine, Nope, the SCC is TOTALLY different from the MFP in the ways you get info from it. It is strange. You will need to get a reference book from Zilog. I don't have the specifics off hand. Also, it depends if you are on a MSTE, TT or Falcon as to what channels the ports are on. ------------ Category 3, Topic 31 Message 58 Fri Dec 24, 1993 D.ENGEL [Thunderbird] at 10:16 EST Can anyone recommend a "C" language which has an easy-to-use graphical environment which has a mouse-based editor, and runs properly on a Falcon030? I've been using Laser C on my ST, and the shell/editor crashes on my new F030. I can still compile/link with laser, but I have to do it from a TOS shell like gulam. Also, are there any programmer specific editors which are mouse based which will work on the F030... I can see getting Geneva and running the editor in a window and using gulam with make.ttp in another to get an acceptable solution too. Thanks. ____________________ \hunderbird ------------ Category 3, Topic 31 Message 59 Fri Dec 24, 1993 AEO.1 [Albert Dayes] at 14:00 EST Thunderbird ... see my reply to you in the CAT #30. ------------ Category 3, Topic 31 Message 60 Sat Dec 25, 1993 R.STEGELMANN [Rolf] at 05:40 EST Thunderbird, I would recommend Latice C 5.60. It has a GEM editor, with mouse based editing (cut, copy, paste). You can control your whole C environment from the editor, compilation options etc. It also positions you to the line in your source which have compilation errors. It is all mouse/menu driven. There are keyboard short cuts. Version 5.60 has library support for the new TOS 4.0x calls. Here is a list of some of the upgrade features for Lactice C 5.60 listed in Orgeon Research's Newsletter: . Completely rewritten documentation. . Falcon enhanced versions of the compiler and debugger . Source level debugging . Code Profiler. Find out where your code is spending its time. . Libary Archiver . DRI to Lattice C object converter . True UNIX Make Utilities . LCC Compiler driver for use with Make I don't have 5.60 yet (it is on order), but I do have version 5.52 and have been using it on a TT. I would assume that 5.60 works on a Falcon since they claim it to be "Falcon enhanced version". Rolf ------------ Category 3, Topic 31 Message 61 Sun Dec 26, 1993 J.TRAUTSCHOL [jtrautschold] at 18:56 EST Ernest Bovine... What Wayne said. You need to get the SCC Unser's Manual from Zilog. Normally you'd require that from your local Zilog distributor, but since I don't know where you line, I can't give you a local number. Call Zilog in California for information. The number is 408-370-8120. Once you've got the info on the SCC itself you need to directly control the chip for anything that's non-standard TOS. In other words, if you wish to use baud rates higher than 19200, you need to go directly to the chip. Atari provides for a number of different clock rates to the SCC, but those clocks vary depending on the machine you're programming for, i.e. the Mega STE, TT030 and Falcon030. There is more information available from Atari if you are a registered developer. Due to non-disclosure I can't post it here, unfortunately. John Trautschold Missionware Software Distributors of Flash II ------------ Category 3, Topic 31 Message 62 Mon Dec 27, 1993 LARRY.D [ST*LIBRARY] at 03:23 EST I've already asked once, and I'm getting no replies. This problem is REALLY dumbfounding.... I have a program that doubles as a desk accessory. I open a window complete with horizontal and vertical sliders and left/right up/down arrows. As a program, it responds beautifully. As an accessory, a message is NEVER generated when the arrows or page up/down is selected. I can click on the move bar or horizontal/vertical sliders and THEN the message is generated (and it's arrow/page message I was waiting for earlier), but will not respond to the original click. To make matters more confusing, it works fine as an accessory on a TOS 2.05 machine, but not on the TT/030 with TOS 3.06. Can ANYBODY think of a reason for this? ------------ Category 3, Topic 31 Message 63 Mon Dec 27, 1993 J.MEEHAN3 [>> Joe M << ] at 05:24 EST Does any one know how, if it is possible, in GFA Basic or C to change the default modem port? Either change the address used by the application or change the default used by the TT. Thanks >> Joe M << Happy New Year! ------------ Category 3, Topic 31 Message 64 Mon Dec 27, 1993 MIKE-ALLEN [NM~SysOp] at 11:20 EST Joe, I think you have to use the Bconmap() function, XBIOS 0x2C. If you call Bconmap with a 0 argument, it will return a long 0 if it is available. Calling with an argument of 6 and up will set the default serial device as follows: Device | MSTe | TT030 | Falcon030 -------+----------+----------+---------- 6 | Modem 1 | Modem 1 | Unused -------+----------+----------+---------- 7 | Modem 2 | Modem 2 | Modem -------+----------+----------+---------- 8 | Serial 2 | Serial 1 | LAN -------+----------+----------+---------- 9 | Unused | Serial 2 | Unused Mike Allen ST HelpDesk~Sysop Written: 8:59 AM Mountain Time Monday, December 27, 1993 ------------ Category 3, Topic 31 Message 65 Mon Dec 27, 1993 ATARI.BENLUX [W. Kilwinger] at 15:33 EST D.LIVINGST11 [ErnestBovine]: > > I got the file uploaded by ATARI.BENLUX [W. Kilwinger] which tells me that > * SCC MEMORY MAP: > * --------------- > * SCC Channel A Control $FF8C81 (all are 1 byte long) > * SCC Channel A Data $FF8C83 > * SCC Channel B Control $FF8C85 > * SCC Channel B Data $FF8C87 > and that serial2 is channel A, and modem 2 is channel B, but no info about >what bits do what, or where the DCD interrupt is vectored. Also, how can I It has never been my intention to put in a less than 2K file what a more than 40 page SCC manual published. On the basis adresses I mentioned are 15 Write Registers Mapped and 7 Read Registers. In a piece of source code I supplied with that text I demonstrated how you can select one of those registers for writing or reading. The reason I published that was that the SCC Manual doesn't publishe Atari specific data and that's what I did. If you don't order that SCC manual from Ziloc my information is worthless and if you do, the SCC manual is worthless without my information. Further I published more information here in GEnie about the vectors: >The SCC interrupts start on on 0x180 (vector 0x60 = 96). Here is the >list I figured out: > >Vector Function Channel > > 96 Transmit IRQ SCC B = Modem 2 or Falcon Modem > 98 Ext/Status IRQ >100 Receive IRQ >102 Receive IRQ > >104 Transmit IRQ SCC A = Serial 2 / LAN port >106 Ext/Status IRQ >108 Receive IRQ >110 Receive IRQ > >A startup/initialise routine should set/reset several SCC bits in >order to let some external signals (DCD, RTS) cause a EXT/Status >interrupt. What I heard sofar is that this routine should reset the >SCC first. If you want to do real HEAVY stuff you have to completely >initialise the SCC and calculate clock values. I don't think a simple >terminal program should do. > >The Ext/Status IRQ service routine should check to bits in the SCC in >order to find out which signal caused the interrupt. It probable >needs to clear that interrupt status. > >A simple terminal program probable don't have to use the >transmit/receive interrupts and send/read data thru the OS. > And for those who missed my piece of code: >* SCC.ASM W.F. Kilwinger May 6, 1993 (Made in GST ASSEMBLER) >* >* Little test program for turning off/on the DTR in the SCC chip in >* the Atari Falcon030, TT and Mega STE. >* >* This is not a complete example !! >* >* The SCC in the Falcon030, TT and Mega STE is mapped on: >* >* SCC MEMORY MAP: >* --------------- >* SCC Channel A Control $FF8C81 (all are 1 byte long) >* SCC Channel A Data $FF8C83 >* SCC Channel B Control $FF8C85 >* SCC Channel B Data $FF8C87 >* >* Note that in the TT documentation this is documented as $FF8C80 OB. >* OB stands for Odd Byte. The TT manual assumes WORD access. I found >* that BYTE access to $FF8C80 and $FF8C81 are mapped to the same SCC >* address, so are $82 and $83, $84 and $85, $86 and $87. But don't >* count on that !!! >* >* SCC Channel A & Channel B are used in the following way on different >* machines: >* >* SCC Channel A: TT030 Serial 2 / LAN, >* Mega STE Serial 2 / LAN, >* Falcon030 LAN >* >* SCC Channel B: TT030 Modem 2 >* Mega STE Modem 2 >* Falcon030 Modem >* >* >* The SCC has 15 Write Registers and 7 Read registers. Unfortually the >* Write Registers can not be read and most of the Write Registers don't >* have a Read Register that match. WR5 is such a register, while turning >* off/on the DTR bit you can't figure out the status of the other bits. >* I used this test program to figure out which bits should be set or not >* and I think I did it right. The bits I don't set can be set by a >* programmer in his application, in that case the programmer have to take >* care for his own bits. >* >* In order to write or read to one of the registers you have to write >* to the command register the number of the register you want to access >* and afterwards you can read or write to the register you have selected >* by accessing the command register again. (For register addressing read >* the Z8030/Z8530 Technical Manual first.) >* >* Write Register 5: >* >* Bit 7: 0 = DTR off, 1 = DTR on >* >* Bits/char: <=5 6 7 8 >* Bit 6: 0 1 0 1 >* Bit 5: 0 0 1 1 >* >* Bit 4: 1 = SEND BREAK >* Bit 3: 1 = Tx ENABLE (Must be on, otherwise chip won't send data) >* Bit 2: non-SDLC/CRC-16 >* Bit 1: 1 = RTS on, 0 = RTS off >* Bit 0: 1 = Tx CRC ENABLE >* >* Good data for DTR on/off is: >* >* 8 bits/char on: $ 68 (You can figure out 8/7 bits by using >* off: $ E8 Rsconf()) >* >* 7 bits/char on: $ 28 >* off: $ A8 >* >* >* Those people that want to keep track of the DCD: >* >* The Data Carrier Detect line is indicated by bit 3 of the SCC's "Read >* Register 0" of SCC channel B. >* >* MOVE.B #0,$FF8C85 ; SCC Channel B, Read Register 0 >* MOVE.B $FF8C85,d1 ; read value into d1, DCD is bit #3. >* > > OPT ABS > SECTION TEXT > > PEA Helptxt >Print MOVE.W #$9,-(sp) Printline > TRAP #1 > ADDQ.L #6,sp > > CLR.L -(sp) > MOVE.W #$20,-(sp) Supervisor mode on > TRAP #1 d0 contains * old SP > ADDQ.W #6,sp > > MOVE.B #$05,$FFFF8C85 Select Write Register 5 > MOVE.B #$68,$FFFF8C85 Clear DTR bit. See above >* for meaning of $68 !!!! > > MOVE.L D0,-(sp) Install old SP > MOVE.W #$20,-(sp) Supervisor mode off, > TRAP #1 because we have to do a > ADDQ.W #6,sp BIOS call. > > MOVE.W #$1,-(sp) Wait for key click > TRAP #1 > ADDQ.L #2,sp > > CLR.L -(sp) > MOVE.W #$20,-(sp) Supervisor mode on > TRAP #1 d0 contains * old SP > ADDQ.W #6,sp > > MOVE.B #$05,$FFFF8C85 Select reg 5 > MOVE.B #$E8,$FFFF8C85 Set DTR on again. See >* above for meaning of $e8 > > MOVE.L D0,-(sp) Install old SP > MOVE.W #$20,-(sp) Supervisor mode off > TRAP #1 > ADDQ.W #6,sp > >Exit CLR.W -(sp) terminate > TRAP #1 > >Helptxt DC.B $0d,$0a,' Test program for SCC DTR programming',$0d,$0a > DC.B $0a,' DTR is off now',$0d,$0a > DC.B ' Press any key to turn it on again',$0d,$0a,$00 > > END > And for those who started programming this chip: you are on your own, the chip isn't very friendly since you can't read what is written in the write registers, so you have to build it up yourself and keep track of the contents of all registers yourself. I wish you luck ! Regards, Wilfred ------------ Category 3, Topic 31 Message 66 Mon Dec 27, 1993 R.WATSON15 [Wayne Watson] at 20:47 EST Joe, In GFA Basic, if reconfiguration is possible then XBIOS(44, 0) will return 0. Change the default port with XBIOS(44, dev). Follow Mike's chart for the dev numbers. ------------ Category 3, Topic 31 Message 67 Tue Dec 28, 1993 R.WATSON15 [Wayne Watson] at 18:50 EST Can anyone provide assembly code to Force a Media Change? The Compendium says that this should be done after a GetBPB call. It provides some assembly but, it is LONG and includes some other stuff. All I need is the code to Force Media Change. My language does not offer the _mediach() call. Thanks. Also, HS Pascal offers a GetMem call that is similiar to Malloc except it takes the memory from the Heap that the program sets up when it is ran. Malloc is also available but, it uses the System heap. My question is, which would be better to use? The program's heap or the System's heap? Which is less likely to get trampled on? Thanks. ------------ Category 3, Topic 31 Message 68 Tue Dec 28, 1993 S.SANDERS2 [Scott @ SDS] at 23:09 EST LARRY.D: I've come across the problem you mentioned with sliders before though I'm having trouble remembering the fix (if there was one). One thought, if you are omitting any slider elements such as the bar something, try adding all of them. -Scott @ SDS ------------ Category 3, Topic 31 Message 69 Wed Dec 29, 1993 LARRY.D [ST*LIBRARY] at 00:08 EST Scott: Thanks for the reply. Everything is enabled on the window, except for the window sizer and info line. Again, it works as a .PRG, but not as an .ACC. Been scratching my head over it for a month, now. ------------ Category 3, Topic 31 Message 70 Wed Dec 29, 1993 CBARRON at 02:14 EST Wayne - Use of heap? Depends if you allocate large and few items, it makes little difference, I believe unless getmem uses a 16 bit size then any allocation over 64K will require Malloc(). If you allocate and deallocate lots of items. [Typical application of lists,queues,etc.] then use Pascal's heap as it will not be as severe with the so called fixed memory allocation bug, related to the old '40 folder' bug. That bug was not exterminated, only made less likely to occur. It will occur if a zillion Malloc()'s are performed. The exact # depends on the system upon which the program is run. Which is most likely to be trampled on? Answer mostly likely the probability of trampling on is about equal, except as noted above. ------------ Category 3, Topic 31 Message 71 Wed Dec 29, 1993 LARRY.D [ST*LIBRARY] at 13:08 EST I FOUND IT! The problem I was having with the desk accessory that would work as a .PRG file but not as an accessory (see a couple of messages previous) has been fixed. The problem apparently lies in the EVNT_MESAG call for a desk accessory in TOS 3.06. I changed this to an EVNT_MULTI call with timers and messages enabled. The timers were set to 50 milliseconds, and it now works. If you've run up against this problem (window gadgets not being recognized) change your EVNT_MESAG call to an EVNT_MULTI with messages and timers enabled. That should fix the problem. Thanks, Scott, for letting me know I wasn't crazy. ------------ Category 3, Topic 31 Message 72 Wed Dec 29, 1993 DMJ [dmj] at 15:25 EST Wayne, The _mediach() routine is the one created in the assembly listing in the Compendium; this listing *defines* a _mediach() function callable from a C program. As for the GetMem() vs. malloc() issue, it depends. HS Pascal claims some space for use with its GetMem() function; I'd wager its memory management is more reliable than TOS's, and tweaked for smaller allocations (linked lists and such). If you're planning on grabbing lots of small pieces of memory, I'd recommend using GetMem. Use malloc whenever you need large pieces of memory. -dmj ------------ Category 3, Topic 31 Message 73 Wed Dec 29, 1993 R.WATSON15 [Wayne Watson] at 21:15 EST Carl & Damien, Thanks for the responses. Yea, for the most part, I will be grabbing small chuncks of memory to store things in. I figured it might be better to use the Pascal version ( GetMem() ) because of the problems with Malloc in some TOSes but, I wanted to be sure. ------------ Category 3, Topic 31 Message 74 Wed Dec 29, 1993 CBARRON at 22:30 EST Larry Evnt_multi(MU_MESAG|MU_TIMER,....) has always been recommended if I recall, for DA's. Too bad there was not a simple way to do it without going through all the gyrations of evnt_multi. Anyway I am glad that is solved. New Problem: How to shut off the internal speaker of a falcon in the auto folder? Xcontrol usuage is too late in the boot up sequence.... ------------ Category 3, Topic 31 Message 75 Thu Dec 30, 1993 C.OATES2 [Chris] at 01:16 EST CBARRON: there's several programs. I use one called SPEAKOFF, which I think I got from the libs here. Probably search on SPEAKER or QUIET or something... John: Thanks! That fixed the problem I was having with loading the images! All is very happy now! (p.s. if anyone is wondering what I'm working on, it's a GEM game which will be sort of like a Lode Runner clone...) ~Chris ------------ Category 3, Topic 31 Message 76 Thu Dec 30, 1993 MIKE-ALLEN [NM~SysOp] at 01:28 EST Carl, try SPEAKOF2.ZIP, file # 29135. Mike Allen ST HelpDesk~Sysop Written: 9:40 PM Mountain Time Wednesday, December 29, 1993 ------------ Category 3, Topic 31 Message 77 Thu Dec 30, 1993 J.PERRY13 [John Perry] at 19:25 EST Does anyone know where I could find a set of functions (preferably in C language) to assist in programming applications that communicate with the modem? I'm mostly looking for "high-level" functions, such as dial() or hangup(). Thanks in advance. ------------ Category 3, Topic 31 Message 78 Thu Dec 30, 1993 S.SANDERS2 [Scott @ SDS] at 21:45 EST LARRY.D: No problem, I'll even note it down for a bug in the next rev of the Compendium. -Scott @ SDS ------------ Category 3, Topic 31 Message 79 Thu Dec 30, 1993 C.FOLLETT [ACK] at 23:15 EST Hello, all This is my first official visit to the programming area here and the "ask any question" topic looked just like the place to ask a few questions! First, a short preface, I have studied programming in college but that was quite a few years back. I studied BASIC, pascal, turbo pascal and fortran. Though I never got too far into any of these laguages, I got the jist of them. Anyway, after I got my new Atari (a Mega STE) I decided to do a bit of programming again. So for Christmas I bought myself The M.A.G.E. programming language. (Any snickers or anything yet?) The back of the box said that it included GFA Basic 3.5 and the MAGE programs and "over 175 pages of comprehensive step by step instructions on how to create games quickly." Well, I waited for Christmas and on that day I eagerly opened up MAGE and started reading, page by page, the manual. This soon turned into an ugly experience. The first part of the manual says that the book is more or less an overview of the MAGE calls and various utilities...no "how to get started" stuph in sight. (This is turning into a long preface...sorry... ;) ) Then the last two chapters are "about how I made this game" chapters...tutorials (supposedly). I thought for sure that this would help me out...no help. These chapters were basically overviews of how he (she?) thought the game through and even says "This section does not explain the M.A.G.E. Shell routines and how they work." So anyways! (Question one:) What the heck happened to the old HERE'S A STEP BY MOUSE CLICK GUIDE TO ACTUALLY ACCOMPLISH SOMETHING type of book? Or at least a chapter of the manual? So now to my more pressing questions and such. One of the reasons that I actually bought MAGE is because it includes GFA Basic 3.5. It doesnt come with the GFA book wich is uncool, but I can understand this and send in the card and get it. I wanted to do some other- than-game programming and figured that GFA would fit the foot. Having no documentation, I searched GEnie for a few "how to GFA Basic program..." type files and downloaded two. One was more or less a book about some ins and outs the docs didnt go over and the other was EXACTLY what I was looking for. GFACLASS has eight lessons on how to program step by step and do something! Im running out of lines! Please read the next post to find out what I have been babbling about. :) Keep On Rockin' In The Free World, ACK ------------ Category 3, Topic 31 Message 80 Thu Dec 30, 1993 C.FOLLETT [ACK] at 23:27 EST Rehi's, all! questions are about GFA Basic v3.5. Why is there no separate topic for it? I thought it was a popular language. In the GFACLASS lessons mouse instructions include SHOWEM to show the mouse pointer and MOUSEK et cetera. BUT when I try to use these commands in 3.5, I get a procedure not found error. What is the deal? The class program is apparently based on v1.0. Could all of the mouse commands be different (or nonexistent) in this MAGE version of GFA? Am I missing something here? One other thing, I almost forgot one of the readme files on the MAGE disk gives me a "disk may be corrupted" message. Can someone please help me out here? I'm still waiting for my docs. If you could just list (or Email me at C.FOLLETT) a few of the mouse commands I'd be most appreciative. Also, anyone else trying out MAGE? Keep On Rockin' In The Free World ACK ------------ Category 3, Topic 31 Message 81 Fri Dec 31, 1993 BRIAN.H [ST~SysOp] at 00:06 EST Ack, GFA has its own category and it is cat 22. There are topics for GFA Basic and M.A.G.E. (I just changed the M.A.G.E. title from the previous DSA GP_GRAPHICS ENGINE FOR GFA BASIC.) > Category 22 Topic 3 Mon Feb 06, 1989 > Sub: GFA Basic 3.n > Questions and answers for GFA Basic. > ************ > > Category 22 Topic 14 Tue Feb 16, 1993 > Sub: M.A.G.E. "Majic Arcade Graphics Engine" > > This topic is for discussion of M.A.G.E. This stands for "Majic Arcade > Graphics Engine" and was previously known as DSA GP Graphics Engine. It > is producted by MajicSoft. ~~Brian..Written on Friday 31 December 1993 at 00:59 a.m. ADT ------------ Category 3, Topic 31 Message 82 Fri Dec 31, 1993 R.WATSON15 [Wayne Watson] at 05:15 EST ACK, There are mouse calls in GFA. SHOWM, HIDEM, MOUSEK, MOUSEY & MOUSEX. One thing that will help in making sure you have the commands typed correctly is, on the first line of the program, type DEFLIST 2. Now just run the program and from then on, any GFA commands will be shown in uppercase. If you use the command and it is NOT in uppercase, then you didn't use the command properly or mistyped it. Also, I usually use a DEFINT "a-z" also. That will tell it to make all variables starting with "aA" to "zZ" Integer (in GFA it's really long integers). SHOWM (not SHOWEM) causes the mouse pointer to be shown after it has been hidden with HIDEM. MOUSEK will cause the program to wait for a mouse click. MOUSEX will return the X coordinate and MOUSEY will return the Y coordinate. MOUSE mx, my, mk will return the X, Y coordinates in mx, my and which mouse button was used. mk & MOUSEK will return these values. 0 = no mouse button 1 = Left mouse button 2 = Right mouse button 3 = Both mouse buttons You can assign variables to the calls. Any variable will do just make sure you use one that can handle the numbers being sent back. I usually use Integers (mk%, my%, etc.). mx=MOUSEX my=MOUSEY mk=MOUSEK REPEAT IF MOUSEK=1 ! If left mouse button pressed PLOT MOUSEX, MOUSEY ENDIF UNTIL MOUSEK=2 ! right mouse button is pressed. ' REPEAT MOUSE mx%,my%,mk% If mk%=2 ! If right mouse button is pressed PLOT mx%,my% ENDIF UNTIL mx%=1 ! left mouse button is pressed. Hope that helps. GFA is a very popular language and very powerful. It has TONS of commands and all to help make your job at programming easier. Once you get the hang of the way GFA does things and all, you can crank out programs pretty quickly. GFA also has a few quirks which makes it not very useful at some things. 90% of the stuff you need however can be done in GFA with no problems though. ------------ Category 3, Topic 31 Message 83 Fri Dec 31, 1993 A.WATSON6 [Anthony] at 13:58 EST ACK, I suspect that the reason that you are getting the procedure not found error is because you are using the commands alone. If you have a line that says: mousek Your program is going to be looking for a procedure called "mousek". However, if you have a line that says: a%=MOUSEK Then the mouse key state will be assigned to the variable a%. Of course, the following lines should be correct: HIDEM SHOWM Which simply hide the mouse pointer and show the mouse pointer. The fact that you can have procedures with the same names as commands can often get confusing, to say the least. For that matter, you can also have variables of the same name: name$="Hello" !*** Sets the name variable to 'Hello' *** @name !*** Calls the procedure called 'name' *** NAME "test.txt" AS "example.txt" !*** Renames a file *** Can get confusing eh? In GFA's default settings, COMMANDS are shown in upper case, and variables/procedures are shown in lower case. Good luck, Anthony ------------ Category 3, Topic 31 Message 84 Sun Jan 02, 1994 C.FOLLETT [ACK] at 22:31 EST Brian, Wayne, Anthony, Thanks for all of your help! I sure appreciate it and will be visiting the GFA cat soon. After I posted those messages I went back into GFA Basic and started playing around with hte commands again. I was just typing a nonsense program (testing out gosubs and loops and such) and I found out a few things about the mouse calls. The first thing that I noticed was that after every PRINT startement (oops...statement) the mouse will disappear. I had my main program loop set up with one SHOWM command at the beginning and thought that it would keep the pointer on for the duration of the program. This seems a bit odd to me that the pointer would disappear after every print statement. Could this be a bug? One funny thing about it , though, after a BOX command the pointer stays visible. Needless to say, now my code is littered with "SHOWM"s. Another thing is this. REPEAT PRINT at(a,b);"blah" PRINT at(c,d);"blah" SHOWM UNTIL mousek=3 I find that with or without a VSYNC command (placed ANYWHERE) the pointer flickers constantly. I'm trying to find a way around this kind of loop as the flicker is simply not acceptable. Any suggestions? thanks again,all, and keep on rockin' in the free world, ACK ------------ Category 3, Topic 31 Message 85 Mon Jan 03, 1994 P.LEFEBVRE [Paul] at 23:32 EST Does anyone know of a program that can convert DRI object files to GST format (and vice-versa)? What is the difference between these formats? -- Paul ------------ Category 3, Topic 31 Message 86 Wed Jan 05, 1994 HISOFT at 13:15 EST Paul, The DRI and GST files are very different and have different capabilities so a fully generalised conversion without losing any information wouldn't be possible. The details of both formats (as well as the Lattice linkable format) are in our book Modern Atari System Software. This is provided as part of the Lattice C 5.6 package and is also available separately. Contact Oregon Research (ORA here on GEnie) for pricing etc. Dave Nutkins, HiSoft. ------------ Category 3, Topic 31 Message 87 Wed Jan 05, 1994 PG.MUSIC [PG-Kevin] at 22:05 EST Can someone tell me the proper way to program optional parameters in "C"? e.g. int wm_wind_set(int handle, int field, ...); int wm_wind_set(int handle, int field, int w1, int w2, int w3, int w4) { /* do some stuff here before calling the real wind_set() function */ return wind_set(handle, field, w1, w2, w3, w4); } I'm trying to alias some functions to call my routine before falling thru to the Pure C library routine. What is the proper way to do this? I can't seem to find a good answer in any of my books. --Kevin Houser ------------ Category 3, Topic 31 Message 88 Thu Jan 06, 1994 CBARRON at 01:18 EST Kevin , by 'optional' I assume you mean 'variable' parameters as in prinitf(char *,...); There are at least three ways to determine the number of parameters actually passed and what they are. Method one is to use an int parameter to indicate this infromation as in. #include double double_sum(int n,...) { va_list args; double total=0.; va_start(args,n); while(n--) total += va_arg(args,double); va_end(args); return total; } A NULL parameter can be used if the parameters are pointers as in #include #include PERRY13: If you're looking for high-level functions like dial() or hangup() your BEST bet (without knowing your application, of course!) would just be to go to a terminal program with a built in scripting language. There are a number of them for the ST it seems... Aladdin is a good example, but so is STORM, which is shareware. Flash II as scripting as well, and these scripting languages are so good you can probably write a bbs using some of them! If this is off-base, my apologies! :-) *** BOB *** ------------ Category 3, Topic 31 Message 92 Sun Jan 09, 1994 R.LUNSFORD2 at 21:10 EST I am about to start rwriting an algorithm in assembler to enlarge a graphic. I have never done anything like this, and would like to know if there are any special considerations to be aware of... Thanks, Russ ------------ Category 3, Topic 31 Message 93 Sun Jan 09, 1994 RHETT [Mr.Anderson] at 21:30 EST Russ, I've done what you say you want to do. Why don't you be a bit more specific so we can give you some advice? Are you going to be doing this with 24-bit data? What kind of enlargement do you plan on doing? A power of two enlargemnt, perhaps? --Rhett ------------ Category 3, Topic 31 Message 94 Sun Jan 09, 1994 E.MONACO [DataBasement] at 22:13 EST Russ, That would depend. If you are rewriting in assembly and want to interface your code with another language such as C or Pascal you'll need to observe the guidelines for your particular language, such as referencing external variables, how arguments are passed and so on. If you are writting the whole "program" in assembly there shouldn't be any "special" considerations, except maybe taking different processors in to account. Last but not least no matter which method you'll have to consider the hardware and OS the code is going to be running on. Perhaps you could be more specific? Erin @DataBasement Software ------------ Category 3, Topic 31 Message 95 Mon Jan 10, 1994 D.ENGEL [Thunderbird] at 06:32 EST Russ, Are you looking for real-time speed, or perhaps slow speed but anti- aliased? Would that be enlargement to 'any' size, or in 100% increments? ____________________ \hunderbird ------------ Category 3, Topic 31 Message 96 Mon Jan 10, 1994 R.LUNSFORD2 at 18:12 EST All, It will be in a fairly low res (probably 320x200 or 240), only needs to run on a 68000 or 68030, will eventually use 8 bit-planes or pixel- packed 16-bit color res, but I'm probably going to start in mono so I can follow it better. I'm going to go for as much speed as possible, with any enlargement factor and as much detail as possible, but detail is fairly secondary to everything else... thanks for the interest, Russ ------------ Category 3, Topic 31 Message 97 Mon Jan 10, 1994 DMJ [dmj] at 19:05 EST Russ, "Rewriting" or "writing"? If it's the former, you need to know how to interface the assembly routine with your high-level language, whichever one that is (and it will be different for each one). If it's the latter, more details are required before any reasonable advice can be offered... -dmj ------------ Category 3, Topic 31 Message 98 Mon Jan 10, 1994 DMJ [dmj] at 20:28 EST Russ, You don't ask for much, do you? -dmj ------------ Category 3, Topic 31 Message 99 Mon Jan 10, 1994 M.HILL13 [Mike] at 21:21 EST Everyone, Didn't really see a sound programming topic. I have a question for all you sample sound playback freaks out there! On the STE/TT/Falcon you have the DMA Sound hardware. It has four main frequencies it can play sample at. Is there anyway to play back samples at other frequencies? Is there a way to supply a different clock frequency to the DMA hardware to generate different playback rates? Mike ------------ Category 3, Topic 31 Message 100 Mon Jan 10, 1994 R.LUNSFORD2 at 22:26 EST DMJ, I don't really want a solution (though that would be nice :)). Really I'm just starting to work on this project, and any advice that could be offered is greatly appreciated... I do know how to interface assembler with C, so no probs there... Just the routine itself... Russ ------------ Category 3, Topic 31 Message 101 Mon Jan 10, 1994 RHETT [Mr.Anderson] at 23:39 EST Russ, Enlarging is nasty when you use bitplanes. If you can have your source data byte-packed (i.e., you're not getting the data to be enlarged off the screen), it's probably best to do the expansion in bytes and then convert bytes to bitplanes. --Rhett ------------ Category 3, Topic 31 Message 102 Tue Jan 11, 1994 DMJ [dmj] at 00:07 EST Mike, It _is_ possible to play back samples using the DMA hardware at any speed. This is done with a "trick", rather than actually providing a new clock to the DMA hardware. (Wondering whether I really want to divulge this bit...) Set up a small buffer in RAM that's just two bytes big; one byte for the left channel, one for the right. Set up the DMA sound hardware so it plays from this address in a constant loop at 50kHz. Then just stuff new sample data into this address as fast as you want to play back; the DMA hardware will check this address 50,000+ times a second, handling the resampling to 50kHz for you. It's best to use the MFP to handle the other-frequency timing; during the MFP Timer A interrupt, just stuff sample data into your 2-byte loop. That's it. Russ, Okay, a few pointers on image enlargement. - Stick with integer ratios to begin with. They're easier to figure out, and it will help you to debug the routines. When you're more comfortable with what you're doing, you can try to bite off non- integer ratios. - Try true-color modes first before doing 256-color modes. Same reason as above. - Extracting pixels from word-interleaved format is a bear. Stick with it, you'll figure it out eventually. - Once you magnify a line, don't re-magnify it for the next line; just copy it. This is much faster. Better yet, write all the copies of your magnified line at once. Hope this helps. -dmj ------------ Category 3, Topic 31 Message 103 Tue Jan 11, 1994 PG.MUSIC [PG-Kevin] at 00:32 EST DMJ, That's a cool, but definitely wierd way of decimating a sampled signal. But, hey... that's what hardware is for, no? :) --Kevin ------------ Category 3, Topic 31 Message 104 Tue Jan 11, 1994 S.SWENA at 01:33 EST Can someone tell me if there is a utility anywhere on Genie that would make it easy to load a short boot program on the boot sector of a floppy disk, automatically figuring out checksums and protecting the BPB and such from corruption. any info would be helpful Thanks, Stanley Swena ------------ Category 3, Topic 31 Message 105 Tue Jan 11, 1994 A.FASOLDT [Al Fasoldt] at 08:49 EST Stanley, There are a lot of utilities that seem to do that. If you can't find any, get back to me and I'll go thjrough my collection and e-mail you a bunch. Al ------------ Category 3, Topic 31 Message 106 Tue Jan 11, 1994 R.LUNSFORD2 at 19:12 EST DMJ, thanks for the tips. You brought up a few points I hadn't considered. It seems that it would be easier to write a routine that enlarges faster in 16- bit pixel-packed mode than in 8 bit 256 mode..Is this true? If so would the extra time it takes to write to a TC screen nullify this advantage, advantage, or would it still be faster than 256 mode? This is assuming that my methods of implementation would be somewhat inefficient. If it's faster, I may just scrap the 8 bit mode and go straight from mono to TC.. thanks again, Russ ------------ Category 3, Topic 31 Message 107 Tue Jan 11, 1994 DMJ [dmj] at 20:46 EST Kevin, "Decimating" actually reduces the sampling rate... the method I outlined is "supersampling" (increasing the sampling rate). How a sample gets decimated is a whole new ball of wax. Russ, You will get FAR, FAR more speed out of a 16-bit pixel-packed enlargement routine than you will lose due to "resolution slowdown". It's not that it takes more time to write to a TC screen (it doesn't, it's FASTER), it's that when running in TC the entire _computer_ slows down. I presume this is because of the large amount of data the video hardware is accessing from the system bus... but I'm not a hardware freak. You should find that TC is even simpler to write than mono. In monochrome, you're dealing with bits, and you have to extract those bits from bytes or words. With true color, each pixel is a single, self-contained word. Much simpler, much faster. I'm not suggesting you allow only TC mode. I'm simply suggesting getting a routine working THERE before moving on to anything else. -dmj ------------ Category 3, Topic 31 Message 108 Tue Jan 11, 1994 M.HILL13 [Mike] at 21:11 EST DMJ, Thanks for that DMA sound trick!!! I had hoped there were some way to do it. Mike ------------ Category 3, Topic 31 Message 109 Wed Jan 12, 1994 PG.MUSIC [PG-Kevin] at 00:01 EST DMJ, I was referring to taking a 50KHz sample, using your method (via MFP timers to stuff in the samples at a lower rate to shift the pitch & speed down). Yet keep the actual 'playback rate' at 50KHz... Grungy sound if you shift down too much since it isn't really interpolating the data, but it works. --Kevin ------------ Category 3, Topic 31 Message 110 Wed Jan 12, 1994 R.LUNSFORD2 at 00:24 EST DMJ, OK...that makes me feel better (TC being faster). The only reason I was going to write the 256 col version was to compare it to TC to see which was faster...if TC is faster then writing the 8BP version would be pointless... Russ ------------ Category 3, Topic 31 Message 111 Mon Jan 17, 1994 S.SWENA at 00:21 EST Al Fasoldt, re. msg 105 about the boot sector utility. I could not find any of them in the library here using the keywords: boot sector floppy bootable By the time I got your msg. offering to send me the ones you have, I had spent the afternoon with DevPack building my special boot sector, calculating the checksum with Diamond Edge, and figuring the last 2 bytes of the sector with a pocket calculator, and loading it with a regular sector editor. Much to my amazement, it worked!! This was a one time job (I hope) but if you could post one or two of the best shareware or Pd utilities for loading bootsectors, or if someone could suggest the name of one that is already in the library I will download it for my tool chest. Thanks; Stanley Swena ------------ Category 3, Topic 31 Message 112 Mon Jan 17, 1994 HEAD.TRIP [Wayne] at 02:51 EST Umm.... I can't remember where to check for the TOS version. I'm using Hi-Soft BASIC 2.10, but I speak 'C' and assembly (speak slowly in 680XX) if anyone can clue me in. Oh, and how do I translate HEX - DECIMAL in basic? I can do anything to OCTAL or HEX but can't find HEX - DECIMAL. Thanks in advance... Wayne - Saturday, January 16, 1993 - 11:53 p.m. PST ------------ Category 3, Topic 31 Message 113 Mon Jan 17, 1994 HEAD.TRIP [Wayne] at 19:09 EST Ok, put all the books back up, etc. after the earthquake and now I've dug this sucker out again and am coding onward. So, I have the TOS Version, etc. BTW, I'm speaking Hi-Soft BASIC 2.10 here... CONST sysbase%=&h4F2 tos_version=SPEEKW(SPEEKW(sysbase%)+&h2) os_date=SPEEKL(SPEEKW(sysbase%)+&h18) gemdos_date=SPEEKW(SPEEKW(sysbase%)+&h1E) It was bugging me... I worked this out by poking (pun intended) through the Atari Compendium. Massive, excellent book! Also, if you're doing anything on a newer machine check out "Modern Atari Systems Software" from Oregon Research (Hi-Soft), it's very helpful. I got it with my Lattice 'C' upgrade, but it shows all the new library calls in Hi-Soft BASIC 2, Lattice and DevPac3. They (Hi-Soft) have really kept up with advancements in the machines. In Hi-Soft BASIC even, I can access the DSP, SPEEDO, MultiTOS, Sound Hardware and more very easily with the new 'Falcon library. It's actually a lot of fun, which means I'll whip up more programs. I hope more Atari will users get into programming for fun with a hi level language (or go deeper) because I feel the future of the machines will depend more on 'user created' software than ever before. Gee, I'm rambling, but I get excited by the excellent books and language support because it'll be good for _all_ us Atari lovers if good software is easier to create. Now, where was I... The earthquake has rattled my brains! I went to bed at 3 am and was awaken at 4:30 by a massive earthquake - fun way to get up - power was out, things flying. My friend was on the freeway, saw lightning- like flashes in the sky and thought a nuclear bomb had gone off! Yow! Anyway, so I'm working on this to keep my mind off the aftershocks, and because the phones are screwed up so I can't contact my brother who is much closer to the epicenter. (I'm in downtown L.A., he's in Sylmar). I feel very stoopid but I still don't know how to convert hex into decimal. The TOS Version has the major revision in the HIGH BYTE & minor in the LOW BYTE. I put the number in my Pro Calc and know it's right but it's hex and I want to display it in decimal. Otherwise I've got a simple little program shell with a 'Help' screen and 'System' screen (actually windowed dialog boxes) to share. See Ya! Wow! - we just had a BIG aftershock! The room was swirling... very weird... I no likeeee this, no sirreeeee Wayne 1/17/1994 ------------ Category 3, Topic 31 Message 114 Mon Jan 17, 1994 DMJ [dmj] at 19:59 EST Stanley, I have a program which takes executable code (like an assembled subroutine) and writes it to a floppy boot sector. It even warns you if the floppy's boot sector is already executable. If you are interested (it's a .TTP program) then let me know. It is the utility I use to create my own boot sectors. -dmj ------------ Category 3, Topic 31 Message 115 Mon Jan 17, 1994 S.SWENA at 21:03 EST DMJ, Yes please upload it or E-mail to me S.SWENA Thanks Stanley Swena ------------ Category 3, Topic 31 Message 116 Mon Jan 17, 1994 M.L.HANSON [Merlin] at 22:08 EST Wayne, I _think_ you are saying that you have a four bit number in an ASCII representation of a hexadecimal digit. As follows: binary represents 48 '0' 57 '9' 65 'A' 70 'F' IF that is the case, put the 4 bit number someplace where you can perform computations on it. Subtract enough from the '0' (and its 'mates') so that '0' becomes a binary 0. And enough from the 'A' so that it becomes binary 10. Then print the number as though it were decimal. Which it will be. In pseudo code (c is the 4-bit number): if c < 65 c = c-48 else c = c-55 Note that if it is printing out as 'a' through 'f' it changes the constant 55 to 87. Since 'a' is represented by binary 97. ------------ Category 3, Topic 31 Message 117 Mon Jan 17, 1994 R.WATSON15 [Wayne Watson] at 22:19 EST Wayne, In GFA and HiSoft Basic, you can convert a Hex number to decimal by using the VAL command. The VAL command works on a string but, all you do is place the number in a string and convert it. You have to place the &H in front of the number to tell it that it is a hex number you want to convert from. a$="&H15" PRINT VAL(a$) ! WIll print out 21. PRINT VAL("&H15") ! Will also print 21. ------------ Category 3, Topic 31 Message 118 Mon Jan 17, 1994 R.WATSON15 [Wayne Watson] at 23:21 EST Wayne, See my reply in the HSB topic in the ORA cat. That way of getting the TOS version is the recommended way. ------------ Category 3, Topic 31 Message 119 Mon Jan 17, 1994 HEAD.TRIP [Wayne] at 23:45 EST Merlin & Wayne, Thanks for the input. Actually, each of you gave me an answer I needed, for different problems . I was into programming for quite awhile but then got busy with work, etc. It's been 7-8 months and some pieces are still tightly lodged in my brain, but others flew away. Maybe the earthquake we just had will loosen things up! Thanks, Wayne - Monday, January 17, 1994 - 08:17 p.m. PST ------------ Category 3, Topic 31 Message 120 Tue Jan 18, 1994 A.FASOLDT [Al Fasoldt] at 03:24 EST Stanley, I'll zoom over to my Aladdin file list and see what it shows. ... OK, I'm not sure what happed to your file search. If you're not using Aladdin, I suppose this is a good advertisement for it: I just went across to another menu in Aladdin and searched the list off-line. Anyway, you may not be joined to the full libraries or something, since a quick perusal of recent files showed these: File #s: 31427, 31407, 27070, 26079, 25507, 24464, 24763. Al ------------ Category 3, Topic 31 Message 121 Tue Jan 18, 1994 D.ENGEL [Thunderbird] at 06:31 EST Hi guys... Can anyone out there point me into the right direction for information/books/uploads/magazines concerning audio applications of "Digital Signal Processing", and information/books/uploads/magazines concerning the format of the various sound file formats and ".mod" file formats? My specific problem is the need to play multiple sampled instruments simultaneously, and possibly change pitch or add special effects via a DSP. Thanks in advance.... __________________ \hunderbird ------------ Category 3, Topic 31 Message 122 Tue Jan 18, 1994 PG.MUSIC [PG-Kevin] at 08:41 EST Could someone point me in the right direction to answers on the host interface hardware for the Falcon's DSP. I need to hit the hardware directly and Atari isn't cooperating in telling me where the host registers are located etc in the Falcon's mem map. This is really annoying me (other word omitted so Brian won't delete the post). They have been totally unresponsive to my requests for this info. Wilfred, if you could find out this info, I'd appreciate any help. (He's the most helpful one at Atari these days). Thanks. T-Bird, for MOD files, check out the sources to a few of the PD mod players. The sources are somewhere in the RT Libs. Just look for Noisetracker or something like that. For audio applications... Umm... try finding a good college library (one that has an EE dept/school) and look in the DSP stuff... I can mention quite a few good DSP books, but they're not audio specific. --Kevin ------------ Category 3, Topic 31 Message 123 Tue Jan 18, 1994 AEO.1 [Albert Dayes] at 14:54 EST Thunderbird, With regard to DSP related information, take a look at the Motorola book on the 56K. It has a nice bibliography of the different literature that is available. If you want some more tecnical related publications on the subject of audio contact the Audio Engineering Society. They have quite a few interesting publications on that subject. There is a file with many of the important audio file formats with C source code to convert between all of them. It might be in the library here. Its generic C source code so it should be easy to port. Audio Engineering Society 60 East 40nd Street New York, NY 10165 -- Albert ------------ Category 3, Topic 31 Message 124 Tue Jan 18, 1994 DMJ [dmj] at 20:08 EST T-Bird, .MOD files don't use any complex DSP, really... they just use a trick to resample samples at high speed and mix four of them together. If you'd like the .MOD file format, you can extract it from the source code of any of numerous players... I'd type it up for you, but I have half a million other things to do. -dmj ------------ Category 3, Topic 31 Message 125 Tue Jan 18, 1994 R.LUNSFORD2 at 21:23 EST T-bird, Let me know if you find anything especially interesting on the MOD stuff....I looked not too long ago, but didn't have the time to do a good search...I do know that there is a soundblaster book in Waldens that had (looked like) a good descript, but didn't have the money to investigate ... russ ------------ Category 3, Topic 31 Message 126 Tue Jan 18, 1994 RHETT [Mr.Anderson] at 23:10 EST Russ, MOD files originated (I believe) on the Amiga, so it might be a good idea to do a search over in the StarShip libraries and/or the Pro/Am libraries for information on MOD files. --Rhett ------------ Category 3, Topic 31 Message 127 Wed Jan 19, 1994 D.ENGEL [Thunderbird] at 18:33 EST Thanks for the DSP and sound help, guys. I'm wading through a bunch of stuff I got from the library... there's so many things I want to try out now! _________________ \hunderbird ------------ Category 3, Topic 31 Message 128 Wed Jan 19, 1994 R.LUNSFORD2 at 20:23 EST Rhett, I had forgotten that mod files started on Amiga...thanks, Russ ------------ Category 3, Topic 31 Message 129 Thu Jan 20, 1994 J.ARMSTRON20 at 21:32 EST Does anyone know of any Database libraries for the 'C' language? If so, please let me know. Thanks, James ------------ Category 3, Topic 31 Message 130 Sat Jan 22, 1994 T.KELLY12 [Terry] at 01:03 EST I have a question/observation regarding Speedo. I am working on a music notation program for the ST/Falcon, and one of the complaints I always had with the old bitmap fonts was that they would not print out as they were spaced on the screen. (This is critical in preparing choral or solo vocal scores.) I had hoped that Speedo would solve this problem once I had implemented the new v_ftext call and kept track of the fractions of pixels generated by vqt_advance, but while closer than the bitmaps, Speedo does not preserve the exact relationships with other objects on the screen when printed on a Deskjet Plus. Darn! My program uses the ST monochrome resolution of 90 dpi and then scales its objects to the 300 dpi of the Deskjet. I cannot, however control the scaling of text; Speedo does that. After some experimenting, I have found that Speedo seems to be assuming a slightly larger resolution for the hi rez screen -- somewhere between 91 and 92 dpi. Does anyone know if this is deliberate or if this is a subtle flaw in the scaling routines of Speedo? --Terry ------------ Category 3, Topic 31 Message 131 Sat Jan 22, 1994 PG.MUSIC [PG-Kevin] at 04:15 EST Terry, The definition of baseline and other font parameters are slightly different with the outline fonts. That is why Atari Works prints with so much space between the lines with the normal "single space" setting. --Kevin ------------ Category 3, Topic 31 Message 132 Sat Jan 22, 1994 K.PORTER5 [KENNEX] at 11:24 EST Hi, I have a 10400ST of course, and now have a 486DX-66 PC. My question is, how do I port over programs like Cyberpaint to my PC. Where do I start. And, if you can suggest some books that can read on graphics programming on the PC, please do. Thanks a Meg Kennex ------------ Category 3, Topic 31 Message 133 Sat Jan 22, 1994 A.FASOLDT [Al Fasoldt] at 12:44 EST Kevin, And why Works permits negative line spacing, which few users seem to know about. Al ------------ Category 3, Topic 31 Message 134 Sat Jan 22, 1994 DAEDWARDS [Warrl] at 14:59 EST Al: It is effectively impossible for you to port a program from the ST to the PC, if you don't have the source code. You COULD reverse-engineer, but expect to spend about as long on the project as the original authors did... that's assuming you're an experienced programmer, and don't forget that the original authors were probably plural while you're singular. Porting data is different... it ranges from extremely difficult to virtually automatic, but I can't address CyberPaint in particular. ------------ Category 3, Topic 31 Message 135 Sat Jan 22, 1994 PG.MUSIC [PG-Kevin] at 17:29 EST Al, Negative line spacing isn't a solution because it screws up the onscreen display. The line spacing needs to be fixed. Oh well... :) I'll just continue using MicroSloth Word for WinDoze for now. I'd like to see Works incorporate a TOC and Index generation feature like in W4Win. That saves me oodles of time. --Kevin ------------ Category 3, Topic 31 Message 136 Sun Jan 23, 1994 T.KELLY12 [Terry] at 02:11 EST Kevin, My concern with the scaling of Speedo hasn't so much to do with the vertical alignment of text, as with the horizontal. For any application that combines graphics and text it is important that both be scaled identically for printout if the hardcopy is to be accurate. Anyone who tried to align text with graphics in Easy Draw knows how annoying it was when the text on the hardcopy would end up a different width than the text on the screen. This was a natural flaw of bitmaps where each character is predefined in whole pixels (or printer dots). The screen fonts simply can not match the printer fonts in exact ratios using whole pixels without compromising the quality of the printed text. This is a particularly acute problem in my application, where a line of 10 pt text must line up with musical notation for the full width of a page. Even a small error in scaling can produce an unsatisfactory result. Technically, Speedo text should not be subject to this problem since it can keep track of character widths in fractions of pixels. The screen representation may not be as attractive as the printed text, but the relative width should be the same. When printing to a 300 dpi device the ratio of printer to ST Hi screen should be 3.333, i.e. 300/90. Speedo seems to scale at about 3.279. I can, with some tweaking, adjust my program to accomodate this, but I am curious as to why there should be such a discrepancy. --Terry ------------ Category 3, Topic 31 Message 137 Sun Jan 23, 1994 A.FASOLDT [Al Fasoldt] at 03:23 EST Kevin, No, negative line spacing *fixes* the online display, or at least it does under Geneva. Al ------------ Category 3, Topic 31 Message 138 Sun Jan 23, 1994 PG.MUSIC [PG-Kevin] at 07:01 EST Terry, You can set the 'width' of outline font output easily with one of the Speedo VDI Calls. I forgot which one, but using it, you can make SURE things match up. Al, Maybe for those of us luck enough to have G, but it is still an Atari Works bug. Even my beta docs mentioned the differences in 'measuring' spacing for OUTLINE and BITMAP fonts. I wonder why Atari didn't check their own docs. --Kevin ------------ Category 3, Topic 31 Message 139 Wed Jan 26, 1994 R.LUNSFORD2 at 00:48 EST Hello, me again ;)^)...anybody got a fgood idea of where to look for an algorithm (C,Basic,Pascal,Assembly,etc) for rotation of a graphic about the Y- axis? A bitmap more specifically...Ultimately it needs to be fast, but for now, I just need something to point me in the right direction. I'd prefer to stay away from store-bought books as I don't have the funds to use right now, but if someone knows a good title..... Thanks much, Russ ------------ Category 3, Topic 31 Message 140 Wed Jan 26, 1994 HEAD.TRIP [Wayne] at 02:17 EST I feel stupid, but I can't seem to get the system time and unpack it in 'C'... I am familiar with programming but not 'C' so I'm sure that's why. It seems everything I try I get two bombs (bus error). Could someone help me out? I was trying the Lattice C 5.6 getclk function, after no luck with Tgettime(). Thanks in advance... Wayne - Tuesday, January 25, 1994 - 08:03 p.m. PST ------------ Category 3, Topic 31 Message 141 Wed Jan 26, 1994 DMJ [dmj] at 23:17 EST Russ, Questions abound. I assume, by the Y axis, you mean horizontally around the screen? That's hard, although not so hard in true color mode. Rotation around the X axis--vertical rotation--is fairly easy. Rotation around the Z axis (as Spin Dry does) is hardest of all. Also, if you're rotating around the X or Y axis, do you need perspective? (This makes it _really_ complicated.) Depending on how simple it is, I (or anyone else) can give you pseudocode for it. Then you can code it in whatever language you like. Wayne, usigned int time_value; int hours,minutes,seconds; { time_value = Tgettime(); hours = (time_value >> 11) & 0x1F; minutes = (time_value >> 5) & 0x3F; seconds = time_value & 0x1F; } Hope this helps. (This was typed "off the cuff"; use at your own risk.) ~dmj ------------ Category 3, Topic 31 Message 142 Thu Jan 27, 1994 S.SANDERS2 [Scott @ SDS] at 01:07 EST Try this Wayne: void use_time( void ) { unsigned short g_time, seconds, minutes, hours; g_time = Tgettime(); seconds = ( g_time & 0x1F ) * 2; minutes = ( g_time >> 5 ) & 0x3F; hours = ( g_time >> 10 ) & 0x1F; /* Now, do something... (maybe return using pointers or * store in a global variable) */ } ------------ Category 3, Topic 31 Message 143 Thu Jan 27, 1994 R.LUNSFORD2 at 02:04 EST DMJ, once again, I can't make it easy...need perspective. I knew you'd like to hear that. I've gotten a cheesy idea on how to do it, but I don't think it would like right. I'd have to sit and play with it to come up with the proper ratios, but could you just shorten it's width, (assuming rotation with the right side fading back) with the leftmost pixels taking precedence over most of the rightmost pixels, stretching the left side up gradually and shrinking the right side (vertically)? I know there's probably got to be a formula for it, but heck if I know where to find it...This transformation biz is fairly new to me :) thanks, Russ ------------ Category 3, Topic 31 Message 144 Thu Jan 27, 1994 V.VALENTI at 02:37 EST Russ, Perspective drawing is easy once you have the formulas. You create a vector table (an array (2,x) assuming 0-2). Then you put in your x,y,z coordinates. When you create a perspective drawing, remember that you the viewer is always in the center and always alined with the x,y on the screen. You use matrix transformations to re-align for rotation and position. You MUST transform all points in your array (or all that will bbe visible. Then you take the points and convert it from x,y,z to x,y. Take the new points and plot it on the screen. I have a little GFA basic program I have been working on that takes four points and you can rotate x y or z... Moving is just a matter of adding or subtracting a constant from the array... If you would like to see it leave me E-Mail and I will download it to you. Vince ------------ Category 3, Topic 31 Message 145 Thu Jan 27, 1994 RHETT [Mr.Anderson] at 12:40 EST Russ, Your ratio idea will approximate perspective reasonably well. I've done it that way. --Rhett ------------ Category 3, Topic 31 Message 146 Fri Jan 28, 1994 R.LUNSFORD2 at 01:10 EST Rhett, ok...if it works, that's enough for me to start working on it ;) Russ ------------ Category 3, Topic 31 Message 147 Fri Jan 28, 1994 J.SPANDE [John Spande] at 19:57 EST Wayne, an easier way is to simply use the timeinfo structure (actually a union) which should be defined in one of the standard header files, depending on your compiler package. timeinfo is simply a union of a bit field structure called part and an integer called realtime. So do something like: { timeinfo time; time.realtime = Tgettime(); hr = time.part.hours; min = time.part.minutes; sec = time.part.seconds; There is a similar union for date (dateinfo). Look in your header files to find the exact definitions. ------------ Category 3, Topic 31 Message 148 Sat Jan 29, 1994 R.BUMAN [*** BOB ***] at 09:27 EST Kennex, a 486DX-66 and NO GEMULATOR??? Hey, for a (relatively) measly $200, street price, you can run almost _any_ of your ST programs on the PC, and they should run FASTER at 66mhz! For more info, go to the GEMULATOR topic base, CAT.19, TOP.15. See ya there! *** BOB *** ------------ Category 3, Topic 31 Message 149 Sun Jan 30, 1994 E.QUILL at 21:55 EST Ref msg #139, Russ "Fundamentals of Interactive Computer Graphics" James D. Foley & Andries Van Dam Addison-Wesley Publishing Company Reading, MA, 1984 ------------ Category 3, Topic 31 Message 150 Tue Feb 01, 1994 R.LUNSFORD2 at 01:26 EST e.quill, Thanks much..will check it out as soon as I get a chance, Russ ------------ Category 3, Topic 31 Message 151 Fri Feb 04, 1994 HEAD.TRIP [Wayne] at 00:28 EST Thanks to all who helped me with the 'Time' question. Wayne - Thursday, February 03, 1994 - 09:05 p.m. PST ------------ Category 3, Topic 31 Message 152 Fri Feb 04, 1994 CODEHEAD [Charles] at 20:39 EST There's a trick you can use to make evnt_multi() return when _either_ mouse button is pressed, by passing the call a special value for one of the button click parameters. I seem to have lost my documentation on this trick -- does anyone know what I'm talking about, and if so could you please enlighten this poor seeker after knowledge? - Charles @ CodeHead Tech ------------ Category 3, Topic 31 Message 153 Fri Feb 04, 1994 PG.MUSIC [PG-Kevin] at 21:59 EST From the evnt_button() or evnt_multi() you can return when either mouse button is pressed by passing the function the following parameter settings: I found it (after forgetting where I saw it in my personal Atari notes) in the errata sheets for the Atari Compendium (available in the ST RT libs). clicks = 0x101 mask = 0x03 state = 0x00 --Kevin ------------ Category 3, Topic 31 Message 154 Sat Feb 05, 1994 R.BUMAN [*** BOB ***] at 08:43 EST I understand binary, but I don't understand this "0x1010" stuff, that is, the 'x'... does this just mean that the x position can be either 0 or 1; or does this refer to something else??? Thanks. *** BOB *** ------------ Category 3, Topic 31 Message 155 Sat Feb 05, 1994 B.SEMAAN [BOSEM] at 11:01 EST Bob Buman, The `0x` in a hex # is just a designation for hex code in Atari/Motorola format. For example to write 256 decimal in hex in the most popular formats: 0x0100 on the ST (680x0) $100 on the Atari 800 (6502) 100h on the IBM (80x86) The leading 0 (after the 0x) is simply an optional placeholder to extend the number out to 16 bits (1 word). You may also run into octal notation from time to time. Decimal 255 would be written as 0377 in octal, 256 dec = 0400 octal. In C it is common to see numeric char constants written in octal as '\377' . Lastly, you'll undoubtedly encounter binary notation, which uses a leading % as in: %11111111 = 0xFF = 0377 = 255 binary hex octal decimal Hope this helps. Bob ------------ Category 3, Topic 31 Message 156 Sat Feb 05, 1994 D.ENGEL [Thunderbird] at 12:15 EST Bob: "0x" before a number means "Hexadecimal" digits will follow. For example 0xFF is 255 in decimal, 0x31 is 49 decimal, etc. This is a standard "C" programming notation. Most assemblers use the "$" sign to mean the same thing... $FF is 255 decimal, and $A0 is 160 decimal, etc. Once you become a programmer, these things haunt you in your sleep... ;-) ______________________ \hunderbird ------------ Category 3, Topic 31 Message 157 Sat Feb 05, 1994 CODEHEAD [Charles] at 21:34 EST Kevin, Thanks for the info! - Charles @ CodeHead Tech ------------ Category 3, Topic 31 Message 158 Sun Feb 06, 1994 M.HILL13 [Mike] at 23:51 EST All, I don't know how many of you programmers use RCS (Revision Control System) software during your development, but I have recently found out how useful it can be. I have been using it at work for over a year now on the PC side of things. I just recently (first time I looked) discovered that Allan Pratt of Atari ported the GNU FSF RCS software to the Atari a year or so back. If your not too familiar with RCS software it works as follows. You create a RCS directory in the directory with source code for a program you are working on. You check in all the source/header files/project files/etc in with the check in program (ci.ttp). This moves the files into the RCS directory and prompts you for a brief description of the files contents. It assigns the file a revision level of 1.1 if this is the first time you checked it in. After checking in all the code for the project you are set. You then check out file(s) as you need them. When you check files out and modify them you should then check them back in. When doing this you are again asked for a description, but this time the description is to describe the changes you just made. The software then determines what changed since the last check in and marks ONLY the differences into the file. It also bumps the revision up a rev on that source file (1.1 to 1.2 for example). So as you can see this is a greater storage system also since you don't need multiple copies of each revision. The software keeps the original 1.1 version in its entirity. Then it just includes the differences (it uses diff.tpp). This saves mucho space and makes it very easy to retrieve different versions. You can check out the latest version (the default) or specify an earlier version to check out. (For example doing a checkout of version 1.1 would bring back the source in its original format). You can look at a log file noting the changes to a file over time. If your working on a project with multiple programmers RCS software is great since you can check files out with a lock when you are modifying them and nobody else can modify them. They could check them out and modify the program, but they won't be able to check the software back in. This feature is mainly useful for network users, but its worth noting. The software is not only useful to programmers. It can be used on articles, pictures, papers, etc. Ascii or Binary. I use it with Lattice C 5.60 at home and it fits nicely into the Lattice C toolbox. I have a "Check In" and "Check Out" entry so I can easily work on files. You can find the RCS software here in the library's and there are ports for IBM, UNIX, etc. If you do alot of programming RCS software can make version control much easier than it is by hand. Check it out! (Get it?) Mike ------------ Category 3, Topic 31 Message 159 Mon Feb 07, 1994 D.LIVINGST11 [ErnestBovine] at 04:26 EST From my files someplace: Here's a cool way to get evnt_multi to report either right or left mouse button events with a single call: int_in[0] flags = MU_TIMER | MU_MESAG | MU_BUTTON | MU_KEYBD int_in[1] clicks = 257 ( 258 if you want double clicks) int_in[2] bmask = 3 int_in[3] bstate = 0 see below ... int_in[14] timer = 0 low word ... or whatever ... int_in[15] timer = 0 high word (would be a LONG time!) When you set bit 8 of the clicks word ( OR $100 ), it causes evnt_multi to negate the value in bstate, and it returns a mouse button event when either button goes down. ========= But this method generates lots of events, for as long as the button is down. You can call evnt_multi() again with different params to shut this off. I think it's easier to use 2 evnt_multi() calls in the same loop, of which one watches the left button and the other the right button. Rather than use clumsy inefficient C bindings that put every parameter on the stack and then move each one into intin[] every time, it's easier to initialize an intin array that's just for evnt_multi(), and poke its address into aespb. You can change intin[2]=bmask and intin[3]=bstate easily for left/right. ------------ Category 3, Topic 31 Message 160 Mon Feb 07, 1994 MIKE-ALLEN [NM~SysOp] at 11:08 EST Mike, There is RCS software and there is RCS software. RCS is almost indespenable on a large, multi-programmer project. One of the few good things about Ada is that RCS is built-in. The particular RCS software I have to deal with (written in house) is so cumbersome, obscure and in general unfriendly that the programmers go out of their way to "cheat" it. Kinda defeats the purpose. When I was writing CP/M software (many moons ago) I used to use diff and ssed to keep my revisions. Diff would create a script for ssed that would create the previous version from the current version. This way al I had to keep on file was the current source code and a series of .dif files to create previous versions as needed. Not really RCS, but it served my purpose. RCS is a wonderful concept as long as it doesn't excessively hinder the programmer. If it's too much of a pain, the programmers WILL find a way to cheat. Mike Allen ST HelpDesk~Sysop Written: 8:32 AM Mountain Time Monday, February 7, 1994 ------------ Category 3, Topic 31 Message 161 Mon Feb 07, 1994 PG.MUSIC [PG-Kevin] at 14:12 EST Any of you guys know the best (fastest) way to index consecutive array elements that are interleaved like this???? addr: 0 |a(0)|b(0)|c(0)|d(0)| 4 |a(1)|b(1)|c(1)|d(1)| 8 |a(2)|b(2)|c(2)|d(2)| What I want to do is quickly index from a(0) to a(1) to a(2) while keeping the layout of the 4 arrays as shown. In "C" I'd want to do this... for(i=0; i>2; }; Well... not exactly that, but you get the picture. Except, I need to do this in assembly lea A, a0 clr.l d0 ; d0 is my index from 0 to maxindex-1 ; a0 points to my A() byte array which is interleaved as shown ; above ; so how do I quickly do the equivalent to this... move d0,d1 lsl.l #2,d1 move.b (a0,d1.l),d2 addq.l #1,d0 ; increment index to next A() item ... I need to find the fastest way to index these guys! And they must be interleaved. Why? I'm trying to skweeze as much as I can during an SDMA interrupt. I need to be able to index my samples this way so I can later load all 16 of the 8bit samples into the registers like this... movem.l d0-d3,(a0)++ then do stuff to them and rearrange to pump out the SDMA in a frame buffer. In reality wavesamples 1, 2, 3, ... , 16 are laid out as follows... |01,0|02,0|03,0|04,0| |05,0|06,0|07,0|08,0| |09,0|10,0|11,0|12,0| |13,0|14,0|15,0|16,0| followed by the next set of 16 samples... |01,1|02,1|03,1|04,1| |05,1|06,1|07,1|08,1| ... See... with this arrangement, I can use movem.l 's to load up the samples for a frame with one instruction do as much of the operation on them with reg only instructions, rearrange for the SDMA output format |out1L|out1R|out2L|out2R| ... and then just use movem.l 's to shove them into a playback buffer. Sorry this post is long & confusing. I'm kind of hurried right now. Any help at doing this FAST would be appreciated. Also, I realize there are errors in my mnemonics & usage above... I don't have them all memorized and I don't have a book handy to check them. Hey, I'm not a computer geek! --Kevin ------------ Category 3, Topic 31 Message 162 Mon Feb 07, 1994 PG.MUSIC [PG-Kevin] at 17:36 EST Charles, You're welcome. :) It bugged me too. :) --Kevin ------------ Category 3, Topic 31 Message 163 Mon Feb 07, 1994 M.HILL13 [Mike] at 19:15 EST Mike, Allan Pratts conversion of the GNU RCS is an excellant RCS package in my opinion. It is very easy to use and cumbersome at all. It fits nicely into Lattice C and should fit nicely into almost any programming enviroment. One of the benefits to the software is that it lets you keep one main copy of the code and you have the diffs to get all the previous versions. You don't need to do a multi-programmer enviroment to see the benefits of the RCS software, but a multi programmer project is a must for RCS software. It sure helps you keep track of previous versions and easily go back to an earlier version if you need to. I encourage anyone to take a look at the RCS port here in the libs if their interested in this type of package. Mike ------------ Category 3, Topic 31 Message 164 Tue Feb 08, 1994 CBARRON at 01:43 EST Kevin, any special reason to keep i in a register instead of just 4*i? Any need for any multiple of i? adding 4 [addq #4,a0] will get the address of the next element. assuming (a[i]+a[i+1]) <=255. (same for b,c,d) indicates: lea A,a0 A start of arrays lea A_end,a1 A_end next long after the arrays. .loop move.l (a0),d0 addq #4,a0 add.l (a0),d0 lsr.l #2,d0 save_answer test_a0_a1 for loop end bne .loop calculates all four at once, and increments the pointer at the same time. C code would be union { unsigned char abcd[4]; long work; }work; ans = (work[i].work+work[i+1].work)>>2; all this assumes no total contained in ans will overflow a byte. if this is the case a fairly tight loop like above is possible. If not you will need to extract each byte. [I THINK] to handle overflows. Mike are you sure Pratt's port will handle binary files? It is fairly easy to use after it is set up 90% of usuage is ci [check in], co [check out] of files. Once the environment vars. are set it is a piece of cake.... Anyone with ftp access if an executable or source port of Berkely pd yacc 1.9 for atari exists, I would appreciate it. I do have the unix source, generates an assert exit with a small grammar, with a direct compile. ------------ Category 3, Topic 31 Message 165 Tue Feb 08, 1994 PG.MUSIC [PG-Kevin] at 10:52 EST CBARRON, Thanks, but I found the method I was looking for in my Motorola '030 book when I returned home. The addressing mode of choice is: (Bn,An,Xn.L*SCALE) As I would use it... move.b (0,a0,d0.L * 8),d7 And... as you guessed... I can't guarantee that the result of the additions will not overflow. That is something that I need to check for. Also, I'm really not doing (a(n)+a(n+1))/2 at the moment. I'm doing more of: (a(n)+b(n)+c(n)+d(n)) = Yout for now. I'll really need lots of this kind of stuff when the program gets farther along, but I think I'm gonna have to move most of this stuff to the 56K in my Falcon just to get the speed I need. Hmm... you did give me one more alternate idea tho... Thanks, --Kevin ------------ Category 3, Topic 31 Message 166 Tue Feb 08, 1994 M.HILL13 [Mike] at 19:05 EST Carl, I tried a Binary file with Pratts port and you were right. It doesn't handle binary files. I will have to recompile my PC version of the RCS software since it is a full port which handles binary files. Regardless though binary file support isn't something I really need. The GNU RCS software is a breeze to setup on the ST. Just a couple enviromental variables. The software is sooo easy to use and can make your life easier I encourage any programmer to take a look at it. Mike ------------ Category 3, Topic 31 Message 167 Tue Feb 08, 1994 DMJ [dmj] at 19:06 EST Kevin, If you want to index a single array from a set of four interleaved byte arrays, you might try something like this: start lea start_addr,a0 ; Start address of arrays. move.l length,a1 ; Get number of entries. adda.l a1,a1 ; This will double # entries. adda.l a1,a1 ; And this quadruples it (4 per entry) adda.l a0,a1 ; Add start to length to get end. loop move.b (a0),d0 ; Read a byte. ... ; Do your processing here. addq.l #4,a0 ; Move to next entry. cmpa.l a0,a1 ; At the end of the array? bgt loop ; No, process next set of data. If you have 16 interleaved arrays, rather than 4, you need to add 16 instead of 4 in the "Move to next entry" line. Since this is too big for addq, you might put the value 16 into a register (say, d7) and add that to a0. Hope this helps. It's kind of hurried and confused. ;-) ~dmj ------------ Category 3, Topic 31 Message 168 Tue Feb 08, 1994 PG.MUSIC [PG-Kevin] at 22:06 EST DMJ, I saved your post to look at more carefully later. I think the method I chose is '030 on up specific, but since this is a Falcon only or better program, I don't think that's a problem. I just looked at the addressing modes available on the '030 and found that index * SCALE mode. Ugh... I dunno if the 030 is up to 16 or 32 sampled voices @ 50KHz (pitch, amplitude, etc modulation) that can be changed or modified upto 100 times per second. Even with only 8bit samples. Maybe 8 and definitely 4 can be had... That is why the timing is critical. Maybe I can skweeeze all 32 out... but that would mean the program basically has to take ALL of the CPU time. Maybe it's time to get more serious with the 56K programming. Even then, I don't think one DSP56K can handle many more voices either... --Kevin ------------ Category 3, Topic 31 Message 169 Tue Feb 08, 1994 DMJ [dmj] at 23:02 EST Kevin, Keep in mind that the (Bn,An,Xn.L*SCALE) method _only_ works on an '030. Not really a problem if you're writing specifically for the Falcon. It's also not the _fastest_ method to use. Moving the address register, rather than changing an index (scaled or not), will be much faster. (Well, you _did_ say speed was important!) ~dmj ------------ Category 3, Topic 31 Message 170 Tue Feb 08, 1994 D.ENGEL [Thunderbird] at 23:16 EST Kevin: If speed is the name of your game, I suggest you unroll the code (sometimes referred to as "unlooping"). Get rid of all the loop overhead by hard coding the loops as successive instructions. You'd be surprised how much time you waste in those tight loops. ____________________ \hunderbird ------------ Category 3, Topic 31 Message 171 Wed Feb 09, 1994 PG.MUSIC [PG-Kevin] at 00:43 EST T-Bird, That's what MACRO's are for. I still don't think the '030 can quite hang... I'm starting small (4voice, get it working etc...) and then trying to up the # of voices until it croaks. I _hope_ I can get 16 voices (for any decent multi-timbral basic synth), but even 8 would be OK. Ok, IF I can also get the envelope, lfo, and other modulators working... DMJ, yeah. But if I don't use an indexed method, I _may_ suffer a bigger speed penalty later. :) Oh, whether or not you use the SCALE portion of the addressing mode doesn't matter. It won't add any cycles to SCALE the index. However, I've been wondering how many cycles I'd waste in instruction fetches etc if I don't use the indexed mode. Hmm... I _HATE_ looking that stuff up. Hey... I just wanna put an end to all this MOD file cheezeenes. A _real_ (well... ALMOST) real sample based synth that can be coupled with a _MIDI_ sequencer and setup pretty much like the real thing... loading SoundDesigner format samples & all. :) Looks like I may just need to 'come up with' a Jag<- >Falcon cable and make a JagSynth cart for using the two together. This is offtopic... but... do you ever wonder if Atari tries to 'scam' on us smaller devs by charging huge prices for the dev kit (I don't WANT a TT), while the big guys mostly seem to be 'licensing' Atari to do a version of their (the other co's) games? I've heard in the past that some at Atari (no names in public) used to brag about 'taking the dev folx' so to speak. Anyway, enough of that... Heck... if I were just doing percussion (non-pitch mapped) I could probably do a gazillion voices. You know... if Atari had just offset the SDMA addresses by ONE MORE WORD... then you could use a SINGLE movep.l instruction per frame register to load them up. :) Well... the asm code looks ok and seems to 'work' (at least in the non- interrupt testing with the debugger). Now it's almost time to write the main() part in Pure C to setup the samples, load them in, let me tweek the pitches, etc... Maybe I can finish it up by late this weekend. Waaaaa!!! I wanna Jag processor to do AUDIO!!!! The 56K and '030 aren't looking like they'll make it. Especially not with 16bit 50Khz stuff.... --Kevin ------------ Category 3, Topic 31 Message 172 Wed Feb 09, 1994 DMJ [dmj] at 19:07 EST [Long post warning] Kevin, A tight assembly loop--one in which _all_ the unnecessary fluff is removed--is ungodly fast. Some of the sample modification routines I used in Sound Lab were so fast on my 470K test sample I had to use the _computer_ to do the timing--my finger just wasn't accurate enough. I have a few rules of thumb when trying to optimize assembly code. 1. Avoid immediate data whenever possible. If a number will be used often, put it in a register and use the register. This doesn't apply whenever you can use the "q" variants; moveq, addq, and subq all store the immediate data within the opcode, so they're much quicker. If you must use immediate data, use a word whenever possible. The less data that must be fetched from memory to the CPU, the faster your code will run (in general). One last tip here: on a 68000, the clr instruction is very slow. Use moveq #0,Dn for data registers, and suba.l An,An for address registers; they're about twice as fast. If you must clear large sections of memory, moveq #0 into several data registers and put movem.l into a loop. 2. Don't shift data around if you can help it. As in your example, rather than scaling an index every time you need it, simply use the scaled value, and scale your step value to match. If you must shift data left one bit, you can do so with add.l Rn,Rn. This takes half the time of lsl.l #1,Dn and it works with address registers too. 3. Don't multiply or divide if you can help it. If possible, adjust your algorithm to work with powers of 2 (so you can shift left or right). (Then refer to tip 2.) If you can't adjust the algorithm, or if the complications are complex, see if you can use a lookup table; if the range of values is small, or if sufficient memory is available, create and use a lookup table. This will grossly increase your routine's speed. 4. Use the simplest addressing mode you can. The fewer calculations the CPU has to do to figure out the effective address, the better. The 68030's new addressing modes look enticing, and can be very useful, but if you can get by with a simpler method, do it! 5. Process data in 16- or 32-bit chunks whenever you can. On an ST, STe, or Falcon, working on a word level instead of a byte level will yield TWICE the speed. On a TT, working on a longword level will yield FOUR TIMES the speed. You've got all those lines on the bus--USE them. (Another Sound Lab example...) To convert a sample from signed to unsigned involves toggling the high bit of each byte (bit 7). It would be possible to bchg those bytes, one by one, but that makes poor use of the bus. Better to eor the value $80808080 to each long (which toggles the high bit of each byte); this processes four bytes at once, and on a TT (if those longwords are aligned on a four-byte boundary) it will _really_ fly! 6. If you have a very simple loop (perhaps one, two, or three instructions in it) see if you can straight-line the code. For example, instead of the following: move.w #255,d0 ; Loop 256 times. .loop add.l d1,(a0)+ ; Update this value. dbra d0,.loop ; Loop until finished. try using this: moveq #63,d0 ; Loop 64 times, each loop does 4. .loop add.l d1,(a0)+ ; Update four values. add.l d1,(a0)+ add.l d1,(a0)+ add.l d1,(a0)+ dbra d0,.loop This cuts down on the amount of time spent handling the looping and spends more time on the actual processing. Note that this technique does not apply to 56K programming, because the 56K DSP supports no-overhead looping in hardware. 7. Don't be afraid to change your data structures or algorithm to optimize your code, if speed is important enough. Sometimes looking at a problem in a new way will help you speed up your routine drastically. For example, the Sound Lab echo routine essentially adds fractions of earlier bytes to each byte to create an echo. If I were to process the data in a forward order, I would need to store the earlier, unaltered data in a buffer, as they would be overwritten when they were processed. Maintaining such a buffer would impose a large overhead on the routine. Instead, I process the data _backwards_. The earlier values I need to refer to are available, unaltered. There is no buffer to maintain, so the routine can work much faster. Please note that the above list is not exhaustive, and I do not consider myself the most knowledgable assembly programmer (especially when it comes to speed) but the above lessons were learned the hard way. It's not necessarily a question of whether the 030 can do 16 or 32 sampled voices at 50kHz. It's more a question of whether the 16MHz 030 in the _Falcon_ can do it. Work it out; if you have 16 voices at 50kHz, it means you have to process 786K per second (roughly). If you can do that, fine--but I really think you might have trouble there. You may need the DSP. ~dmj ------------ Category 3, Topic 31 Message 173 Wed Feb 09, 1994 D.ENGEL [Thunderbird] at 23:33 EST dmj: Here's one for you (or anyone else for that matter): Do you know of a way I can take an 8-bit signed value (with leading zeroes padding to 32 bits) and sign extend it to 32 bits, using simple boolean arithmatic, or signed adds/subtracts? e.g.: $00000081 Value $FFFFFF81 Result $0000007F Value $0000007F Result etc. I can do it in 3 instructions, but I'd like to think of a way which only takes 1 or 2. Thanks ____________________ \hunderbird ------------ Category 3, Topic 31 Message 174 Thu Feb 10, 1994 RHETT [Mr.Anderson] at 00:02 EST TBird, Assuming your value is in d0: ext.w d0 ext.l d0 --Rhett ------------ Category 3, Topic 31 Message 175 Thu Feb 10, 1994 PG.MUSIC [PG-Kevin] at 05:22 EST T-Bird, Try... some_operation ; that gives you signed bytes in d0 as before ext.w d0 ; sign extend byte to word ext.l d0 ; sign extend the word to the longword do_some_signed_long_stuff I haven't checked the execution times yet... but this does it in 2 instructions. Oh. I forgot... you said "simple boolean arithmetic". DMJ, I was referring to 'the 16MHz '030 on a 16bit bus in the Falcon' when I said '030. Heh... My limited time is making my posts more cryptic than they used to be. :) I've been changing the data structures almost daily. :) Thanks for the tips. Most of them I've used in small combinations years ago... Now, I may have to use _all_ of those suggestions in one routine. :) I kind of got side tracked tonight with a problem getting the SDMA to interrupt using the GPIP7 interrupt. It interrupts fine, calls my routine, and I RTE. But... the computer just locks. Hmm... seems like I'm getting a new frame interrupt too soon. Strange... The only thing my 'test' Gpip7 irq handler is doing is saving the regs, changing the SDMA frame buffer, restoring the regs, and RTEing. Ugh... probably something simple that I'm messing up. I should probably just use the TimerA evnt cnt mode, but... I'm trying to make this something which can run 'behind' other apps which may use timer A. Doesn't the 030 support a loop mode like the 010 does? I thought that short, tight loop mode was FAAAAAAAST. Hmm... time to look it up again. Yep, I've been creating macros to help keep the code readable while it is unrolled. --Kevin ------------ Category 3, Topic 31 Message 176 Thu Feb 10, 1994 PG.MUSIC [PG-Kevin] at 08:09 EST dmj, T-Bird, Umm... I found my problem in the interrupt. In my 'haste' the other day to find a quick way to shove the frame addresses into the SDMA (looking for a faster way than I was using before), I was trying to use the movep.w instruction with an odd adress (to move to the odd byte in successive words). Somehow, I munged it up. Anyway... I fixed _that_ problem. :) Now I need to figure out what happened to my pitch transpose routine (works fine out of the interrupt during testing). --Kevin PS. I'm hoping I can process 100 sample frames per second (at LEAST 60 frames per second) to allow 'real time' manipulation of the sample voices (from midi, program control etc...). I figure I'll have to deal with about 8000 sample bytes every second. I may have to rewrite the routines to just adjust the pitch on the '030 a and then pass in a synchronized frame to the DSP to do the amplitude and envelopes etc. Then either pass that directly to the SDMA or DA conv or try returning a 'processed frame' so the '030 can retrieve some info. Fun fun... :) ------------ Category 3, Topic 31 Message 177 Thu Feb 10, 1994 D.ENGEL [Thunderbird] at 23:04 EST Rhett, Kevin: Whoops! I should have been a little more clear in my description of the brain-teaser... I need to sign extend an 8-bit value in a 32 bit register, WITHOUT the help of an "ext.l" or "ext.w" instruction. I figured out how to do it with 2 instructions, I don't think anyone can get any better than that. I tried a ton of boolean math and I don't think there is a "magig" number to add or multiply or and or XOR or whatever to get it to sign extend. Oh, well... Thanks anyways. _____________________ \hunderbird ------------ Category 3, Topic 31 Message 178 Thu Feb 10, 1994 DMJ [dmj] at 23:21 EST Kevin, - I'm hoping I can process 100 sample frames per second... How big are your sample frames? You lost me somewhere. - I figure I'll have to deal with about 8000 sample bytes - every second. 8kHz? Geez, that's slow. You must need something faster than that. Now I'm really confused. - I may have to rewrite the routines to just adjust the pitch - on the '030 a and then pass in a synchronized frame to the - DSP to do the amplitude and envelopes etc. They're just 8-bit samples, right? Then you don't need a multiply to change the amplitude; just create say, 65 256-byte lookup tables that store all the possible results of your multiplications. The tables are numbered 0-64, and they represent volume settings of 0/64 to 64/64. You do the multiplies once, then just look up the values. This only takes 16K, and it's how MOD players work. (It's also similar to how Sound Lab does volume changes and fades in real time.) ~dmj ------------ Category 3, Topic 31 Message 179 Fri Feb 11, 1994 PG.MUSIC [PG-Kevin] at 08:06 EST DMJ, That should've said... 8000 samples every frame. 100 frames every second. Yup, I'm gonna use a 64Kb lookup for 127 different amplitude levels. No big deal there. However, I eventually wanted to convert this thing over to 16bit samples.And a 16bit lookup would be huuuuuge. For that... I s'pose the 56K is necessary. --Kevin ------------ Category 3, Topic 31 Message 180 Fri Feb 11, 1994 DMJ [dmj] at 19:02 EST T-Bird, First off, you could have submitted this great brain teaser as a "Brain Stem Rotator" for AEO-PJ... I bet Albert Dayes would have loved it. If you don't want to use ext.w and ext.l (or the 68020 variant extb.l, which will go from 8-bit to 32-bit in one step), then you can do it this way (assuming your number is in d0.b): ror.l #8,d0 ; Puts d0.b in the most significant byte divs.l #16777216,d0 ; Divide by 2^24 to scale back down. This does, of course, require a 68020 or better for the divs.l, and it's incredibly slow. Here's an alternative method: add.b #128,d0 ; Change -128 to 127 to 0 to 255. sub.l #128,d0 ; Change it back (long this time). Thanks for a stimulating puzzle. There are two variations of the above solutions which I didn't bother to mention. ~dmj ------------ Category 3, Topic 31 Message 181 Fri Feb 11, 1994 AEO.1 [Albert Dayes] at 20:10 EST DMJ, T-Bird's teaser would have been an excellent Brain Stem Rotator! -- Albert ------------ Category 3, Topic 31 Message 182 Sat Feb 12, 1994 PG.MUSIC [PG-Kevin] at 00:22 EST Guys, Never mind. I realized that I was forgetting to do: mfpGPIP7_inservice = $fffa0f bclr.b #7,mfpGPIP7_inservice before I exited the interrupt routine. Thanks anyway. Maybe someone will find that example useful. Now back to my regularly scheduled hacking... --Kevin ------------ Category 3, Topic 31 Message 183 Sat Feb 12, 1994 DMJ [dmj] at 00:22 EST Kevin, 8000 samples per frame, 100 frames per second. That's 800,000 samples per second. If all you're doing to adjusting the amplitude, you might get by, but if you want to _mix_ those samples... have fun. Perhaps you should try 8 channels, instead of 16? 128 amplitude levels is 32K, not 64K. If you want to use 16-bit samples, you can either: A. Do a bit of fudging a bit shaving and squeak by with a 2M lookup table. (I suggested that to someone here and they nearly passed out. ;) B. Use the DSP. It's got enough horsepower for exactly what you're trying to do; why not use it? ~dmj ------------ Category 3, Topic 31 Message 185 Sat Feb 12, 1994 D.ENGEL [Thunderbird] at 00:32 EST dmj: Thanks for the further input. You've given me two more ways to extend it out. I came up with several of my own including a rotate left 24 bits and an Arithmetic shift right back 24 bits. Since I already needed to shift my result, I incorporated that into my technique and have it using 1 less instruction. P.S. No the speed of the shifts is not a concern here... it is faster this way than the others because of the way I incorporated it in with the shifts I had to do anyways. Thanx again ____________________ \hunderbird ------------ Category 3, Topic 31 Message 186 Sat Feb 12, 1994 PG.MUSIC [PG-Kevin] at 01:40 EST And one more change... On the Falcon... 6.xx KHz mode isn't supported so... The line with: move.w #$0000, $ff8920 Should say... move.w #$0003, $ff8920 ; 50Khz, repeat playback mode Sorry. The lack of sleep has caught up. :) --Kevin ------------ Category 3, Topic 31 Message 187 Sat Feb 12, 1994 PG.MUSIC [PG-Kevin] at 02:40 EST DMJ, I can count on you guys to catch me nodding off at the computer consoles. For some reason I was gonna do -128 to 127 for the volume levels. Some idea about inverting the phase. I thought of using a beeeeeeeg lookup table. For me, I wouldn't care, hey I've got 14meg of RAM and oodles of 105 and 88 SyQuest carts to burn. . However, I think the 4meg Falcon folx would be upset. Yeah, I've been trying to avoid using the 56K until I can figure out the best way to do it. Either, adjust ONLY the pitch with the '030, pump it to the DSP and then let the DSP mix everything, volume, etc, and then go straight out the SDMA. OR, figure out a way to let the DSP also handle the pitch adjustments while of 32 different (sample rates of the source samples can be different too) wavesamples that can be looped etc. The problem I have is getting the DSP to tell the '030 the current position in the sample is for the next frame start. I may just scale back the voices for now and then figure out the DSP as I go along. Also, using the DSP means I have to actually _learn_ how to use my DSP debugger from BrainStorm. --Kevin ------------ Category 3, Topic 31 Message 188 Sat Feb 12, 1994 R.BUMAN [*** BOB ***] at 11:33 EST BOSEM and Thunderbird: Thanks _very_ much, your messages were quite helpful... I come from 6502 programming and that much I understood, but the rest was news to me! Gee, I feel like I'm finally moving into the 90's. :-) *** BOB *** ------------ Category 3, Topic 31 Message 189 Sat Feb 12, 1994 DMJ [dmj] at 11:48 EST Geez, Kevin, you FORGOT to clear the ISRA bit in the MFP? Sheesh. Somebody give this guy a firm kick in the rear. (I won't tell you how long it took _me_ to figure that out when I first did interrupt programming.) ~dmj ------------ Category 3, Topic 31 Message 190 Sat Feb 12, 1994 DMJ [dmj] at 12:51 EST T-Bird, If you don't mind my asking, how did you arithmetic shift right 24 bits in one instruction? That was my first thought, but I couldn't figure out how to do the 24-bit shift in one go. (Hence the rotate right, and divide.) Also, I looked at some timings... the add/sub method takes as much time as a single shift operation--less if your shift count is stored in a register. (Of course, it assumes the upper portion of the register is clear.) ~dmj ------------ Category 3, Topic 31 Message 191 Sat Feb 12, 1994 PG.MUSIC [PG-Kevin] at 15:59 EST DMJ, The bad thing is... this _isn't_ the 1st interrupt programming I've done. I even looked at the same instruction clearing my MFP timer routines and didn't think of clearing the SDMA's GPIP7 interrupt. Hehe... at least I recognized the symptoms. Oh yeah, I just found SoundLab in the RT Libs. Did you know that it absolutely won't work on my Falcon, even in the ST compatibility modes? Once you get the message about 'hit any key' it is bomb city. Also, the 'Spectrum' style gfx wreak havoc in 1024x656x16color. Do you have any plans to try & fix that? I'll register if I can get it to work. :) It would come in handy. Only thing I can figure is T-Bird had the proper shit count sitting in a register. Shifts in the form xS{L,R}.l Dn,Dn are modulo 32 or izzit 31? Big News Break on more voices on the Falcon. I forgot about having 4 stereo 8bit tracks on the SDMA. That means I can do a lot less mixing to get more voices. Yay! I still need to get into my DSP debugger more. It's nice, but I just haven't had time to 'think it thru'. --Kevin --Kevin ------------ Category 3, Topic 31 Message 192 Sat Feb 12, 1994 D.ENGEL [Thunderbird] at 17:22 EST dmj: How can I do what I did the way I did it? Simple.... I'm not programming a 680x0 CPU. __________________ \hunderbird 'cause I can't say any more than that. ------------ Category 3, Topic 31 Message 193 Sun Feb 13, 1994 DMJ [dmj] at 12:46 EST Kevin, At the moment, I do not know what is causing the problem. Most likely it's some of the illegal hardware accessing Sound Lab is doing. (When I wrote it, I was just figuring out how to do most of the stuff I did.) You might try it in ST High compatibility mode, or hold down the ALT key while you load (to bypass the title screen), but even if that works, problems will show up later. Without a Falcon to test software on, finding exactly where the problem is is difficult. As for that low res screen sitting in the middle of the medium res one... yes, I'm not surprised it dies a gruesome death on the Falcon. Frankly, I was amazed when I found it worked on a TT. If you like, I can send you a "fixed" version which still doesn't work... perhaps you can tell me exactly where it dies for you. T-Bird, That's cheating. Oh, that I could be in your shoes right now. ~dmj ------------ Category 3, Topic 31 Message 194 Sun Feb 13, 1994 PG.MUSIC [PG-Kevin] at 16:16 EST DMJ, The opening screen works fine on the Falcon in the ST compatibility modes. It is when you "hit any key" to get past the opening screen that it craps out. :) Sure, send up a fixed version. I'll try to run a debugger on it & find out where its dying. Probably a bad hardware access. Since, the TT has pretty much _the_same_ hardware as the STe, I'm not surprized it works. --Kevin ------------ Category 3, Topic 31 Message 195 Mon Feb 14, 1994 R.LUNSFORD2 at 03:31 EST Hello, I'm translating some assembly (from one assembler (not sure which)) to Devpac3 and I've run into two problems... 1. how do I translate this move.w (a0,d0.w*2),d1 2. is this just specifying the dest size, or is it muls'ing two longs: muls.l d0,d6 I have no idea how to translate the first one, tried a bunch of things. The second one I noticed gives a long result from two word operands, can I just lop off the .l? this is bugging me to death... Russ ------------ Category 3, Topic 31 Message 196 Mon Feb 14, 1994 RHETT [Mr.Anderson] at 12:32 EST Russ, That is a 68020+ instruction. If you have a 68020 or better, look up in your DevPak manual how to turn on 68020 instructions. It's probably an OPT. If you want the code to run on the 68000, use this fragment as a replacement: add.w d0,d0 move.w (a0,d0.w),d1 asr.w #1,d0 Notes: This only works if d0 doesn't overflow on the add. If that potential exists, extend d0 to a longword first and do a longword-indexed instruction. Note that the last instruction above is unnecessary is you don't care about trashing d0. --Rhett ------------ Category 3, Topic 31 Message 197 Mon Feb 14, 1994 T.WRATHER [Thomas] at 20:46 EST I have several related questions concerning how the BUS Error exception vector is handled under TOS. Why does a program running in User mode generate a BUS Error when it tries to read the contents of the BUS Error vector (i.e. the contents of address 0x00000008)? When I execute the same program in Supervisor mode, the contents of the BUS Error vector are reported as 0x00e0121c. But MemFile 3.0 reports the contents of 0x0000008 as 0x000dd612, and Show-System reports the contents of 0x0000008 as 0x011083ca. Why does the value of the vector seem to float? I expected it to remain the same. Thomas Wrather ------------ Category 3, Topic 31 Message 198 Tue Feb 15, 1994 ATARI.BENLUX [W. Kilwinger] at 04:17 EST Thomas: >Why does a program running in User mode generate a BUS Error when it tries to >read the contents of the BUS Error vector (i.e. the contents of address >0x00000008)? Since you can't access low memory (the first 64K) in user mode. > >When I execute the same program in Supervisor mode, the contents of the BUS >Error vector are reported as 0x00e0121c. But MemFile 3.0 reports the contents >of 0x0000008 as 0x000dd612, and Show-System reports the contents of 0x0000008 >as 0x011083ca. Why does the value of the vector seem to float? I expected it >to remain the same. Probable because these are different reports. What you find on 0x0000008 is a pointer to the bus error handler. You report 0x00e0121c which means that the handler is in ROM on a STE or TT (otherwise it will be $0x00FCxxxx), seems to be correct for me. The other programs probable give a address that the bus error handler dumps in the post-mortem area ? Regards, Wilfred ------------ Category 3, Topic 31 Message 199 Tue Feb 15, 1994 STARFALL [ Alan ] at 12:25 EST The various memory examination tools steal the bus exception vector while they are running, so they can trap illegal accesses. When Memfile is running, the bus exception vector points to a handler in Memfile. What's a bit confusing is that a user mode access to low memory gets you a *bus* error, rther than a privilege violation. Privilege violations are generated internally by the 68000 when you execute a non-user mode instrcution. Bus errors are triggered by events external to the CPU. When you access a low memory address, the GLUE chip checks the state of the CPU. If the CPU isn't in superviser mode, the GLUE sends a bus error signal to the CPU, rather than the data from that address. A privilege violation might make more sense, but this can't be triggered from outside the CPU. The bus error is the only way the GLUE chip can complain. / / * / Alan * * ------------ Category 3, Topic 31 Message 200 Tue Feb 15, 1994 DMJ [dmj] at 19:05 EST Thomas, - Why does a program running in User mode generate a BUS Error - when it tries to read the contents of the BUS Error vector...? Because you can only access that address in supervisor mode. - Why does the value of the vector seem to float? Because some compilers change this vector in their startup code, to try to handle such errors "gracefully" and clean up after themselves. ~dmj ------------