Jump to content
IGNORED

Effectus suggestions and bug reports


Recommended Posts

Hi good afternoon.

what kind of task does that have in eff?

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

 

if I change that on :

SET $E=$8000
SET $491=$8000

 

I don't see any change in the asm program.

 

greeting


; Effectus example
; - - - - - - - - - - - - - - - - - -
; Display list interrupt (DLI) demo

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

Link to comment
Share on other sites

Error handling is not yet directly implemented in Effectus. It only shows Mad Pascal errors when they arise. But those errors are only produced by wrong usage of Effectus code or the statement syntax not yet supported.

 

Link to comment
Share on other sites

[BUG ERROR FOR 0.5.0]

 

I started to change my test code and received this error.


NOTE: the code below does not have the correct values (and other stuff) in the DL array because I did not complete the changes due to a translation error.

SBYTE ARRAY TEXT="NNNNNNNNNNNNNNNNNNNNtajemnice@atariNNNNNNNNNNNNNNNNNNNN"
BYTE ARRAY DL=[$70$70$70$56$0$0$41$0$0]

BYTE
  CH=$2FC,
  HSCROL=$D404
CARD SDLSTL=$230

PROC WAIT=*(BYTE F)[$18$65$14$C5$14$D0$FC$60]

PROC MAIN()
  BYTE I=$CA

  DL(4)=PEEK(TEXT)   ; LSB of TEXT
  DL(5)=PEEK(TEXT+1) ; for test, proper is to get MSB

  SDLSTL=DL

  WHILE CH=$FF DO
    I=8
    WHILE I DO
      I==-1
      HSCROL=I
      WAIT(1)
    OD
    DL(4)==+1
    IF DL(4)=$23+$C THEN DL(4)=$C FI ; instead of $C we need DL(4)=PEEK(TEXT)
  OD
  GRAPHICS(0)
RETURN
DL(4)=PEEK(TEXT)
DL(5)=PEEK(TEXT+1)

; goes to

DL := Peek(4]=PEEK[TEXT);
DL := Peek(5]=PEEK[TEXT+1);

Hardcoded working version:

SBYTE ARRAY TEXT="NNNNNNNNNNNNNNNNNNNNtajemnice@atariNNNNNNNNNNNNNNNNNNNN"
BYTE ARRAY DL=[$70$70$70$56$0$0$41$0$0]

BYTE
  CH=$2FC,
  HSCROL=$D404
CARD SDLSTL=$230

PROC WAIT=*(BYTE F)[$18$65$14$C5$14$D0$FC$60]

PROC MAIN()
  BYTE I=$CA

  DL(4)=0   ; LSB
  DL(5)=$20 ; MSB

  SDLSTL=DL

  WHILE CH=$FF DO
    I=8
    WHILE I DO
      I==-1
      HSCROL=I
      WAIT(1)
    OD
    DL(4)==+1
    IF DL(4)=$23 THEN DL(4)=0 FI
  OD
  GRAPHICS(0)
RETURN

Nice to see in the future Action! syntax https://github.com/zbyti/a8-action-scramble/blob/master/src/ANTIC.ACT

SET $E=DLADDR
PROC DL=*()[
  $70             ; EMPTY ROW
  $42 TEXT        ; FIRST TEXT ROW (GR.0)
  $D2 SCREEN      ; STARTSCREEN (GR.0) WITH HSCROL AND DLI
  $12 $92 $12 $92 $12 $92 $12 $92 $12 $92 $12 $12 $12
  $12 $12 $12 $12 $12 $92 $92 $92 $92 $92 $92 $92
  $41 DL          ; JUMP TO BEGINNING OF DL
]

 

Edited by zbyti
working version
  • Like 1
Link to comment
Share on other sites

  PROC TEST=*(BYTE CURSOR,BACK,BORDER,X,Y,UPDOWN)
  [
    $8E 710  ; BACKGROUND COLOR
    $8C 712  ; BORDER COLOR
    $8D 752  ; CURSOR VISIBILITY 
    $A5 $A5 $8D 755  ; CHARACTERS UPSIDE DOWN? 
    $A5 $A3 $8D 85 0  ; COLUMN FOR TEXT
    $A5 $A4 $8D 84 0  ; ROW FOR TEXT
    $60]

;-------

procedure TESTProc(CURSOR : byte; BACK : byte; BORDER : byte; X : byte; Y : byte; UPDOWN : byte); assembler;
  asm
  {
  lda CURSOR
  ldx BACK
  ldy BORDER
  mva X $a3
  mva Y $a4
  mva UPDOWN $a5
    .by $8E $C6 $02 $8C $C8 $02 $8D $F0 $02 $A5 $A5 $8D $F3 $02 $A5 $A3 $8D $55 $00 $A5 $A4 $8D $54 $00 $60 
  };
end;

I don't see the .eff source but I have a question...

 

This is obviously Action! way to handle the parameters (registers and $Ax) but this is a proper way in Effectus?

This is implicit zero page usage and I don't like it for this reason ;) well... not so secret since we use explicite =* :D

Maybe let's leave this job to MP/MADS compilers and yours -z flags?

 

Passing 3 byte data through registers it's fine, but... @tebe don't do that during his optimizations?

 

;---------------------------------------------

 

EDIT:

 

OK, my bad... It's necessary to keep of the compatibility with PROC/FUNC =* written in the machine code.

 

Edited by zbyti
my bad
  • Like 1
Link to comment
Share on other sites

Okay :]

 

I just used =* mainly because this produce in Action! faster and direct code, instead of many parameters I preferred to use globals, so I forgot about the need for compatibility.

 

If the readme.txt file contains information about reserving $Ax that's enough, in general it can be very useful.

 

It will be fun if you extend Effectus with: {romoff}downto and then you implement include we will be able to rewrite some things from blibs.

Edited by zbyti
add info
  • Like 1
Link to comment
Share on other sites

[BUG ERROR FOR 0.5.0] fixed https://github.com/Gury8/effectus/pull/6

BYTE ARRAY
  DL=[$70$70$70$52$00$40$52$60$40$52$C0$40$41$0$0]

BYTE
  HSCROL=$D404,
  RANDOM=$D20A

CARD
  SDLSTL=$230,
  SCREENI=[$4000]

PROC WAIT=*(BYTE F)[$18$65$14$C5$14$D0$FC$60]

PROC MAIN()
  BYTE
    HSCROLI=$CA,
    A,B,C

  SDLSTL=DL
  HSCROLI=$F

  DO
    IF HSCROLI=$B THEN
      A=(RANDOM&15)+33
      B=(RANDOM&15)+33
      C=(RANDOM&15)+33

      POKE(SCREENI,A)
      POKE(SCREENI+$60,B)
      POKE(SCREENI+$C0,C)

      POKE(SCREENI+$30,A)
      POKE(SCREENI+$30+$60,B)
      POKE(SCREENI+$30+$C0,C)

      DL(4)==+1
      DL(7)==+1
      DL($A)==+1

      SCREENI==+1

      IF DL(4)=$30 THEN
        DL(4)=0
        DL(7)=$60
        DL($A)=$C0
        SCREENI=$4000
      FI

      HSCROLI=$F
    FI

    HSCROL=HSCROLI HSCROLI==-1
    WAIT(1)
  OD
RETURN
A=(RANDOM&15)+33
B=(RANDOM&15)+33
C=(RANDOM&15)+33

; goes to

A := (RANDOM AND 15);
B := (RANDOM AND 15);
C := (RANDOM AND 15);
until 0 = 1; why not until false?

 

nescroll.eff nescroll.pas nescroll.xex

Edited by zbyti
fixed
  • Like 1
Link to comment
Share on other sites

[BUG ERROR FOR 0.5.0]

var dl : array [0..0] of byte absolute $4000;

begin
	dl[0] := $80;
	dl[256] := $f0;
	repeat until false;
end.
byte array dl=$4000

proc main()
  dl(0)=$80
  dl(256)=$f0
  do od
return

goes to ranged array

// Effectus auto-generated Mad Pascal source code listing
program testPrg;

uses
  Crt;

var
  dl : array[0..255] of byte absolute $4000;

procedure MAINProc;
begin  // 1
  dl[0] := $80;
  dl[256] := $f0;
  repeat
  until 0 = 1;
end;  // 4

begin
  MAINProc;
end.

 

Edited by zbyti
divide the code
  • Like 1
Link to comment
Share on other sites

[BUG ERROR FOR 0.5.0]

byte array dl=$6000, dl_temp=[$12$13$15]

proc main()
  dl=dl_temp
  do od
return

goes to

// Effectus auto-generated Mad Pascal source code listing
program testPrg;

uses
  Crt;

var
  dl : array[0..0] of byte = ($6000);
  dl_temp : array[0..2] of byte = ($12, $13, $15);

procedure MAINProc;
begin  // 1
  dl := dl_temp;
  repeat
  until 0 = 1;
end;  // 4

begin
  MAINProc;
end.

This is correct in some strange way :D Action! put values in dl_temp (in memory), Mad Pascal make a copy of that and put to dl, generally this works.

Edited by zbyti
this is not a critical bug but I think it should be fixed
  • Like 1
Link to comment
Share on other sites

We need more convenient way then hardcoding to determine LMS for DL in Effectus next version ;)

 

SBYTE ARRAY TEXT="NNNeffectus@rulezNNN"
BYTE ARRAY DL=[$70$70$70$70$67$1$20$41$0$0]

BYTE
  CH=$2FC,
  VSCROL=$D405
CARD SDLSTL=$230

PROC WAIT=*(BYTE F)[$18$65$14$C5$14$D0$FC$60]

PROC MAIN()
  BYTE I=$E0

  I=$F
  SDLSTL=DL
  WHILE CH=$FF DO
    WHILE I DO
      I==-1
      VSCROL=I
      WAIT(3)
    OD
    WAIT(50)
    WHILE I<$F DO
      I==+1
      VSCROL=I
      WAIT(2)
    OD
  OD
  GRAPHICS(0)
RETURN

 

 

vscroll.eff vscroll.xex

Edited by zbyti
  • Like 1
Link to comment
Share on other sites

            else if System.Pos('{AND}', params[1]) > 0 then begin
              SplitStr(params[1], '{AND}', aList);
              params[1] := aList[0] + ' AND ' + aList[1];
            end

 

@Gury for me this approach is very limited... I try to fix this "detail" but it's looks like this chunk need some serious refactor, better I leave it to You.

 

EDIT1: maybe I try fix only this:

(RANDOM&15)+33
; goes to
(RANDOM{AND}15){AND}33

EDIT2: ok, i fix that: core.pas line 845 https://github.com/Gury8/effectus/pull/6

                temp04 += paramsEx[i];
                if i < High(paramsEx) then begin
                  temp04 += op[i+1];
                end;

 

Edited by zbyti
code chunk
  • Thanks 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...