tebe Posted September 17, 2017 Author Share Posted September 17, 2017 http://mads.atari8.info Mad Pascal 1.5.1 1.5.1 - new switches -CODE:$address, -DATA:$address -STACK:$address, -ZPAGE:$address - SYSTEM unit: RandomF (Result as Single), VAL (Integer, Single) - GRAPH, FASTGRAPH unit: Bar, Bar3D, GetX, GetY, MoveRel, FloodFill - MATH unit: RandomRange, RandomRangeF, RandG (gaussian distributed random number) - CRT unit: SOUND (similar to Atari BASIC SOUND) - VBXE unit: TVBXEMemoryStream - new warning 'Comparison might be always true/false due to range of constant and expression' - resources RCASM, CMCPLAY, MPTPLAY, added ability to load under ROM - internal ANTIC-a code by '~' txt0: string = 'Atari'~; // ANTIC code txt1: string = 'Spectrum'*~; // ANTIC code + invers 8 Quote Link to comment Share on other sites More sharing options...
gozar Posted September 30, 2017 Share Posted September 30, 2017 What's the best way to set up Mad Pascal under Windows 10? Can I just put it in the path? Quote Link to comment Share on other sites More sharing options...
pirx Posted October 1, 2017 Share Posted October 1, 2017 this would certainly work a treat, but I found it easier to just prepare a bunch of .BAT files, based on the examples from the package. Quote Link to comment Share on other sites More sharing options...
tebe Posted October 8, 2017 Author Share Posted October 8, 2017 (edited) http://mads.atari8.info Mad Pascal 1.5.2 - new data type FLOAT (SINGLE IEEE 754) - SYSTEM unti: FileSize (SDX) - SYSTEM unit: EXP:Single, LN:Single, LN:Real, EXP:Real (high accurate) - SYSUTILS unit: AnsiUpperCase, ExtractFileExt - TYPES unit: Bounds, CenterPoint, EqualRect, InflateRect, IntersectRect, IsRectEmpty, NormalizeRect, OffsetRect, Point, PointsEqual, PtInRect, PtInEllipse, Rect, RectWidth, RectHeight, Size, UnionRect - IMAGE unit: LoadMIC, LoadPIC, LoadBMP, LoadPCX, LoadGIF - VIMAGE unit: LoadVBMP, LoadVPCX, LoadVGIF - GRAPH, FASTGRAPH unit: SetClipRect, ClipLine, FillRect(TRect), Rectangle(TRect) p.s.SDX 'RUNEXT.CFG' BMP:GIF:PCX,CAR:X.COM,A:\PROGRAMS\VIMAGE.COM % Natural Logarithm function Ln(x: Float): Float; overload; //---------------------------------------------------------------------------------------------- // Ln returns the natural logarithm of the Real parameter X. X must be positive. // https://www.codeproject.com/Tips/311714/Natural-Logarithms-and-Exponent //---------------------------------------------------------------------------------------------- var N, P, K, L, R, A, E: Float; begin E := 2.71828182845905; P := x; N := 0; if x>Float(0) then begin // This speeds up the convergence by calculating the integral while(P >= E) do begin P := P / E; N := N + 1; end; N := N + (P / E); P := x; while true do begin A := N; K := N - 1; L := P / Exp(K); R := K * E; N := (L + R) / E; if A-N < Float(0.01) then Break; end; end; Result := N; end; vimage.zip Edited October 8, 2017 by tebe 4 Quote Link to comment Share on other sites More sharing options...
Estece Posted October 30, 2017 Share Posted October 30, 2017 When i compiled a jgp_engine.pas it generated an unoptimized code ; optimize OK (..\jgp\jgp_engine.pas), line = 41 lda A and #$7F sta STACKORIGIN+10 asl STACKORIGIN+10 lda STACKORIGIN+10 sta TMP ; optimize OK (..\jgp\jgp_engine.pas), line = 42 lda TMP ora #$01 sta W+1 lda TMP sta W Can You do a optimization pass on the whole generated mads assembly ? Maybe this can be of any use to You : http://hitmen.c02.at/files/cc65/opt65.c Keep up the good work and i hope that mads and mad pascal can produce the fastest code on the atari 65 xe in the world Quote Link to comment Share on other sites More sharing options...
tebe Posted October 30, 2017 Author Share Posted October 30, 2017 thx Estece Quote Link to comment Share on other sites More sharing options...
peteym5 Posted November 1, 2017 Share Posted November 1, 2017 Not sure this has been covered yet. How hard would it to use Mads Pascal for other 6502 based platforms. Atari 5200, 7800, Lynx. Commodore 64, Apple II? I know with "uses" it loads in modules and one for the 8-bit. It may not be difficult to make something up to address 5200 and 7800 memory. Unless Mads Pascal is Atari 8-bit OS dependent. Quote Link to comment Share on other sites More sharing options...
pirx Posted November 2, 2017 Share Posted November 2, 2017 It is not, unless you use modules like crt that are A8 oriented. To mitigate this you just need to replace them with appropriate equivalents (by writing them). Additionally, you need to modify mads settings to output binary in a desired format. Quote Link to comment Share on other sites More sharing options...
tebe Posted December 13, 2017 Author Share Posted December 13, 2017 Madpascal 1.5.3 http://mads.atari8.info 2 Quote Link to comment Share on other sites More sharing options...
Estece Posted December 14, 2017 Share Posted December 14, 2017 Thanks Tebe for better generation of code for 6502 Baby steps in great direction of faster code !!! I don't see whole assembly optimization because of 'sta TMP' then 'lda TMP' yet Why ? var tmp:byte; hwscroll:^byte absoulute $d404; hwscroll^:=tmp; generate : mwa HWSCROLL bp2 ldy #$00 lda TMP sta (bp2),y when : var tmp:byte; hwscroll:byte absolute $d404; hwscroll:=tmp; gives : mva TMP HWSCROLL I care more about faster code on Atari XL than compatibility of mad pascal with x86. This is silly for me and it's slows down generated code Yes i can code in mads but i like pascal Do You want me to stop nitpicking? Quote Link to comment Share on other sites More sharing options...
tebe Posted December 14, 2017 Author Share Posted December 14, 2017 Estece, pointer is slower this examples not comparable var hscroll: ^byte; begin hscroll:=pointer($d404); hscroll^:=tmp; hscroll:=pointer($d405); hscroll^:=tmp+1; end; var hscroll: byte absolute $d404; begin hscroll:=pointer($d405); Incompatible types: got "POINTER" expected "BYTE" Quote Link to comment Share on other sites More sharing options...
Estece Posted December 14, 2017 Share Posted December 14, 2017 I understand what i typed. It's too hard for You to write better.Your example is absolute different case that not use absolute keyword I will stop nitpicking and code in mads like You do when You wrote mod player example. Mod example will not compile on x86. Good luck with maintaining mad pascal to people that will care about it Quote Link to comment Share on other sites More sharing options...
tebe Posted December 14, 2017 Author Share Posted December 14, 2017 (edited) Estece, it's compiler bug a: ^byte absolute $d404; Edited December 15, 2017 by tebe 3 Quote Link to comment Share on other sites More sharing options...
+Sheddy Posted December 14, 2017 Share Posted December 14, 2017 Lol Optimising compilers are complicated I don't suppose GCC supports 6502 though Quote Link to comment Share on other sites More sharing options...
ivop Posted December 15, 2017 Share Posted December 15, 2017 https://github.com/puppeh/gcc-6502 5 Quote Link to comment Share on other sites More sharing options...
Alfred Posted March 3, 2018 Share Posted March 3, 2018 I had a quick look at the compiler source and wondered, is the compiler able to compile itself ? If it could, then it might be possible to bootstrap it to the Atari. Quote Link to comment Share on other sites More sharing options...
peteym5 Posted April 17, 2018 Share Posted April 17, 2018 I am looking to use Mad Pascal to program some of the less elaborate game ideas that had been pitched toward me by Video 61 and others. (like Zoo Keeper and Klax.) The type of games I had been compressing to execute from a 16K cartridge with sections decompressed to RAM using Deflate/Inflate. That would cut down on development time and is something I can teach to other team members. One issue is that some of these guys use Apple Macintosh and Mads Assembler and Mad Pascal seem to only run in DOS mode, Command Prompt, or BAT batch file. I would need to set something up for them. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted April 17, 2018 Share Posted April 17, 2018 One issue is that some of these guys use Apple Macintosh and Mads Assembler and Mad Pascal seem to only run in DOS mode, Command Prompt, or BAT batch file. I would need to set something up for them. Well, the compilers aren't GUI apps: they're CLI tools. If you read the documentation for either (MADS assembler or MAD Pascal), you'll see you can download the source for both and build them using the Free Pascal Compiler on whichever target platform you like. I believe there are even pre-compiled versions of MADS available for macOS (courtesy of Jac!). 1 Quote Link to comment Share on other sites More sharing options...
gozar Posted April 18, 2018 Share Posted April 18, 2018 Well, the compilers aren't GUI apps: they're CLI tools. If you read the documentation for either (MADS assembler or MAD Pascal), you'll see you can download the source for both and build them using the Free Pascal Compiler on whichever target platform you like. I believe there are even pre-compiled versions of MADS available for macOS (courtesy of Jac!). Yes, I've compiled it for macOS. I think I used brew to install fpc (Freepascal) and then used it to compile MADS and MAD Pascal. If they can program, they should be able to install it. 1 Quote Link to comment Share on other sites More sharing options...
tebe Posted May 1, 2018 Author Share Posted May 1, 2018 Mad Pascal 1.5.5 http://mads.atari8.info - CRT: TextMode - SYSUTILS: ExtractFilePath - SYSTEM: EoLn - SYSTEM: ParamCount, ParamStr, add compatybility with DOS II+/D - OBJECT improvements - add automatic conversion INTEGER to REAL 3 Quote Link to comment Share on other sites More sharing options...
devwebcl Posted May 2, 2018 Share Posted May 2, 2018 How much free memory is there available for coding ? For instance, in cc65 is like 30kb. Cheers, Devwebcl Quote Link to comment Share on other sites More sharing options...
tebe Posted May 2, 2018 Author Share Posted May 2, 2018 (edited) How much free memory is there available for coding ? For instance, in cc65 is like 30kb. Cheers, Devwebcl $D8..$FF $0500..$06FF $2000...$BFFF TMemoryStream is available (PORTB), unit OBJECTS THighMemStream is available (CPU65816 - 16MB), unit HIGHMEM TVBXEMemoryStream is available (VBXE - 512 KB), unit VBXE Edited May 2, 2018 by tebe 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted May 2, 2018 Author Share Posted May 2, 2018 Borland founder, Turbo Pascal, 1 Quote Link to comment Share on other sites More sharing options...
Lastic Posted May 16, 2018 Share Posted May 16, 2018 Yes, I've compiled it for macOS. I think I used brew to install fpc (Freepascal) and then used it to compile MADS and MAD Pascal. If they can program, they should be able to install it. Super interesting topic for me coming from a school Turbo Pascal, C , inline assembler 8 bit PC background (and Fortran,Cobol,RPG, bweurk ...) Noob question, I've installed Freepascal via Macports on both my Intel OS X 10.10 Macbook and my PPC OS X 10.5.8 Powerbook and compiled mads and mad pascal successfully. However on both when I try to compile the PasIntro.pas with Mad Pascal 1.5.5 I get the following error : Mad Pascal Compiler version 1.5.5 [2018/04/29] for 6502 Compiling PasIntro/pasintro.pas (0,0) Error: Identifier, number or expression expected but 'unknown token' found Am I missing something , should I've compiled Mad Pascal patched with a diff or what am I missing ? Quote Link to comment Share on other sites More sharing options...
dmsc Posted May 16, 2018 Share Posted May 16, 2018 Hi! However on both when I try to compile the PasIntro.pas with Mad Pascal 1.5.5 I get the following error : Mad Pascal Compiler version 1.5.5 [2018/04/29] for 6502 Compiling PasIntro/pasintro.pas (0,0) Error: Identifier, number or expression expected but 'unknown token' found Am I missing something , should I've compiled Mad Pascal patched with a diff or what am I missing ? - . The provided mp.pas source has an error, I don't know if the posted EXE cames from the same source. In line 16945, changes the "j" inside the function call to "i", so the line changes from: j := CompileConstFactor(j, ConstVal, ConstValType); to read: j := CompileConstFactor(i, ConstVal, ConstValType); . Without this, the program fails depending on the uninitialized value of "j". Also, another error on line 23193, change "i" to "j" on the Error call, the line must read: Error(j, 'Unresolved forward declaration of ' + Ident[j].Name); . After that, compile with " fpc -MDelphi -Os -Xi -Xs -XX mp-155.fix.pas " to get a working executable. 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.