Harry Potter Posted September 24, 2021 Share Posted September 24, 2021 Hi! Do you know about MadLibs? If so, you might enjoy my Atari 8-bit version at c65 additions - Manage /game at SourceForge.net. Try it out! BTW, does it work? Any recommendations on optimizing it? 2 1 Quote Link to comment Share on other sites More sharing options...
popmilo Posted September 24, 2021 Share Posted September 24, 2021 Like it Simple but fun Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 24, 2021 Author Share Posted September 24, 2021 I thank you for the compliment, popmilo. Do you have any recommendations on how to optimize it? I enjoy optimizing. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 25, 2021 Author Share Posted September 25, 2021 I have a lot of cc65 C code optimization techniques at c65 additions - Manage Files at SourceForge.net. Does anybody have any other suggestions? Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted September 25, 2021 Share Posted September 25, 2021 (edited) could the description texts include the target machine within them as well as what each is as a program and what the optimization thoughts would be? Edited September 25, 2021 by _The Doctor__ Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 25, 2021 Author Share Posted September 25, 2021 I don't understand. If you're talking about the optimization techniques I have online, most of them should work on most computers. Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted September 25, 2021 Share Posted September 25, 2021 I was referring to your programs, themselves, not the other examples. I had clicked the first link in the thread, not the one that came later... ? so it makes more sense now. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 28, 2021 Author Share Posted September 28, 2021 I'm glad for the good response from people downloading my program. Does anybody out there have any ideas on how to better optimize the program? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted September 29, 2021 Share Posted September 29, 2021 As this has just been written, I would have expected it to run under SDX, but it crashes Altirra (130XE, SDX, U1M & SIDE3 emulation). The only way I can get it to run is to boot from the floppy. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 I'm glad for your input. BTW, what's SDX? Maybe it's because of my use of AtaSimpleIO? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted September 29, 2021 Share Posted September 29, 2021 SDX is Sparta Dos X installed in U1M. Incognito, SIDE etc. is the standard DOS these days Quote Link to comment Share on other sites More sharing options...
danwinslow Posted September 29, 2021 Share Posted September 29, 2021 (edited) Or, more generally, just SDX installed anywhere. http://sdx.atari8.info/index.php?show=en_download_release It can be run from cart, from disk, from specialized devices as above. Edited September 29, 2021 by danwinslow Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted September 29, 2021 Author Share Posted September 29, 2021 danwinslow, I looked at the link you gave me and am wondering which one(s) to download. I have the Altirra demulator. Should I get another version also? Quote Link to comment Share on other sites More sharing options...
danwinslow Posted September 29, 2021 Share Posted September 29, 2021 You can download one of the cartridge versions and install in Altirra as a cartridge. There's an emulators selection at the very bottom of that list. Quote Link to comment Share on other sites More sharing options...
xxl Posted September 29, 2021 Share Posted September 29, 2021 5 hours ago, danwinslow said: Or, more generally, just SDX installed anywhere. http://sdx.atari8.info/index.php?show=en_download_release It can be run from cart, from disk, from specialized devices as above. that's not true - you can't run SDX from disk. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted September 29, 2021 Share Posted September 29, 2021 Ok, I stand corrected. Must have been thinking about 3.2. Thanks. Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted September 30, 2021 Share Posted September 30, 2021 23 hours ago, TGB1718 said: SDX is ... the standard DOS these days Not here. SDX is the standard DOS that comes on every new A8 hardware (if you like it or not). Still I avoid using it and use DOS 2.x instead. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted September 30, 2021 Share Posted September 30, 2021 Appreciate what you say, but once you start using SDX and all it's features, most other DOS's become clumsy by comparison. Quote Link to comment Share on other sites More sharing options...
xxl Posted September 30, 2021 Share Posted September 30, 2021 there was a time when programs stopped appearing on Amiga, you could see that the only form of using this computer was configuring the desktop, arranging icons, etc. around this activity, even a mini community was created, articles, photos of active user desktops appeared, etc. I notice that this stagnation also affected this community, the manifestation of which is configuring DOS, creating directories, copying between directories, the command line - the highest degree of initiation etc. "have you create directory today?" 1 Quote Link to comment Share on other sites More sharing options...
snicklin Posted October 1, 2021 Share Posted October 1, 2021 (edited) On 9/30/2021 at 10:54 PM, xxl said: I notice that this stagnation also affected this community, the manifestation of which is configuring DOS, creating directories, copying between directories, the command line - the highest degree of initiation etc. I agree here. I feel that most users want to be able to just pick something up and use it. It is ok to go off doing those other tasks, but you should then present the results of your work as something people can instantly use again. Not a big problem though, if it requires too much effort, I will avoid the software. It is like PC software that is distributed as source only. Then someone says that you also need to download a compiler, so you Download that and then you need a version of make, then you need some extra dll..... pahh forget it.... Edited October 1, 2021 by snicklin Added text Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted October 2, 2021 Share Posted October 2, 2021 12 hours ago, snicklin said: It is like PC software that is distributed as source only. Then someone says that you also need to download a compiler, so you Download that and then you need a version of make, then you need some extra dll..... pahh forget it... Agreed, Visual Studio Code to program a Raspberry Pi Pico, it's ridiculous what needs to be installed and I have to admit I never got to get it working other than to compile the examples Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted October 2, 2021 Author Share Posted October 2, 2021 Does anybody here have any stories to add to MadLib? I prefer Sci-Fi and Fantasy but want other genres as well. Quote Link to comment Share on other sites More sharing options...
ilmenit Posted October 7, 2021 Share Posted October 7, 2021 (edited) On 9/25/2021 at 1:39 PM, Harry Potter said: I have a lot of cc65 C code optimization techniques at c65 additions - Manage Files at SourceForge.net. Does anybody have any other suggestions? The document describing optimizations in a way "do this instead of that because it's faster" is not very useful. It's lacking information to which version of CC65 it applies It's not explaining why specific construct is faster than the other It's not showing difference in generated code by different code alternatives It's not providing information how much faster/smaller generated code is You use bizarre way of versioning - your documents have numbers 1.00, 1.10, 1.20... like with software versioning, however they are NOT new versions of the same document, but each document has different content. It's misleading (I initially checked only "the newest" version). Also your recommendations are very strange... Example: [Incremental Switch Returns] When you use a switch to return an incremetal value where each condition returns one more (or less) than the previous, reorganize the code by putting the highest (or lowest if less than the previous), using an increment/ decrement instead and remove the breaks on all except the last if necessary. An example follows: Instead of: ------------------------------- char c=0, d; switch (c) { case 1: d=1; break; case 3: d=2; break; case 2: d=3; break; case 4: d=4; break; } ------------------------------- Try: ------------------------------- char c=0, d=0; switch (c) { case 4: ++d; case 2: ++d; case 3: ++d; case 1: ++d; break; } ------------------------------- in case of the first switch code the whole switch(c) can be replaced by expression: d=c Your second code looks like a strange version of Duff's device but it's not used for code unrolling in your case, so it's pointless. Additionally the code has bug (case 2 and case 3) should change positions. Also your optimization tips contain ones like "Ints are shorter and faster than strings" - seriously? or [Optimizing Longs] On an 8-bit computer, longs are very slow and require alot of code. Fortunately, using pointers to longs instead seems to produce tighter code. I think this is because it allows your program to handle words, while the compiler provides the routines to handle the longs referenced. This, however, should slow down your code even more. ...what? ? I'm afraid it's hard to give other suggestion than "remove it from the Internet with hope that nobody will ever find it" Edited October 7, 2021 by ilmenit 1 Quote Link to comment Share on other sites More sharing options...
stepho Posted October 8, 2021 Share Posted October 8, 2021 ilmenit, I think you missed the case labels in the first switch. Case 3 gives d=2 and case 2 gives d=3, which means d=c doesn't work for c==2 or c==3 . Which makes the second switch code functionally correct. The 2nd switch minimises the jumps required (notice the missing breaks) but would give interesting results if d was a pointer to a register (even worse if it is a write only register). I'm too lazy to evaluate code size and execution time. Harry, Perhaps rename files as: Optimizing_cc65_Code-part-1.txt Optimizing_cc65_Code-part-2.txt etc Quote Link to comment Share on other sites More sharing options...
ilmenit Posted October 8, 2021 Share Posted October 8, 2021 (edited) 3 hours ago, stepho said: ilmenit, I think you missed the case labels in the first switch. Case 3 gives d=2 and case 2 gives d=3, which means d=c doesn't work for c==2 or c==3 . Which makes the second switch code functionally correct. you are correct, still the example seems to be totally artificial. The second case (without breaks) makes sense only to set the value of 'd' according to 'c', because if there are other operations in the original switch (before the breaks), then in the second all the following operations would be executed (making it incorrect). For having functionality of dictionary translating one value into other, a simple lookup table is shorter and faster: unsigned char get_d_for_c[] = { 0,1,3,2,4 }; d=get_d_for_c[c]; Edited October 8, 2021 by ilmenit Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.