Skip to main content

News

Topic: neoSphere 5.9.2 (Read 522476 times) previous topic - next topic

0 Members and 14 Guests are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.2
Reply #1320

I've never heard of that, but I always did wonder why there isn't an exponent operator.


It's brand new in the latest version of the JavaScript standard (ECMA 7), and yes, it's quite useful especially for games where you do a lot of squaring.

C and C++ don't have an exponent operator either, which always annoyed me having come from a QuickBasic/VB background initially.  For a while I wondered why x ^ 2 in C wasn't giving me the expected results... :P
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.2.2
Reply #1321
I had always expected it would be ^^. But I guess this means I can still dream of a day where ^^ will mean logical-xor.

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: minisphere 4.2.2
Reply #1322
I guess JS-ers were expected to use Math.pow all the time?

Also, is anyone here familiar with creating a port/pkg on FreeBSD? Once I get minisphere compiled properly on it I'd like to see how far we can take that, though admittedly we'd probably have to nudge Allegro into updating their BSD port to 5.2.x to cover our bases.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.2
Reply #1323

I guess JS-ers were expected to use Math.pow all the time?


Yeah, which is annoying because it makes code more difficult to read, as well as require up to two unnecessary property reads (Math -> Math.pow) plus a JS function call.  It's difficult to optimize, especially for interpreted engines, since the bytecode compiler has to know ahead of time that `Math.pow` hasn't been reassigned.  With a proper operator the compiler can easily see an expression like 2 ** 16 and do constant folding on it.

C also has the same issue with pow(), but it's not as big a deal there because pow(base, exp) adds less visual noise compared to Math.pow(base, exp).
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.2.2
Reply #1324

Also, is anyone here familiar with creating a port/pkg on FreeBSD? Once I get minisphere compiled properly on it I'd like to see how far we can take that, though admittedly we'd probably have to nudge Allegro into updating their BSD port to 5.2.x to cover our bases.


I'm pretty sure the normal way to do it is to create an entry in the ports tree and use the infrastructure there to create the package.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.3
Reply #1325
minisphere 4.2.3 is available now.  It adds the new JS exponentiation operator and improves the Encoding API to more closely match the WHATWG encoding standard.  Specifically, TextEncoder now outputs pure UTF-8 always, rather than copying the string byte-for-byte from Duktape; and TextDecoder now supports the "fatal" and "ignoreBOM" flags.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1326
Oops!  I stumbled on a nasty regression in 4.2.3 related to text validation that could cause Unicode text to become corrupted internally, leading to subtle bugs.  While I was at it I improved the TextDecoder implementation - it now supports streaming.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1327
I just implemented a new DataReader object to replace the methods removed from FileStream in v4.2:
https://github.com/fatcerberus/minisphere/blob/master/docs/miniRT-api.txt#L514-L615

Not sure if we also need a DataWriter - it seems that going forward JSON is a better choice for an output format.

edit: Ended up implementing a DataWriter class after all.  Even if it's not used for writing binary files, it can still be useful to send data over a socket.
  • Last Edit: October 08, 2016, 01:30:46 am by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.2.4
Reply #1328
Does minisphere not use ~/minisphere//games for the games directory in Linux any more? I have ~/minisphere/games/ as a symlink to ~/Dropbox/Programming/Sphere/games, and the default startup game says there aren't any games.

Also, until further notice I'm replacing the AUR package's allegro dependency with allegro5-git. For whatever reason, the AUR package can play tracker files. It may or may not just be an issue with my setup, but I don't know what else to do, considering it conflicts with the official allegro package.
  • Last Edit: October 13, 2016, 03:23:53 pm by Eggbert

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1329
~/minisphere/games should still be correct.  No idea what's wrong there.

Re: Allegro, that was actually answered on your Github issue.  The official package doesn't include DUMB because for some reason the DUMB maintainer has it dependent on Allegro 4.  So there's a conflict there.  I guess the AUR package doesn't have that issue because it can use unofficial versions of dependencies.
  • Last Edit: October 13, 2016, 10:06:29 pm by Lord English
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.2.4
Reply #1330
Oh, I didn't notice those last two replies

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1331
@Eggbert:
Checked into your game directory issue.  Search paths are here:
https://github.com/fatcerberus/minisphere/blob/master/src/engine/vanilla.c#L1045-L1046

homepath() points here:
https://github.com/fatcerberus/minisphere/blob/master/src/engine/utility.c#L31

The correct path on Ubuntu is therefore ~/Documents/minisphere/games.  I'm not sure where ALLEGRO_USER_DOCUMENTS_PATH points on Arch, you'd have to look into that.
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.2.4
Reply #1332
Alright, I fixed it, I just thought it was kind of weird, since I could have sworn it was ~/minisphere before. I moved it to ~/Documents/minisphere and everything is fine now.

Also, I've been meaning to ask. From sphere2-api.txt
Quote

new Font(filename);

    Constructs a Font object from a font file.  Currently only the Sphere RFN
    font format is supported.


Do you have plans to support TTF fonts?
  • Last Edit: October 20, 2016, 10:27:12 pm by Eggbert

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1333

Also, I've been meaning to ask. From sphere2-api.txt
Quote

new Font(filename);

    Constructs a Font object from a font file.  Currently only the Sphere RFN
    font format is supported.


Do you have plans to support TTF fonts?


Yes, I just haven't thought of a good API design for it yet.  TrueType has fancy features that raster fonts don't have to worry about like kerning, etc.  TTF also means full support for Unicode, and minisphere isn't fully Unicode-aware yet, there's only enough internal Unicode support to deal with Duktape strings which are UTF-8 encoded and need to be converted to CP-1252 for compatibility with Sphere 1.x (that was quite fun to fix a while ago, as DaVince can attest to :P).
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • Sphere Developer
Re: minisphere 4.2.4
Reply #1334
I'm experimenting with using SpiderMonkey in minisphere instead of Duktape.  So far I built the latest SpiderMonkey source from Mercurial, and... well, not much else.  I'll first have write a C binding for SM before I can do anything with it because it now has a C++-only API and the entire minisphere codebase is C.  So that'll be time-consuming.  Let's see how this project goes. :)
neoSphere 5.9.2 - neoSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub