tebe Posted May 12 Share Posted May 12 (edited) new unit CURVES Procedure Curve (p1, p2, p3: TPoint; Segments: Byte); Procedure CubicBezierCurve (p1, p2, p3, p4: TPoint; Segments: Byte); Procedure Catmull_Rom_Spline (NumPoints: Byte; var Points: ArrayPoints; Segments: Byte); Procedure BSpline (NumPoints: Byte; var Points: ArrayPoints; Segments: Byte); curve_test.obx curve_test.pas Edited May 12 by tebe 2 Quote Link to comment Share on other sites More sharing options...
Alfred Posted May 16 Share Posted May 16 Can we get an example of how to use the banked ram option ? As in, load a small binary file to a 130 XE ram bank, and have some code that was loaded into main ram invoke a subroutine that resides in the code that was loaded into the bank. I've read the doc, but it's not clear how you actually define things correctly such that the mainline program can invoke a bank loaded subroutine. Quote Link to comment Share on other sites More sharing options...
tebe Posted May 16 Share Posted May 16 (edited) example 1: library loaded into RAM from disk (address $6000 in this example, library are not relocatable) xio(40,1,0,0,'D:TEST_LIB.OBX'); // load and run executable file test_lib.pas -> Compile -> Assembly -> mads test_lib.a65 -hm -x -i:[madpascal\base] // switch '-hm' is important for LIBRARY test.pas -> Compile -> Assembly -> mads test.a65 -x -i:[madpascal\base] // in this case switch '-hm' is not relevant create folder 'disk' build.bat -> 'copy test_lib.obx disk' -> 'copy test.obx disk\autorun.' -> 'dir2atr.exe -md -B foxdos.obx disk.atr disk\' -> 'altirra64.exe disk.atr' function dodaj(a,b: integer): integer; external 'TEST_LIB'; define function 'dodaj' as external from library 'test_lib' w: integer external tmp 'test_lib'; define variable 'w' as external about alias 'tmp' from library 'test_lib', this allows you to redirect names occurring in the library to names occurring in the program p.s. https://www.freepascal.org/docs-html/prog/progse55.html library_ram.zip Edited May 16 by tebe Quote Link to comment Share on other sites More sharing options...
tebe Posted May 16 Share Posted May 16 (edited) example 2: library loaded as resource (DOSFILE) test_lib DOSFILE 'test_lib.obx' RCLABEL 'test_lib' is not relevant, is not considered program test; {$r test.rc} uses crt; function dodaj(a,b: integer): integer; external 'TEST_LIB'; var w: integer external tmp 'test_lib'; begin w := dodaj(4512,23345); writeln(w); repeat until keypressed; end. library_ram_rc.zip library_overload.zip Edited May 16 by tebe Quote Link to comment Share on other sites More sharing options...
tebe Posted May 16 Share Posted May 16 (edited) example 3: library loaded to banked ram (resource LIBRARY) lib0 library 'test_lib.obx' program test; {$r loadlib.rc} uses crt, objects; function dodaj(a,b: integer): integer; external 'TEST_LIB'; const lib0=3; // PORTB BANKS = [0..xx] var w: integer; // variables are not available in libraries in banked memory begin w := dodaj(4512,23345); writeln(W); repeat until keypressed; end. p.s. https://github.com/tebe6502/Mad-Pascal revised version of MP to make compilation for banked memory work library_portb.zip library_game.zip Edited May 16 by tebe Quote Link to comment Share on other sites More sharing options...
tebe Posted May 19 Share Posted May 19 https://github.com/tebe6502/Mad-Pascal/tree/master/samples/a8/compression decompression: APL (apultra.exe), DEFLATE (zopfli.exe), LZ4 (smallz4.exe), PP (powerpack.exe), UPK (upkr.exe), ZX0 (zx0.exe), ZX2 (zx2.exe), ZX5 (zx5.exe) compression / decompression: LZH, LZW, RLE, LZJB 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted July 1 Share Posted July 1 (edited) hitbox, 3 ways hitbox.pas (casual), hitbox2.pas (with the direction of the hit), hitbox3 (casual fast) hitbox_source.zip hitbox.obx hitbox2.obx hitbox3.obx Edited July 1 by tebe 1 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.