Jump to content
Gury

Effectus suggestions and bug reports

Recommended Posts

Posted (edited)

@Gury I already downloaded a new version yesterday, good job!

I'll report any bugs on your GitHub not Mariusz, ok?

Edited by zbyti

Share this post


Link to post
Share on other sites
Posted (edited)

zp-sieve.eff

On 5/8/2020 at 9:09 PM, Gury said:

Solved by Effectus 0.4.1

But if file name contains '-' then Effectus produce invalid Pascal program name.

Edited by zbyti

Share this post


Link to post
Share on other sites

It is Pascal syntax convention, which does not allow such characters in variables and similar statements, in this case in program name.

I fixed it, but this will be published with next release.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/8/2020 at 9:21 PM, Gury said:

Solved by Effectus 0.4.1. It is faster than Action! example. I added this example to Effectus examples repository, thanks!

24 Jiffies Action! 3.7.p

13 Jiffies Effectus.

 

GREAT!

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Proper count is 1028 http://atarionline.pl/forum/comments.php?DiscussionID=4873&page=4_#Item_37

 

My tests on screenshot (early Mad Pascal 1.6.4). I don't remember if I synchronized with the frame in those tests.

 

Screenshot_2020-02-27_10-55-02.png

 

Action! and Effectus do not use SETBLOCK. Mad Pascal, CC65 and others use fill-like procedures.

I'll do a test for Action! and the Effectus with SETBLOCK and ZERO Page (Mad Pascal Opt).

 

Screenshot_2020-05-10_15-31-40.png

 

RESIEVE with ZERO PAGE:

Mad Pascal 1.6.4 (last master) - 38 frames

Effectus 0.4.1 - 39 frames

Action! 3.7P - 48 frames

Edited by zbyti
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Action! 3.7P not always count to 1028, sometimes count to 1027... Interesting indeed :)

 

I'll check my algorithm implementation.

 

EDIT:

It was my fault, false alarm.

Edited by zbyti
false alarm
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

[BUG REPORT]

//Action!, Effectus
BYTE ARRAY FLAGS(8192)
SETBLOCK(FLAGS,8192,'T)
//translated
FLAGS : array[0..8192] of byte;
FillChar(FLAGS, 8192, 84);

//Mad Pascal
flags: array [0..8191]
fillchar(flags, sizeof(flags), true);

@Gury in translation you reserve too much for ARRAY.

Edited by zbyti

Share this post


Link to post
Share on other sites
Posted (edited)

I will fix that!

 

Hmm, I re-checked the problem and I think it can be an issue. If you declare a variable in Action! like this:

 

BYTE ARRAY flags(8192)

 

and then use a FOR loop:

FOR i = 0 to 8192

 

In this phase Effectus does not recalculate the value in FOR statement, it read it as it is (it will not be 8191).

 

I will check FillChar issue.

 

Edited by Gury
Re-check
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi good afternoon.
something for effectus 0.4.1
Interrupt !!!

 

MODULE; VBI DEMO FOR ANTICDEFINE RTI="$40",       PHA="$48",       PLA="$68",       TXA="$8A",       TAX="$AA",       TYA="$98",       TAY="$A8",       JMP="$4C",       XITVBV="$E462",SAVETEMPS="[$A2 $07 $B5 $C0 $48 $B5    $A8 $48 $B5 $A0 $48 $B5 $80 $48      $CA $10 $F1 $A5 $D3 $48]",    ; diese SAVETEMPS Routine ist aus der Action! Fehlerkorrekturliste. Sie ist umfangreicher als das originale Beispiel aus dem Magazin    ; und funktioniert sicher. Das Original sichert nur die Variablen für Addition/SubtraktionGETTEMPS="[$68 $85 $D3 $A2 $00 $68    $95 $80 $68 $95 $A0 $68 $95 $A8    $68 $95 $C0 $E8 $E0 $08 $D0 $EF]"    ; das gleiche wie oben gilt auch für die GETTEMPS RoutineCARD SDLST=560,VDSLST=512,               VVBLKD=$224BYTE NMIEN=$D40E,COLBK=$D01A,     WSYNC=$D40A,COUNT=[0]BYTE ARRAY DLISTBYTE ARRAY CLRS(0)=[64 66 68 70 72 74     72 70 68 66  64  66  68  70  72     74  72  70  68  66  64  66  68     70 72 74 76 ]PROC DLINT(); a DLI written in ACTION!    BYTE DUM    [PHA TXA PHA TYA PHA]    IF COUNT=26 THEN DUM=0    ELSE DUM=CLRS(COUNT) FI    WSYNC=1    COLBK=DUM    COUNT=COUNT+1    IF COUNT=27    THEN COUNT=0    FI    [PLA TAY PLA TAX PLA RTI]PROC INIT7()    GRAPHICS(7)    SETCOLOR(0,2,10)    SETCOLOR(1,5,12)    SETCOLOR(2,0,0)RETURNPROC DLSETUP(); custom Display List    BYTE I    INIT7()    NMIEN=$40    DLIST=SDLST      VDSLST=DLINT    FOR I=30 TO 40    DO DLIST(I)=141 OD    FOR I=42 TO 54 STEP 2    DO DLIST(I)=141 OD    FOR I=57 TO 72 STEP 3    DO DLIST(I)=141 OD    FOR I=76 TO 84 STEP 4    DO DLIST(I)=141 OD    NMIEN=$C0RETURNPROC ROTATE(); the VBI routine    BYTE HOLD,CTR,CNTR    SAVETEMPS; save the temp registers    HOLD=CLRS(26); save the last element    FOR CTR=0 TO 25; the loop    DO CNTR=25-CTR; to count backwards, Action! has no STEP-1 statement    CLRS(CNTR+1)=CLRS(CNTR) OD; rotate    CLRS(0)=HOLD; put the last element into the first    GETTEMPS; get the temp registers    [JMP XITVBV]; exit the VBIPROC VBINST(); install the VBI    NMIEN=0; turn off the interrupts    VVBLKD=ROTATE; vector to PROC ROTATE    NMIEN=$40; turn the interrupts back onRETURNPROC DJD(); the driver routine, named for a famous computer genius    BYTE CRSINH=752    VBINST(); install the VBI    DLSETUP(); set up the Display List    CRSINH=1    PRINTE()    PRINTE("Áîôéã Interrupts in ACTION!")    PRINT("           by DAVID PLOTKIN")    DO OD; an endless loop...RETURN
	

 

 

MODULE; VBI DEMO FOR ANTIC
DEFINE RTI="$40",
       PHA="$48",
       PLA="$68",
       TXA="$8A",
       TAX="$AA",
       TYA="$98",
       TAY="$A8",
       JMP="$4C",
       XITVBV="$E462",

SAVETEMPS="[$A2 $07 $B5 $C0 $48 $B5
    $A8 $48 $B5 $A0 $48 $B5 $80 $48  
    $CA $10 $F1 $A5 $D3 $48]",
    ; diese SAVETEMPS Routine ist aus der Action! Fehlerkorrekturliste. Sie ist umfangreicher als das originale Beispiel aus dem Magazin
    ; und funktioniert sicher. Das Original sichert nur die Variablen für Addition/Subtraktion
GETTEMPS="[$68 $85 $D3 $A2 $00 $68
    $95 $80 $68 $95 $A0 $68 $95 $A8
    $68 $95 $C0 $E8 $E0 $08 $D0 $EF]"
    ; das gleiche wie oben gilt auch für die GETTEMPS Routine
CARD SDLST=560,VDSLST=512,
               VVBLKD=$224
BYTE NMIEN=$D40E,COLBK=$D01A,
     WSYNC=$D40A,COUNT=[0]
BYTE ARRAY DLIST
BYTE ARRAY CLRS(0)=[64 66 68 70 72 74
     72 70 68 66  64  66  68  70  72
     74  72  70  68  66  64  66  68
     70 72 74 76 ]

PROC DLINT(); a DLI written in ACTION!
    BYTE DUM
    [PHA TXA PHA TYA PHA]
    IF COUNT=26 THEN DUM=0
    ELSE DUM=CLRS(COUNT) FI
    WSYNC=1
    COLBK=DUM
    COUNT=COUNT+1
    IF COUNT=27
    THEN COUNT=0
    FI
    [PLA TAY PLA TAX PLA RTI]

PROC INIT7()
    GRAPHICS(7)
    SETCOLOR(0,2,10)
    SETCOLOR(1,5,12)
    SETCOLOR(2,0,0)
RETURN

PROC DLSETUP(); custom Display List
    BYTE I
    INIT7()
    NMIEN=$40
    DLIST=SDLST  
    VDSLST=DLINT
    FOR I=30 TO 40
    DO DLIST(I)=141 OD
    FOR I=42 TO 54 STEP 2
    DO DLIST(I)=141 OD
    FOR I=57 TO 72 STEP 3
    DO DLIST(I)=141 OD
    FOR I=76 TO 84 STEP 4
    DO DLIST(I)=141 OD
    NMIEN=$C0
RETURN

PROC ROTATE(); the VBI routine
    BYTE HOLD,CTR,CNTR
    SAVETEMPS; save the temp registers
    HOLD=CLRS(26); save the last element
    FOR CTR=0 TO 25; the loop
    DO CNTR=25-CTR; to count backwards, Action! has no STEP-1 statement
    CLRS(CNTR+1)=CLRS(CNTR) OD; rotate
    CLRS(0)=HOLD; put the last element into the first
    GETTEMPS; get the temp registers
    [JMP XITVBV]; exit the VBI

PROC VBINST(); install the VBI
    NMIEN=0; turn off the interrupts
    VVBLKD=ROTATE; vector to PROC ROTATE
    NMIEN=$40; turn the interrupts back on
RETURN

PROC DJD(); the driver routine, named for a famous computer genius
    BYTE CRSINH=752
    VBINST(); install the VBI
    DLSETUP(); set up the Display List
    CRSINH=1
    PRINTE()
    PRINTE("Áîôéã Interrupts in ACTION!")
    PRINT("           by DAVID PLOTKIN")
    DO OD; an endless loop...
RETURN

 

Edited by funkheld

Share this post


Link to post
Share on other sites
Posted (edited)

@funkheld and the point is? DLI works fine, VBI works too :] In code like yours current parser go crazy! :]

 

SET $E=$2000
SET $491=$2000

BYTE ARRAY DL=[$70$70$70$42$00$40$2$2$2$2$F0$2$2$2$2$2$70$70$70$41$00$20]
BYTE ARRAY DLI=[$48$A9$DE$8D$0A$D4$8D$18$D0$68$40]
; 48        PHA
; A9 DE     LDA #$DE
; 8D 0A D4  STA $D40A   ;WSYNC
; 8D 18 D0  STA $D018   ;COLPF2
; 68        PLA
; 40        RTI

BYTE
  CH=$2FC,
  NMIEN=$D40E

CARD
  VDSLST=$200,
  SDLSTL=$230

PROC MAIN()
  SDLSTL=DL
  VDSLST=DLI
  NMIEN=$C0

  WHILE CH=$FF DO OD
  GRAPHICS(0)
RETURN

 

Edited by zbyti
DLI code

Share this post


Link to post
Share on other sites
Posted (edited)

[BUG ERROR]

 

SET $E=$2000
SET $491=$2000

BYTE
  RTCLOCK=$14,
  COLOR2=$2C6,
  CH=$2FC,

CARD
  VVBLKD=$224,
  OLDVEC

PROC SETVBLK=$E45C(BYTE WHICH,MSB,LSB)

PROC VBLANKD()
  COLOR2=RTCLOCK
[$6C OLDVEC]

PROC MAIN()
  PRINTE("Setting up Vblank")
  OLDVEC = VVBLKD
  SETVBLK(7,(VBLANKD RSH 8),VBLANKD)
  WHILE CH=$FF DO OD
  SETVBLK(7,(OLDVEC RSH 8),OLDVEC)
RETURN

1. CH=$2FC, ; translator don't catch comma as error

2. [$6C OLDVEC] OLDVEC ; missing reference

3. PROC SETVBLK=$E45C(BYTE WHICH,MSB,LSB) ; not possible

Edited by zbyti

Share this post


Link to post
Share on other sites
17 hours ago, zbyti said:

[BUG ERROR]

1. CH=$2FC, ; translator don't catch comma as error

2. [$6C OLDVEC] OLDVEC ; missing reference

3. PROC SETVBLK=$E45C(BYTE WHICH,MSB,LSB) ; not possible

Hi,

error catching is planned for some other version. I will resolve some bugs and add some new features before that.

OLDVEC issue is also on the list for fixing. Currently, variables cannot be assigned inside machine language [] block.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

No worries, I noticed that also. The problem is a way Effectus assigns a pointer in this particular example. I already have solution for this, it will be fixed in next release. The good starting point is the same example in Tebe's GitHub Mad Pascal repository.

Action! language is very unique in a way it uses arrays and pointers, so I need to examine all possible cases to adapt Effectus to translate correctly to Mad Pascal.

 

Share this post


Link to post
Share on other sites
Posted (edited)
39 minutes ago, Gury said:

Action! language is very unique in a way it uses arrays and pointers, so I need to examine all possible cases to adapt Effectus to translate correctly to Mad Pascal.

In Action:

 

ARRAY BYTE

  TEXT(30),

  SCREEN=$8000

 

TEXT indicates on first byte of array, index will be BYTE in loops. TEXT(0)=10 produces only LDA / STA.

SCREEN is a POINTER to $8000 and array index will be always CARD type in loops.

 

Above goes from my knowledge ;)

Edited by zbyti

Share this post


Link to post
Share on other sites

[BUG ERROR FOR 0.4.3]

// .eff
CLOCK=RTCLOK WHILE RTCLOK=CLOCK DO OD

// goes to .pas

CLOCK := RTCLOK;
RTCLOK := CLOCK;
WHILE RTCLOK=CLOCK do begin
end;  // while

 

main.eff

Share this post


Link to post
Share on other sites

Good find!

I also spoted this problem in some previous release, all comparisons generated assignments with the same name before branch (IF, FOR, WHILE, UNTIL). I already fixed this problem for FOR and UNTIL branches for most cases in current releases. I will dig into remaining problems for this issue before releasing new version.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

@Gury 

if You create some simple issue on github I try to fix them and step by step I involve myself into development. What do you think?

I know Action! pretty well but without runtime library and I have basic knowledge about Mad Pascal and Free Pascal.

Share this post


Link to post
Share on other sites

That's great to hear. Currently my goal is to follow my plan to resolve known issues. You can help, but it's better to wait till next release so we don't collide with different fixes.

When we do this it will be must to run a test suit to check all works ok.

You can already involve in doing this, but use different branch.

 

  • Like 1

Share this post


Link to post
Share on other sites
On 5/25/2020 at 6:20 PM, zbyti said:

[BUG ERROR FOR 0.4.3]

// .eff
CLOCK=RTCLOK WHILE RTCLOK=CLOCK DO OD

// goes to .pas

CLOCK := RTCLOK;
RTCLOK := CLOCK;
WHILE RTCLOK=CLOCK do begin
end;  // while

 

main.eff 1.38 kB · 8 downloads

Fixed in version 0.5.

  • Thanks 1

Share this post


Link to post
Share on other sites
WHILE RTCLOK=CLOCK do begin
end;
WHILE RTCLOK=CLOCK do;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...