wordpress 2.3 HTML entity bug

There is/was a rather annoying bug in wordpress 2.3. Normally when editing pages in the advanced editor, the actual text of the post/page has to be preprocessed to convert things like × to × so that it wouldn't show up in the editor as ×, and ditto for angle brackets. The extra ampersands and brackets would then be removed before saving. However, in the 2.3 upgrade a few things in the core structure of post/page retrieval had been changed and the somehow the the page-retrieval didn't do the pre-processing anymore. The upshot was that the amps and brackets got converted to normal ascii and unicode, seriouslycompletely messing up your pages.

I managed to track the problem to get_post() and get_page() in wp-includes/post.php. get_post() did get the upgrade, but get_page() didn't. The latter needs to be updated to carry and use a third parameter, and call sanitize_post() like get_post() does.

Of course, right after doing this I found out that a fix was already present in the SVN. Just update the file with this one. Ain't that always the way.


To see if you are affected as well, make a new page and input the following:

× > entities

Then hit `Save and Continue Editing'. If the text has changed to “× > entities”, you're in trouble: every page you edit in that state will have its entities converted. Get the fixed file as soon as possible.

new tonclib

I've been making a lot of changes to tonclib – mostly adding, but also some removals. The most important changes are:

  • A more unified interface for the base drawing routines. Whereas I used to have something like bm8_foo(...), I now have bmp8_foo(..., void *dstBase, u32 dstPitch) for everything. Although the extra parameters make the routines a little slower, it makes it easier to switch video-modes.
  • A few color routines like blending/fading, convert to rgbscale (like grayscale, but for any color vector) and a few color adjustments.
  • I'm trying to include (well, annex, really) some of libgba's functionality. In terms of shared functionality, the libgba names can be used by including tonc_libgba.h. This is definitely not a finished item yet.
  • Tonc's Text Engine. I already had some basic routines for text on different video types, but this is a good deal better. Instead of having separate foo_puts() routines, TTE uses function pointers for placing glyphs on screen. This means there can be a single interface for all modes, and customizable writers. Already provides are glyph renderers for 8/16bit bitmaps and 4bit tiles, using a 1bpp bitpacked font. In principle, the renderers can handle any sized fixed and variable-width fonts (within reason: 128x128 fonts would be impractical, for example). There are also hooks for the stdio functions (printf, yay!) and some simple commands for positioning, color and font changes. Example of use:
    // Set-up 4bpp tile rendering bg 0 using cbb=0 and sbb=31.
    // The default options set implicitly here are: verdana 9 font, yellow for 
    // text color
    tte_init_chr4_dflt(0, BG_CBB(0)|BG_SBB(31));
    // Init stdio hooks
    tte_init_con();
    // Print something at position (10,10)
    iprintf("\\{P:10,10}'Ello world!, %d", 1337);
    
    Aside from the initializer, using TTE is basically independent of what you're writing with or on. Of course, all this stuff does have a fair amount of per-character overhead (about 150 cycles, I believe). It shouldn't be too hard to port TTE to NDS; I am planning to do this at some point.

There are more smaller changes here and there, but those are of lesser consequence.


tonclib 1.3 linky.

grit mini-fix

Small fix for grit. The function that handles the extensions didn't add the extension-period as it should if no extension was given in the -o option. ‘-ofoo’ would result in things like foos and foosh.

This is a one-line fix, by the way. In /libgrit/pathfun.cpp, function path_repl_ext(), replace this:

    if(pext)
        strcpy(pext, ext);			
    else
        strcat(str, ext);
by this
    if(pext)
        strcpy(pext, ext);			
    else
    {
        strcat(str, ".");
        strcat(str, ext);
    }

This is not really a critical update. As long as there's an extension-period inside the -o option, or if there was no -o to start with, it should work fine as is.

grit mini-fix

The quantizer for true-color to paletted wasn't properly prepared for the BGR order that big-endian systems use. This has been fixed. As this has no effect on little-endian systems (such as the binaries that you can find here), only the source archive has been updated.

grit and usenti updates

Git is now fully at 0.7. Or, rather, grit is at 0.7. As mentioned before, a name-change was in order and this has now taken place.

Other than that, there is little difference. Dovoto pointed to a bug in the tileset directory code which made me finally deal with the way directories were being handled. Unless told otherwise, the output goes into the current working directory. This is how it should be anyway. Non-binary changes are: updated documentation (for grit itself too) and a modified Makefile because it was out of date with the code itself (thanks Richard).

What's not been added are palette reduction and a more general tileset reducer. I have functions that can do these things (inside cldib), but applying them in the grit code base is … icky. There are so many potential problems with options here that I prefer to wait and add them later. Or maybe make separate tools for them.


I've also added the new Wingrit exporter to Usenti, which is now at v1.7.7.

git/grit 0.7β

Guess this'll be it then. Like the last Tonc, this is beta, which is my way of saying “lots of nice, new stuff, but might not be completely ready yet”.

So what's new? Well ...

  • The transparency options (-pT, -gT) should be sorted out now. I've tried to make them work intelligently when the options and bitdepths don't really match well.
  • It's now also possible to convert multiple bitmaps in one single call of git. Be careful which options you use here, though, as they're still pretty much considered separate runs internally. For instance specifying the output file and not using -fa would overwrite the file. Obvious, yes, but still something to be aware of.
  • Also added are logging functions (option -Wnumber). If you see your files converted incorrectly, try using -W3 and see what comes up.
  • And finally, something pretty cool: the use of an external tileset. With the -fx option, you can use an external bitmap containing an already reduced tileset. This is useful if you want to guarantee the order of the tiles. New tiles will be added and saved to this bitmap as well, so you could run it over multiple bitmaps and build up a shared tileset. It's still a little experimental, but seems to work well enough. For now, stick to 8bpp BMP or PNG (preferably pre-tiled or start with an empty bitmap). I hope to add meta-tiling options later.

Wingit has also been updated a little: transparency options are now included in the GUI, as it the external tileset option. However, the documentation hasn't been updated for these yet. That's one of the todo items.


The git downloads can be found here. Once again, this is still beta. On the outside it looks alright, but internally it's still a bit of a mess now. It's also quite possible that there are still some lose pointers dangling about; if you see it crash, please tell me.


It's been brought to my attention that the name ‘git’ was already taken by that pinko, commie tree-huggering bunch from Linux. So, a name change is in order. Shame; I really liked the name.

Anyway, unless someone can give me a nice and descriptive acronym (sorry, Dave, but ‘dmit’, as much as I like it, fails on the second criterion), the new name be ‘grit’.


And now for something moderately different: I've added the readme's of most projects to the projects page. This should be especially useful for git, as the distribution that comes with devkitPro leaves it out >_>.

←↓↑→

Now, I had planned to release new versions of usenti and git this weekend, with proper NDS-alpha and external tileset support. I was pretty well on schedule too. At least, up until last Tuesday. Around 23h, I decided to play a little StepMania (on keyboard, mind you; trying on a mat would probably count as a bad idea for me) as a temporary diversion. It went alright, so I did another run. And another. Next thing I know, it's 7am. Things got a little blurry after than >_>.

In any case, this has caused a slight delay. Most of the work is complete right now, actually, but there's still a few things I have to think about before releasing them and before I make the final decision, I have to stop seeing large numbers of arrows scrolling up on the inside of my eyelids. Sorry, but that's just the way it is.

On the bright side, I can finally clear some of the hard ones now ^_^.

More tonc 1.3β

Dammit, just missed releasing this before the end of the day. Oh well. Anyway, I'm releasing tonc 1.3β officially now. Yes, it's still a beta, but I think I've got rid of all of the loose ends now. Or at least most of them

The changes with the last beta version are relatively few. The text remains mostly the same, except for regbg.htm and asm.htm. It's in the code where you'll find the most changes. I've removed the leading underscores from the zero-#defines (and there was much rejoicing), updated some graphics and ‘finished’ the bigmap demo. Also, tonclib is now fully doxygenated. Manual in CHM inside. The Doxygen configuration file is included, so if the CHM doesn't work for you, you can always generate the documentation yourself.

tonc 1.3β

I'm close to another tonc release. It's not quite ready, but here are a few Work-in-Progress versions.

Many things have changed. Tonclib has gone through a rigorous overhaul, the demo hierarchy has been altered, with new and better makefiles. Most demos have been altered (mostly just using text), the ‘basic’ demos are now completely self-contained, and I've added a couple of new ones as well. Take particular note of the updated DMA and mode7_ex demos, and the new bigmap demo.

The text has undergone a few changes as well. Much of the set-up chapter has been moved to the back, and reg-tables have been prettified. The mode7-2 chapter has been enhanced and (drumroll) there's now an assembly chapter! A big assembly chapter. The numbering system now has chapter numbers, and each section, equation, etc, is now prefixed with it.

You might have noticed that there's now a PDF file as well. I've merged all the chapters with some perl-fu, and printed to PDF with cutePDF. The solution is not optimal yet (some bad page breaks here and there), but the result looks very nice indeed. If anyone's interested in helping me get rid of the page-break problem, I have 1.4MB html file if anyone's interested playing with that. I'll probably release the scripts I used for various items as well someday.


In other news, git 0.6 didn't quite do the NDS transparency bit correctly. In fact, it completely did it wrong. I'd release the fix soon, if it weren't for the fact that it will probably be released as part of the new devkitPro before that.


Usenti 1.7.6

Apparently usenti v1.7.5 had a nasty bug that messed up 24bpp saving. The bug was actually in cldib, so I updated the git source too (not that anyone'd notice though). While I was at it, I changed a few other items as well.

Usenti v1.7.6 changes

  • Fixed 24bpp save
  • Added quick-copy option (Alt+C)
  • Better scaling for color components
  • Manual is callable from the app (F1)

Hmm, I never listed the v1.7.5 changed did I?

  • Fully-variable zoom
  • Snap to tile option for editing
  • NDS alphabit support for 16bpp export. The color in palette-index 0 will have bit 15 set.