Search results

  1. pfuentes69

    ThinkC How to measure time taken to execute a task?

    I saw another funky behaviour related to the FPU... For example, I was using this code to calculate the colour of a shape: // Calculate color // dpLight is a float with values from 0.0f to 1.0f // colModel is the base colour RGBColor colPix; colPix.red = (int)((float)colModel.red * dpLight)...
  2. pfuentes69

    ThinkC How to measure time taken to execute a task?

    So, it's getting weird... this sample code works always fine now, but using it in my project, it fails if I set the compiler to use the FPU. For example: char buf[50]; float fff = 12.345f; sprtint(buf, "#.3f", fff); DrawString(c2pstr(buf)); This will work fine if FPU is not used, but it will...
  3. pfuentes69

    ThinkC How to measure time taken to execute a task?

    Thanks. That made the trick. Now I have another issue, as I'm trying to write the result in my project using DrawString, and for that I'm converting the float to string using sprintf, but I'm getting a "NAN" result... I need to see about it...
  4. pfuentes69

    ThinkC How to measure time taken to execute a task?

    Not really understanding.... If I do this.... #include <stdio.h> #include <time.h> void waitforkey(void) { while(1) if (getchar()) break; } main() { int t, tt; t = clock(); printf("Press enter..."); waitforkey(); tt = clock()...
  5. pfuentes69

    ThinkC How to measure time taken to execute a task?

    weird... it seems that if I just declare t and tt as int, it works...
  6. pfuentes69

    ThinkC How to measure time taken to execute a task?

    Hey, I want to take some measures of performance, and I have issues to check the time taken between two steps. This is the code I'm testing: #include <stdio.h> #include <time.h> void waitforkey(void) { while(1) if (getchar()) break; } main() { clock_t t, tt...
  7. pfuentes69

    ThinkC 3D Viewer App project

    I made today some tests... Rendering the Utah teapot it takes: - Basilisk (on MacBook Air 1.2GHz i7) = 0.4 Secs (FPU emu) - LC475 (Full 040 @33MHz): 24 secs (No FPU) and 8 secs (FPU) - MacMini G4 1.5GHz: 1.8 secs (No FPU, it crashes with FPU) I couldn't try on the SE/30, but it will take...
  8. pfuentes69

    ThinkC How to draw a "rubber band line" (XOR)?

    In fact, the full book is available here: https://cdn.preterhuman.net/texts/computing/macintosh/Macintosh_C/ It seems to be "Macintosh C - A Hobbyist's Guide to Programming the Mac OS in C", written by K. J. Bricknell It seems quite interesting...
  9. pfuentes69

    ThinkC 3D Viewer App project

    Made a new version... I added keyboard control for the camera, and changed the dialog settings to make it easier to use: I couldn't figure out how to process KeyDown events for the cursors, but I used instead: - a, d: move sideways - w, s: move up-down - r, f: move forward-backwards - A, D: to...
  10. pfuentes69

    ThinkC How to detect the cursor keys press?

    Hello, I need to process the KeyDown event for the cursor keys, but I can't figure out how to do it. I managed to understand how to process key press for most keys, but not yet how to read the cursors. For other keys I can do something like this: // The key is pressed while our windows...
  11. pfuentes69

    ThinkC 3D Viewer App project

    Hey, my project is starting to look like something... The App is attached here, it would be nice to have some people testing it. Tomorrow I'll be able to check in some of my Macs. My better 68K Mac is an LC475 with a full 040 at 33MHz... I guess it should be much better in a machine with...
  12. pfuentes69

    ThinkC How to draw a "rubber band line" (XOR)?

    Answering myself... it seems that the way to go is to use PenMode(patXor); I found this chapter that explains all nicely: https://cdn.preterhuman.net/texts/computing/macintosh/Macintosh_C/chap12.pdf Maybe the full book is somewhere, but I can't find it.
  13. pfuentes69

    ThinkC How to draw a "rubber band line" (XOR)?

    Hey, for my project I need to make a tool to draw profiles as a sequence of segments. The tool would allow to use the mouse to add points to the profile, and while drawing the current segment I want the mouse to draw a "rubber band" line and fix it when pressing the button, then add the next...
  14. pfuentes69

    ThinkC [Study Group 1] Drawing on the Macintosh

    I could finally test my code on a real Mac... And it works! A Mac rendering a Mac...
  15. pfuentes69

    I'm in the Apple-1 Club!

    BTW... @Action Retro... Will you be making a video about installing Linux on or wildly upgrading the Apple 1? ;)
  16. pfuentes69

    I'm in the Apple-1 Club!

    Great thanks! I have now some entertainment for the week-end :)
  17. pfuentes69

    I'm in the Apple-1 Club!

    I just wanted to make my first built as much standard as possible, so I decided finally not to do the modifications proposed for this by Uncle Bernie. I didn't know about that utility! That actually is great, and maybe it will help me also to get a real cassette to work, as until now I only had...
  18. pfuentes69

    I'm in the Apple-1 Club!

    That would be cool... and display the photos in ASCII :) That was during a mini-VCF here in Switzerland, and this photo of my table was made with the QuickTake...
  19. pfuentes69

    I'm in the Apple-1 Club!

    You got a quite nice set, I like your wooden things. This is mine... Custom built getting the PCB and the components separately... the keyboard is also quite hand-made. I'd like to get the jukebox board... it makes it far more useable, now I use the cassette interface reading the audio files...
  20. pfuentes69

    ThinkC [Study Group 1] Drawing on the Macintosh

    Well... I had some advance... I used the QuickDraw primitives to paint polygons, and used it for my 3d render project. I have lots of issues related to memory management... I need to see how can I solve it, but with very big models I have crashes. But happy so far. Now I need to learn how to...