Classic Macintosh has an easily accessible fixed-point math library. Including from THINK Pascal. If you're thinking of doing 2D graphics or gameplay mechanics/physics/logic, you'll probably want to use it instead of floating point.
Oh, also, the sine wave here looks pixel-imperfect because I'm only sampling once it every 3 columns. As a demo of a cost-saving measure :) The precision is good enough that it would look perfect if you sampled it every column.
@cancel I like how it also shows at which step it's currently at. :)
@cancel Why do we need to include fixMath.p and fixMath.lib? What's a .lib file?
@neauoire .lib is precompiled (or source, too, I think?) code. it doesn't work for you without it, right?
@cancel It doesn't no, looking at FixMath.p it seems like a "header file" for something else. Do you know if a lib file can be opened at all?
@neauoire no. the fixmath.lib is probably completely machine code. there's probably no source for it -- it was likely written entirely in 68k assembly.
@neauoire it would be nice to have the assembly... but it's probably on some backup disk in some closet at Apple since 1990 or something :)
@cancel understood :) I'm glad to have an example that works without sin, but I don't like that this file has dependencies.
@cancel Where did you find the fixmath library?
@neauoire it came with THINK Pascal 4.0 but it also comes with MPW pascal (with slightly different interface .p file) and the even older mac pascal
@neauoire fixmath came with every dev thing for mac. I think it's mostly code that just points to stuff in the mac's ROM. it's extremely common. way more common than the FPU you're using which induces more dependencies :P
@cancel so fixmath.lib is not a pascal-specific thing
@neauoire correct, you could also use it from C or from 68k assembly. i think fixmath.lib actually doesn't have the full fixed point math routines in it -- I think they're in the Mac ROM and the .lib just points to the locations and maybe has a simple loader init in it, and that's it.
@neauoire not 100% sure on that though. but the .lib seems too small to have stuff like the sin/tan lookup tables.
@neauoire when I get a disassembler working I can look at it :)
@neauoire if you look in the official "Inside Macintosh" development manuals they document this library. so it's pretty important.
@neauoire I actually don't know why it's missing from the 4.5d4 version I originally downloaded. kind of strange. I think the author probably just forgot.
@cancel I need your hand with something. I've been meaning to unsit smalltalk-80, but stuffit example doesn't work if I double-click it, could you try it out?
@neauoire ill do it when i wake up, about to take a nap :)
@cancel alright :) good night 👋
@neauoire did you do it already?
@cancel yeah, it was a pain in the butt, only to realize that I don't like smalltalk at all.
Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.