Join us on Discord!
You can help CodeWalrus stay online by donating here.

SDL/n2DLib ports for TI Nspire

Started by gameblabla, August 19, 2015, 08:48:31 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

gameblabla

I forgot there was several versions of Wolfenstein 3D...
I have updated my port to reflect this and now, you can play Spear of Destiny and the full versions as well !

QuoteIt was there with packing enabled as well. I thought it was a bed and he simply fell asleep from exhaustion xD
Rofl, i can tell you didn't play Wolf3D that much.
Well, if it's not an alignement issue then it's something else instead...
With the new version, it's the "Demo" pict that appears instead.

Quote from: DJ Omnimaga on April 27, 2016, 06:00:11 PM
According to the TI-Planet news, when you die it can also lead to controls no longer responding (which I assume it means the game freezes, right?)
I was unable to reproduce this...

QuoteAlso I wonder if we should have a topic for Ndless SDK/C development environment setup support?
There's already a tutorial on Hacksprite that explains this. (For Unix, that is)
I know Windows is a pain in the ass but it might be a good idea to update the SDK.

QuoteBtw @gameblabla : The link to the post about the Sega Dreamcast game you ported to the Nspire is missing from the first post of this topic and some screenshots give 404 not found there.
What dreamcast game ? Fruity ?
It seems to work well here on my side.
  • Calculators owned: None (used to own an Nspire and TI-89)

Dream of Omnimaga

Yeah I meant a topic for SDK problems for people who followed the tutorials to no avail.

And yeah I meant Fruity. It is not mentioned at all in the first post of this topic.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

rwill

Quote from: Vogtinator on April 27, 2016, 05:57:45 PM
Quote from: gameblabla on April 27, 2016, 05:20:54 PM
However, it seems that some bugs persist.
For example, when you die, a table appears just in front of you. (!)

Probably a side effect of removing the "#pragma pack(1)"...
I'll investigate

It was there with packing enabled as well. I thought it was a bed and he simply fell asleep from exhaustion xD

(Don't forget to update your SDK :P)

Well...

there are things like this in the source:

gamestate.weapon = (weapontype) -1;                     // take away weapon


Now gamestate.weapon is of enum type weapontype which does not specify -1 as a valid enum. GCC being pedantic as always probably uses this as an excuse to let checks like gamestate.weapon != -1 being true. For the specific case that something wrong is drawn there is this:

    if (gamestate.weapon != -1)
    {
        shapenum = weaponscale[gamestate.weapon]+gamestate.weaponframe;
        SimpleScaleShape(viewwidth/2,shapenum,viewheight+1);
    }


If the if() gets optimized to true always shapenum is something read at weaponscale[ -1 ] plus whatever.

gameblabla, see if changing the lines around 830 in wl_def.h to the following helps:

#define NUMWEAPONS      4
typedef enum
{
    wp_none = -1,
    wp_knife = 0,
    wp_pistol = 1,
    wp_machinegun = 2,
    wp_chaingun = 3
} weapontype;


The correct way would be to always use the enum names and never a numeric value.

gameblabla

Just how rwill you can spot issues like this ?
I didn't even know GCC's optimisation was that aggressive !

It works properly now so congrats rwill.
  • Calculators owned: None (used to own an Nspire and TI-89)

Vogtinator

Quote from: gameblabla on April 28, 2016, 07:01:46 PM
Just how rwill you can spot issues like this ?
Turn on all GCC warnings (-Wall -Wextra as a minimum, there are even more) and use one (or more than one) static analyzer.

QuoteI didn't even know GCC's optimisation was that aggressive !
You should read https://lwn.net/Articles/342330
  • Calculators owned: TI-Nspie CX CAS, Casio FX-85ES

Dream of Omnimaga

This is this kind of collaboration that helps projects grow and improve. Good job guys :3=
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gameblabla

Quote from: Vogtinator on April 28, 2016, 07:08:24 PM
Turn on all GCC warnings (-Wall -Wextra as a minimum, there are even more) and use one (or more than one) static analyzer.
There was so much warnings, i did not even bothered to enable the switches. :P

QuoteThis is this kind of collaboration that helps projects grow and improve. Good job guys :3=
Yeah, but one could argue that rwill in fact, ported the game rather than me because without his help,
it just wouldn't work on Nspire.

That's a lots of strange issues i would have probably never thought of.
  • Calculators owned: None (used to own an Nspire and TI-89)

Dream of Omnimaga

You still took the initiative to start the porting, though. :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

rwill

Quote from: gameblabla on April 28, 2016, 07:01:46 PM
Just how rwill you can spot issues like this ?
I didn't even know GCC's optimisation was that aggressive !

It works properly now so congrats rwill.

Well I checked what happens in the player death function Died()
and could not spot where it spawns a table. I saw the assignment
of -1 to gamestate.weapon in there though and remembered that
GCC is sometimes doing questionable things when optimizing
as -1 was missing in the weapontype enum. Seeing that
gamestate.weapon was used as an index into an array that
determines what gets drawn as the active weapon then kind
of solved the issue already.

Sometimes you can try to build without optimizations to see if the
problem goes away. If it does it is most likely a
programmer <-> compiler issue. Debugging by inserting printf()s
at certain places in the code can help too, especially when running
without debugging symbols at a high optimization level.

I do not use high warning levels and/or static analyzers - they
give a false sense of security. For example even with trying I cannot
get gcc to spit out a warning at the lines in question in the wolf code
so....


Lionel Debroux

QuoteI do not use high warning levels and/or static analyzers - they give a false sense of security.
I feel that not using them and hiding important warnings gives a worse false sense of security, though :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

rwill

Quote from: Lionel Debroux on April 30, 2016, 08:23:44 AM
QuoteI do not use high warning levels and/or static analyzers - they give a false sense of security.
I feel that not using them and hiding important warnings gives a worse false sense of security, though :)

Well at least I know that there isn't an automatic tool holding my hand when writing code.

Dream of Omnimaga

There are certain people, such as TI and HP calc OS dev teams that should use tools with warnings enabled. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Dream of Omnimaga

So for those who finished the shareware version of Wolfeinstein 3D on their Nspire, Critor has made available Spears of Destiny demo (a prequel to Wolfeinstein 3D): https://tiplanet.org/forum/archives_voir.php?id=521451

It requires installing Wolfeinstein 3D. Source of the info: https://tiplanet.org/forum/viewtopic.php?f=43&t=18356

  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

gameblabla

Hi, i have ported a Wolf3D modification by M2 Software !
It's called Witching Hour and it's a horror game.



You can download it on Tiplanet.

Website of the author :
http://87.207.49.73/index.php?siteID=WH
  • Calculators owned: None (used to own an Nspire and TI-89)

Dream of Omnimaga

Wow, they sure wanted the game to be dark. O.O Nice to see this ported gameblabla
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal