Effectus
The main goal of Effectus is to emulate Action! language as close as possible. Source code is
generated using Mad Pascal cross-compiler, which is further compiled to binary code with
Mad Assembler (Mads). These powerful tools were created by Tomasz Biela (Tebe).
The steps are as follows:
- Action! code is parsed and appropriate Mad Pascal source code listing is generated
- Mad Pascal compiles this code to *.a65 file prepared for compilation by Mad Assembler
- Mad Assembler compiles *.a65 file to final binary code (*.xex by default)
examples directory includes listing examples to demonstrate available features of Effectus language,
which can be basis for your further development and experimentation.
My special thanks and credits go to:
- Tomasz Biela (Tebe), author of Mad Pascal and Mad Assembler (Mads), who made this all possible with his great development tools
- Zbyti for the support with new examples (including benchmark testing), development support, fixing bugs and Linux distribution
- Mariusz Buk for hosting original project on GitHub with MacOs compilation
- All others not mentioned here, who help me to improve Effectus in any way
You can read about current development here.
Missing features and bug issues are listed here.
References:
Effectus download repository
Mad-Assembler and Mad-Pascal references
New version 0.5.6
(18.8.2024)
- Proper handling of strings and their length in BYTE ARRAY declaration
- String length is determined by the first element of array (0th element, f.e. str(0))
- InputSD and InputMD procedure proper handling of strings using new internal Mad Pascal variable eff_array_buffer
- Console window
- Parameter list for local routines
- Showing Mad Pascal errors
- Support for Neo6502 and Commander X16 computer board system (Mad Pascal support, not tested using Effectus)
- Some changes in examples repository
- Effectus source code listing
- Updated header information
- Updated routine description headers
- Source code refactoring and cleaning
- Minor code optimization
- Effectus 0.5.6 was compiled with Free Pascal 3.2.2
- Included cross-compilers
- Mad Pascal Compiler version 1.7.1 [2024/08/14] for MOS 6502 CPU
- Mad Assembler 2.1.7 build 33 (1 Aug 24) (2024/08/01)
New version 0.5.5
- True support for handling strings using BYTE ARRAY declaration (strings are handled as array of ATASCII numbers)
- Temporary SBYTE directive is not needed anymore (it is removed)
- Proper handling of strings using procedures SCOPY, SCOPYC, SASSIGN
- PRINT procedures adapted to new feature
- Proper handling of number manipulation procedures and functions
- Fixed SCOPY, SCOPYC, SASSIGN: using both literal values and variables as parameters
- Fixed SCOMPARE operation, proper resulting values when comparing two strings
- Assembler block in generated Pascal code now uses asm/end; syntax instead of usual asm {}; syntax
- Console window
- New parameter -mi for showing Mad Assembler compile info
- Additional log file for showing compile status of Mad Assembler generated code (effectus-mads.txt)
- Showing errors when compiling *.a65 Mad Assembler code
- New color and background for Effectus title name :)
- Effectus unit source code libraries converted as include files
- Source code clean-up
New version 0.5.4
- 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
New version 0.5.3
Bug fixes
- Better handling of BYTE ARRAY and CARD ARRAY variables with pre-declared values
- Better handling of ASM {} and PAS {} directives
- code can be inserted at the beginning of the routine with no unexpected statements
- comments can include these directive names
- Better handling and checking of variable assignments
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, 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
New version 0.5.1
New features
Bug fixes
- Proper parsing of FUNCtions inside IF condition block
- Proper handling of zero-page addresses from $A0 to $AF as parameters for machine language routines inside PROCedures and FUNCtions
- Code refactoring and bug fixes by Zbyti:
- doubled operator fix with all operands
- SHL -> LSH bug correction
- LSH -> SHR bug correction
New version 0.5
New features
- Better handling of pointers including ARRAY variables (introducing Mad Pascal new byte pointer type PByte)
- Enhanced handling of device and I/O operations (introducing Mad Pascal CIO unit with true handling of Open and Close routines, reading/writing BYTE and string values, so Mad Pascal BlockRead and BlockWrite routines are not needed anymore):
- smaller and faster code
- added support for XIO procedure
- Open routine: (using Mad Pascal Opn routine instead of Assign/Reset combination without the need for special file variable handler (f.e. f : file;))
- Close routine: (using Mad Pascal Cls routine instead of Close(f); statement)
- direct writing of characters to device with PutD and PutDE routines (using Mad Pascal Put instead of BlockWrite routine)
- direct writing of strings and numbers to device with PrintD, PrintDE, PrintBD, PrintBDE, PrintCD, PrintCDE, PrintID and PrintIDE routines (using Mad Pascal BPut instead of BlockWrite routine)
- reading strings from device with InputSD and InputMD routine (using Mad Pascal BGet instead of BlockRead routine)
- reading numbers from device with InputBD, InputCD and InputID routines (using Mad Pascal Get instead of BlockRead routine)
- GetD(7) true handling
- IF condition block: comparing values with FUNCtions Rand, Peek, PeekC and SCompare can be used
- Assignment of BYTE ARRAY variable with index element as a FUNCtion is possible
(f.e. dir = new_dir(Rand(8))). This feature is currently possible only for Rand, Peek, PeekC, ValB, ValC and ValI functions.
- Smaller and faster compiled executable code (Mad Pascal SySutils used when necessary, CIO unit with new I/O functions enables Effectus to use specialized routines for device and I/O operations, Mad Pascal temporary variable intValue removed)
- CHAR data type as a substitute for BYTE data type
- Shell:
- new options (-z, -zb, -zw, -zp) added for declaring variables in zero page block as absolute address variables starting at $e0 address (BYTE, CARD (word) and PBYTE data types supported)
- some text and reference link changes
- Mad Pascal Compiler version 1.6.4 [2020/06/20] included with the package
- Mad Assembler 2.1.0 build 8 (23 Dec 19) included with the package
- New examples added (chessboard.pas and rscroll.pas from zbyti's test suit package)
Bug fixes
- n=Peek(COL) is actually LMS of absolute address variable COL, not a value content (correct syntax for that case would be n=COL, or n=Peek(710))
- Removed assignment of compare statement prior to actual WHILE branch condition statement (bug found by zbyti)
New version 0.4.3
New features
Bug fixes
- DEFINE constants are case insensitive now
- Correct parsing of new line called by statement PRINTE() or PRINTE("")
- Removed unnecessary UNTIL initial variable assignment before main DO UNTIL DO loop declaration
- More statement spacing freedom
- Proper division (div operator) handling ('/' operator substituted with div operator,
as there is no real division functionality in Action! anyway)
- Proper assignment of second parameter in Action! MoveBlock procedure as pointer assignment of first parameter in Mad Pascal Move procedure in case it is a number
Example:
Action! statement: MOVEBLOCK(TOPMEM,57344,1023)
Mad Pascal statement: Move(pointer(57344), pointer(TOPMEM), 1023);
- Closing end statement added in Mad Pascal code for some cases where Action! RETURN statement does not appear,
f.e. after closing ']' in inline assembly
Misc
- New examples
- New document listing of missing features and bug issues
New version 0.4.2
New features
- 2-pass parsing process (DEFINE constants are parsed in 2nd pass)
- Command prompt shell (DEFINE constant list if -i option is selected)
Bug fixes
- Correct parsing of character "-" in Effectus source code listing files (bug found by zbyti)
(illegal character removed from program statement in Mad Pascal, f.e. zp-sieve is translated to program zpsievePrg;)
- Removed unnecessary FOR initial variable assignment before main FOR loop declaration
- Joystick unit overrided Graph unit, so graphics usage was not detected.
The fix enables Graph and Joystick units to be interchangeable and neither unit is removed from unit clause
- begin word added after declaring BYTE ARRAY variable, which didn't appear in some cases
- Action! RETURN statement in IF condition allowed, so it is possible to exit routine immediately without branching to ending RETURN statement.
It is substituted with Exit statement in Mad Pascal
Example: IF KBCODE=135 THEN RIGHT RETURN FI
- Assignment of BYTE ARRAY varible to memory address variable is allowed,
f.e. Action! SCREEN=SAVMSC is translated to SCREEN := pointer(word(@SAVMSC)); in Mad Pascal
Misc
- Compiled 64-bit versions of Mad Assembler and Mad Pascal included in Effectus 64-bit version package
- Code optimization
New version 0.4.1
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