zbyti Posted July 22, 2020 Share Posted July 22, 2020 Beer quality code! I like it! 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 22, 2020 Share Posted July 22, 2020 (edited) BYTE I PROC MAIN=*() PRINTF("yO!") PAS{ FOR I := 30 DOWNTO 0 DO WRITELN(I); } RETURN BYTE I PROC MAIN=*() PRINTF("yO!") PAS{ FOR I := 30 DOWNTO 0 DO } PRINTBE(I) PAS{ ; } RETURN Edited July 22, 2020 by zbyti another example 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted July 22, 2020 Author Share Posted July 22, 2020 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted July 22, 2020 Author Share Posted July 22, 2020 16 hours ago, zbyti said: @tebe Great! We have to convince @Gury to do something like pas {some pascal code} and the ability to import Mad Pascal libraries anyway I'll check yours library. I will think about this, it would be great feature to have. We must consider the ways to accomplish this efficiently. What directives to call and what kind of Mad Pascal code to include, directly including custom *.pas listing files and also considering reading Mad Pascal units. Just a thought. 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 22, 2020 Share Posted July 22, 2020 (edited) BYTE I PROC PRINTYO() PRINT("yO!") PUTE() RETURN PROC MAIN=() PAS{ FOR I := 30 DOWNTO 0 DO EFF_PRINTYO(); } PAS{ FOR I := 30 DOWNTO 0 DO } PRINTYO() PAS{ ; } ASM{ lda #0 sta $14 } RETURN EFF_ prefix for our Effectus PROC/FUNC to make sure that the namespaces not collide with Pascal (you do this during translation anyway). ASM{} should work out of the box. Edited July 22, 2020 by zbyti EFF_ 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 22, 2020 Share Posted July 22, 2020 @Gury we can use Effectus procedures inside PAS{} with prefix EFF_ and outisede {} without prefix :] 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted July 22, 2020 Author Share Posted July 22, 2020 (edited) To make things simpler, I think it would be better to make eff_ prefix for Effectus procedures and functions for any possible combination. It will be done before compilation phase anyway. I reconsidered what you described above with the listing code and yes, you are right, it will be better to just prefix PROCs and FUNCs with EFF_ (eff_, _eff_, etc.) inside PAS directive. Outside code calling remains the same as original. Only PAS directive must differentiate between routines. Is this ok? Edited July 22, 2020 by Gury Minor correction... zbyti, you are right :) 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 22, 2020 Share Posted July 22, 2020 (edited) @Gury Use of ASM{} and PAS{} is the responsibility of the developer not Effectus translator Yes, if we absolutely want to use our procedure written in Action! without breaking {} then let's use its name as it gets during translation - let's assume it will be EFF_ in other cases it should work as usual. ------------------ With PAS{} I can use for example Mad Pascal procedures: PAS{ SetIntVec(iVBL, @eff_vbl_procedure); } or create "proxy/decorator" like libraries this will be greatly enhance of Effectus :] Edited July 22, 2020 by zbyti typos - as usual ;) 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 24, 2020 Share Posted July 24, 2020 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 24, 2020 Share Posted July 24, 2020 Refactored Action! version: SET $E=$2000 ; INCLUDE "H6:RUNTIME.ACT" DEFINE DEC="[$C6",CED="]",INC="[$E6",CNI="]", PHR="[$48$8A$48$98$48]",PLR="[$68$A8$68$AA$68]", SETVBV="$E45C",JMP="$6C" ;------------------------------------------------------------------------------ BYTE ARRAY DL=[$70$70$70$42$E0$00$41$00$20] BYTE CHBAS=$2F4,LSB,MSB, A=$E0,B=$E1,C=$E2,D=$E3,E=$E4, N1=$CA,N2=$CB,I=$CC,SIZE=$CD,TMP=$CE BYTE ARRAY SORTTABLE(255) CARD VVBLKD=$224,SDLSTL=$230,OLDVBL ;------------------------------------------------------------------------------ PROC WAIT=*(BYTE F)[$18$65$14$C5$14$D0$FC$60] PROC SETVBLK=SETVBV(BYTE WHICH,MSB,LSB) ;------------------------------------------------------------------------------ SET $E=$3000 PROC VBLANKD=*() PHR INC E CNI IF E=10 THEN INC D CNI E=0 FI IF D=10 THEN INC C CNI D=0 FI IF C=10 THEN INC B CNI C=0 FI IF B=10 THEN INC A CNI B=0 FI PLR [JMP OLDVBL] ;------------------------------------------------------------------------------ PROC INITCOUNTER=*() MOVEBLOCK($4000,$E080,80) SETBLOCK($E0,$28,$FF) A=0 B=0 C=0 D=0 E=0 CHBAS=$40 SDLSTL=DL OLDVBL=VVBLKD RETURN PROC STARTCOUNTER=*() WAIT(1) SETVBLK(7,$30,0) RETURN PROC STOPCOUNTER=*() LSB=PEEK(@OLDVBL) MSB=PEEK(@OLDVBL+1) SETVBLK(7,MSB,LSB) RETURN ;------------------------------------------------------------------------------ PROC MAIN=*() SIZE=254 TMP=255 FOR I=0 TO 254 DO SORTTABLE(I)=TMP DEC TMP CED OD FOR I=0 TO 254 DO PRINTB(SORTTABLE(I)) PUT(32) OD WAIT(100) INITCOUNTER() STARTCOUNTER() WHILE SIZE#0 DO FOR I=0 TO 253 DO N1=SORTTABLE(I) N2=SORTTABLE(I+1) IF N1>N2 THEN SORTTABLE(I)=N2 SORTTABLE(I+1)=N1 FI OD DEC SIZE CED OD STOPCOUNTER() WAIT(100) GRAPHICS(0) FOR I=0 TO 254 DO PRINTB(SORTTABLE(I)) PUT(32) OD DO OD RETURN BSORT.ACT Quote Link to comment Share on other sites More sharing options...
Gury Posted July 27, 2020 Author Share Posted July 27, 2020 New version 0.5.2 New features New extra, non-standard commands added: PAS {} and ASM {} code blocks to use Mad Pascal and Mad Assembler code inside Effectus code directly (great idea by zbyti :) Calling PROCedures and FUNCtions, implemented in Effectus, must include appropriate string extension in PAS {} block, in particular, Proc or Func as extension depending on routine type. Variables or any other entities can be interchanged between Effectus and PAS {} block of code. Examples: PAS { for i := 0 to 14 do begin SayHelloProc; end; } ASM { lda #0 sta 710 } ODFOR and ODWHILE loop directives as substitutions for ending OD statements to compensate some remaining issues with FOR and WHILE branches inside ELSE and ELSEIF condition blocks DO OD infinite loop code change (Mad Pascal condition code "until 0 = 1;" substituted with "until false;" code) Bug fixes Better handling of FOR, WHILE, DO, UNTIL, OD statements in nested loops SetBlock routine bug fix supporting first parameter as pointer value Command shell Any text file is accepted as source code listing to compile, not just files with *.eff extension (f.e., you can use *.ACT files) Misc Code refactoring branches.inc (condition and branch/loop logic) extra.inc (PAS {} and ASM {} code block logic) New examples by me and Zbyti (provided on AtariAge forum) Code optimization sunnyday.xex sunnyday.eff drunkman.xex drunkman.eff nescroll.xex nescroll.eff vscroll.xex vscroll.eff sayyo.xex sayyo.eff 1 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 27, 2020 Share Posted July 27, 2020 Quote Link to comment Share on other sites More sharing options...
zbyti Posted July 28, 2020 Share Posted July 28, 2020 (edited) PAS {} works fine! (with one little exception) ; Effectus example ; ---------------- ; Vertical scrolling demo pas { const text = '...EFFECTUS RULEZ...'~; dl : array [0..9] of byte = ( $70,$70,$70,$70, $67,lo(word(@text)+1),hi(word(@text)), $41,lo(word(@dl)),hi(word(@dl)) ); } byte ch=$2fc, vscrol=$d405 card sdlstl=$230 proc main() byte i=$e0 i=$f pas { sdlstl := word(@dl); } while ch=$ff do while i do i==-1 vscrol=i pas { pause(3); } od pas { pause(50); } while i<$f do i==+1 vscrol=i pas { pause(2); } od od graphics(0) return vscroll.eff vscroll.xex Edited July 28, 2020 by zbyti updated xex & eff Quote Link to comment Share on other sites More sharing options...
mariusz-buk Posted July 28, 2020 Share Posted July 28, 2020 MacOS version updated to 0.5.2 https://github.com/mariusz-buk/effectus 2 Quote Link to comment Share on other sites More sharing options...
Gury Posted July 28, 2020 Author Share Posted July 28, 2020 Many thanks, Mariusz! Quote Link to comment Share on other sites More sharing options...
zbyti Posted September 24, 2020 Share Posted September 24, 2020 @Gury look! Effectus (Action!) will work on C64 3 Quote Link to comment Share on other sites More sharing options...
Gury Posted September 24, 2020 Author Share Posted September 24, 2020 That's wonderful news. Do you use C64 sometime? If so, would you test new and old features on the machine? Quote Link to comment Share on other sites More sharing options...
zbyti Posted September 24, 2020 Share Posted September 24, 2020 (edited) With some limitations we can use Effectus on C64 #!/bin/bash mp="$HOME/Programs/MadPascal/mp" mads="$HOME/Programs/mads/mads" base="$HOME/Programs/MadPascal/base" effectus="$HOME/Programs/Effectus/effectus" if [ -z "$1" ]; then echo -e "\nPlease call '$0 <argument>' to run this command!\n" exit 1 fi $effectus -t $1 name=${1::-4} if [ -f $name.pas ]; then [ ! -d "output" ] && mkdir output mv $name.pas output/ $mp output/$name.pas -t c64 -z 10 -o else exit 1 fi if [ -f output/$name.a65 ]; then $mads output/$name.a65 -x -i:$base -o:output/$name.prg else exit 1 fi if [ ! -z "$2" ]; then x64 output/$name.prg fi ; Effectus example ; ---------------- ; Scrolling C64 demo PROC Main() BYTE ARRAY screen1=$400 BYTE ARRAY screen2=$500 BYTE ARRAY screen3=$600 BYTE ARRAY screen4=$700 BYTE ARRAY new_dir=[$D7 $D8 $D9 $FF 1 39 40 41] BYTE ch, dir, i dir = 1 screen = scrloc DO FOR i = 0 TO 255 DO screen1(i) = ch + i screen2(i) = ch + i screen3(i) = ch + i screen4(i) = ch + i OD IF Rand(10)=0 THEN dir = new_dir(Rand(8)) FI ch = ch + dir OD RETURN effectus-c64.mp4 rscroll.eff rscroll.prg Edited September 24, 2020 by zbyti add video 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted September 24, 2020 Author Share Posted September 24, 2020 That's great! I am not C64 user, but it is good to have nice neighbour around ;) 1 Quote Link to comment Share on other sites More sharing options...
xorcerer Posted May 15, 2021 Share Posted May 15, 2021 (edited) Crossover to C64 is very interesting, it could allow a wider audience and multi-platform cooperation. Is the entire http://freeweb.siol.net/ subdomain down? I get timeouts constantly, while https://siol.net/ is working. Edited May 15, 2021 by xorcerer Quote Link to comment Share on other sites More sharing options...
Gury Posted May 15, 2021 Author Share Posted May 15, 2021 Hi! You can download the latest version on GitHub here. My only target is Atari 8-bit series of home computers. You can modify it and make it work to fit your needs in any way. Currently it supports other platforms as much as Mad Pascal does, which is the heart of the inner workings of the whole system. With the addition of Mad Assembler to compile resulting listing to object code. These two great compilers are provided, of course, by Tebe. 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted December 9, 2021 Author Share Posted December 9, 2021 New home for Effectus here. 2 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted August 25, 2022 Author Share Posted August 25, 2022 New version (0.5.4) There are no changes to core syntax functionality, but it is the basis for future versions. The main change is inclusion of Mad Pascal 1.6.6 and Mad Assembler 2.1.5 as core cross-languages. This led to directory structure changes to support them for proper functioning. Highlights: - Compiled with Free Pascal 3.2.2 - Updated to Mad Pascal 1.6.6 and Mad Assembler 2.1.5 build 3 - Support for Commodore 64, C16/Plus 4 and raw (supported by Mad Pascal) - Changes in directory structure reflect the changes in Mad Pascal version 1.6.6 package - Effectus source code clean-up and tab indentation instead of spaces (resulting in smaller file size) - Shell color change for Effectus title name - Little code optimization The support for other systems is not tested and it is yet to be explored. Don't expect magic code for multiple platforms, this may only happen with your help. Binaries can be downloaded below. The version for GitHub is not yet prepared. effectus-0-5-4-x86_64-win64.zip 1 Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted August 26, 2022 Share Posted August 26, 2022 could this be made to work to compile Atari 7800 binaries, out of curiosity? Quote Link to comment Share on other sites More sharing options...
Gury Posted August 26, 2022 Author Share Posted August 26, 2022 It is possible, the processor is similar, but not the same. I can't talk about this architecture, because I am not familiar with it. 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.