Overw8-bits, 6k intro for MorphOS
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    Hello.

    I have released my 4k intro (and source) because I won't participate on a demoscene competition, and the intro size is 6kb after include stdlib on the executable, due some changes on latest TinyGL library. The name honors to this last problem with size and the theme of intro. I hope you enjoy with this little intro:

    Overw8-bits

    [ Edited by BalrogSoft 21.05.2014 - 23:20 ]
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »21.05.14 - 16:05
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    tolkien
    Posts: 523 from 2013/5/29
    Hello Balrog!
    It´s a shame I have my two MorphOS machines K.O. but I hope someone can grab it and upload to youtube.
    Yes, I know It isn´t the same but...

    Thanks for the intro!
    MorphOS: PowerMac G5 - PowerBook G4 - MacMini.
    Classic: Amiga 1200/060 - A500 PiStorm
  • »21.05.14 - 17:21
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Intuition
    Posts: 1110 from 2013/5/24
    From: Nederland
    Very nice indeed.

    The source is a great example to learn from too, thanks! :)
    1.67GHz 15" PowerBook G4, 1GB RAM, 128MB Radeon 9700M Pro, 64GB SSD, MorphOS 3.15

    2.7GHz DP G5, 4GB RAM, 512MB Radeon X1950 Pro, 500GB SSHD, MorphOS 3.9
  • »22.05.14 - 00:04
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    BSzili
    Posts: 559 from 2012/6/8
    From: Hungary
    It's just a tip, but maybe you could try dos.library Exit() instead of exit() from libnix?
    This is just like television, only you can see much further.
  • »22.05.14 - 08:24
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    Thanks to all for your support! It was my first 4-6k intro.

    To BSzili:

    Yes, I have tried Exit from Dos.library, but I have readed on Autodocs that this function expects that your program is written on BCPL :

    Quote:

    Exit() is currently for use with programs written as if they
    were BCPL programs. This function is not normally useful for
    other purposes.

    In general, therefore, please DO NOT CALL THIS FUNCTION!


    Anyway I have found a solution, RemTask(0) as a Exit alternative make it working!

    I have to work now, but I will publish a new version at the end of the day.
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »22.05.14 - 09:36
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Yasu
    Posts: 1724 from 2012/3/22
    From: Stockholm, Sweden
    This is a really nice little intro! Makes me feel all nostalgic :-)
    AMIGA FORUM - Hela Sveriges Amigatidning!
    AMIGA FORUM - Sweden's Amiga Magazine!

    My MorphOS blog
  • »22.05.14 - 09:55
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    BalrogSoft wrote:
    Anyway I have found a solution, RemTask(0) as a Exit alternative make it working!

    That won't work correctly I'm afraid (it will nuke the shell when started from it, and leak WBStartupMsg if ran from Ambient).

    This should do the trick however:

    1. Only check for ESC in keys function. If it is found signal self with CTRL-C signal, telling glutMainLoop that the app is terminating:

    Code:

    static void keys(unsigned char c, int x, int y)
    {
    if (c == 0x1b)
    {
    Signal(FindTask(0), SIGBREAKF_CTRL_C);
    }
    }


    2. Move cleanup that is in keys() function after glutMainLoop() call in main()/entry().




    PS. Currently the app cannot be run safely from Ambient if compiled with NOSTARTUPFILES. For that to work you'd need to handle WBStartupMsg manually. Something like:

    Code:

    #ifdef NOSTARTUPFILES
    int entry(void)
    {
    SysBase = *(struct ExecBase **) 4;
    struct Message *wbstartupmsg = 0;
    struct Process *self = (struct Process *) FindTask(0);
    if (self->pr_CLI == 0)
    {
    WaitPort(&self->pr_MsgPort);
    wbstartupmsg = GetMsg(&self->pr_MsgPort);
    }
    #else
    int main(void)
    {
    SysBase = *(struct ExecBase **) 4;
    #endif


    ... normal application code here ...


    #ifdef NOSTARTUPFILES
    if (wbstartupmsg)
    {
    Forbid();
    ReplyMsg(wbstartupmsg);
    }
    #endif
    return 0;
    }


    [ Edited by Piru 22.05.2014 - 19:15 ]
  • »22.05.14 - 10:45
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    Quote:

    Piru wrote:
    That won't work correctly I'm afraid (it will nuke the shell when started from it, and leak WBStartupMsg if ran from shell).



    It works on my Macmini system.

    Quote:

    Piru wrote:
    This should do the trick however:

    1. Only check for ESC in keys function. If it is found signal self with CTRL-C signal, telling glutMainLoop that the app is terminating:

    Code:

    static void keys(unsigned char c, int x, int y)
    {
    if (c == 0x1b)
    {
    Signal(FindTask(0), SIGBREAKF_CTRL_C);
    }
    }




    Unfortunately, It doesn't work, I tried it before. I can't exit pressing CTRL+C shortcut, and I can't exit sending a SIGBREAKF_CTRL_C signal.

    I'm not aware about last changes on TinyGL, and MorphOS SDK doesn't contain any documentation about TinyGL, but whats the proper way to exit from glutMainLoop()? There aren't functions like glutLeaveMainLoop() or mglExit() implemented on TinyGL.

    Quote:

    Piru wrote:
    PS. Currently the app cannot be run safely from Ambient if compiled with NOSTARTUPFILES. For that to work you'd need to handle WBStartupMsg manually.


    Done, now it works properly with NOSTARTUPFILES defined.

    This is the last version, only 3795 bytes:
    Overw8-bits

    [ Edited by BalrogSoft 22.05.2014 - 17:44 ]
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »22.05.14 - 18:37
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    BalrogSoft wrote:
    Quote:

    Piru wrote:
    That won't work correctly I'm afraid (it will nuke the shell when started from it, and leak WBStartupMsg if ran from ambient).



    It works on my Macmini system.

    Trust me, it doesn't work correctly.


    Quote:

    Quote:

    Piru wrote:
    This should do the trick however:

    1. Only check for ESC in keys function. If it is found signal self with CTRL-C signal, telling glutMainLoop that the app is terminating:

    Code:

    static void keys(unsigned char c, int x, int y)
    {
    if (c == 0x1b)
    {
    Signal(FindTask(0), SIGBREAKF_CTRL_C);
    }
    }




    Unfortunately, It doesn't work, I tried it before. I can't exit pressing CTRL+C shortcut, and I can't exit sending a SIGBREAKF_CTRL_C signal.

    Indeed, you're right. I missed that it doesn't work if idlefunc is specified. I'll fix this for future versions.

    Quote:

    I'm not aware about last changes on TinyGL, and MorphOS SDK doesn't contain any documentation about TinyGL, but whats the proper way to exit from glutMainLoop()?

    Unfortunately in the current version there is no way other than hitting the window close gadget or calling exit() or longjmp().
  • »22.05.14 - 19:36
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    Quote:

    Piru wrote:
    Trust me, it doesn't work correctly.



    What's the problem exactly?

    The first version with nostartupfiles isn't working? It works without nostartupfiles?

    Have you tried the last version?

    Quote:

    Piru wrote:
    Unfortunately in the current version there is no way other than hitting the window close gadget or calling exit() or longjmp().


    It leaves very few options, I tried longjmp before, and it doesn't work with nostartfiles, it fails with a apparently random return code on the moment i use setjmp function on my code, even before setjmp is executed, exit function can't be used without stdlib. So windowed mode is the only correct solution.
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »22.05.14 - 21:45
    Profile Visit Website
  • MorphOS Developer
    Piru
    Posts: 587 from 2003/2/24
    From: finland, the l...
    Quote:

    BalrogSoft wrote:
    Quote:

    Piru wrote:
    Trust me, it doesn't work correctly.



    What's the problem exactly?


    It kills the shell process when ran from shell. The shell window stays but the actual shell process goes away, effectively killing it.

    Current version does work correctly when started from Ambient, though.

    Quote:


    The first version with nostartupfiles isn't working?

    It is not, when started from shell.

    Quote:

    It works without nostartupfiles?

    calling exit() works correctly indeed.


    Quote:

    Have you tried the last version?

    I don't need to. I know RemTask(0) from shell is not good for the shell.


    Quote:

    Quote:

    Piru wrote:
    Unfortunately in the current version there is no way other than hitting the window close gadget or calling exit() or longjmp().


    It leaves very few options, I tried longjmp before, and it doesn't work with nostartfiles

    That is indeed correct, longjmp isn't any better than exit in this regard, as it also pulls in much of libnix.

    The next release of TinyGL allows CTRL-C termination, even when idlefunc is used.
  • »23.05.14 - 05:12
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    I have updated Overw8-bits, it runs in windowed mode when NOSTARTUPFILES is defined and it should work properly on all systems. There is two versions included, a 6kb versions that runs on fullscreen mode, and the 4k version that runs on windowed mode.

    Edited:
    I have found one bug, only one sound channel was working, now it works.

    Overw8-bits

    [ Edited by BalrogSoft 23.05.2014 - 13:22 ]
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »23.05.14 - 11:35
    Profile Visit Website
  • k8o
  • Cocoon
    Cocoon
    k8o
    Posts: 57 from 2013/5/29
    From: London / UK
    Nice little retro intro, sound sucks a bit, but i like the visuals...

    BalrogSoft, I hope you don't get disheartened and do some more demos & intros :)

    [ Edited by k8o 23.05.2014 - 13:36 ]
  • »23.05.14 - 15:36
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    BalrogSoft
    Posts: 171 from 2006/10/6
    From: Spain
    Quote:

    k8o wrote:
    Nice little retro intro, sound sucks a bit, but i like the visuals...


    Music is a very simple code music, it just one line of code, It was taken from this video:

    https://www.youtube.com/watch?v=tCRPUv8V22o

    This is the song:

    ((t*("363664689"[t>>13&7]&15))/12&128)+(((((t>>12)^(t>>12)-2)%11*t)/4|t>>13)&127);

    There are very interesting readings about it, if you are interested, search on google this "music one line code".

    Quote:

    k8o wrote:
    BalrogSoft, I hope you don't get disheartened and do some more demos & intros :)


    No, I want to make intros for MorphOS and Amiga classic, I have some ideas and code for another 4k intro. I'm working on a startup c code for classic Amigas also, but I have very few time for this kind of projects nowadays.

    Since I got fired 3-4 years ago, I'm very busy trying to make some games, I have worked on some games with a ex coworker from the last company I have worked, but we got very few sales (I think mainly because these games were remakes of well known classic games), I'm trying to make my first game alone now, and trying to make an original game concept, but now I'm having problems to find a graphic artist. So it left very few time for demoscene projects.

    The best part is that the game currently runs on MorphOS and other commercial platforms, so it will be published for MorphOS, but I don't know when it will be available.

    Edited:

    A new version is available, removed unused code, and replaced some for loops to while loops, it removes a few bytes more.

    Overw8-bits
    Balrog Software - AmigaSkool.net
    Mac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
    Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
    Amiga 1200D - OS 3.9 - Blizzard 603e/240mh
  • »24.05.14 - 10:14
    Profile Visit Website