zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) Here is my solution for Ubuntu Linux: 1. Go to the src/mads_mp/ and compile: fpc -Mdelphi -vh -O3 mads.pas fpc -Mdelphi -vh -O3 mp.pas Move binary (mp, mads) to Effectus root folder. 2. In src/effectus/effectus.pas comment {* Writeln('Compiling to native code...'); if Compile(FilenameSrc) then begin Writeln('Compile error!'); end else begin Writeln('Compilation is successful!'); end; if isInfo then ShellInfo; DestroyLists; *} and compile it: fpc -Mdelphi -vh -O3 effectus.pas Move effectus binary file to Effectus root folder. 3. Create bash file effectus.sh and make it executable (mod -x effectus.sh) #!/bin/bash export EFFECTUS_HOME="$HOME/Programs/Effectus" if [ -z "$1" ]; then echo -e "\nPlease call '$0 <argument>' to run this command!\n" exit 1 fi dir=$(pwd -P) "${EFFECTUS_HOME}"/effectus $1 name=${1::-4} filePAS="${name}.pas" fileAsm="${name}.a65" if [ -f $namePas ]; then [ ! -d "output" ] && mkdir output mv "${dir}/$filePAS" output/ cd output "${EFFECTUS_HOME}"/mp $filePAS -o else exit 1 fi if [ -f $fileAsm ]; then "${EFFECTUS_HOME}"/mads $fileAsm -x -i:"${EFFECTUS_HOME}"/base -o:$name.xex cd .. else exit 1 fi if [ ! -z "$2" ]; then atari800 "${dir}"/output/$name.xex fi Set $EFFECTUS_HOME to your proper location and save effectus.sh. 4. Add $EFFECTUS_HOME/effectus and $EFFECTUS_HOME/effectus.sh (as effectus-build) to your path: ~/bin$ ln -s $EFFECTUS_HOME/effectus.sh effectus-build ~/bin$ ln -s $EFFECTUS_HOME/effectus effectus 5. Now you can do this: ~$ effectus file.eff ---> compile to file.pas ~$ effectus-build file.eff --> create output directory with file.xex ~$ effectus-build file.eff run --> create output directory with file.xex and run with atari800 6. Enjoy :] Compilation for 64-bit Linux ready to download below. Effectus-x64-Linux.zip Edited May 1, 2020 by zbyti 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) Sieve - directly from Action! (I only changed file extension) - 100 jiffies less then Action! :] sieve.eff sieve.xex Edited May 1, 2020 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) Now i prepare some benchmarks for: Mad Pascal, Action!, Effectus with delivered MP&MADS and last MP&MADS builds from github. 1. SIEVE with SETBLOCK (and try variables on page zero) 2. Another SIEVE 3. CHESSBOARD 4. YOSHPLUS Stay tuned :] In the meantime, I simplified the build script for Linux. #!/bin/bash EFFECTUS_HOME="$HOME/Programs/Effectus" if [ -z "$1" ]; then echo -e "\nPlease call '$0 <argument>' to run this command!\n" exit 1 fi dir=$(pwd -P) "${EFFECTUS_HOME}"/effectus $1 name=${1::-4} filePAS="${name}.pas" fileAsm="${name}.a65" if [ -f $namePas ]; then [ ! -d "output" ] && mkdir output mv $filePAS output/ cd output "${EFFECTUS_HOME}"/mp $filePAS -o else exit 1 fi if [ -f $fileAsm ]; then "${EFFECTUS_HOME}"/mads $fileAsm -x -i:"${EFFECTUS_HOME}"/base -o:$name.xex cd .. else exit 1 fi if [ ! -z "$2" ]; then atari800 output/$name.xex fi Edited May 1, 2020 by zbyti new build script 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 1, 2020 Author Share Posted May 1, 2020 (edited) Great work with script, zbyti. I suppose there were some troubles with the code in commented lines? I will look what can be done to fix this. In meantime, I suggest you to uncomment last statement DestroyLists; because this command disposes all created string lists. Edited May 1, 2020 by Gury 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) 57 minutes ago, Gury said: Great work with script, zbyti. I suppose there were some troubles with the code in commented lines? I will look what can be done to fix this. In meantime, I suggest you to uncomment last statement DestroyLists; because this command dispose all created string lists. OK. I uncomment DestroyLists and compile Effectus again. I think the first problem is in shell.pas, here: AProcess.Executable := GetCurrentDir + PathDelim + 'mp'; // AProcess.Parameters.Add(AnsiQuotedStr(GetCurrentDir + '\bin\roto.pas', '"')); AProcess.Parameters.Add(AnsiQuotedStr(filename, '"')); // if isMadPascal_o then AProcess.Parameters.Add('-o'); // if isMadPascal_d then AProcess.Parameters.Add('-d'); //SetParams(AProcess, propMadPascal, propFlagMadPascal); AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes, poStdErrToOutPut]; AProcess.Execute; I fixed the last bug in the script: #!/bin/bash EFFECTUS_HOME="$HOME/Programs/Effectus" if [ -z "$1" ]; then echo -e "\nPlease call '$0 <argument>' to run this command!\n" exit 1 fi dir=$(pwd -P) "${EFFECTUS_HOME}"/effectus $1 name=${1::-4} filePAS="${name}.pas" fileAsm="${name}.a65" if [ -f $filePAS ]; then [ ! -d "output" ] && mkdir output mv $filePAS output/ cd output "${EFFECTUS_HOME}"/mp $filePAS -o else exit 1 fi if [ -f $fileAsm ]; then "${EFFECTUS_HOME}"/mads $fileAsm -x -i:"${EFFECTUS_HOME}"/base -o:$name.xex cd .. else exit 1 fi if [ ! -z "$2" ]; then atari800 output/$name.xex fi Ok. New compilation is ready to download. effectus-x64-linux.zip Edited May 1, 2020 by zbyti new effectus compilation with proper build script 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) effectus-build-new sieve.eff run Reading Action! source file...sieve.eff Generating code... Mad Pascal Compiler version 1.6.4 [2020/05/01] for 6502 Compiling sieve.pas 64 lines compiled, 0.77 sec, 8664 tokens, 821 idents, 273 blocks, 7 types ZPAGE: $0080..$00DA RTLIB: $2032..$2163 SYSTEM: $21A0..$21A3 CODE: $2000..$2341 DATA: $2342..$4358 Writing listing file... Writing object file... 7567 lines of source assembled in 6 pass 852 bytes written to the object file Current master version of Mad Pascal speed up Effectus in Sieve benchmark (without SetBlock) :] Edited May 1, 2020 by zbyti Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) [BUG Report] Sieve with SetBlock after some correction is close to the same code written (and optimized) in Mad Pascal (~620 Jiffies)! Original Mad Pascal Code included. During translation SETBLOCK(FLAGS,8190,'T) in Action! goes to: FillChar(FLAGS, 8190, 'T); and I have to change this to: FillChar(FLAGS, 8190, 84); zp-sieve.eff zp-sieve.pas sieve-mp.pas I compiled Effectus code with Mad Pascal Compiler version 1.6.4 [2020/05/01] for 6502. In native Action! this code have 746 Jiffies. Edited May 1, 2020 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
+Eyvind Bernhardsen Posted May 1, 2020 Share Posted May 1, 2020 I got it built on my Mac using zbyti's method, including commenting out the native compilation step from effectus.pas. I like make, so I made myself a Makefile instead of the shell script: EFFECTUS_HOME=$(HOME)/build/effectus EFFECTUS=$(EFFECTUS_HOME)/effectus MADS=$(EFFECTUS_HOME)/mads MP=$(EFFECTUS_HOME)/mp executables := $(patsubst %.eff,%.xex,$(wildcard *.eff)) detritus := $(wildcard *.xex *.lst) .PHONY: all clean all: $(executables) clean: $(RM) $(detritus) %.pas : %.eff $(EFFECTUS) $< %.a65 : %.pas $(MP) $< %.xex : %.a65 $(MADS) $< -x -i:$(EFFECTUS_HOME)/base -o:$@ effectus-darwin64.zip 2 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 [BUG Report] effectus-build-new chessboard.eff run Reading Action! source file...chessboard.eff Generating code... Mad Pascal Compiler version 1.6.4 [2020/05/01] for 6502 Compiling chessboard.pas chessboard.pas (23,15) Error: Incompatible types: got "WORD" expected "POINTER" chessboard.eff chessboard.pas 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) [BENCHMARK - YOSHPLUS] Mad Pascal 1.6.4 35047 iterations in 100 frames. Effectus (MP 1.6.4) 35047 iterations in 100 frames. Action! 33239 iterations in 100 frames. yoshplus.eff YOSHPLUS.ACT YoshBench.pas Edited May 1, 2020 by zbyti 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 1, 2020 Author Share Posted May 1, 2020 (edited) Wow, how much happened from the morning... Great test, zbyti, keep it coming. And new bug reports are coming First I will look at the issue with setting procedure parameters (f.e. SETBLOCK(FLAGS,8190,'T) and next will be fixing pointer issue in chessboard.eff example. I will create new discussion topic in programming section to follow bug report issues, so we can analyze and fix them. I see first version for MacOS appeared, just great! I have one from Mariusz, but for older version. He will help with MacOS version released too. Edited May 1, 2020 by Gury 1 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 [BUG REPORT] In Action! this line: IF (X+Y)<=RADIUS THEN BINGO==+1 FI goes in Pascal to: if [X+Y]<=RADIUS then begin Inc(BINGO); end; correct is: if (X+Y)<=RADIUS then begin Inc(BINGO); end; mcarlopi.eff mcarlopi.pas 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 1, 2020 Author Share Posted May 1, 2020 Good findings! Here is new topic in programming section where bug report issues are collected. Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 OK. I have a moment and I know a little bit of Mad Pascal I will try to improve Effectus sources according to the idea of the author and make proper Linux version. Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) Ok. I modified shell.pas and now if You add to your ~/.bashrc local variable $EFFECTUS_HOME (modify path to your needs) like this: export EFFECTUS_HOME="$HOME/Programs/Effectus" effectus binary should works on Linux :] new-effectus-x64-linux.zip Edited May 1, 2020 by zbyti 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 1, 2020 Share Posted May 1, 2020 (edited) effectus-build-new resieve.eff run Reading Action! source file...resieve.eff Generating code... Mad Pascal Compiler version 1.6.4 [2020/05/01] for 6502 Compiling resieve.pas 59 lines compiled, 0.76 sec, 8634 tokens, 820 idents, 273 blocks, 7 types ZPAGE: $0080..$00DA RTLIB: $2030..$2185 SYSTEM: $21B5..$21D3 CODE: $2000..$234C DATA: $234D..$4365 Writing listing file... Writing object file... 7933 lines of source assembled in 6 pass 9062 bytes written to the object file Sieve again but different algorithm. Some troubles... resieve.eff RESIEVE.ACT Edited May 1, 2020 by zbyti bad result in effectus Quote Link to comment Share on other sites More sharing options...
Gury Posted May 2, 2020 Author Share Posted May 2, 2020 9 hours ago, zbyti said: Ok. I modified shell.pas and now if You add to your ~/.bashrc local variable $EFFECTUS_HOME (modify path to your needs) like this: export EFFECTUS_HOME="$HOME/Programs/Effectus" effectus binary should works on Linux :] new-effectus-x64-linux.zip 2.96 MB · 3 downloads Nice work! I will add this to new version to differentiate between platforms. 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 2, 2020 Author Share Posted May 2, 2020 7 hours ago, zbyti said: effectus-build-new resieve.eff run Reading Action! source file...resieve.eff Generating code... Mad Pascal Compiler version 1.6.4 [2020/05/01] for 6502 Compiling resieve.pas 59 lines compiled, 0.76 sec, 8634 tokens, 820 idents, 273 blocks, 7 types ZPAGE: $0080..$00DA RTLIB: $2030..$2185 SYSTEM: $21B5..$21D3 CODE: $2000..$234C DATA: $234D..$4365 Writing listing file... Writing object file... 7933 lines of source assembled in 6 pass 9062 bytes written to the object file Sieve again but different algorithm. Some troubles... resieve.eff 574 B · 1 download RESIEVE.ACT 574 B · 0 downloads I found a bug. It is a problem with determining branch statements in some situations. IF condition does not follow FOR branch before it. Lot of stuff to analyze and bringing new bug free version of Effectus. 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 2, 2020 Author Share Posted May 2, 2020 Mariusz Buk prepared GitHub repository https://github.com/mariusz-buk/effectus He is willing to prepare MacOS version and probably other updates for the project. 1 Quote Link to comment Share on other sites More sharing options...
mariusz-buk Posted May 2, 2020 Share Posted May 2, 2020 (edited) Anybody interested is welcome to join as a contributor. Repository is under control of Boštjan and I hope he'll be in charge of reviewing and accepting any pull requests. If you'd like to create a feature please use feature/short-name-of-the-feature format for a branch name. For all bug fixes please use bugfix/short-name-of-the-bugfix. Pull requests should be created against master branch for current version. I'd be happy to help if required. Edited May 2, 2020 by mariusz-buk 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 2, 2020 Share Posted May 2, 2020 @mariusz-buk you missed effectus/src/procedures.inc this file is on my pull req Quote Link to comment Share on other sites More sharing options...
mariusz-buk Posted May 3, 2020 Share Posted May 3, 2020 Thank you @zbyti for your first PR! Great work! 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted May 8, 2020 Author Share Posted May 8, 2020 New version 0.4.1 (64-bit Windows platform console version) Bug fixes: removed ASCII character 9 from processed Action! listing, which could break further compilation of the code removed duplication code in variable declaration block of Mad Pascal listing removed duplicated begin code blocks proper handling of machine language following the PROC/FUNC declaration statement PROC/FUNC parameters (automatic translation of character to ATASCII value in Mad Pascal listing code, f.e.: SetBlock(flags, 8190, 'T) <==> FillChar(FLAGS, 8190, 84); branches: proper handling of IF condition with brackets (f.e. IF (X+Y)<=RADIUS THEN BINGO==+1 FI) better handling of WHILE and FOR closing OD statements proper handling of logical expressions in Action! resulting to TRUE value in Mad Pascal (WHILE I DO <==> while I > 0 do begin) proper handling of increments/decrements with BYTE ARRAY variables (f.e. DL(4)==+1) PrintD, PrintDE proper comma (,) determination in text New features: BYTE ARRAY variable declaration with continuous bytes supported (f.e. BYTE ARRAY DL=[$70$70$70$56$C$20$41$1$20]) added # comparison operator (substitution for <>) Misc: some Mad Pascal listing code indentation corrections added missing line ending character added new examples by zbyti (resieve.eff, fillscr.eff) removed some unused code code optimization effectus-0-4-1-x86_64-win64.zip fillscr.eff fillscr.xex resieve.eff resieve.xex 3 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 10, 2020 Share Posted May 10, 2020 (edited) I corrected my sieve implementation on Action, now everything is ok. F0RESIEV.ACT f0resiev.eff f0resiev.pas real-sieve.pas Edited May 10, 2020 by zbyti 2 Quote Link to comment Share on other sites More sharing options...
zbyti Posted May 10, 2020 Share Posted May 10, 2020 @Gury Could you write a list of missing things in the Effectus 0.4.1 and errors for the? I will consider abandoning writing in Action! in favor of the Effectus. 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.