Jump to content
IGNORED

Mad Pascal


Recommended Posts

It was another C&P problem ;) corrected.

 

(*
* Fire by koalka/bbsl/karzelki
*)

program Fire;

uses atari;

const
  screen  = $6400;
  charset = $6000;
  dl: array [0..25] of byte = (
    $42,lo(screen),hi(screen),
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
    $41,lo(word(@dl)),hi(word(@dl))
  );

var
  b0i    : byte absolute $e0;
  b1i    : byte absolute $e1;
  tmp    : byte absolute $e2;

  p0     : PByte absolute $e3;
  p1     : PByte absolute $e5;
  p2     : PByte absolute $e7;

begin
  color4 := $20; tmp := 0;
  sdlstl := word(@dl); chbas := hi(charset);
  gprior := $40; sdmctl := $21;

  for b0i := 0 to $f do begin
    for b1i := 0 to 7 do poke(charset + b1i + b0i * 8, tmp);
    inc(tmp,$11);
  end;

  FillChar(pointer(screen), $400, 0);

  while true do begin
    p0 := pointer(screen - 31);
    p1 := pointer(screen - 31 + $100);
    p2 := pointer(screen - 31 + $200);

    for b0i := 0 to 255 do begin
      tmp := p0[30] + p0[31] + p0[32] + p0[63];
      tmp := tmp shr 2;
      p0^ := tmp;

      tmp := p1[30] + p1[31] + p1[32] + p1[63];
      tmp := tmp shr 2;
      p1^ := tmp;

      tmp := p2[30] + p2[31] + p2[32] + p2[63];
      tmp := tmp shr 2;
      p2^ := tmp;

      inc(p0); inc(p1); inc(p2);
    end;
    //colbk := 10; pause;

    p0 := pointer(screen + $2e0);
    for b0i := $1f downto 0 do p0[b0i] := rnd and 15;
  end;
end.

 

 

fire.pas fire.xex

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


(*
* Fire by koalka/bbsl/karzelki
*)

program Fire;

uses atari;

const
  screen  = $6400;
  charset = $6000;
  dl: array [0..25] of byte = (
    $42,lo(screen),hi(screen),
    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
    $41,lo(word(@dl)),hi(word(@dl))
  );

var
  b0i    : byte absolute $e0;

  p0     : PByte absolute $e1;
  p1     : PByte absolute $e3;
  p2     : PByte absolute $e5;

  b1i, tmp    : byte;

begin
  color4 := $20; tmp := 0;
  sdlstl := word(@dl); chbas := hi(charset);
  gprior := $40; sdmctl := $21;

  for b0i := 0 to $f do begin
    for b1i := 0 to 7 do poke(charset + b1i + b0i * 8, tmp);
    inc(tmp,$11);
  end;

  FillChar(pointer(screen), $400, 0);

  while true do begin
    p0 := pointer(screen - 31);
    p1 := pointer(screen - 31 + $100);
    p2 := pointer(screen - 31 + $200);

    for b0i := 0 to 255 do begin
      p0^ := byte(p0[30] + p0[31]+ p0[32]+ p0[63]) shr 2;
      p1^ := byte(p1[30] + p1[31]+ p1[32]+ p1[63]) shr 2;
      p2^ := byte(p2[30] + p2[31]+ p2[32]+ p2[63]) shr 2;

      inc(p0); inc(p1); inc(p2);
    end;
    //colbk := 10; pause;

    p0 := pointer(screen + $2e0);
    for b0i := $1f downto 0 do p0[b0i] := rnd and 15;
  end;
end.

fire.obx fire.pas

Edited by tebe
  • Like 4
Link to comment
Share on other sites

@zbyti, I relly applaud your efforts to benchmark all these different languages, but it's getting hard to follow. Your code and results are all over the place. Perhaps you could start a github repo to keep track of the different languages and compilers, like C (CC65, KickC , gcc), Mad Pascal, Millfork, K65, Action! (native and effectus), etc... Each in their own subdirectory.

 

You could call it Atari LAnguages BenchmArks MAnifestation, i.e. ALABAMA :)

 

or

 

MAsochism

MAsturbations

MAnagement

MAximizer

 

And when the project hasn't been updated for years, it becomes MAusoleum ;)

 

 

 

  • Thanks 1
Link to comment
Share on other sites

11 minutes ago, zbyti said:

No.

Just because what I said???

 

If so, I don't get it. My posting was meant lighthearted, slightly funny perhaps, but also serious about collecting all your benchmarks from different threads (that's what I meant with all over the place, i.e. they are to be found at different places on this forum) and put them in one repository. I had and have no ill meaning.

 

Edit: and the alabama thing, apparently my attempt at humor didn't get through. Masochism was meant lighthearted, as in you punish yourself by trying so many languages. Masturbations, dito, but about....  Management and Maximizer were actually meant serious.

 

Edit2: clarified all over the place some more.

 

Edit3:

Oxford Dictionary:

	1. (informal) everywhere
		"we've been all over the place looking for you"

	2. in a disorganized or confused state.
		"the government is all over the place on this"


Cambridge Dictionary:

	1. in a lot of different places or in all parts of a place

	2. (informal) not correct, regular, or well organized; changing a lot without reason

 

I meant the first meaning. Funny though, how both dictionaries disagree on which meaning is informal :)

 

Edited by ivop
Link to comment
Share on other sites

12 minutes ago, zbyti said:

I decided to focus on my project, I no longer have time to read & write on AA.

 

I made that decision yesterday not because of you.

 

My repositories are already on GitHub https://github.com/zbyti

If you had just said this, instead of "You will see nothing more from me" and "No", I think I might have understood it better :)

 

I really thought you meant I had offended you by the phrase "all over the place", which could well have been the case if you look at the aforementioned different meanings.

 

Good to see your code is already on github! I didn't know.

 

Good luck with the project you are focusing on right now!

  • Like 1
Link to comment
Share on other sites

5 minutes ago, ivop said:

If you had just said this, instead of "You will see nothing more from me" and "No", I think I might have understood it better :)

 

I really thought you meant I had offended you by the phrase "all over the place", which could well have been the case if you look at the aforementioned different meanings.

713+UNN755L._AC_SY606_.jpg

Link to comment
Share on other sites

I have a problem with MP (V1.6.3). I try to pass a struct to a procedure by reference, so I can modify its values.

type thund = record 
                aussehen: zeichen;
                spalte: zahl;
                zeile: zahl;
                alte_spalte: zahl;
                alte_zeile: zahl;
                aktion: hund_aktion;
                aktion_dauer: zahl;
             end;

 

but this does not work/results are not written back:

 

procedure BewegeHund(var hund: thund)

    if hund.zeile>rand_oben then hund.zeile:=hund.zeile-1; // No effekt


for now I've worked around it for now by returning a copy of the result instead. But that is really too slow/complex:

 

function BewegeHund(hund: thund): thund;

  BewegeHund:=hund;

 

Any ideas? Is that a limtiation of MP?

- Peter.
 

Link to comment
Share on other sites

@JAC! why you use so old MP?

 

Quote

It is possible to recurse procedures, provided that the procedure parameters will be passed by value and will be of a simple - ordinal type. The record or pointer type will not be properly allocated in memory.

http://mads.atari8.info/doc/madpascal_en.html#proc

Edited by zbyti
link
Link to comment
Share on other sites

On 11/9/2020 at 1:01 AM, zbyti said:

I checked the main page and it states "1.6.3", and so does the documentation in your like above, so I expected that is the latest version.

http://mads.atari8.info/

image.png.23690775a2694ce5e63f68d4cd5368e3.png

 

Will try the newer versions tomorrow.

 

Link to comment
Share on other sites

Mad Pascal 1.6.4 https://github.com/tebe6502/Mad-Pascal/releases

 

multiplying procedures u8x8, u16x16 replaced by code from CC65
adding the POKEY reset code at the beginning of the program launch
optimization of conditional IF expressions () and () and ... IF () or () or ...
CMP_SHORTINT, CMP_SMALLINT optimization
GRAPH, FASTGRAPH: SetActiveBuffer, SetDisplayBuffer, NewDisplayBuffer, SwitchDisplayBuffer, example demoeffects\lines2.pas, line3.pas, line4.pas
GRAPH: Ellipse procedure (X, Y, StAngle, EndAngle, xRadius,yRadius: Word);
MATH: Hypot
SYSTEM: Length(string_array[element])
SYSTEM: GetMem, FreeMem
SYSTEM: IntToStr(CARDINAL), Str(CARDINAL, STRING)
SYSUTILS: ByteToStr(BYTE): STRING
SYSUTILS: corrected FindFirst, StrToFloat
SYSTEM: corrected Val(string, real, code) ; Val(string, single, code)
new CIO unit: Opn, Cls, Get, Put, BGet, BPut, XIO
new SIODISK unit, separated from the SYSTEM
new S2 unit, integrated with handler installer VBXE-S2: (S_VBXE.SYS)
new DEFLATE unit, which performs DEFLATE decompression (procedure unDEF), example compression\undef.pas
new LZ4 unit, implementing LZ4 decompression (procedure unLZ4), example compression\unlz4.pas, unlz4_stream.pas
new APLIB unit, which performs apLib decompression (procedure unApl), example compression\unapl.pas, unapl_stream.pas
new CRC unit: function crc32(crc: cardinal; buf: Pbyte; len: word)
a new PASCAL procedure/function modifier, causing a new memory block to be assigned/released for variables each time a procedure/function is called, example 'math\evaluate.pas'.
added ability to disable ROM while maintaining system operation, {$DEFINE ROMOFF}
shorter names of the switch -zpage (-z), -stack (-s), -data (-d), -code (-c), -define (-d), -ipath (-i)
added possibility to generate code for C64 (-t c64)

 

  • Like 3
Link to comment
Share on other sites

On 11/2/2020 at 2:29 PM, zbyti said:

New Mad Pascal Benchmark Suite:

 

mp-1.6.5-2020-11-02.png.c3c062e9e3eb06ec56c8b660bd4bf626.png

I really like the Mad Pascal benchmark suite! The different tests examine different aspects of the language nicely.

 

However, I am somewhat unsure in which tests "higher is better" and in which "lower is better".

 

Is there a list showing this somewhere, that I have missed?

 

@zbyti maybe you can point me in the right direction.

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