zbyti Posted June 26, 2020 Share Posted June 26, 2020 (edited) @tebe does the shorter code in Mad Pascal cause to generate a shorter code in MADS? Edited June 26, 2020 by zbyti Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 26, 2020 Share Posted June 26, 2020 @Gury -nc Effectus only translate source to Mad Pascal I think -t would be more appropriate, what do you think? It seems to me that the -nc I have chosen is confusing because of the -c flag. Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 26, 2020 Share Posted June 26, 2020 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 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 26, 2020 Share Posted June 26, 2020 @funkheld Those are compiler directives not implemented yet. $E may be useful but $491 make no sense in Effectus. Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 26, 2020 Share Posted June 26, 2020 but why is there no error message? hello, thanks. Quote Link to comment Share on other sites More sharing options...
Gury Posted June 26, 2020 Author Share Posted June 26, 2020 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. Quote Link to comment Share on other sites More sharing options...
Gury Posted June 26, 2020 Author Share Posted June 26, 2020 3 hours ago, zbyti said: @Gury -nc Effectus only translate source to Mad Pascal I think -t would be more appropriate, what do you think? It seems to me that the -nc I have chosen is confusing because of the -c flag. Yes, it is a good idea. Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 26, 2020 Share Posted June 26, 2020 (edited) [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 June 26, 2020 by zbyti working version 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted June 26, 2020 Author Share Posted June 26, 2020 Okej, good analysys. Future will bring new fixed version Great work on Scramble program, btw. 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 26, 2020 Share Posted June 26, 2020 (edited) 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 =* 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 June 27, 2020 by zbyti my bad 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted June 27, 2020 Author Share Posted June 27, 2020 No problem The main goal is to maintain as much compatibility as possible. We can make some exceptions with parameters, but we should make them less than it is necessary. Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) 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 June 27, 2020 by zbyti add info 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) [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 June 28, 2020 by zbyti fixed 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) [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 June 27, 2020 by zbyti divide the code 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) [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 Action! put values in dl_temp (in memory), Mad Pascal make a copy of that and put to dl, generally this works. Edited June 28, 2020 by zbyti this is not a critical bug but I think it should be fixed 1 Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) 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 June 28, 2020 by zbyti 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 27, 2020 Share Posted June 27, 2020 (edited) hello, why is the "N" in the text? greeting Edited June 27, 2020 by funkheld Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 27, 2020 Share Posted June 27, 2020 I want the memory from 2000-3fffhex. how can you start the program at 4000hex with effectus? thank you. greeting Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 (edited) @funkheld 1. "N" is a "." in GR.5 2. For now you can't directly do that. Use Effectus -nc flag and compile .pas with: mp -code:address Edited June 27, 2020 by zbyti Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 27, 2020 Share Posted June 27, 2020 (edited) hello, thanks for the info. why is the Effectus -nc flags ? greeting. Edited June 27, 2020 by funkheld Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 @funkheld https://atariage.com/forums/topic/306222-effectus-suggestions-and-bug-reports/?do=findComment&comment=4572284 Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 27, 2020 Share Posted June 27, 2020 (edited) compile .pas with: mp -code:address not function ! mp -code:3000 vscroll.pas greeting Edited June 27, 2020 by funkheld Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 27, 2020 Share Posted June 27, 2020 @funkheld I suggest You resolve these issues in a different thread, this one is for bugs and suggestions Quote Link to comment Share on other sites More sharing options...
zbyti Posted June 28, 2020 Share Posted June 28, 2020 (edited) 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 June 28, 2020 by zbyti code chunk 1 Quote Link to comment Share on other sites More sharing options...
funkheld Posted June 28, 2020 Share Posted June 28, 2020 Hi good afternoon. how is the source of effectus compiled with freepascal? thank you. 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.