Cross-compiling: AmigaOS3, ArOS and MorphOS
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    Some time ago, I compiled and upgraded an old Amiga OS program on Amiga OS 3. Last week, I got it to compile on ArOS, and now I'm trying to get it to compile on MorphOS.

    It's a modest little Blackjack game that, except for the colors, on ArOS looks like this: Jack31.png

    The colors have since been corrected.

    Notice the buttons, now here are two other versions, one MorphOS and the other AmigaOS on MorphOS: Jack31m.jpg

    The buttons actually do appear on the AmigaOS version, but not when running under MorphOS.

    So... before I start poking around, seeing what is causing those gadgets not to initialize, I thought I'd ask here if there's an obvious reason why those buttons are missing on MorphOS. I'm not expecting an answer here, so I'm just asking in case I am missing the obvious.

    As always, any and all clues appreciated.

    Ed.
  • »15.01.13 - 02:45
    Profile
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    Hard to say anything without seeing the source and crashlog.
  • »15.01.13 - 12:20
    Profile Visit Website
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    [edited post]

    Disregard. After going back and re-checking, my m68k version appears to have broken. Not sure how. I gotta go back and recheck some things. I'll ask my question again later.

    Ed.

    [ Edited by EDanaII 15.01.2013 - 19:34 ]
  • »16.01.13 - 00:11
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    OK. Take two.

    Here are the sources for anyone who might want to take a look.

    I put some printf statements in the code and they show that none of the gadgets are initializing. The same thing for the m68k version under MorphOS, but that version runs fine under AmigaOS 3.
  • »16.01.13 - 03:52
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    I cant test it here right now but is diamond.font installed?
    1 + 1 = 3 with very large values of 1
  • »16.01.13 - 06:42
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    On my machine? I have no idea. I have whatever fonts are installed on the MorphOS 3.1.
  • »16.01.13 - 12:34
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    I just tried and it seems to work. No crash no Hit.

    It works just fine. The included binary as well as a self compiled.

    http://www.geit.de/tmp/jack.jpg

    Geit


    [ Edited by geit 16.01.2013 - 16:50 ]
  • »16.01.13 - 14:49
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    Hmmm... So maybe something wrong with my MorphOS installation? Does anyone have any ideas on how I might confirm that?
  • »16.01.13 - 17:29
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    Maybe run snoopium and enable debug options from system settings.
    1 + 1 = 3 with very large values of 1
  • »16.01.13 - 17:53
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    OK, finally understanding Itix's comments about the diamond.font, I checked the Fonts: directory and saw nothing that looked like the corresponding Amiga Fonts: one. So, what am I looking for here? Is the MorphOS layout different? Does it define the Diamond.font differently? Searching Fonts: for it came up "bupkis."

    The font on the MorphOS and m68k interpreted version is definitely not the same as the others, so it could be a cascade failure from this. It certainly explains why both are failing on MorphOS
  • »16.01.13 - 21:38
    Profile
  • MorphOS Developer
    jacadcaps
    Posts: 3108 from 2003/3/5
    From: Canada
    The layout of the fonts directory isn't different - MorphOS simply does not provide the font you are using, so you have to install it first (and likely bundle with your application).
  • »17.01.13 - 08:32
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    Right, I have the diamond font installed, too.

    Anyway you should check properly if the font is available and pop up a requester. At least you must not ignore the missing font and continue rendering your stuff.

    This will cause hits and crashing and should never happen. The result of any function returning a pointer must be checked! There is no way around when you want to create proper software.

    Geit


    [ Edited by geit 17.01.2013 - 11:52 ]
  • »17.01.13 - 09:40
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    I assume I can copy the Diamond.font into the Fonts: directory. That's good enough for an "install?"

    That said, what about storing it locally? In the program's root directory. Will it find it there, or do I have to do something different to make it find it? I'd rather it be there than in Fonts:. Seems easier, ultimately.
  • »17.01.13 - 16:41
    Profile
  • MorphOS Developer
    itix
    Posts: 1520 from 2003/2/24
    From: Finland
    You must also copy diamont directory with its contents to FONTS:.

    You can also store font locally to PROGDIR:Fonts. I have never used this but diskfont.library in AROS and MorphOS should support it automagically. In AmigaOS it will not work.

    [ Edited by itix 17.01.2013 - 21:15 ]
    1 + 1 = 3 with very large values of 1
  • »17.01.13 - 18:13
    Profile
  • MorphOS Developer
    geit
    Posts: 1049 from 2004/9/23
    EDanaII,
    Quote:

    I assume I can copy the Diamond.font into the Fonts: directory. That's good enough for an "install?"


    If you want to include it, than you need the file and the drawer. The file contains the font describtion, while the directory contains the available bitmap font sizes.

    And you need to check the result after opening the font, as the system may fail to open the font, even when it is included und installed properly.

    Geit
  • »17.01.13 - 19:04
    Profile
  • Just looking around
    EDanaII
    Posts: 16 from 2012/7/28
    I used Itix's second tip and now it works fine.

    Now to take the time to refine it a little more. :)

    Thanks all!
  • »18.01.13 - 00:22
    Profile