Date: Tue, 1 Jul 1997 21:18:12 -0400 From: Ajay Nath <AjayNath@compuserve.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: How to get type/creator from an FSSpec? did you try calling FSpGetFInfo...or something like that...check in Think Reference
Date: Wed, 2 Jul 1997 10:27:45 -0700 From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Not Position Independent >Can someone please tell me: Is this "SHOW ABSOLUTE REFS" a feature of PF, >or Eddy, or what? I can't afford to register PF this month. Is this a >feature only in the registered version? SHOW ABSOLUTE REFS can be turned on by going to the 'Project' menu then 'Project setup' then 'Set prefs' it should be on the right side of the window about half way down. I really can't remeber what that error is about, it's a 68K thing and I am now offically 68K dumb. :)
Date: Wed, 2 Jul 1997 13:52:32 -0400 (EDT) From: Figaro Tea <humphret@lurch.winthrop.edu> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: moving registers in 68K On Wed, 2 Jul 1997, Kevin Avila wrote: > Here is a nice example of my 68K lameness. :) Okey the PowerPC has 'mr > r3,r4" to move the data in a register to another. How would you do this in > 68K? You can't use move.l d1,d2...or can you? Yeah, you can do that. Oh, and BTW, you are lame:) Just kidding ..._Tim_...
From: mikobe@TallShips.iSTAR.ca (Meikal Oestebo) To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Not Position Independent >SHOW ABSOLUTE REFS can be turned on by going to the 'Project' menu then >'Project setup' then 'Set prefs' it should be on the right side of the >window about half way down. I really can't remeber what that error is >about, it's a 68K thing and I am now offically 68K dumb. :) --------------- Thanks a bunch Kevin: It was right under my nose. I wish I could help you with your problem with 68K, but I'm sure someone on the list will. Then I'll learn a little more. Mike.
Date: Wed, 2 Jul 1997 14:35:50 -0400 (EDT) From: Figaro Tea <humphret@lurch.winthrop.edu> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Assembly Block Comment Via Grep Since I'm still using Fantasm 3.2 I don't know if version 4.x has block comments in it or not. But if you're like me and using a grep-powered search engine like BBEdit Lite 4.0, or BBEdit 4.0, to do your editing, then you can use grep to make block comments in assembly: First, select all the lines you want to comment. Go to find, and in the dialog box check "use grep" For the find field, put this in: (^.*) And for the replace field, put this in: ;\1 Voila, all the lines are commented out! Of course you'll have to select the "selection only" checkbox. To take out the comments, use this for the find field: ^[;*](.*) and this for the replace field: \1 If you've ever used UNIX before then you probably already know what grep is; if you haven't, then don't worry, it'll still work:) If you don't know about BBEdit, you can visit their web page at <http://www.barebones.com>. And you can get BBEdit Lite 4.0 at <ftp://ftp.barebones.com/pub/freeware/BBEdit_Lite_4.0.1.sit.bin> ..._Tim_...
Date: Thu, 3 Jul 1997 00:48:14 -0400 From: Scott Lahteine <slur@world.std.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: moving registers in 68K >Here is a nice example of my 68K lameness. :) Okey the PowerPC has 'mr >r3,r4" to move the data in a register to another. How would you do this in >68K? You can't use move.l d1,d2...or can you? Yes. Also: move.w d1, d7 move.l d0, sp move.l a0, d0 move.l ccr, d0 You can move any register to (almost) any other register. You can even do "move.l (sp)+, pc" but you spell it "rts". ------------------------------------------------- Scott Lahteine <mailto:slur@world.std.com> <http://world.std.com/~slur/> "No Universe is perfect which leaves no room for improvement." -------------------------------------------------
Date: Thu, 3 Jul 1997 11:35:27 -0400 (EDT) From: mikobe@TallShips.iSTAR.ca (Meikal Oestebo) To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: MacsBug "Delay"? Me again; I'm playing with MacsBug and am finding some long "delays". Can someone tell me why? Here's a short example of what I'm doing: --------------------------- debug Main: move.b #1,d0 move.w #2,d0 move.l #3,d0 ;rts global Main ----------------------------- As soon as Macsbug kicks in, I type s and a return. That goes fine for the first two instructions here, but when I step into the third one, there is a long pause before I get my curser back. I cannot esc to the screen either. It's as if Macsbug has frooze for a while. I had hoped to put a lot of move instructions in one "program" with plenty of comments to help me get a grasp on the things Tim has been teaching us newbies, but it takes 15 seconds or more for macsbug to "recover" from my previous instruction. Any Ideas anyone? ***If anyone happens to see the 1 I put in the first line of my program, would they please tell it to come home! That was a perfectly good 1 I put in there! So when I stepped into the second instruction, what the heck happened to my 1? Is the register ""self-clearing"" or something like that? Thanks. Mike.
Date: Thu, 3 Jul 1997 13:17:10 -0400 (EDT) From: Figaro Tea <humphret@lurch.winthrop.edu> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: MacsBug "Delay"? On Thu, 3 Jul 1997, Meikal Oestebo wrote: > I'm playing with MacsBug and am finding some long "delays". Can someone > tell me why? > > Here's a short example of what I'm doing: > --------------------------- > debug > Main: > move.b #1,d0 > move.w #2,d0 > move.l #3,d0 > > ;rts > global Main > ----------------------------- > As soon as Macsbug kicks in, I type s and a return. That goes fine for the > first two instructions here, but when I step into the third one, there is a > long pause before I get my curser back. I cannot esc to the screen either. > It's as if Macsbug has frooze for a while. I'm not sure why you this would happen to you, I haven't seen it before on my system. You might try to uncomment the 'rts' instruction, I doubt this would be the cause of your problems, but you never know... If you have System 7.6 and you're using MacsBug 6.5.3, then get 6.5.4, there's a problem with 6.5.3 and system 7.6. > ***If anyone happens to see the 1 I put in the first line of my program, > would they please tell it to come home! That was a perfectly good 1 I put > in there! So when I stepped into the second instruction, what the heck > happened to my 1? Is the register ""self-clearing"" or something like > that? Yeah, registers are self-clearing; this is something I was going to talk about next. ..._Tim_...
Date: Thu, 3 Jul 1997 16:18:12 -0400 From: Stuart Ball <lightsoft@compuserve.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: MacsBug "Delay"? Mike wrote: >Me again; > >I'm playing with MacsBug and am finding some long "delays". Can someone >tell me why? Macsbug is searching for embedded symbols, hence the long delays. I would suggest you use the rts_ macro rather than straight "rts". This will speed up Macsbug by a fair amount. Macro usage: rts_ "label_name" Make LS_68k_macros.def a globinc, or just paste the macro in from this file, definition follows: **Insert a macsbug label **call as rts_ "label_string" rts_: MACRO rts dc.b $80+end\@-start\@ start\@: dc.b \1 end\@: align dc.w 0 *literals endm Then there's the super duper rts_ macro which allows you to turn lables on and off, viz: **Insert a macsbug label **call as rts_ "label_string" rts_: MACRO rts ifne use_labels *if use_labels is 1 then generate embedded labels dc.b $80+end\@-start\@ start\@: dc.b \1 end\@: align dc.w 0 endif endm This allows you to reduce the size of your code when debugged by setting use_labels to zero. 68k embedded symbols are covered in the user manual. Stu.
Date: Fri, 4 Jul 1997 09:44:09 -0400 From: Ajay Nath <AjayNath@compuserve.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: MacsBug "Delay"? some of the registers on the 68k & PPC are considered "volatile" by the OS...this means that the values that are in them when you exit a system routine may not be the same as ones you put in on the 68k i think d0-d2 were volatile & also a0-a2 but it has been so long since i used 68k code i don't remember. i think that since you are storing values into volatile registers & then calling _Debug you are getting different values back try using d5-d7 instead & you should sees things come out right
Date: Fri, 4 Jul 1997 10:45:14 -0400 (EDT) From: mikobe@TallShips.iSTAR.ca (Meikal Oestebo) To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: anyone new to assembly??? I was wondering if there are some people on this list who are, (god help them), as new to assembly as I am. I'm starting to feel like a Model-T on board of the Enterprize. If you're out there, don't be shy; - drop me a line. I'd love to hear from you. Mike.
From: Malcolm Sharman <sharman@norex.com.au> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Coverting C++ to PF Hello Every Body As thre subject says, I need to convert C++ to Fant inparticular 68k. Does anybody have any ideas. Coverting C is fairly straight forward but C++ has many more data types and functions. Has anybody had much experience with C++ and can give me some tips to convert the code to assembly? Malcolm Sharman Lead Programmer Paranoia Software
From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Coverting C++ to PF >Has anybody had much experience with C++ and can give me some tips to >convert the code to assembly? well what I do is compile the C++ in codewarrior then use the disassembly option to get the assembly code from that, after you d that the rest is easy. :)
From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Memory/Address??? >It's me again; >Can someone help me understand what is happening in the example below at >line #5, (move.w d0,sum.)? I get the general idea. This moves the value, >(5), at d0 into memory, at location (sum). But when I go into macsbug and >step into this line, I don't see any of the registers changing. Shouldn't >one of the address registers be affected? it does not affect registers, but memory. if you were to watch the memory address of sum that would change, but everything else would stay the same because it is mearly copying the data...not moving it
From: Scott Lahteine <slur@world.std.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Memory/Address??? >Can someone help me understand what is happening in the example below at >line #5, (move.w d0,sum.)? I get the general idea. This moves the value, >add: move.w #2,d0 > move.w #3,d1 > add.w d1,d0 > move.w d0,sum For the above line the addressing mode is "absolute addressing." No address registers (A0 - A7) are involved. Rather the address represented by "sum" is retrieved from memory (as part of the instruction) and stored in a register internal to the processor. The value from register D0 is then stored into memory beginning at the address labelled "sum." >sum: ds.w 1 The above line reserves 2 bytes of memory (one word) for storage. The label "sum" can be used to reference the value contained at this address. You can access it in a few different ways. There is PC-relative, which is quicker and smaller. The syntax for this is simply to use "sum(pc)" instead of just "sum," but you can only use PC-relative for source operands. (i.e., only when fetching from memory). If you wanted to use an address register for debugging purposes, you can change the "move.w d0, sum" to the following: lea sum, a0 move.w d0, (a0) - or - lea sum(pc), a0 move.w d0, (a0) - or - move.l #sum, a0 move.w d0, (a0) - and why not - lea sum-50(pc), a0 ; some assemblers don't like this line move.w #25, d5 move.w d0, 25(a0, d5)
Date: Sun, 6 Jul 1997 08:58:26 -0400 From: Ajay Nath <AjayNath@compuserve.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Memory/Address??? well if you look at your code you will see that you are not changing any of the address registers so they should NOT change, only the data registers & the value of "sum" should change
Date: Sun, 6 Jul 97 21:20:50 -0700 From: James Hague <jhague@dadgum.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: *fast* graphics? >Trouble is, I really have >no idea how to do fast sprite animation. Half a year ago or so I bought a >book called "Tricks of the Mac Game Programming Gurus". In it, there was an >"advanced graphics" chapter. The problem is, even though it uses encoded >sprites and all kind of bells 'n whistles it is slow. Warning: There are two really bad chapters in that book! One is the chapter you are talking about. The encoding scheme makes the sprite data tons larger than it needs to be, and all that data has to be loaded into the cache. There are other bad things too, but that's one of the biggies. The second is the PowerPC optimization chapter. The advice about using floating point registers to move 8 bytes at a time is *just plain wrong*. Except when copying directly to the screen, it is always faster to copy a word at a time instead of a doubleword at a time (at least on the 601/603). This is because of the way the floating point unit operates. Anyway, on to your question! A good exercise that will humble just about any PPC programmer (including myself) is to try to write your own version of BlockMove that beats the one in the toolbox. Most likely, you'll find that BlockMove outperforms your code by a third or more, and then even after you figure out the cache tricks it uses, you'll still probably lose. There's some *fantastic* code in there, especially on the 603 and 604, and the calling overhead is practically zero. And of course if you use BlockMove instead of your own code then it's specially optimized for every machine out there. I bring this up for two reasons. One is that heavy duty PPC optimization can be rather difficult and non-obvious. The second is that BlockMove is actually a good building block for graphics routines. To do an offscreen sprite copy (from a GWorld into a GWorld) just write a little loop with a call to BlockMove for each row. It'll beat CopyBits for small to medium sized areas, and it's *simple*. It's a good starting point for more sophisticated code. Don't believe this will work? Bumbler uses BlockMove as the core of the sprite routine for the title screen. I estimate that BlockMove gets called maybe 1000 times per frame (the title screen runs at 30fps). The only warning is that you should *never* use BlockMove to copy directly to the screen. CopyBits works of course, but BlockMove blows up horribly because screen memory can't be loaded into the cache. James
Date: Mon, 7 Jul 1997 23:12:00 +0100 From: scope@ndirect.co.uk (Thomas Hartmann) To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: anyone new to assembly??? Hi Mike, >I was wondering if there are some people on this list who are, (god help >them), as new to assembly as I am. I'm starting to feel like a Model-T on >board of the Enterprize. If you're out there, don't be shy; - drop me a >line. I'd love to hear from you. I know exactly how you feel, cause I feel the same :-) So what are we going to do about it. I have started with C again -yet another try - with the hope that things will start to klick into place. It seems one has to get a PowerMac to get the most out of Fant and the people on the list. (I am afraid I won't have the small change for that for quite a while ;-) Anyway let's keep the spirit up. What are you up to and how are you trying to tackle the Powerfant mountain? Regards Thomas
Date: Tue, 8 Jul 97 12:19:54 -0000 From: Malcolm Sharman <sharman@norex.com.au> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: anyone new to assembly??? I know how you guys feel when starting out with Fantasm and PowerFant. Thomas if you really want to do good programming stick with Fantasm. C is a more popular lanuage but produces code that is about half as fast as Fants code. If you know assembly C and anyother highlevel lanuage is faily easy to interpret.Don't get me wrong and think I am just saying that. I had alot of trouble getting started, but I stuck with it for nearly 6 months and now I am well on the way to producing a new 3D game called DEADLY WATERS. The demo should be available soon from most FTP sites. Anyway stick with Fant guys you will find it worth it in the long run. By the way I do 90% of my development on the 68k machine then test in on my Powermac 9600. This may seem strange but I like 68k assembly better, and 9600 is a pain in the ass to work with even though it has twin 200 604e's in it. Lightsoft make PowerFantasm multiprocesor enabled. Sorry about that See you later MALCOLM SHARMAN LEAD PROGRAMMER PARANOIA SOFTWARE
Date: Mon, 7 Jul 1997 20:26:44 -0700 (MST) From: mephisto@extremezone.com (Harvey Hirst) To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: anyone new to assembly??? >I was wondering if there are some people on this list who are, (god help >them), as new to assembly as I am. I'm starting to feel like a Model-T on >board of the Enterprize. If you're out there, don't be shy; - drop me a >line. I'd love to hear from you. > >Mike. Such fun! It takes a while to get in the habit of "thinking" in assembly. I've been working with Fantasm (68k) for a while now, if you get stuck I'd be happy to take a crack at helping. Harvey
Date: Mon, 7 Jul 1997 22:44:22 -0800 From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Can't build AGAIN >Can someone PLEASE tell me what I am doing wrong this time? >Here's what I'm trying to build. >----------------------------- > debug >Main: move.l #0,a0 ;A0 contains 0 > move.l #3,d0 ;D0 contains 3 > lea space(pc),a0 ;A0 contains address of space > move.b space(pc),d1 ;D1 contains first byte of space > move.b d0,(a0) ;first byte of space has 3 > move.b space(pc),d1 ;D1 contains 3 > move.b (a0),d1 ; " > rts >space: ds.b 16 > global Main Not to make you sound stupid or anything, but make sure that you have your assembly file in your build control file. When I was first starting out several time I forgot to list my source-code file in the BCF. Also if, at this time you are only doing simple things like the example above perhaps using the stand-alone assembler will be better for you, not the buld manager.
Date: Mon, 7 Jul 97 23:15:36 -0700 From: James Hague <jhague@dadgum.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: anyone new to assembly??? >It seems one has to get a PowerMac to get the most out of Fant and the >people on the list. Ah, but as it's much harder for compilers to generate good 68K code, you get more benefit out of writing in pure assembly for the 68K! James
From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Am I paranoid? >Well, what can I say. Eddie is DELETING my files. I saved the file, I made >damn sure it was there. I included it in my bcf. The first couple of times, >everything went dandy but then...horror! Suddenly Eddie/Fantasm complained >that the file couldn't be found! I searched and searched and searched. It >was nowhere! Even though I had seen it with my own eyes just a couple of >minutes ago! I had that same bug a few months ago, however, Lightsoft released an update that fixed the problem, I would suggest you get that update of the web pages.
From: Stuart Ball <lightsoft@compuserve.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Gamma fading? Hi Per, Try <http://hyperarchive.lcs.mit.edu/HyperArchive/Archive/dev/src/> Stu. >Hi all. > >I want to fade the monitor to black in 16 bit color mode. Since CLUT fading >only allows me to fade when in 8bit color (right?) I would appreaciate any >hints on how to do gamma fading. I've seen some old Pascal code that did >this, but alas! I can't seem to find the source again. > >Any help on this would be much appreciated (as always!) > >/Per Hjeltman
From: Kevin Avila <kevin@cache-computing.com> To: Multiple recipients of <list-fantasm@mail.tau.it> Subject: Re: Which Chapter to Read? >I've got Inside Macintosh. Everything I try to learn keeps talking about >and using terms that have not yet been explained. I tried to read the >section on the Toolbox Manager, but it kept referring to the Stack and the >Heap. ( Whatever they are). So I started to read the chapter on the >Memory Manager. (Stack and Heap + Pointers and Handles). Well there is a book Inside Macintosh:Overview that might help you with that, however if I remember corectly the assemblt guide by Lightsoft )downloadable from the WWW page) covers all that.