atarionline.pl ATALAN - new programming language - Forum Atarum

Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.

  • :
  • :

Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.

    • 1: CommentAuthorrudla
    • CommentTime9 Sep 2010 zmieniony
     
    Thanks for the ideas.

    Atalan does not support recursion so -Cl option is it's standard mode of operation.

    aliasing is going to be automatic. Atalan is going to compute graph of function calls and automatically allocate same addresses for local variables of function that do not call each other. Programmer will not have to do anything explicit.

    However explicit aliasing will be possible in Atalan using syntax
    b:0..10
    a@b:0..10 ; a is on same address as b
    • 2: CommentAuthoremka
    • CommentTime10 Sep 2010
     
    Algorytmy możenia i dzielenia na procesorze 6502 zajmują sporo czasu i gdzie się tylko da unika się ich.
    Wiem że to nie jest książka życzeń, ale czy w jakiejś przyszłości można liczyć na zaimplementowanie w Atalan'ie takich operatorów jak [ << ] czy [ >> ] przyspieszyło by to mnożenie i dzielenie przez 2 4 8 16... i uprościło zarządzanie np. tablicami bitowymi.
    • 3: CommentAuthorrudla
    • CommentTime10 Sep 2010
     
    @emka: Definitely. In fact, multiplication and division by 2, 4 end many other constants are already optimized using shifts. In similar way, for example a mod 2 is translated to lda a; and #1.

    Many uses of multiplication are for accessing 2d arrays and Atalan supports 2d arrays and generates line index for them, so multiplication is avoided.
    • 4:
       
      CommentAuthorxeen
    • CommentTime20 Nov 2010
     
    widzę w atalanie wsparcie dla rmt i wygląda to (z punktu widzenia programisty nieco wyżej poziomowego) bardzo dobrze (prosto - w sensie). laickie pytanie - czy w prosty sposób za pomocą tego wsparcia można odpalać moduł od wybranego patternu?
    • 5: CommentAuthorrudla
    • CommentTime21 Nov 2010 zmieniony
     
    You may try to use this modified (Not tested!) version of music'init routine. It supports extra argument for RMT music init function.

    music'init'line:macro module:adr line:0..255 =
    _x = lo module
    _y = hi module
    _a = line
    instr ref rmt_vars
    instr call rmt_init

    In future Atalan release, I will try to support optional arguments and support this argument directly.
    • 6: CommentAuthorrudla
    • CommentTime27 Nov 2010
     
    Atalan project is still going on.
    I have finally made Altirra compile on my system and I would like to present first results of my experiments:

    Symbolic debugger for Atalan!!

    It's just first version, but it is actually possible to load the Atalan source code and step through it using F10.
    • 7: CommentAuthorilmenit
    • CommentTime27 Nov 2010
     
    This can be killer feature to convince people to use this language. Was it complicated to add this code to Altirra?
    • 8: CommentAuthorrudla
    • CommentTime27 Nov 2010
     
    It was not so hard, as I expected :-)

    Well, not very much. Problem was getting the Altirra compiled. The build system uses 2 different assemblers (yasm & MADS) big and there are no comments, and I had to convert the projects to newer version of Visual Studio.

    The code base is relatively large but after some digging through code and placing breakpoints, I have found the places I needed.

    There already was support for parsing MADS listings so I added parsing for special comment lines Atalan includes into generated .asm source.

    Much more work would be needed to make this practical (watches are necessary), but when it's done, it will be wonderful :-)
    • 9: CommentAuthorrudla
    • CommentTime27 Nov 2010
     
    I am now trying to communicate with phaeron to find some nice way how to incorporate my changes into main Altirra source trunk.
    • 10: CommentAuthorrudla
    • CommentTime3 Jan 2011
     
    Atalan has new support for PMG on Atari.
    Folowing is the minimal example of how to use PMG in Atalan.

    ; Player/Missile Graphics
    ; Demo program for ATALAN programming language
    ;(c) 2010 Rudla Kudla

    use atari

    const smiley:array =
    %00000000
    %00111100
    %01000010
    %10000001
    %10100101
    %10000001
    %10000001
    %10000001
    %10100101
    %10011001
    %10000001
    %01000010
    %00111100
    %00000000

    ;This is minimal initialization code for PMG
    init'pmgbase
    DMACTL = playfield + dl + players + missiles + hires_sprites
    GRACTL = players + missiles

    ;Set the player 0 properties and define it's shape
    player(0).scolor = Medium'green
    player(0).x = 100
    player(0).bitmap(50) = smiley
    • 11:
       
      CommentAuthorinsert
    • CommentTime4 Jan 2011
     
    rudla. what's up with our game project? ;)
    • 12: CommentAuthorrudla
    • CommentTime4 Jan 2011 zmieniony
     
    PMG support was prerequisite. Now I'm going to program our monkey using sprites :-)
    • 13:
       
      CommentAuthorinsert
    • CommentTime4 Jan 2011
     
    great ;)
    • 14: CommentAuthornosty
    • CommentTime5 Jan 2011
     
    Hmmm Odpalając PMG.atl na emulatorze, widze jakby smile bardzo szybko poruszal sie z dolu ekranu w górę, az osiągnie odpowiednią pozycje. Wszystko trwa ulamek sekundy ale jest widoczne.
    Nie moge tego teraz sprawdzic na real Atari.
    Ktos tez tak ma i wie moze dlaczego?
    • 15: CommentAuthornosty
    • CommentTime5 Jan 2011
     
    Ja nie znam sie na pmg, wiec nie bijcie jesli odpowiedz jest oczywista.
    Odpalilem kod jak ponizej. Wszyscy gracze maja kolor RED ale 2 sa innych i 2 innych. Czemu??

    ; Player/Missile Graphics
    ; Demo program for ATALAN programming language
    ;(c) 2010 Rudla Kudla

    use atari

    const smiley:array =
    %00000000
    %00111100
    %01111110
    %11111111
    %11011011
    %11111111
    %11111111
    %11111111
    %11011011
    %11100111
    %11111111
    %01111110
    %00111100
    %00000000

    ;This is minimal initialization code for PMG
    init'pmgbase
    DMACTL = playfield + dl + players + missiles + hires_sprites
    GRACTL = players + missiles


    ;Set the player 0 properties and define it's shape
    player(0).scolor = red
    player(0).x = 100
    player(0).bitmap(50) = smiley

    player(1).scolor = red
    player(1).x = 150
    player(1).bitmap(80) = smiley

    player(2).scolor = red
    player(2).x = 80
    player(2).bitmap(125) = smiley

    player(3).scolor = red
    player(3).x = 65
    player(3).bitmap(55) = smiley
    • 16: CommentAuthorrudla
    • CommentTime5 Jan 2011 zmieniony
     
    That is my fault :-)

    The example is missing initialization of GPRIOR register (623,$26F).
    You need to add following two lines of code into initialization:

    out GPRIOR@$26F:byte
    GPRIOR = 1


    In next release, I will include GPRIOR in Atari platform file, so just GPRIOR = 1 will be necessary.
    • 17: CommentAuthornosty
    • CommentTime7 Jan 2011 zmieniony
     
    W temacie PMG wciaz jestem lamerem, ale wyczytalem ze mozna multiplikowac duchy zmieniajac ich kolor i polozenie w czasie przerwania DLI.
    Probowalem i nie udalo mi sie. Tzn udalo mi sie "zmultiplikowac" ducha w pionie, choc to troche bez sensu, bo moglem go sobie od razu zdefiniowac wyzszego.
    A mi zalezalo raczej na przesunieciu w poziomie i zmianie kolorow.
    Zamieszczam kod i wynik. Co robie zle?

    use atari

    s@$8000:array(0..39,0..23) of byte

    ;24 lines of text, 4th line will execute DLI

    const gr0:array of dl_command = (
    3 times BLANK8,
    CHR0+LMS, s,
    2 times CHR0,
    CHR0+DLI,
    20 times CHR0,
    NEXT, gr0
    )

    const smiley:array =
    %00000000
    %00111100
    %01111110
    %11111111
    %11011011
    %11111111
    %11111111
    %11111111
    %11011011
    %11100111
    %11111111
    %01111110
    %00111100
    %00000000

    ;Here we define the Display List Interrupt (DLI) procedure.
    ;It is special procedure of type dli.
    ;dli is procedure type based on interrupt type.

    set_col:dli =
    wait'line
    COLPF(2) = white
    player(0).bitmap(150) = smiley
    player(0).x = 50
    player(0).scolor = red

    ;Initialize graphics.

    sdlstl = gr0
    COLOR0(2) = red+8

    ;This is minimal initialization code for PMG
    init'pmgbase
    DMACTL = playfield + dl + players + missiles + hires_sprites
    GRACTL = players + missiles
    out GPRIOR@$26F:byte
    GPRIOR = 1

    ;Set the player 0 properties and define it's shape
    player(0).scolor = Orange'green
    player(0).x = 100
    player(0).bitmap(50) = smiley

    ;Set the inerrupts.
    on'dli set_col

    • 18: CommentAuthorrudla
    • CommentTime7 Jan 2011
     
    Please note, that even if it's not obvious from the Atalan's syntax, assigning 'smiley' to bitmap(50) does in fact copy whole smiley array to player's bitmap (starting at element 50).

    This is relatively slow operation.

    So it is basically not possible to perform this in dli. Also, as you correctly noted, this has no meaning, as you can do this out of the dli anyways.

    Also to change the color during DLI, you must use property player(0).color.
    player(0).scolor specified system color, which gets copied to hardware register color once per TV frame, so it has no effect in dli.

    So your DLI routine should probably look like this:

    et_col:dli =
    wait\'line
    COLPF(2) = white
    player(0).x = 50
    player(0).color = red


    And you should add this to initialization:

    player(0).bitmap(150) = smiley

    I prepared some short info on using PMG from Atalan here ->link<-
    • 19: CommentAuthornosty
    • CommentTime7 Jan 2011
     
    Thank you. It works! :)
    use atari

    s@$8000:array(0..39,0..23) of byte

    ;24 lines of text, 4th line will execute DLI

    const gr0:array of dl_command = (
    3 times BLANK8,
    CHR0+LMS, s,
    2 times CHR0,
    CHR0+DLI,
    20 times CHR0,
    NEXT, gr0
    )

    const smiley:array =
    %00000000
    %00111100
    %01111110
    %11111111
    %11011011
    %11111111
    %11111111
    %11111111
    %11011011
    %11100111
    %11111111
    %01111110
    %00111100
    %00000000
    %00000000
    %00111100
    %01111110
    %11111111
    %11011011
    %11111111
    %11111111
    %11111111
    %11011011
    %11100111
    %11111111
    %01111110
    %00111100
    %00000000

    ;Here we define the Display List Interrupt (DLI) procedure.
    ;It is special procedure of type dli.
    ;dli is procedure type based on interrupt type.

    set_col:dli =
    wait'line
    player(0).x = 50
    player(0).color = Orange
    COLPF(2) = white

    cycle:vbi =
    player(0).x = 100
    player(0).scolor = Olive'green


    ;Initialize graphics.

    sdlstl = gr0
    COLOR0(2) = red+8

    ;This is minimal initialization code for PMG
    init'pmgbase
    DMACTL = playfield + dl + players + missiles + hires_sprites
    GRACTL = players + missiles
    out GPRIOR@$26F:byte
    GPRIOR = 1

    ;Set the player 0 properties and define it's shape
    player(0).scolor = Olive'green
    player(0).x = 100
    player(0).bitmap(50) = smiley

    ;Set the inerrupts.
    on'vbi cycle
    on'dli set_col
    • 20:
       
      CommentAuthorxeen
    • CommentTime14 Jan 2011 zmieniony
     
    Czy jest/planowane jest jakieś wsparcie w ATALAN dla podstawowych dyskowych dosowych operacji (takie odpowiedniki, open, put, get, moze run)?
    • 21:
       
      CommentAuthorinsert
    • CommentTime14 Jan 2011
     
    xeen. moze action sie pouczymy razem? ;P
    • 22:
       
      CommentAuthorlarek
    • CommentTime14 Jan 2011
     
    Nie no, propozycja nie do odrzucenia ;)
    • 23: CommentAuthorrudla
    • CommentTime15 Jan 2011
     
    Support for file operations is planned.
    It should be doable even now, only the programmer would have to know principles of calling OS IO routines very well.

    I would, however, like some simplified version, similar to how I tried to simplify PMG programming.
    • 24: CommentAuthormono
    • CommentTime15 Jan 2011
     
    I propose to build 2 libraries:
    - one for standard OS CIO based operations (open,close,get,put,status,xio, and device special for ex. dir,note,point,format,mkdir; number of files limited to amount of free CIO channels usually less than 8),
    - second for SpartaDOS X based file operations; more flexible than OS CIO operations; number of files configured by user; more comfortable note/point, file finding, retrieving of directory, attributes of file, and much more.
    SDX has a lot of features worth to support in modern language :).
    • 25:
       
      CommentAuthorpirx
    • CommentTime15 Jan 2011 zmieniony
     
    please do, please :)
    • 26: CommentAuthorrudla
    • CommentTime15 Jan 2011
     
    Would actually someone want to develop something using Sparta DOS X ?
    I mean, such advanced features are more usable for system programming and it seems, that nowadays mostly just games and demos are developed.
    • 27:
       
      CommentAuthorpirx
    • CommentTime28 Mar 2011
     
    Simple "Game of Life" in Atalan - executable and source. Have fun watching blinking exclamation marks!
    • 28:
       
      CommentAuthorKaz
    • CommentTime28 Mar 2011
     
    Szybkie. Dzieki, dorzucam do katalogu uzytkow do dzialu "Rozne".

    Czy to przymiarka do wiekszego projektu w Atalanie, jakies sprawdzenie, jak sie w tym pisze?
    • 29:
       
      CommentAuthorpirx
    • CommentTime28 Mar 2011
     
    Taka wprawka. Najpierw porwałem się na coś większego, ale poległem, na szczęście uzyskałem pomoc na grupie Atalanowej i coś zaczęło działać. Skoro działa, to puściłem tu. Kluczem było zrozumienie wagi określania zakresów zmiennych za pomocą typów.
    • 30:
       
      CommentAuthorjhusak
    • CommentTime28 Mar 2011
     
    Lekkie proste i przyjemne :)))
    Ładne źródełko.
    • 31: CommentAuthorrudla
    • CommentTime28 Mar 2011
     
    Beautiful. You guys are amazing. :-)
    • 32: CommentAuthorw1k
    • CommentTime28 Mar 2011
     
    i must learn this language :)
    • 33: CommentAuthorascrnet
    • CommentTime3 May 2012 zmieniony
     
    hi,

    if I put the platform the program crashes. (win xp sp3)

    D:\atalan>atalan -p atari starts.atl
    Atalan programming language compiler (19-Mar-2011)
    by Rudla Kudla (http:\atalan.kutululu.org)

    Building starts.atl...

    AppName: atalan.exe AppVer: 0.0.0.0 ModName: atalan.exe
    ModVer: 0.0.0.0 Offset: 00002650


    :S ....

    regards
    • 34: CommentAuthorilmenit
    • CommentTime19 Feb 2013
     
    What is the state of the Atalan language? Is it still under development? Is the compiler stable enough to write some bigger program?
    • 35:
       
      CommentAuthorjhusak
    • CommentTime19 Feb 2013 zmieniony
     
    Tak, trochę zrąbana ta rewizja. Niemniej, chyba w pliku atari.atl, tam się na definicji macro wyrąbuje.

    Yeah, this rev is screwed a little. To be exact, it fails in file atari.atl on macro definition.