code logs -> 2007 -> Mon, 19 Feb 2007< code.20070218.log - code.20070220.log >
--- Log opened Mon Feb 19 00:00:30 2007
00:01
< Serah-Lost>
Or not, no rebooting now.
00:04 MyCatVerbs is now known as MyCatSleeps
00:57 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Sleep]
01:29 timelady [~romana@Nightstar-14612.lns7.adl2.internode.on.net] has quit [Connection reset by peer]
01:32 Thaqui [~Thaqui@Nightstar-26359.jetstream.xtra.co.nz] has joined #code
01:51 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has joined #Code
02:01 BlueTiger [BlueTiger@Nightstar-567.natsoe.res.rr.com] has quit [Quit: ]
02:50
<@ToxicFrog>
Hmm.
02:51
<@ToxicFrog>
For queue/stack like things, we have push (add to top), pop (remove from top), and pull (remove from bottom)
02:51
<@ToxicFrog>
What's add to bottom?
02:51
<@ToxicFrog>
I'm tempted to choose 'snap'~
02:51
<@ToxicFrog>
But it doesn't start with p.
03:03
< Vornicus>
I seem to recall askingthis question.
03:03
< Vornicus>
"place"?
03:38
<@ToxicFrog>
That works for now.
03:39
<@ToxicFrog>
Ok. I've spent most of this day slacking and watching FMA.
03:39
<@ToxicFrog>
Enough of that.
03:39 * ToxicFrog invokes IDA
03:39 * Vornicus wonders what TF is disassembling.
03:39
<@ToxicFrog>
Total Annihilation.
03:40
<@ToxicFrog>
I got the movies playing from the hard drive working a while ago.
03:40
<@ToxicFrog>
But that still leaves the music.
03:40
< Vornicus>
Aha
03:40
<@ToxicFrog>
I should be working on VWT, since there are Actual Projects blocked on that, but I can't shape my mind to it at the moment.
03:40
<@ToxicFrog>
Hmm. TA was written in C++.;
03:41 * ToxicFrog sees the DirectPlayCreate() calls
03:41
<@ToxicFrog>
Die, die
03:41
< Vornicus>
C++ appears to have been the language of choice for game programming for a decade now.
03:41
<@ToxicFrog>
Unsurprising.
03:42
<@ToxicFrog>
It is as fast as C, or nearly so, and adds plenty of useful stuff.
03:43
<@ToxicFrog>
Hmm. There's the stuff for playing sound effects, and there's the stuff for SMK playback...
03:43
< Vornicus>
...how can you tell all this?
03:43
<@ToxicFrog>
I look at the names of the imported functions.
03:43
<@ToxicFrog>
If something is calling SmackBufferOpen(), odds are it's part of the SMK movie playing code.
03:44 * ToxicFrog eyes this function name
03:44
<@ToxicFrog>
_JumpToContinuation
03:44
<@ToxicFrog>
C++ doesn't have continuations, what the hell
03:44
< Vornicus>
what is a continuation anyway?
03:44
<@ToxicFrog>
Umm.
03:45
<@ToxicFrog>
The best way I can describe it is a snapshot of program state, embodied (at least in LISP) as a function closure.
03:45
< Vornicus>
a...ha.
03:45
<@ToxicFrog>
Call it and execution resumes from the point where the continuation was created.
03:45
<@ToxicFrog>
This occurs even if you are no longer downStack from it.
03:46
<@ToxicFrog>
(whereas with longjmp, I believe that results in jumping into either an uninitialized stack frame or another function's stack frame, with hilariously tragic results)
03:47
< Vornicus>
weirdass.
03:47
< Vornicus>
I... have no idea what I'd ever use that for.
03:47
<@ToxicFrog>
Anyways. What I'm looking for here is a call to an imported function that looks like part of the CD playing code.
03:50
<@ToxicFrog>
...what the hell does REPNE SCASB do?
03:50
<@ToxicFrog>
I've never seen that opcode before.
03:51
<@ToxicFrog>
Aah. IDA says it's a string comparison.
03:51
<@ToxicFrog>
Hmm. What I need is a complete execution trace of this thing.
03:51
<@ToxicFrog>
strace would be acceptable if there were a windows native version.
03:52
<@ToxicFrog>
More specifically, what I need is the ability to frob the "play track" button and see what it calls.
03:53 * ToxicFrog gnargs
03:56
<@ToxicFrog>
We have things like CDStop and CDPlay, but they're strings, not functions
03:56
<@ToxicFrog>
And furthermore appear to be referenced nowhere in the program
03:57
<@ToxicFrog>
...
03:57
< Vornicus>
...?
03:57
<@ToxicFrog>
aDebugDatS_txt db 'debugdat\%s.txt',0
03:57
<@ToxicFrog>
TA has debugging facilities.
03:58
< Vornicus>
...runthem!
03:58
<@Reiver>
03:58
<@ToxicFrog>
I'm trying to find them right now
03:58
<@Reiver>
That is entirely awesome.
03:58
<@ToxicFrog>
I hope this isn't just some vestigal leftover that can't actually be invoked
04:00
<@ToxicFrog>
Helloooooo, argv parse code.
04:00
<@ToxicFrog>
-debughelper looks promising.
04:00
<@ToxicFrog>
...oh, you have got to be kidding me
04:01
<@ToxicFrog>
db "Couldn't find library 'debughelper.dll'\n"
04:01
<@ToxicFrog>
db "Couldn't find function 'DebugFunc1'\n"
04:02
<@ToxicFrog>
It uses an extra DLL for debugging.
04:02
<@ToxicFrog>
Which, unsurprisingly, did not ship with it.
04:02 * ToxicFrog crackles at it
04:03
< Vornicus>
Are you crackling with power?
04:03
<@ToxicFrog>
Yep.
04:03
<@ToxicFrog>
And listening to mojo-instilling music
04:05 * ToxicFrog eyes it
04:05
<@ToxicFrog>
The string "NO DISC" appears when you access the in-game music configurator without a music CD in.
04:06
<@ToxicFrog>
This string is referenced from only one place in the executable.
04:06
<@ToxicFrog>
Where, as far as I can tell, it isn't actually used for anything o.O
04:06
< Vornicus>
weirdass.
04:06
<@ToxicFrog>
Very.
04:06
< Vornicus>
What is your mojo-instilling music anyway?
04:07
<@ToxicFrog>
At the moment - MATERIALIZE from Mai-Otome; Tobira no Mukou E from FMA; Mezame and Kagutsuchi Kourin from Mai-HiME; Green Earth Theme from Advance Wars II.
04:09
<@ToxicFrog>
Hmm. I think I do see what this bit does, though.
04:09
<@ToxicFrog>
%esi = getTrackCount()
04:09
<@ToxicFrog>
if( %esi )
04:09
<@ToxicFrog>
{
04:09
<@ToxicFrog>
sprintf(buf, "%d", %esi);
04:09
<@ToxicFrog>
display(buf)
04:09
<@ToxicFrog>
} else {
04:09
<@ToxicFrog>
// wacky stuff I don't understand involving "NO DISC" goes here
04:09
<@ToxicFrog>
}
04:10
<@ToxicFrog>
Lightbulb!
04:10
<@ToxicFrog>
I think I see what these function calls using TRACKNUM are.
04:11
<@ToxicFrog>
They're something like setGUIElement(char * value, const char * elementname)
04:11
<@ToxicFrog>
Being called as setGUIElement(buf, "TRACKNUM")
04:11
<@ToxicFrog>
Or setGUIElement("NO DISC", "TRACKNUM"
04:12
<@ToxicFrog>
...except, fuck, none of them are the same function.
04:13
<@ToxicFrog>
This does not amuse me.
04:14
<@ToxicFrog>
It's almost enough to make me want to go into politics so that I can litigate that game developers are required to release the source code at some point before going out business.
04:16
<@Reiver>
I remember a tale, from the days of the cavedog forums.
04:17
<@Reiver>
That one of the lead coders, on the day of the Cavedog closures, had in his hand a ZIP disk of the TA and TAK source codes, that he'd worked on.
04:17
<@Reiver>
Apon being informed of the news, or some such thing, he Dramatically Tossed It On The Bosses Desk And Walked Out.
04:17
<@ToxicFrog>
Yes. I remember that story.
04:18
<@Reiver>
Modders ever since have cursed his name that he didn't skip the first bit~
04:18
<@ToxicFrog>
This is how I know that I can't burn shit with my mind.
04:18
<@Reiver>
...*snrrrrk*
04:35 ErikMesoy|sleep [~ejm@Nightstar-3192.bb.online.no] has quit [Operation timed out]
04:49
<@ToxicFrog>
That and the fact that TopWare Interactive still exists in a form other than a still-smouldering crater.
04:51
<@Reiver>
?
04:53 ErikMesoy [~ejm@Nightstar-3192.bb.online.no] has joined #code
04:53
<@ToxicFrog>
Reiver: about a year and a half ago, I had an email exchange that basically went like this:
04:54
<@ToxicFrog>
ME: Hey, Valkyrie! Any chance of releasing the Septerra Core source and editors?
04:54
<@ToxicFrog>
VALKYRIE: Great idea, but the publisher has it in a deathgrip. Good luck.
04:54
<@ToxicFrog>
ME: Hey, TopWare! etc etc
04:54
<@ToxicFrog>
TOPWARE: No.
04:54
<@ToxicFrog>
ME: Why not?
04:54
<@ToxicFrog>
TOPWARE: Fuck off.
04:54
<@Reiver>
Septerra Core?
04:55
<@ToxicFrog>
Isometric CRPG by Valkyrie Studios.
04:55
<@Reiver>
aha.
04:55
<@ToxicFrog>
Set on a world that consists of seven nested shells, each one with its own inhabitants and ecology.
04:55
<@Reiver>
...aha?
04:56
<@ToxicFrog>
The shells are free-floating continents, BTW, not spheres, so the day/night patterns from shell 2 inwards are determined by the rotation of the shells above as well as by the rotation of Septerra itself. It's fairly cool, if scientifically implausible.
04:56
<@ToxicFrog>
Great game.
04:56
<@ToxicFrog>
Every time I play, I want to do three things:
04:56
<@ToxicFrog>
- rip the overworld music for external listening
04:56
<@ToxicFrog>
- replace the battle music with something with a bit more mojo
04:57
<@ToxicFrog>
- redo much of the battle system and interface to streamline it while keeping the same mechanics
04:57
<@ToxicFrog>
And possibly 4, rewrite the entire rendering, sound and control subsystem to use SDL and subsequently port it to Linux.
04:58
<@ToxicFrog>
1 and 2 I have tried to do by reverse engineering the file formats, but the closest I've come is dumping the script for chapter 1 and most of the sound effects; some of the stuff is compressed and I can't figure out the compression algorithm.
04:58
<@ToxicFrog>
3 I cannot do without the source.
04:58
<@Reiver>
Yeah, fair enough.
04:59
<@ToxicFrog>
Oh. And there's also some typos I want to fix, but I can't get at that part of the string table yet~
04:59
<@ToxicFrog>
However.
05:00
<@ToxicFrog>
At the moment, the order of the day is Total Annihilation, music playing code thereof.
05:01
<@Reiver>
You seek the code for what purpose?
05:01 AnnoDomini [~farkoff@Nightstar-29521.neoplus.adsl.tpnet.pl] has joined #Code
05:01
<@ToxicFrog>
Aah, you have missed this?
05:01
<@ToxicFrog>
Total Annihilation is written to play music off the CD.
05:02
<@ToxicFrog>
This means, among other things, that sending it over the 'net means stripping the music, and that if you have multiple CD drives there's a (n-1)/n chance that it misdetects which one it should use and ends up playing nothing, or something entirely different.
05:02
<@ToxicFrog>
I am trying to get it to play them off the hard drive.
05:02
<@Reiver>
I... see.
05:02 * Reiver ponders.
05:03
<@ToxicFrog>
This means, err, ripping out all of the functions it uses to get disc and track information and actually play music and replace them with MP3 playing code or somesuch.
05:03 * Reiver wonders if you couldn't hack it into one of the .hpis, because it was entirely happy playing music out of those...
05:03
<@ToxicFrog>
Probably in a custom DLL, because adding those functions to the EXE would be a pain.
05:03
<@ToxicFrog>
...it was?
05:03
<@ToxicFrog>
How so?
05:03
<@Reiver>
hrm.
05:03
<@ToxicFrog>
I demand links!
05:03
<@Reiver>
...Well, sound effects. Not music per se, now I think about it.
05:03
<@ToxicFrog>
Yes. This is something entirely different.
05:03 * Reiver 's memory is foggy. It was a long time since he modded TA. >.>
05:04
<@Reiver>
(Damn but it was a good mod, though. Alas, too late in the day to get any real following.)
05:04
<@Reiver>
It contained a lot of Amusingly Ironic Tweaks.
05:04
<@ToxicFrog>
The music subsystem plays tracks off the CD, picking a set of tracks based on the current game state (battle, calm) and then randomly picking a specific track within them.
05:04
<@Reiver>
For example, making the little scout boats more powerful by removing their laser.
05:05
<@Reiver>
Not putting anything back in, I note. Just removing what was there. >.>
05:05
<@ToxicFrog>
What I'm after here is isolating the functions it calls to:
05:05
<@ToxicFrog>
- determine if there's a disc inserted (true if trackcount > 0, false otherwise)
05:05
<@ToxicFrog>
- determine track count (enumerate contents of ./music)
05:05
<@ToxicFrog>
- play a track (this will get very ugly)_
05:05 * Reiver nod.
05:12
<@ToxicFrog>
Why can't all arguments and return values just be put on the stack ;.;
05:18 * ToxicFrog kills both Intel, and an indeterminate subset of IBM's management, right in the goddamn face
05:19
< Vornicus>
goodness.
05:20
<@ToxicFrog>
If IBM's management hadn't been smoking some damn fine crack that day, we would be using stuff based on the MC68K by now, or perhaps the PPC >.<
05:20 * AnnoDomini would probably make a witty comment, but he has run out of time! Flee, flee, flee to Uni!
05:21 * Vornicus still needs to learn 68K and PPC assembly.
05:21
<@ToxicFrog>
68K is soooooo much nicer than 80x86.
05:21
<@ToxicFrog>
Admittedly, I could say this about lots of things, including the original text of the Necronomicon.
05:22
< Vornicus>
pff
05:22
<@ToxicFrog>
But it is pretty nice.
05:22
<@ToxicFrog>
And has memory-mapped IO.
05:22
<@ToxicFrog>
The PPC, although I haven't done any assembly programming for it, I understand is similar only more awesome.
05:23
<@ToxicFrog>
so much hate
05:23 * Vornicus wants to learn PPC mainly so he can do violence to SS1Mac
05:23
<@ToxicFrog>
Hee
05:23
<@ToxicFrog>
Why start small?
05:23
<@ToxicFrog>
What are you planning, a highres patch?
05:24
< Vornicus>
Highres patch, and possibly seeing how many routines I can get out of it.
05:24 * ToxicFrog nods
05:24
<@ToxicFrog>
A key rebinder would also be handy for some people.
05:24
<@ToxicFrog>
But I haven't been able to build one for the DOS version as yet.
05:25
<@ToxicFrog>
I would have thought it would be the *easy* part, but apparently not.
05:25
< Vornicus>
Since it's generally nicer than x86 I imagine it would be possible for someone with a decent amount of skill to extract, say, the original physics routines from it.
05:25
<@ToxicFrog>
...or the AI routines.
05:25
< Vornicus>
...indeeeed.
05:25
<@ToxicFrog>
Man, TSSHP would love that.
05:25 timelady [~romana@Nightstar-14612.lns7.adl2.internode.on.net] has joined #Code
05:26 * Reiver hands timelady some assembly.
05:26
< timelady>
mmm, crunchy
05:26
<@ToxicFrog>
The physics routines are probably more interesting in general, but the AI routines would be the big thing for creating a faithful reimplementation.
05:26
<@ToxicFrog>
As well as using to mock practically every pre-Havok FPS with~
05:26
< Vornicus>
Havok is what Far Cry uses, right?
05:26
< timelady>
did anyone see the recent xkcd?
05:27
< Vornicus>
TL: indeed.
05:27
<@ToxicFrog>
timelady: yep. I was amused.
05:27
< timelady>
i lold
05:27
<@ToxicFrog>
Vornicus: unsure. It is what HL2 uses, though.
05:27
<@ToxicFrog>
And several other games.
05:27
< timelady>
a lot
05:27
< timelady>
a lolacaust
05:27
< Vornicus>
Though if they want to do that to ESR they have to be careful - he's kinda a gun nut.
05:27
< timelady>
kindaa?????
05:27
< timelady>
the mans a total loon!
05:28
< Vornicus>
Yes.
05:28
< timelady>
also sadly racist:(\
05:28
<@Reiver>
...
05:28
<@ToxicFrog>
It is a source of constant vexation to me when a game does something Totally Awesome, and then the rest of the industry doesn't notice.
05:28
<@ToxicFrog>
cf ss1, TA, maaaaybe Marathon.
05:29
< Vornicus>
Marathon's terminal system was only really done over in, like, Doom 3.
05:30
<@Reiver>
terminal system?
05:30
<@Reiver>
And TA did things... Different.
05:30
< timelady>
did you see the lisp xkcd? that on ha dme in tears
05:30
< timelady>
larry wall must be so proud *sniiff*
05:30
<@Reiver>
We did, tl
05:30
<@Reiver>
'twas awesome. :)
05:31 * Vornicus has seen all of them.
05:31
< timelady>
im so easily pleased you see:)
05:31
<@Reiver>
timelady: Do you read the alt texts?
05:31
<@ToxicFrog>
Vornicus: yeah, but I'm not sure if this counts as "totally awesome" - it's primarily just another method of delivering plot.
05:31
< timelady>
just ask for a handful of geek whimsy online and im so happy
05:31
< timelady>
but perl still blows:)
05:31
< timelady>
notalways
05:31
< Vornicus>
...true.
05:31
<@Reiver>
They're like a second punchline. ;)
05:31
< Vornicus>
the 5d space is great though - Unreal Tournament could do that.
05:31
<@ToxicFrog>
Myst has journals, Marathon has terminals, Shock has audio logs, etc.
05:32
<@Reiver>
5d space?
05:32
<@ToxicFrog>
5d space was cool, and has been a feature in the Unreal engine since at least UT.
05:32
<@ToxicFrog>
Although the only game I've played that actually used it was Wheel of Time.
05:32
<@Reiver>
What is 5d space?
05:32
<@Reiver>
(And what is Wheel of Time?)
05:32
< Vornicus>
5d space: places overlap.
05:32
<@Reiver>
...and?
05:33
< Vornicus>
You can have two corridors on the same level that go /through/ each other.
05:33
<@ToxicFrog>
Reiver: Wheel of Time is an FPS based on the book series of the same name, using the Unreal engine.
05:33
<@Reiver>
...This is a special thing instead of a bug?
05:33
< Vornicus>
It is intentional.
05:33
<@Reiver>
So it lets you, uh
05:33
<@ToxicFrog>
Set several decades before the books, incidentally.
05:33
<@ToxicFrog>
Reiver: think: portals.
05:34
<@Reiver>
Create spaces that are impossible in the real world.
05:34
<@Reiver>
...portals.
05:34
<@Reiver>
hm.
05:34
< Vornicus>
Yes.
05:34
<@ToxicFrog>
Or n-dimensional mazes, consisting of many rooms packed into the same space.
05:34
<@Reiver>
Surely you could just use a Teleport() code or something?
05:34
<@ToxicFrog>
But you can't see through a teleporter.
05:34
<@ToxicFrog>
(and indeed, Marathon uses teleporters heavily_)
05:34
<@Reiver>
...I... guess ...
05:34
< Vornicus>
If I had a decent editor, I would show you what it can do.
05:34
<@Reiver>
I need a copy of UT and Wheel of Time, now~
05:34
< Vornicus>
...sorta.
05:35
<@ToxicFrog>
I don't know if UT ever actually used that capability.
05:35
< Vornicus>
UT had at least one level - The Mirror - that used it.
05:35
<@ToxicFrog>
Reiver: in Wheel of Time, it's only used in a few places, and only for portals - the guardian mirror in the White Tower Basement level and the waygates in the subsequent levels.
05:35
<@ToxicFrog>
Marathon uses it rather more heavily.
05:35
<@Reiver>
Aww.
05:35
< timelady>
wheel of time? not that robert jordan ohmigodthislastsforever series?
05:36
<@ToxicFrog>
timelady: the same.
05:36
<@Reiver>
So it's just an Interesting Teleporter, instead of a core feature. Pity.
05:36
<@ToxicFrog>
The game is actually quite fun.
05:36
< timelady>
gods
05:36
< timelady>
i tried to forget it after book 7
05:36
< timelady>
theres a game?????
05:36
< Vornicus>
the most common use is portals.
05:36
<@ToxicFrog>
Reiver: well, Wheel of Time they wanted to stick to euclidean geometry~
05:36
<@ToxicFrog>
And the most common use is, as Vorn says, portals. Because it makes for really awesome portals you can see and shoot through (as can the AI).
05:36
<@ToxicFrog>
Unlike, say, Half-Lifeian teleporters.
05:37
<@ToxicFrog>
timelady: I made it to book 9 before bailing.
05:37
<@ToxicFrog>
But, yes, there's a game. And it takes many liberties with canon. But it's a lot of fun.
05:37
<@ToxicFrog>
It also has the best deathmatch map ever, Balefire Arena~
05:38
<@Reiver>
Half-Lifeian teleporters were just spawn points weren't they?
05:38
< timelady>
congrats ToxicFrog - or commiserations
05:38
< timelady>
canon shmanon. it only matters in dr who:)
05:38
<@ToxicFrog>
Reiver: nooo.
05:38
< Vornicus>
Bob-B-Q!
05:38
<@ToxicFrog>
I mean, it depends. The things that cause headcrabs to pop out at you, yes.
05:38
<@ToxicFrog>
The things that you step into and there's a green flash and it takes you somewhere else, no.
05:38
< Vornicus>
The things in the Lambda Complex are teleporters.
05:39
<@Reiver>
I thought that was just a level cutscene.
05:39
<@ToxicFrog>
That's an env_trigger, I think, connected to a scripted_sequence which calls an env_teleport and a bunch of other stuff.
05:39
<@Reiver>
And/or a Teleport() kinda thingy.
05:39
<@ToxicFrog>
Yes. It is.
05:39
<@ToxicFrog>
Which is my point.
05:39
<@ToxicFrog>
In Quake-based games such as HL, if you want some kind of portal or teleporter, you have to make a widget that moves the player from point A to point B.
05:40
<@ToxicFrog>
In Marathon, or other games that support 5d space, you can directly connect those areas.
05:40
<@ToxicFrog>
If you have played Prey or watched the Portal trailer, you know what I mean by that.
05:40
< Vornicus>
Quake 3 had see-through teleporters. I don't know if you could shoot through them though.
05:40 * timelady just hasnt played enough games to know the code mentality
05:41
<@ToxicFrog>
But, again, I'm not sure if 5d space counts as Totally Awesome, especially since *apart* from portals there are few places you can use it that won't break versimilitude.
05:42
< Vornicus>
HL actually has a few areas that are sorta 5d.
05:42
<@Reiver>
?
05:42
< Vornicus>
Different maps accidentally overlap each other.
05:42
<@ToxicFrog>
Doesn't count~
05:43
< Vornicus>
Yeah
05:44
< Vornicus>
but it's exploited in speedruns - stuff you don't collect, you can collect later because it's 'moved' from one map to the other.
05:48
<@ToxicFrog>
What I'm mostly thinking of is gameplay and interface elements.
05:48
<@Reiver>
...OK den...
05:48
<@ToxicFrog>
SS1's physics; TA's, well, TA's entire interface, but especially the hotkeys and the unit AI controls.
05:49
<@ToxicFrog>
(note that I'm including in physics the ability to pick up and throw/drop arbitrary items)
05:49 * Vornicus throws a skull at a medbot.
05:49
<@ToxicFrog>
Pity you couldn't throw things hard enough to inflict damage.
05:49
<@ToxicFrog>
They kind of over-fixed that in Thief~
05:50
< Vornicus>
oops~
05:50 * Vornicus still needs to play Thief.
05:50
<@ToxicFrog>
(a Hammerite hammer, if picked up and thrown while running towards the target, will basically instantly kill anything except a Haunt or a locked door, which require two hits each)
05:50
<@ToxicFrog>
(I consider this an exploit and don't use it)
05:51
<@ToxicFrog>
And yes, you very much do.
05:51
<@ToxicFrog>
It's an excellent game.
05:51
<@ToxicFrog>
Go torrent a copy of Thief Gold.
05:51 * Vornicus can't play it ;_;
05:51
<@ToxicFrog>
...oh, right.
05:51
<@ToxicFrog>
Bum.
05:54
<@ToxicFrog>
Argh. Somewhere, there has to be a function it calls to get sound from the CD to the DSP.
05:54
< Vornicus>
ARGHICCUPS
05:54 * ToxicFrog flips Vorn over and shakes him
05:55
< Vornicus>
ow
05:58 * Vornicus breaks out ResEdit.
05:58
< Vornicus>
Such a nice tool.
05:58 * ToxicFrog plunges into the murky depths of MSDN to find documentation for PlaySoundA()
06:00
<@ToxicFrog>
Ok, MSDN is useless.
06:00
< Vornicus>
...code is actually in the data fork.
06:01
<@ToxicFrog>
...
06:01
< Vornicus>
...now there's a magic word. "Joy!"
06:01
<@ToxicFrog>
Is this not normal?
06:01
< Vornicus>
On Classic Mac, many files - in particular applications - have a data fork and a resource fork.
06:02
< Vornicus>
68K applications have the code in a section of the resource fork; PPC has it in the data fork.
06:02
< Vornicus>
I always forget which is which.
06:02 timelady [~romana@Nightstar-14612.lns7.adl2.internode.on.net] has quit [Quit: run away! run away!]
06:02
< Vornicus>
It's really too bad - ResEdit has a disassembler in it.
06:02
<@ToxicFrog>
...
06:02
<@ToxicFrog>
There is no god.
06:03
< Vornicus>
?
06:03
<@ToxicFrog>
PlaySoundA is used thusly:
06:03
<@ToxicFrog>
PlaySoundA(const char * filename, handleType * handle, unsigned long flags)
06:03
< Vornicus>
okay, and?
06:04
<@ToxicFrog>
It is declared, at least according to this, as taking three longs.
06:04
<@ToxicFrog>
And then you cast.
06:04
< Vornicus>
06:04
< Vornicus>
:(
06:05
<@ToxicFrog>
Also, I think I have to study SDL's windows-based CD playing code ;.;
06:05
<@ToxicFrog>
According to the internets, there is no way to directly play CDs in DirectX like there is in SDL.
06:05
<@ToxicFrog>
You get the CDDA data some other way and then pass it to DirectSound.l
06:06
<@ToxicFrog>
I hope I'm wrong about that.
06:06 * Vornicus eyes, needs a thing that describes Mac PPC application header data.
06:09 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code
06:09
< Vornicus>
...IDA has a Mac PPC disassembler
06:10
<@ToxicFrog>
This does not surprise me.
06:10
<@ToxicFrog>
IDA is pretty kickass.
06:10
<@ToxicFrog>
Even if its debugging facilities are but a pale shadow of GDBs.
06:19 Forj [~Forj@Nightstar-869.bitstream.orcon.net.nz] has joined #code
06:20 * ToxicFrog glares
06:20
<@ToxicFrog>
I need some way to integrate IDA with GDB.
06:22
<@ToxicFrog>
A code editor built into IDA would also be nice ??
06:23
< Vornicus>
Forjotron!
06:24
< Forj>
VORN
06:24
< Forj>
the "package" has been "delivered"
06:24
< Vornicus>
Let's try this again without pretending we're spies, shall we?
06:25
< Forj>
awww, but it's fun
06:25
< Forj>
thesis is at the binders
06:25
< Vornicus>
Wootence
06:25
< Forj>
I have a happy wife
06:25
< Forj>
although, to be fair, she's too tired and feeling shitty for the happy to get through
06:25
< Vornicus>
awh.
06:26
< Vornicus>
In any case, TF does it better.
06:27
< Forj>
yeah, but he's actually trying to make it sound cool
06:27
< Forj>
I was going for the lame end of the scale
06:27 Forj is now known as ForjAFK
06:28
< ForjAFK>
gotta go pamper my wife :)
06:29 * ToxicFrog relays stoatburger, hugs to Chalcy
06:32
<@ToxicFrog>
Hmm.
06:33 * ToxicFrog determines the memory location being used to store the count of CD tracks, slaps a RW watch on it
06:35
<@ToxicFrog>
Ok, there are three places where it's written.
06:35
<@ToxicFrog>
So far.
06:37
<@ToxicFrog>
At some point I will need to actually work out what CD drive it's trying to read from and put the actual CD in there.
06:38
<@Reiver>
pft
06:39
<@ToxicFrog>
Aha.
06:39
<@ToxicFrog>
It's looking at the DVD drive.
06:40
<@ToxicFrog>
Aaha.
06:40
<@ToxicFrog>
This isn't the total track count, it's the current track number.
06:40 * Vornicus thinks TF is figuring it out.
06:40
<@ToxicFrog>
It's 0 if no disc is inserted, and nonzero otherwise.
06:40
< ErikMesoy>
One day I need to figure out how to make bold text in gaim.
06:40
<@ToxicFrog>
^B?
06:41
< ErikMesoy>
Apparently not.
06:41
<@ToxicFrog>
That works in its MSN mode...
06:41
<@ToxicFrog>
And in xchat, obviously.
06:41
< ErikMesoy>
It works everywhere else.
06:42
<@ToxicFrog>
The raw character, if it helps, is 0x02
06:43 * ErikMesoy makes his morning rounds of checking mail and webcomics
06:44
<@ToxicFrog>
Vornicus: no, I'm not >.<
06:45
<@ToxicFrog>
Goddammit, I need an actual execution trace
06:45
<@ToxicFrog>
Something that shows me which instructions are being executed, which branch paths are being followed
06:47
<@ToxicFrog>
Oh, hey.
06:47
<@ToxicFrog>
There it is.
06:48
<@ToxicFrog>
Wow, this really slows it down.
06:48
<@ToxicFrog>
...to the extent of causing TA to report a "software breakpoint exception"
06:49
< Vornicus>
heh
06:49
<@ToxicFrog>
Ok, I need some way to tell it not to trace into ntdll.dll
06:49
<@ToxicFrog>
Because that accounts for tens of thousands of lines of trace information, none of which is helpful
06:58 gnolam is now known as Mechagnolam
06:59
<@ToxicFrog>
Argh
07:00
<@ToxicFrog>
This is making me wish for the clarity of the SS1 code
07:00
<@ToxicFrog>
Which is a bad, bad sign
07:00
< Vornicus>
...ouch.
07:01
<@ToxicFrog>
Ok, let's put a trace on PlaySoundA
07:01
<@ToxicFrog>
It's got to pass the data from the CD to the DSP at some point, right?
07:01
<@ToxicFrog>
And then I can work backwards from there.
07:02
< Vornicus>
CD music usually gets piped directly from the CD drive to the sound card.
07:02
<@ToxicFrog>
...fuck, you're right.
07:03
<@ToxicFrog>
But somewhere there is a system call that tells it which track to play!
07:03
< Vornicus>
Indeed.
07:03
<@ToxicFrog>
I'm going to have to look at the SDL code after all, aren't I?
07:07
<@ToxicFrog>
[ben@leela ~]$ curl http://www.libsdl.org/release/SDL-1.2.11.tar.gz | tar xzv
07:07
<@ToxicFrog>
I never get tired of doing that.
07:07
< Vornicus>
heheh
07:08 ForjAFK [~Forj@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: Gone]
07:09
<@ToxicFrog>
It uses mciSendCommand()
07:10
<@ToxicFrog>
TA uses mciSendStringA(), which it looks like uses a different API to serve the same purpose.
07:10
<@ToxicFrog>
I move ever closer to my goal.
07:10 * ToxicFrog grins
07:10
<@ToxicFrog>
push 0
07:10
<@ToxicFrog>
push 0
07:11
<@ToxicFrog>
push 0
07:11
<@ToxicFrog>
push offset strCommand ; "stop cdaudio"
07:11
< Vornicus>
...madness
07:11
<@ToxicFrog>
move edi,eax
07:11
<@ToxicFrog>
call esi ; mciSendStringA()
07:11
< Vornicus>
That's a CD audio command.
07:11
<@ToxicFrog>
Yep.
07:14
<@ToxicFrog>
.text:004CDA2F mov esi, ds:mciSendStringA
07:14
<@ToxicFrog>
.text:004CDA35 push ebx ; hwndCallback
07:14
<@ToxicFrog>
.text:004CDA36 lea eax, [esp+54h+strReturnString] ; Load Effective Address
07:14
<@ToxicFrog>
.text:004CDA3A push 20h ; uReturnLength
07:14
<@ToxicFrog>
.text:004CDA3C push eax ; lpstrReturnString
07:14
<@ToxicFrog>
.text:004CDA3D push offset aStatusCdaudioN ; "status cdaudio number of tracks"
07:14
<@ToxicFrog>
.text:004CDA42 call esi ; mciSendStringA ; Indirect Call Near Procedure
07:14
<@ToxicFrog>
.text:004CDA44 cmp eax, ebx ; Compare Two Operands
07:14
<@ToxicFrog>
.text:004CDA46 jnz loc_4CDB2A ; Jump if Not Zero (ZF=0)
07:14
< Vornicus>
AAAAAA
07:16
<@Reiver>
...
07:17
<@Reiver>
So basically you're sifting through a stack, like it's The Worst Source Code Ever?
07:17
<@ToxicFrog>
No, this isn't a stack.
07:17
<@ToxicFrog>
This is code.
07:17
<@ToxicFrog>
I do believe I have found the functions for getting CD drive information and for playing a track.
07:17
<@Reiver>
...Assembly?
07:17
<@ToxicFrog>
There's plenty of room in this function to load a DLL!
07:18
<@ToxicFrog>
Yep.
07:18
<@Reiver>
...How?
07:18 * Reiver doesn't get how there is plenty of room in that function.
07:18
<@ToxicFrog>
Oh, I just rip out the current code and replace it with some string literals and calls to LoadLibraryEx() and GetProcAddress()
07:18
< Vornicus>
I means "I can erase the code and put in DLL loading code instead"
07:18
<@ToxicFrog>
Yes, what Vorn said.
07:19
<@Reiver>
The 'amount of room' is significant?
07:19
<@ToxicFrog>
The idea being here that it: checks a flag; loads the DLL and sets the flag if it wasn't already loaded; and then passes the requested track number to it.
07:19
<@ToxicFrog>
Reiver: I can't use up more room than the function already occupies, without JMP wackiness.
07:20
<@Reiver>
Oh.
07:20
<@ToxicFrog>
Because then I end up either overwriting chunks of the function after it, or changing its offset.
07:20
<@Reiver>
You can use less though, right?
07:20
<@ToxicFrog>
Both of which are Bad Things.
07:20
<@ToxicFrog>
Yes.
07:20
<@Reiver>
OK.
07:20 * Reiver really hasn't dealt with assembler, so...
07:20
< Vornicus>
TF is the most talented assembly hacker I know. I would kill to have half his skills.
07:21
<@ToxicFrog>
This function is about 512 bytes long, and I shouldn't need nearly that much to load a DLL and then call into it.
07:23
<@ToxicFrog>
Hmm. If I were a betting man, I'd bet that 0x00460a51 is the callback for the interface "play track" widget, and 0x00460cc0 is the function used by the engine internals.
07:24
<@ToxicFrog>
Aha.
07:24
<@ToxicFrog>
"play cdaudio from %i" plays from the given track.
07:26
<@ToxicFrog>
Hmm. Not sure what the function that uses it really does, though.
07:26
<@ToxicFrog>
Vornicus: I still consider myself a newbie, really.
07:26
<@ToxicFrog>
There are romhackers out there who are truly terrifying,
07:27
<@ToxicFrog>
"Oh yeah, I just completely rewrote the text rendering routines in this game to support variable-width english fonts. Five of them. In Z80 assembler."
07:28
< ErikMesoy>
O.o
07:28
< Vornicus>
...batshit
07:28
<@ToxicFrog>
However, what skills I have have indeed served me well.
07:29
<@ToxicFrog>
And if I can pull this off, it will top even the SS1 highres patch.
07:29
<@ToxicFrog>
Aah, who needs drugs when you have code?
07:29
< ErikMesoy>
The term is "infodrug".
07:30
< ErikMesoy>
I wrote a quasi-paper on that some months ago.
07:34 ErikMesoy [~ejm@Nightstar-3192.bb.online.no] has quit [Client exited]
07:35 * Vornicus gnargs
07:36
<@ToxicFrog>
?
07:36
< Vornicus>
I feel crappy!
07:37 * Vornicus feels very much like he's going to hurl at any moment.
07:37
<@ToxicFrog>
...erk
07:55 * Reiver gives Vorn a bucket.
08:18 MyCatSleeps is now known as MyCatStudies
08:21 Thaqui [~Thaqui@Nightstar-26359.jetstream.xtra.co.nz] has quit [Quit: Leaving]
08:29 Vornicus is now known as Vornicus-Latens
09:04 GeekSoldier [Rob@Nightstar-4864.pools.arcor-ip.net] has joined #code
09:44 ErikMesoy [~ejm@Nightstar-3192.bb.online.no] has joined #code
09:47 You're now known as TheWatcher[wr0k]
10:34 GeekSoldier_ [Rob@Nightstar-3722.pools.arcor-ip.net] has joined #code
10:35 * AnnoDomini eyes GeekSoldier and his evil twin.
10:35 GeekSoldier [Rob@Nightstar-4864.pools.arcor-ip.net] has quit [Killed (NickServ (GHOST command used by GeekSoldier_))]
10:35 GeekSoldier_ is now known as GeekSoldier
10:36
< AnnoDomini>
Oh no! The evil twin has killed the good one, and has taken his place!
10:36
< GeekSoldier>
Muwahahahaha!
10:39
< GeekSoldier>
now... which one was the evil one?
10:39
< AnnoDomini>
You.
10:39 * AnnoDomini spins the axis of evil! http://www.waronterrortheboardgame.com/thegame/
10:42
< GeekSoldier>
meh, I played that game IRL.
10:42
< AnnoDomini>
You did? Rad!
10:42
< GeekSoldier>
twice.
10:43
< AnnoDomini>
I wish I had money to buy and friends to play it with.
10:43
< GeekSoldier>
I'm talking actually being in Iraq-played IRL.. with guns and stuff.
10:45
< AnnoDomini>
Ah-HA.
10:45
< AnnoDomini>
You know TheDagda from #roguery then?
10:45
< GeekSoldier>
nay.
10:46
< AnnoDomini>
He's in Iraq, too, some kind of communications man.
10:46
< GeekSoldier>
ah. not fun.
10:47
< AnnoDomini>
Bitches a lot about AC and that the ISP blocks out lots of stuff.
10:47
< ErikMesoy>
He can't just proxy?
10:48
< GeekSoldier>
Yeah, they have websense blocking everything.
10:48
< ErikMesoy>
That's a new level of smartness from ISPs.
10:48
< ErikMesoy>
Hmm. Websense. superproxy.co.uk got me past that a week ago, before the school finally took the filter down.
10:48
< GeekSoldier>
it was getting difficult to find a non-blocked proxy when I was last over there.
11:00
< ErikMesoy>
As a matter of personal interest (since I am of age and citizienship to be called in to the US Army), what rationale do they give for the censorship, and how severe are the punishments for being in breach of it?
11:02
< GeekSoldier>
the rationale is this: Since most access is through military networks, and bandwidth is limited, they have to restrict what users can access.
11:02
< ErikMesoy>
Is it just me or does that not make sense?
11:02
< ErikMesoy>
Imposing a simple bandwidth limit sounds better.
11:02
< ErikMesoy>
And/or turning off images.
11:03
< GeekSoldier>
they are also in place to help increase the security of the systems by restricting access to certain types of sites (p2p, social nets, etc.)
11:04
< GeekSoldier>
when logging into any gov't computer, you consent to monitoring and possible prosecution under the Uniform Code of Military Justice if you are found to circumvent the regulations.
11:04
< ErikMesoy>
>.<
11:05
< GeekSoldier>
you are an American citizen? your ip is from Norway.
11:05
< ErikMesoy>
Both correct.
11:06
< ErikMesoy>
I have dual citizienship but have been exempted from the Norwegian army.
11:06
< GeekSoldier>
ah, interesting.
11:06
< GeekSoldier>
you are concerned about a draft?
11:06
< ErikMesoy>
Not really. Worst case situation, I renounce my American citizienship, though I hope not to do that.
11:07
< GeekSoldier>
There will not be a draft. political suicide for anyone who even mentions that they had thought of it.
11:07
< ErikMesoy>
Unless, of course, Iran nukes the Pentagon or something.
11:07
< ErikMesoy>
At which point anyone not supporting the draft will be hung as a traitor.
11:07
< GeekSoldier>
Yeah, well. current climate prevailing, of course.
11:08 * GeekSoldier nods.
11:09
< GeekSoldier>
Well, they can't draft me!
11:09
< GeekSoldier>
Take that, Iran!
11:09
< ErikMesoy>
The thing is, being a white american male is a very useful property to have when travelling. It gets me a semi-free pass through security, for one thing.
11:10
< ErikMesoy>
And I intend to travel, e.g. because I hope to study at MIT.
11:10
< GeekSoldier>
I would think Norwegian citizenship would help more.
11:11
< GeekSoldier>
ah, you mean travelling to the states. yes.
11:11
< GeekSoldier>
I find my affiliation and citizenship somewhat restrictive while travelling in Europe. (The whole arrogant American stereotype)
11:12
< ErikMesoy>
I keep that stereotype in a sort of metaphorical costume box for use when I want to cut through bullshit.
11:12
< GeekSoldier>
hehe. break out the stars and stripes and people leave you alone?
11:13
< ErikMesoy>
Not quite. "Ah'm an American sit-ee-zeen and I wawn't be held up by the likes of you!" gets public officials to cooperate out of fear of causing a diplomatic incident.
11:13
< ErikMesoy>
Polite Norwegians are subject to more bureacracy, or so it seems.
11:13
< GeekSoldier>
I understand.
11:17
< ErikMesoy>
Anyone who wants a spaceship named after them?
11:17
< GeekSoldier>
eh?
11:17
< ErikMesoy>
I'm out of names again.
11:19
< ErikMesoy>
I have two colony ships and three destroyers to name. Anyone who wants their own or their pet's name slapped on it gets it. It has to be publically viable, of course. (So no "SS Inside Joke" or the like.)
11:21
< GeekSoldier>
what sort of civilization created these ships?
11:22
< ErikMesoy>
A democratic human one.
11:22
< GeekSoldier>
have you any naming conventions that are followed?
11:23
< ErikMesoy>
No. This is early post-apocalyptic. Everyone gets to make up new conventions.
11:24
< GeekSoldier>
I'll lend my other alias, then for one of the ships: Aunir
11:25
< ErikMesoy>
Colony or destroyer?
11:25
< GeekSoldier>
Colony.
11:43 MyCatVerbs [~rb6822@Nightstar-12655.cs.bris.ac.uk] has joined #code
11:55 * ErikMesoy names a ship the Mycat and another the Caturbs out of boredom. If you don't mind, of course.
12:03
< MyCatVerbs>
Not at all. Sounds quite fun, even.
12:04
< ErikMesoy>
Catverbs would be too odd for a spaceship, even if I do get to make up the naming conventions.
12:07
< MyCatVerbs>
Fair 'nuff.
12:11 Mechagnolam is now known as gnolam
12:21
< GeekSoldier>
that's a good rule.
12:21
< AnnoDomini>
Indeed.
12:22 * Reiver eyes.
12:22
<@Reiver>
Poor prettyboys.
12:22
<@Reiver>
So maligned.
12:22
<@Reiver>
(Pass me the cricket bat, would you?)
12:22
< ErikMesoy>
LOL.
12:23
< ErikMesoy>
Could I be considered a "prettyboy" for having long hair?
12:23
<@Reiver>
Yes.
12:23
< AnnoDomini>
No.
12:23 * Reiver beats the crap out of ErikMesoy, whoever he is.
12:23
< ErikMesoy>
I'll find the picture.
12:23
<@Reiver>
...Whaaat? I had the baseball bat out and everything. Be a shame not to use it. :)
12:23
< AnnoDomini>
You're more of a member of a metal band.
12:23
< ErikMesoy>
http://img407.imageshack.us/img407/7016/erikblurpv9.png
12:24
< ErikMesoy>
Motion blur added to background. Personal image is untouched.
12:25
<@Reiver>
Yeah, that's a metal band.
12:25 * Reiver beats you up anyway. Cricket bats are expensive, afterall.
12:26
< ErikMesoy>
Ow! OW!
12:26
< ErikMesoy>
I was trying to look like a flying superhero.
12:26 * ErikMesoy runs away
12:27 * ErikMesoy gets a sword and comes running back at Reiver
12:27
< ErikMesoy>
!
12:27 * Reiver parries, whacks Erik upside the head. Hard.
12:27 * ErikMesoy maledicts, runs off once more
12:31
< ErikMesoy>
http://images-046.cdn.piczo.com/p6/img/i182372459_54585_6.jpg
12:31
< ErikMesoy>
Sword. Shield.
12:31 * ErikMesoy prepares to do battle with Reiver for the third time.
12:35
<@Reiver>
Bulgerian Pollaxe.
12:35
<@Reiver>
http://video.google.com/videoplay?docid=-6683319791066097285
12:36
<@Reiver>
(Or well, the really boring bit of the drill on such matters.)
12:36 * gnolam pikes Reiver and ErikMesoy at a safe 6 m distance.
12:36 * ErikMesoy looks at Reiver. "Gang up on him?"
12:36 * Reiver turns aside the pike, steps in, smacks gnolam in the face in a friendly and cheerful manner that explains just why the front line of pike formations involved halberds...
12:36 * ErikMesoy swords Reiver across the head while his back is turned.
12:37 * ErikMesoy goes to look up "Bulgerian Pollaxe" on Wikipedia.
12:38
<@Reiver>
Pollaxe is a kind of weapon.
12:38
< ErikMesoy>
Poleaxe, perhaps? :?
12:38
< gnolam>
I can tell you right now that turning aside a charging full pike is a futile proposition.
12:38
<@Reiver>
Bulgerian Pollaxe is, well, how the Bulgerians used Pollaxes~
12:38
< GeekSoldier>
poleaxe?
12:38
<@Reiver>
No, Pollaxe.
12:38
< gnolam>
Bulgarians.
12:38
<@Reiver>
Look it up; it's not actually pole-axe as the root word.
12:39
<@Reiver>
Ah, there we go.
12:39
<@Reiver>
http://video.google.com/videoplay?docid=5600254920609793730
12:39
< ErikMesoy>
Nifty. I found it.
12:40
<@Reiver>
(That one is far more interesting, so to speak.)
12:40
<@Reiver>
(Or more to the point, we're actually swinging the bloody things.)
12:40
<@Reiver>
(Yay videotaping drills, and not actual fights. *snicker*)
12:41
< gnolam>
Those pollaxes look mighty thick. Rattan?
12:41
<@Reiver>
Nein
12:42
<@Reiver>
Wood with foam+duct tape padded ends.
12:42
< gnolam>
Same thing, really.
12:42
< gnolam>
Same rules.
12:42
<@Reiver>
Well, yes and no.
12:42
<@Reiver>
Sort of slightly needed given we use full force combat, mind, but.
12:42
< gnolam>
Real men use steel!
12:42
<@Reiver>
*ahem*
12:42
<@Reiver>
Not with pollaxes.
12:42
< gnolam>
It works fine with bardiches. :)
12:43
<@Reiver>
Which have the inconvinent trait of having been specifically designed to defeat full steel plate armor.
12:43
<@Reiver>
This makes training somewhat difficult to do more than once~
12:43
< gnolam>
Not really.
12:43
< gnolam>
You use the same darn steel combat rules as with everything else.
12:43
<@Reiver>
You mean pulled blows?
12:43 * gnolam looks at the time.
12:44 gnolam is now known as gnoCPLD
12:44
< ErikMesoy>
!time
12:44
<@Reiver>
Yeah, doesn't work with this combat style. >.>
12:44
<@Reiver>
A lot of the moves are "Hit the guy's weapon hard enough that you smack it out of his hands, and then follow through into his face hard enough that he collapses backwards and out of the list entirely".
12:45
< ErikMesoy>
I don't have a sparring partner, so I practice with the sword by making a figure |X| a hundred times. The weight is fairly decent. Not nearly as heavy as metal, of course, but far better than plastic.
12:45
<@Reiver>
And "Sweep the opposing weapon aside, then hook the spike behind his neck and force him to the ground, to dispatch at your lesure"
12:45
<@Reiver>
Also the minor catch that these rules specifically target the face, hands and feet.
12:45
<@Reiver>
Ah, these are weighted.
12:46
<@Reiver>
So they have similar weights to period, just not the, uh, armor peircing abilities. >.>
12:46
< ErikMesoy>
Nifty.
12:46
<@Reiver>
And we're fighting according to Le Je de la Hache tournament rules.
12:46
< ErikMesoy>
Jeu*
12:47
<@Reiver>
Er, yes.
12:47
<@Reiver>
I suck at my spelling~
12:47
<@Reiver>
...Which differ from actual combat techniques in two ways, primarily:
12:47
<@Reiver>
1) It recognises the concept of the List, though most moves that force someone out of it also force them flat on their face, so are 'considered worthwhile learning in war' anyway
12:48
<@Reiver>
2) No armpit strikes, as while the only other worthwhile target against a warrior in full plate that they don't already attack, it apparently wasn't considered sporting~
12:54
<@Reiver>
Heh.
12:54
<@Reiver>
That turning aside video: It may not look like the last blow landed was much of a blow at all.
12:54
<@Reiver>
But then you see in the last few moments of the video, the other guy having to readjust his helmet afterwards... >.>
12:55
< AnnoDomini>
!day
12:55
< AnnoDomini>
Hm.
12:55 KarmaBot [~karma.bot@Nightstar-29521.neoplus.adsl.tpnet.pl] has joined #Code
12:55
< KarmaBot>
KarmaBot v1.19. online and ready. Summoned by AnnoDomini. Type "!help commands" for command list.
12:55
< AnnoDomini>
!time gmt
12:55
< KarmaBot>
It is now 13:10, Monday at time zone UTC.
12:55 KarmaBot [~karma.bot@Nightstar-29521.neoplus.adsl.tpnet.pl] has left #Code [Banished by AnnoDomini.]
13:11 Mahal [~Mahal@Nightstar-4998.worldnet.co.nz] has quit [Quit: fuk off i got biskit]
13:11 Mahal [~Mahal@Nightstar-4998.worldnet.co.nz] has joined #Code
13:11 mode/#code [+o Mahal] by ChanServ
13:24 You're now known as TheWatcher[afk]
13:34 Mahal is now known as MahalBed
14:00 MyCatVerbs [~rb6822@Nightstar-12655.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
14:06 GeekSoldier [Rob@Nightstar-3722.pools.arcor-ip.net] has left #code []
14:16 You're now known as TheWatcher[wr0k]
14:26 ErikMesoy is now known as ErikMesoy|videoconference
14:54 ErikMesoy|videoconference is now known as ErikMesoy
15:02 Reiver is now known as ReivZzz
15:27 You're now known as TheWatcher
15:58 gnoCPLD is now known as gnolam
16:21 Vornicus-Latens is now known as Vornicus
17:08
<@ToxicFrog>
I have a new and more cunning plan.
17:08
< ErikMesoy>
Hear, hear!
17:09
< Vornicus>
What is it?
17:10
< Vornicus>
--I take as your plan to merely replace the CD play code with something else didn't work.
17:11
<@ToxicFrog>
I haven't tried it yet, I just woke up.
17:11 You're now known as TheWatcher[afk]
17:11
<@ToxicFrog>
This is(?should be) a less invasive, and thus safer, technique.
17:12
<@ToxicFrog>
I simply replace all calls to mciSendStringA that are cdaudio-related with calls to another function of my devising that understands the MCI cdaudio commands.
17:12 MyCatVerbs [~rb6822@Nightstar-18324.cs.bris.ac.uk] has joined #code
17:13 MyCatVerbs [~rb6822@Nightstar-18324.cs.bris.ac.uk] has quit [Quit: Swim, swim, hungry!]
17:18
< Vornicus>
aha
17:19 Forj [~Forj@Nightstar-869.bitstream.orcon.net.nz] has joined #code
17:20
<@ToxicFrog>
Stage 1 is something that simply logs all calls and then passes them to the real mciSendStringA.
17:21 * ToxicFrog sets about writing a DLL loader in asm
17:28 Forjeh [~Forj@Nightstar-869.bitstream.orcon.net.nz] has joined #code
17:29 Forj [~Forj@Nightstar-869.bitstream.orcon.net.nz] has quit [Ping Timeout]
17:42 Forjeh [~Forj@Nightstar-869.bitstream.orcon.net.nz] has quit [Quit: Gone]
17:49
<@ToxicFrog>
push eax ; 50 ; save register
17:49
<@ToxicFrog>
push offset libraryName ; 68 AA AA AA AA ; const char * libname
17:49
<@ToxicFrog>
call ds:LoadLibraryA ; FF 15 D4 C0 4F 00 ; LoadLibraryA()
17:49
<@ToxicFrog>
push offset funcName ; 68 AA AA AA AA ; const char * funcname
17:49
<@ToxicFrog>
push eax ; 50 ; hModule lib
17:49
<@ToxicFrog>
call ds:GetProcAddress ; FF 15 94 C0 4F 00 ; GetProcAddress()
17:49
<@ToxicFrog>
mov funcPtr, eax ; A3 AA AA AA AA ; store new function
17:49
<@ToxicFrog>
pop eax ; 58 ; restore register
17:49
<@ToxicFrog>
; total 30 bytes
17:49
<@ToxicFrog>
If I can find 30 contiguous bytes - or 28 in a place where stomping EAX doesn't matter - I have my loader.
17:49
<@ToxicFrog>
...well, 30 bytes, plus space elsewhere for libraryName and funcName.
17:49
< ErikMesoy>
Should I be concerned that I (only) moderately understand this?
17:51
< AnnoDomini>
You should not. Go home and rethink your life.
17:52 Linin [~dfhdfh@193.19.190.ns-22262] has joined #Code
17:53
< Linin>
plz i need help who can help me
17:53
< Linin>
?
17:53
< Linin>
plz
17:53
< Vornicus>
Don't ask to ask. Just ask.
17:54
< Linin>
Vornicus i can pvt u
17:54
<@ToxicFrog>
...help with what?
17:55
< Vornicus>
No.
17:55
< ErikMesoy>
Underwear.
17:55
< Vornicus>
Private Underwear reporting for duty, sir?
17:55
< ErikMesoy>
No. Linus' quote on underwear.
17:55
< Linin>
ToxicFrog plz pvt u
17:55
<@ToxicFrog>
If you want to ask me something you can ask it in here.
17:55
< ErikMesoy>
Source code, requests and underwear are similar - if you don't show them in public, you probably have something to hide, or it's messy.
17:55
< Linin>
i wanna talk to you privat so that they won't laugh at me
17:56
< Linin>
plz
17:56
< Linin>
i wanna talk to you privat so that they won't laugh at me
17:56
< ErikMesoy>
Refusal to display your (source code/underwear/request) could be due to similar reasons.
17:56
<@ToxicFrog>
...is it code related?
17:57
< AnnoDomini>
Linin: Are you a spammer of some variety?
17:57
< Linin>
no
17:57
<@ToxicFrog>
Man, I do not have a heck of a lot of room to insert new strings into this thing.
17:57
< Linin>
i need any packers
17:57
< AnnoDomini>
You need what now?
17:57
< Linin>
but don't laugh at me
17:57
< Linin>
plz
17:57
< Linin>
packers
17:57
< Linin>
plz
17:58
< AnnoDomini>
You mean like WinRAR?
17:58
<@ToxicFrog>
I could replace the "Unknown TNT version" string, I don't think anyone's still using Riva TNT video cards these days...
17:58
< Linin>
lol no AnnoDomini
17:58
< Linin>
plz man
17:58
< Linin>
help me
17:58
< Linin>
packers plz
17:58
< AnnoDomini>
Define packer.
17:58
< Linin>
ToxicFrog help me
17:58
<@ToxicFrog>
We can't help you until we know what you're asking for.
17:58
< AnnoDomini>
What is a packer?
17:58
<@ToxicFrog>
Asking for "packers" means nothing without an understanding of what you mean by that.
17:59 * Vornicus sends linin to Green Bay.
17:59
< Linin>
packers as exetools.com
17:59
< Linin>
compression
17:59
< ErikMesoy>
+1 Merciful Club of Owl's Wisdom.
17:59
< Linin>
pass through the anti virus
17:59
< ErikMesoy>
aka Slapping Trout or Dead Fish.
17:59
< ErikMesoy>
Minor artifact.
18:00
< ErikMesoy>
Any target hit by the Slapping Trout takes 1d6+1 nonlethal damage and gains a +4 bonus to Wisdom for an hour.
18:00
< Linin>
is anyone gonna help me
18:00
< AnnoDomini>
Ah. Linin is but a wannabe cracker, or script kiddie.
18:01
< ErikMesoy>
Compression? Try *zip.
18:01
< Linin>
no ErikMesoy
18:01
< Linin>
AnnoDomini no
18:01
< AnnoDomini>
I don't understand you, Linin.
18:01
<@ToxicFrog>
ErikMesoy, AnnoDomini: he's after executable packers.
18:01 * ErikMesoy slaps Linin with the +1 merciful Club of Owl's Wisdom.
18:01
< Linin>
AnnoDomini do u know spack
18:01
< Linin>
and pepsin
18:01
< Linin>
and pex
18:02
< Linin>
open tghe site
18:02
< AnnoDomini>
What now? I have never heard of such things.
18:02
< Linin>
exetools.com
18:02
<@ToxicFrog>
Which take a binary, and wrap the code in some custom compression/encryption so that it cannot be easily reverse engineered and takes up less space.
18:02
<@ToxicFrog>
UPX is a popular one.
18:02
< AnnoDomini>
Aha.
18:02
< AnnoDomini>
Like a code optimized or whatnot?
18:02
< AnnoDomini>
*optimizer
18:02
<@ToxicFrog>
No.
18:02
< ErikMesoy>
It probably isn't quite optimized when obfuscated.
18:02
<@ToxicFrog>
Nothing like that.
18:03
< AnnoDomini>
Ah.
18:03
<@ToxicFrog>
Well, actually -
18:03
<@ToxicFrog>
The result is smaller on disk.
18:03
< Linin>
ToxicFrog but UPX all the anti virus can be caught
18:03
< AnnoDomini>
So it obfuscates, and then compresses.
18:03
<@ToxicFrog>
No, the compression and obfuscation are the same thing.
18:03
<@ToxicFrog>
Which is easier to reverse engineer: a binary, or 100k of compressed data with an unpacker function on the front?
18:04
< AnnoDomini>
I have no idea, but I think it's the binary.
18:04 mode/#code [+b *!*@193.19.190.172] by Vornicus
18:04
<@ToxicFrog>
Exactly.
18:04
< AnnoDomini>
Banjolnir!
18:04 Linin was kicked from #code by Vornicus [#code asking people to help you do something illegal is a bad way to make an entrance.]
18:05
<@ToxicFrog>
What this does is replace the original code (and, typically, data) with a block of compressed data, and the original entry point with a function that unpacks it into memory and then jumps into it.
18:05
< ErikMesoy>
I am reminded of Befunge, Malbolge and Intercal now.
18:05
<@ToxicFrog>
I note that packers, in and of themselves, are not illegal. And there may even be circumstances where they are useful for legal things, although I can't think of any offhand.
18:05 * AnnoDomini understands now.
18:05
<@ToxicFrog>
However, he pretty obviously was looking for one that virus scanners couldn't unpack.
18:05
<@ToxicFrog>
No guesses as to why.
18:06
< AnnoDomini>
Really
18:06
< AnnoDomini>
*+.
18:09
<@ToxicFrog>
(no guesses as in "you don't get any because it's so obvious". Not as in "I have no idea".)
18:11
< AnnoDomini>
((I assumed you were being sarcastic.))
18:15 MahalBed is now known as Mahal
18:16 * Vornicus poings Mahal
18:24
<@ToxicFrog>
Ok, I have my addresses.
18:24
<@ToxicFrog>
People with Riva TNT cards with unknown version numbers might get cryptic error messages, though~
18:24
< Vornicus>
I don't think I've /ever seen/ a Riva TNT card.
18:24
<@ToxicFrog>
Yeah, that's why I'm not terribly worried.
18:25 * AnnoDomini bahs! He has a Riva TNT card.
18:25 * ErikMesoy has a completely unknown card.
18:25
<@ToxicFrog>
I'm storing the DLL name, function name, and function pointer in the space previously occupied by the "Unknown TNT version: 0x%08x" message.
18:26
<@ToxicFrog>
Hmm. IDA needs a "jump to entry point" command.
18:28 Mahal is now known as MahalOUt
18:29 Janus [~Cerulean@Nightstar-10302.columbus.res.rr.com] has joined #Code
18:31 You're now known as TheWatcher
18:39 * ToxicFrog goes to look up just how far he can jump with JMP.
18:40 * jerith ponders.
18:42
<@jerith>
Yay! I have (more or less) bent Pygments to my will!
18:43
<@ToxicFrog>
Ok, JMP, at the machine code level, is quite impressively nasty.
18:44
< ErikMesoy>
Do tell.
18:44
< ErikMesoy>
Horror stories of machine code are always fascinating.
18:44
<@ToxicFrog>
The JMP mnemonic has 21 machine code variants, spanning four different opcodes and widths ranging from 3 to 7 bytes.
18:45
<@jerith>
The assemblers I've used tend to only have two variants of JMP.
18:45
<@ToxicFrog>
http://pdos.csail.mit.edu/6.828/2006/readings/i386/JMP.htm
18:46
<@ToxicFrog>
jerith: these are all JMP, I think, and the assembler generates the correct variant automagically.
18:46
<@ToxicFrog>
Hmm. Ok, what we have here is ten bytes where it basically goes:
18:46
<@ToxicFrog>
atexit(lambda() { return; })
18:47
<@jerith>
SJMP which is a short jump to a relative address (8-bit signed) and LJMP which requires you to shove an address into an index register and is an absolute jump.
18:47
<@jerith>
Usually the assembler will choose the one you want.
18:47
<@ToxicFrog>
And I have another thirty bytes, 2-aligned, where the empty function goes.
18:48
<@ToxicFrog>
I can work with this, I think.
18:49
<@ToxicFrog>
Oh, wait.
18:49
<@ToxicFrog>
I have 27 bytes to work with.
18:49
<@ToxicFrog>
Hrm.
18:52
<@ToxicFrog>
Ok. Opcode E9 XX XX XX XX. Takes a signed 32-bit offset and does a relative jump to it.
18:53
<@ToxicFrog>
Can I work with this?
18:53
<@jerith>
TF: What are you up to?
18:53
<@ToxicFrog>
Modifying TA to play music off the hard drive.
18:55
<@jerith>
TA?
18:55
<@ToxicFrog>
This means, among other things, getting it to load the DLL that provides the music playing functions.
18:55
<@ToxicFrog>
Total Annihilation.
18:56
<@jerith>
Ah. And you're doing this by hand-hacking the binary?
18:56
<@ToxicFrog>
Yep.
18:56
<@jerith>
Ah.
18:56
<@jerith>
Why, exactly?
18:56
<@ToxicFrog>
...because I don't have the source?
18:56
<@jerith>
That's a good reason. ;-)
18:59
<@ToxicFrog>
...yes, I do believe I can do this.
19:00
<@ToxicFrog>
...shit.
19:00
<@ToxicFrog>
No, I'm one byte short.
19:00
<@ToxicFrog>
One byte!
19:00
< Vornicus>
...suck.
19:00
<@ToxicFrog>
Hmm. Perhaps if I did it with call/return...
19:01
<@ToxicFrog>
Let's see. Five bytes for the call, then 23 bytes of actual stuff, then one byte for RETN, which leaves me with five bytes into which I can just fit mov funcPtr,eax.
19:19 Thaqui [~Thaqui@Nightstar-26359.jetstream.xtra.co.nz] has joined #code
19:20
<@ToxicFrog>
.text:0049ED85 sub_49ED85 proc near ; CODE XREF: sub_49E830+35p
19:20
<@ToxicFrog>
.text:0049ED85 push offset aFakemci_dll ; "fakeMCI.dll"
19:20
<@ToxicFrog>
.text:0049ED8A call ds:LoadLibraryA
19:20
<@ToxicFrog>
.text:0049ED90 push offset aFakemci ; "fakeMCI"
19:20
<@ToxicFrog>
.text:0049ED95 push eax ; hModule
19:20
<@ToxicFrog>
.text:0049ED96 call ds:GetProcAddress
19:20
<@ToxicFrog>
.text:0049ED9C retn
19:20
<@ToxicFrog>
.text:0049ED9C sub_49ED85 endp
19:21
<@ToxicFrog>
My inserted code, as disassembled by IDA.
19:24 * jerith ponders.
19:24
<@jerith>
This is a local page, it shouldn't be taking this long to generate...
19:26
<@jerith>
Aww, there's no lexer for squid config files.
19:26 * jerith ponders writing one.
19:28 AnnoDomini [~farkoff@Nightstar-29521.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
19:30 AnnoDomini [~farkoff@Nightstar-29085.neoplus.adsl.tpnet.pl] has joined #Code
19:43
<@ToxicFrog>
Hmm.
19:43
<@ToxicFrog>
I appear to have broken it ;.;
19:44 * AnnoDomini patpats ToxicFrog.
19:44 * jerith "fixes" it.
19:48
<@ToxicFrog>
I can't figure out how, though!
19:53
<@ToxicFrog>
Hmm. The problem is in the changes made to main().
19:54
<@ToxicFrog>
That is to say, if I make all the changes except those, it still works.
19:54 Chalcedon [~Chalceon@Nightstar-869.bitstream.orcon.net.nz] has joined #code
19:54 mode/#code [+o Chalcedon] by ChanServ
19:55 * ToxicFrog NOPs out the call to atexit
19:55
<@ToxicFrog>
Shit.
19:55
<@ToxicFrog>
atexit is having some kind of side effects.
19:56
<@ToxicFrog>
Without those, it goes KABLOOEY later on.
20:00
<@ToxicFrog>
...hmm.
20:00
<@ToxicFrog>
call _atexit
20:00
<@ToxicFrog>
add esp,4
20:01
<@ToxicFrog>
That looks a lot like _atexit puts something on the stack, which main() then discards.
20:02 * ToxicFrog NOPs that out too, AND IT WORKS
20:03
<@ToxicFrog>
Now I need to construct a real fakeMCI.dll, and the fakeMCI function, and change all relevant calls to mciSendStringA().
20:05
< Vornicus>
yiboo!
20:05
<@ToxicFrog>
...that's odd.
20:05
<@ToxicFrog>
If I run it with no fakeMCI.dll, it doesn't segfault.
20:05 * ToxicFrog tosses it into the debugger
20:06
<@ToxicFrog>
I think I'm actually going to pull this off.
20:06
<@ToxicFrog>
Sweet.
20:07
< Vornicus>
woohoo
20:09 * ToxicFrog decides to try using devCPP to generate the DLL, as he doesn't have minGW installed.
20:12
<@ToxicFrog>
Hmm.
20:12
<@ToxicFrog>
Ok, it looks like GetProcAddress(NULL, "foo") is legal.
20:12
<@ToxicFrog>
And returns NULL.
20:15 * ToxicFrog strangles Microsoft
20:15
<@ToxicFrog>
God forbid you tell me WHAT HEADER TO INCLUDE!
20:27
< gnolam>
ToxicFrog: err. Does not make sense.
20:27
< gnolam>
Dev-C++ /uses/ MinGW, no?
20:28
<@ToxicFrog>
Yes. And?
20:29
< gnolam>
Thus, if you have Dev-C++ you have MinGW?
20:29
<@ToxicFrog>
Depends.
20:29
<@ToxicFrog>
You can install devC++ sans compiler, and tell it to use an existing minGW install.
20:29
<@ToxicFrog>
Or you can tell it to use something else.
20:30
<@ToxicFrog>
Or you can install it with a builtin mingw build toolset.
20:35
<@ToxicFrog>
Ok, I'm become rapidly less impressed with devCPP.
20:36
<@ToxicFrog>
"could not create c:/bin/dev-cpp/projects/fakeMCI/Makefile.win: error 32"
20:37
<@ToxicFrog>
...there's also no option to open multiple projects at once.
20:38
<@ToxicFrog>
...and I can see it creating the Makefile right there, too.
20:39
<@ToxicFrog>
And why the hell is it saving the source files in ../../Templates?!
20:41
<@ToxicFrog>
There we go.
20:41
< gnolam>
Eh, Dev-Cpp is crap. Well-known fact.
20:41
< ErikMesoy>
Hexedit it. Hexedit it all. :P
20:42
< gnolam>
Code::Blocks is at least halfway decent.
20:42
<@ToxicFrog>
Now I'm back to glaring at MS for not documenting which library you need to link against to get mciSendStringA()
20:43 * ToxicFrog deploys grep, again, and comes up with libwinmm.a
21:02
<@ToxicFrog>
Dammit. GetProcAddress() is failing.
21:21 MyCatStudies is now known as MyCatVerbs
21:21
<@ToxicFrog>
AHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA
21:22
<@ToxicFrog>
EAX: 6dcc11d0 -> fakeMCI.dll:fakemci_fake@16
21:22
< ErikMesoy>
Oh no! It's the Mad Scientist laughter!
21:22
< ErikMesoy>
We're doomed!
21:22
< ErikMesoy>
Flee! Flee, I say!
21:22
< ErikMesoy>
And flrrd, too.
21:22 * ErikMesoy flees.
21:22 * AnnoDomini yloos.
21:22
<@ToxicFrog>
And now, groceries.
21:25 Takyoji [~Takyoji@Nightstar-25280.dhcp.roch.mn.charter.com] has joined #code
21:26
< Takyoji>
I'm using the rewrite engine to cloak the URI of my pages.. what do you think would be besto make it appear as? Should it be example.com/sample-page/ or example.com/sample-page.html ?
21:29
< Vornicus>
Depends on what you're doing.
21:31
< Takyoji>
I'm just trying to hide it from looking like sample.php?q=sample-page
21:32
< Takyoji>
First off, to keep it from being dynamic, and secondly, make it appear like its a .html file and/or directory
21:32
< Takyoji>
Its for an online store I'm working on
21:35
< Vornicus>
The former is a bit neater, if you can get it to work without the trailing /
21:35 ErikMesoy is now known as ErikMesoy|sleep
21:35
< Takyoji>
ahh k
21:36
< MyCatVerbs>
Takyoji: my personal preference would be for .html, please. Makes life slightly easier when users hit the "save" button on a page.
21:38
< Takyoji>
I'm misunderstanding what you mean. You mean, when people try to save a seperate copy of the page on their computer or when they add it to their favorites?
21:39
< MyCatVerbs>
The former. Makes no difference to the latter.
21:41
< Takyoji>
I'm doing this for Search Engine Optimization purposes..
21:41
< Takyoji>
That's why I'm trying to prevent it from being dynamic pages
21:41
< Takyoji>
URIs* not pages
21:43
< MyCatVerbs>
SEO work? You should beat yourself with fifteen rulers. Anyway, sounds like it probably won't matter either way, then.
21:49
< Janus>
I have a question~ How many times should I get shot?
21:49
< MyCatVerbs>
Janus: ideally none, unless you're discussing vaccinations. What've you done?
21:51
< Janus>
I updated my game's code layout a bit. Now, a linked list with pointers to 6 different objects represents an onscreen character.
21:53 * MyCatVerbs blinks.
21:53
< MyCatVerbs>
Janus: if the number of objects pointed to is static and you know their types in advance, why not just one object that points to the other six?
21:58
< Janus>
Well, I wouldn't really know how many characters would appear, which explains the linked list.
21:58
< Janus>
Besides that... it kinda is one object that points to six others.
22:01
< Janus>
There's one for the AI, another for drawing the character onscreen, a third for keeping tabs on it's condition, one for it's physics, and finally one for it's permament stats. (so... I guess five instead of six then.)
22:01
< MyCatVerbs>
Janus: why not use an array instead and just resize it periodically if the character count explodes?
22:03
< MyCatVerbs>
Janus: the trick to making that quick is to always double the size of the array whenever you resize it. That way, the time spent on array resizing will scale at something like n*log(n), while you'll never end up wasting more than half the amount of memory it takes to store the elements currently being used, even under worst-case conditions.
22:03
<@ToxicFrog>
MyCatVerbs: array insertion/deletion is hell slow.
22:03
< MyCatVerbs>
ToxicFrog: ...what?
22:03
< MyCatVerbs>
oO
22:03
<@ToxicFrog>
Say you want to remove element 0 of the array.
22:03
< MyCatVerbs>
...why? That's the most bizarre thing I've heard all afternoon.
22:03
<@ToxicFrog>
You now have to move everything after that down one slot.
22:04
<@ToxicFrog>
Access is O(1), but add or remove is O(n).
22:04
<@ToxicFrog>
Whether this is important depends on what you're doing with it, of course.
22:05
< Janus>
Oddly enough, I already have something like that for drawing order. But I keep the actual list around so I don't have to resort it if the roster changes.
22:05
< MyCatVerbs>
ToxicFrog: so just keep a pointer to the last element on the array. When you want to delete an element, overwrite its position with the last element on the list and then zero the memory previously occupied by the final element. O(1). And adding is O(1) for any non-insane quantity of elements, because you're just moving the last-element pointer and writing a new element in.
22:06
<@ToxicFrog>
MCV: the assumption I'm making here is that order is significant.
22:06
< Janus>
It is; the PC has to be the first element on the array.
22:07
< MyCatVerbs>
ToxicFrog: that's pretty rare for a videogame. The problem that you *ought* to be pointing out with my method is the fact that you can't maintain external pointers to elements within the array. :)
22:07
<@ToxicFrog>
That too.
22:07
<@ToxicFrog>
Well, actually if it's a pointer array you can.
22:07
<@ToxicFrog>
You can't maintain pointers to array elements, but you can to the things they point to.
22:07
< MyCatVerbs>
Oh yeah, I should've thought of that. Thank you.
22:08
< Janus>
Anyway, that's probably not the thing that'd get me shot~
22:09
< MyCatVerbs>
Oh wait, having a linked list for the actors isn't harmful anyway. You often want to do things like run through the entire list applying physics constructs to each in turn, so the list traversal is going to be negligible anyway. >_>
22:10 * ToxicFrog typically has a linked ring.
22:10
< MyCatVerbs>
Oh. Any 'ticular reason?
22:10
<@ToxicFrog>
So the event loop is basically: while(true) { obj->Tick(); obj = obj->next; }
22:11
< MyCatVerbs>
I've seen 'for (p=pawnlist.start;p!=null;p=p.nextinlist)' type forms in UnrealScript code quite often, so I tend to vaguely like that form for linked-list traversal.
22:11
<@ToxicFrog>
No need to check for falling off the end, and if I just want to iterate over it, the check is just if( obj == list_head ) instead of if( obj == NULL )
22:12
<@ToxicFrog>
*iterate over it once
22:12
< MyCatVerbs>
I see. Little awkward if you want to map a relationship (e.g. collision detection?) from one element to all other elements, though, surely?
22:13
<@ToxicFrog>
No more awkward than a normal linked list.
22:13
< Janus>
But, is it normal for linked lists to have references to several objects instead of just one..?
22:13
< MyCatVerbs>
Oh right, yeah. Normally you'd check for a null pointer, with a circular one you just check to see if you've landed back on a pointer which is equal to *this, right?
22:13
<@ToxicFrog>
Yep.
22:14
<@ToxicFrog>
Janus: depends on what you mean by that.
22:14
<@ToxicFrog>
"is it normal for a linked list to contain more than one object" - yes, that's the entire point of having one
22:15
<@ToxicFrog>
"is it normal for a node in a linked list to contain more than one object" - no, generally each node has one object, and that object may contain relevant subobjects
22:15
< Janus>
Mine's the latter then.
22:18
< Janus>
It's created when the game loop calls a function from the Character object that creates four temporary objects that are needed for onscreen characters, stores them in the Linked list object, and returns it so it can be added to the stack.
22:18
< Janus>
Each node, rather.
22:19
< Janus>
Since they were all throw-away, I figured I'd keep them close together.
22:20
< Janus>
That's actually not the worst thing about it, though. :D
22:22
< Janus>
You see, each object has a pointer to their linked list node. They have every access to anything public in every other object.
22:24
< Janus>
... so while they look like they're independent of eachother, they've actually quite the load of dependency issues.
22:27
< Janus>
I'm not quite sure /how/ that's bad, only that it is.
22:29
< MyCatVerbs>
Janus: I commend you for noticing that it is. What happens is that if the different pieces of code happen to know too much about one another then attempts to change one will require you to change things elsewhere, too.
22:30
< MyCatVerbs>
Janus: when you find yourself having that happen, it's often a sign that you need to rethink the boundaries of your program's modularisation. Bad modularisation is pretty much identical to no modularisation at all.
22:32
< Janus>
Ironically, this is why I changed the layout in the first place. I figured splitting a few classes up would help make it more manageble.
22:32
< MyCatVerbs>
Myself, I don't know how to pick module boundaries well. I've bitten myself in the ass with similar problems before and haven't yet the experience and judgement to be able to guard against such issues.
22:33
<@ToxicFrog>
ben@durandal /cygdrive/f/Games/Totala/ida
22:33
<@ToxicFrog>
$ cat fakemci.log
22:33
<@ToxicFrog>
fakeMCI: stop cdaudio
22:33
<@ToxicFrog>
fakeMCI: close cdaudio
22:33
<@ToxicFrog>
fakeMCI: open cdaudio
22:33
<@ToxicFrog>
fakeMCI: stop cdaudio
22:33
<@ToxicFrog>
fakeMCI: close cdaudio
22:33
<@ToxicFrog>
fakeMCI: open cdaudio
22:33
<@ToxicFrog>
Wooo, it's calling my loaded function now
22:37
<@ReivZzz>
So, TF, when are you going to start inserting the game balance hacks?~
22:38
<@ReivZzz>
I have here a little list of things you might wanna improve...~
22:38
< MyCatVerbs>
HACKERY!? Where?
22:38 ReivZzz is now known as Reiver
22:39
<@ToxicFrog>
ReivZzz: talk to the UberHack team, or Switeck~
22:39
< MyCatVerbs>
Awwww, hacks. :(
22:39
<@ToxicFrog>
MyCatVerbs: around .idata:004FC3D8 at the moment~
22:40
<@Reiver>
TF: I already did. They couldn't fix the pelicans either~
22:40
<@ToxicFrog>
...what's wrong with Pelicans?
22:40
<@Reiver>
Immunity to missile fire when over water.
22:40
<@ToxicFrog>
ISTR Switeck did fix that.
22:40
<@Reiver>
Fixing this interesting little quirk makes them untargetable by submarines.
22:40
< AnnoDomini>
Why are you peeps ending your sentences with '~'?
22:41
< MyCatVerbs>
AnnoDomini: because we just love our home directories!~
22:41 * Reiver thwap MCV.
22:41 MahalOUt is now known as Mahal
22:41
< AnnoDomini>
I'm afraid I do not follow.
22:42
<@ToxicFrog>
Reiver: they're hovercraft.
22:42
<@Reiver>
TF? You can explain better than I.
22:42
<@ToxicFrog>
Submarines aren't meant to be targeting them anyways.
22:42
<@Reiver>
TF: But they're not! They're boats!
22:42
<@ToxicFrog>
From the readme, paraphrased:
22:42
<@ToxicFrog>
- ships have Floater=1, CanHover=0
22:42
<@ToxicFrog>
- hovercrafts have Floater=0, CanHover=1
22:42
<@ToxicFrog>
- pelicans have Floater=0, CanHover=1, Waterline=9
22:43
<@Reiver>
The origional TA made them boats so they could be ensunk.
22:43
<@Reiver>
By subs, I mean.
22:43
<@ToxicFrog>
The last entry, waterline=9, is what breaks missiles: they aim at parts of the pelican that are underwater.
22:43
<@Reiver>
This just happened to make them immune to missile fire.
22:43
< MyCatVerbs>
Wait, are you working on TA:Spring or something? oO
22:43
<@ToxicFrog>
This is also what makes them targetable by subs.
22:43
<@ToxicFrog>
In *every other respect* pelicans are identical to hovercraft.
22:43
<@Reiver>
Well, yes.
22:43
<@ToxicFrog>
Including:
22:43
<@Reiver>
That's because they're a mechanical hackjob.
22:43
<@ToxicFrog>
- no damage from acid
22:44
<@ToxicFrog>
- no change in movement speed when crossing liquids
22:44 Janus is now known as Jan[food]
22:44
< Vornicus>
What are pelicans made from?
22:44
< Vornicus>
or, rather, what makes pelicans?
22:44
< AnnoDomini>
Flesh, bone, and feathers.
22:44
<@Reiver>
Given that missiles are somewhat game-dominating, and subs, while interesting, are a vastly less significant effect in-game, they felt it best to choose the lesser of two evils and just make the bloody things hovercraft~
22:44
<@ToxicFrog>
Thus, Switeck arrives at the conclusion - as do I - that giving pelicans a waterline is a bug; removing it allows missiles to hit them normally and also makes them consistent WRT acid damage, etc.
22:45
<@Reiver>
Vorn: The Advanced KBot factory, ARM side.
22:45
< Vornicus>
aha
22:45
<@Reiver>
They're a KBot that transforms into a little boat.
22:45
< MyCatVerbs>
Er, yo. What project you working on, please?
22:45
<@Reiver>
Ruleswise they're hovercraft.
22:45
<@ToxicFrog>
MyCatVerbs: I'm hacking on TA to make it play music from the hard drive.
22:45
< MyCatVerbs>
I remember in the original TA they did take damage from acid, same as ships.
22:45
<@Reiver>
TF: I consider it a 'lesser of two evils'.
22:45
<@ToxicFrog>
And they aren't an OTA unit, they're a TACC unit.
22:46
< MyCatVerbs>
ToxicFrog: piffle and semantics! And also a mistake that you caught me out in. =)
22:46
<@ToxicFrog>
Reiver: so...making them immune to missiles and behave in a manner completely inconsistent to their documentation, their appearance, and most of their unit definition file is the lesser of two evils?
22:46
<@Reiver>
Given their transformation script and other quirks, it seems they are a hovercraft by technicality - it was easier to make them hovercraft with fancy animations, than it was to make an entire new movement class.
22:47
<@Reiver>
What documentation?
22:47
<@ToxicFrog>
Actually, they could have made it a ship trivially easily.
22:47
<@Reiver>
Ships can't move onto land.
22:47
<@Reiver>
And use a different AI, much to the chargrin of modders.
22:47
<@ToxicFrog>
So, basically...
22:48
<@Reiver>
Documentation: You mean the floater=0, hover=1 thing? If you don't set those the way they were set, the Pelecan would stop working. It's not documentation, it's part of the rules hack~
22:48
<@ToxicFrog>
You want pelicans to be vulnerable to both missiles and torpedos, to take damage on acid, and basically to behave like ships instead of hovercraft?
22:48
<@ToxicFrog>
And no, by documentation I mean the *manual*
22:48
<@ToxicFrog>
Which says they hover
22:50
<@ToxicFrog>
Well, it says they "skim across the water"
22:50
<@ToxicFrog>
Which to me says hovercraft or hydrofoil.
22:50
<@ToxicFrog>
And it's not a hydrofoil.
22:51
<@ToxicFrog>
MyCatVerbs: anyways...one big issue with TA is that it can only play music off the CD, and only CD audio.
22:51
<@ToxicFrog>
I want to make a version where you can distribute the music as part of the TA install, as mp3s or whatever.
22:51
< MyCatVerbs>
Ah, I see.
22:51
< MyCatVerbs>
So you're patching the binaries, I take it?
22:51
<@ToxicFrog>
I am now at the point where instead of calling mciSendStringA(), which is the function that does all the CDDA control, it is now calling a function of my own devising in fakeMCI.dll
22:52
< MyCatVerbs>
Oooh, yay, hooking!
22:52
< MyCatVerbs>
Oh wait, fuck. Please make sure no hollywood writer ever gets ahold of a log of this conversation?
22:52
<@ToxicFrog>
Which required some minor alternations to main() and the insertion of a 25-byte function in the padding between two other functions.
22:52
<@ToxicFrog>
And some changes to the string table.
22:53
<@ToxicFrog>
At the moment, my function just logs it and then calls the real function.
22:53
< MyCatVerbs>
Otherwise "patching the binaries" is going to end up right there with "reroute the encryption" "hacking the megahertz" and "verb the kernel" in bad hacker clich? films. :(
22:53
<@ToxicFrog>
However, it is now entirely possible to write a function that passes non-CDDA commands to the real function, and intercepts CDDA commands and does something SDL_mixer related with them or the like.
22:55
< MyCatVerbs>
ToxicFrog: ohhhh, network socket!
22:55
<@ToxicFrog>
...
22:55
< MyCatVerbs>
Make 'em control send commands to a musicpd!
22:55
<@ToxicFrog>
No, I am not rewriting the netplay code.
22:56
< MyCatVerbs>
No, I mean for an mpd on a *nix box with a good soundcard attached to a huge honking amplifier and some meaty speakers.
22:56
<@ToxicFrog>
mpd?
22:56
<@Reiver>
"Skim accross the water" to me implies something along the lines of a jetboat.
22:56
<@ToxicFrog>
Music playing daemon?
22:56
<@Reiver>
It's skimming along the water, not floating above.
22:57
< MyCatVerbs>
ToxicFrog: yesh. It rawks. ^^
22:57
<@ToxicFrog>
Well. I will be documenting the API.
22:58
<@ToxicFrog>
So if you want to provide your own tamusic.dll that does this, go ahead.
22:58
< MyCatVerbs>
ToxicFrog: gapless playback, wonderful CPU and memory efficiency. Also it's really nice when you're jumping into and out of X11 a lot, 'cuz it doesn't die when the X server does, unlike, say XMMS.
22:58
<@Reiver>
So yes, I basically want them to behave like ships instead of hovercraft.
22:58
<@Reiver>
Be that an amphibious KBot, or a landwalking skeeter, is a matter of semantics.
22:58
< MyCatVerbs>
And it's controlled entirely over an ordinary TCP socket, with a straightforward command set, so there are quite a few frontends for it by now.
22:59
< MyCatVerbs>
The default one it ships with is a chunk of bash script using netcat, I think.
23:00
<@ToxicFrog>
This would be useful if I had a sound system attached to Orias.
23:00
<@ToxicFrog>
But I don't.
23:00
<@ToxicFrog>
Still, fairly cool.
23:00
<@Reiver>
Anyhow.
23:01
<@Reiver>
Other things on the Wishlist, and far more bastardly to argue about: It is almost possible to have a mobile unit build another mobile unit...~
23:01 You're now known as TheWatcher[t-2]
23:01
<@Reiver>
It seems to fall apart when you try to select where on the map they will be built.
23:01
<@ToxicFrog>
They did that in TAK.
23:01
<@Reiver>
Yes.
23:01
<@Reiver>
But not TA.
23:02
< MyCatVerbs>
ToxicFrog: yeah, it beats the pants off everything else on most platforms. Only real annoyance is the lack of wma support. But mplayer does those, and I guess it's largely my own damn prerogative to hack that into mpd.
23:02
<@ToxicFrog>
Or just transcode them into something better.
23:02
<@Reiver>
Because you click on the map, and the little box seems to jiggle, and then the construction dood walks to the top left hand corner.
23:02
<@ToxicFrog>
Hmm.
23:02
<@Reiver>
And then proceeds to give the 'can't reach construction site' error.
23:02
<@Reiver>
It doesn't take much for a coder to speculate what is going wrong~
23:03
< MyCatVerbs>
ToxicFrog: yeah, but they're lossy. Anything else lossy would sound horrible and anything lossless would be a horrible waste of disk space. :/
23:03 Mahal is now known as MahalOut
23:05
<@ToxicFrog>
...umm.
23:05 Vornicus is now known as Vornicus-Latens
23:05
<@ToxicFrog>
If you convert it to high-bitrate OGG or MP3, you're unlikely to lose and audible data.
23:05
<@ToxicFrog>
*any
23:06
< Vornicus-Latens>
192 adaptive!
23:06
<@ToxicFrog>
Adaptive?
23:06
<@ToxicFrog>
VBR?
23:06
< MyCatVerbs>
Yesh.
23:07
< MyCatVerbs>
Ogg is intrinsically adaptive by default. You have to deliberately tell the encoder if you want CBR, and the CBR options are generally frowned upon.
23:07 You're now known as TheWatcher[zZzZ]
23:08
< MyCatVerbs>
Er, ogg *vorbis*, specifically.
23:08
< MyCatVerbs>
I mean, there's nothing stopping you from packing up a RIFF WAV in an ogg container if you felt like it, heh.
23:09
<@ToxicFrog>
True.
23:09
< Vornicus-Latens>
Pretty much anyone ever means when they say OGG is Vorbis
23:09
< Vornicus-Latens>
I've only rarely seen Speex mentioned. I don't even know if I got the name right.
23:12
< MyCatVerbs>
Vornicus-Latens: a) yes you did b) Ogg FLAC? It's been done.
23:12
< MyCatVerbs>
I think there's also a standard for text chunks in ogg files, as well as the Theora codec and hopefully someday Tarkin, too.
23:17
< Vornicus-Latens>
what's theora and tarkin?
23:17
<@ToxicFrog>
aughflail
23:17
<@ToxicFrog>
it's not calling it in all the situations it should be
23:17 * Vornicus-Latens comes back, because lying down makes it hurt worse.
23:20
< MyCatVerbs>
Vornicus-Latens: two different video codecs. Same spirit as Vorbis and FLAC - no patent encumberance.
23:21
< MyCatVerbs>
Vornicus-Latens: Theora is, I believe, a fairly straightforward, conventional codec which is reasonably stable.
23:22
< MyCatVerbs>
Vornicus-Latens: Tarkin is some serious experimental voodoo shit. Four-dimensional wavelet-based compression, I think. Not really finalised yet.
23:24 Vornicus-Latens is now known as Vornicus
23:30 Takyoji [~Takyoji@Nightstar-25280.dhcp.roch.mn.charter.com] has quit [Quit: Leaving]
23:34
< MyCatVerbs>
Hmmm. Is there any sane way whatsoever to do data arithmetic inside a shell script, or would I be better off forking that off to a scripting language? Please bear in mind that I don't know any. >>
23:35 * MyCatVerbs considers writing a stubby C program. Tempting...
23:36
<@ToxicFrog>
Yes, assuming you mean bash.
23:37
<@ToxicFrog>
(( expression )) executes a mathematical expression.
23:37
<@ToxicFrog>
$(( expression )) likewise and expands to the result.
23:37
<@ToxicFrog>
http://tldp.org/LDP/abs/html/arithexp.html
23:37
<@ToxicFrog>
Also, if you wanted to call an existing program to do that, both bc and gs will do nicely.
23:38
< MyCatVerbs>
Er, I meant date arithmetic, not data arithmetic, sorry. Bad typo and I didn't notice it at first.
23:38
<@ToxicFrog>
...how do you mean?
23:38
<@ToxicFrog>
Number of hours/minutes/seconds until whatever, etc?
23:39
< Vornicus>
GNU's date utility has all sorts of wacko options for that kind of thing.
23:39
<@ToxicFrog>
Read the man page on date(1)
23:39
<@ToxicFrog>
It has all kinds of handy things.
23:39
< MyCatVerbs>
ToxicFrog: something similar. Taking as arguments a day and a month, I need to find the day and month corresponding to seven days prior and the day and month corresponding to one day prior.
23:39
<@ToxicFrog>
date -d "$month/$day - 7 days"
23:39
<@ToxicFrog>
date -d "$month/$day - 1days"
23:39
<@ToxicFrog>
Err, - 1 day
23:40
<@ToxicFrog>
You'll also want to read the man page to get the formatting options.
23:41
< MyCatVerbs>
The man page doesn't seem to specify what format "STRING" is supposed to be in for the -d option.
23:41
< MyCatVerbs>
Oh right, texinfo manual.
23:42
< MyCatVerbs>
Sorry, one of the handful of stupid annoyances with my distro is that they strip the goddamn texinfo manuals for some reason.
23:42
<@ToxicFrog>
I don't like this pressure to move to texinfo ;.;
23:42
<@ToxicFrog>
...
23:42
<@ToxicFrog>
What distro is that?
23:43
< MyCatVerbs>
ToxicFrog: Arch Linux.
23:45
< MyCatVerbs>
Yeah, I hate texinfo manuals too. But they're the only way that GNU like to document many of the coreutils. :/
23:49
< MyCatVerbs>
Oh fuck this gnarly kludge, I'll do it in C.
23:50 gnolam [Lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Z?]
23:51
<@ToxicFrog>
...which somehow isn't a gnarly cludge?
23:53
< MyCatVerbs>
ToxicFrog: because I don't have to piss about winding my way through byzantine little options to date?
23:54
< MyCatVerbs>
ToxicFrog: like how there's apparently no sane way to get date to print a date which equates to a given unix timestamp?
23:54
< MyCatVerbs>
Whereas in C, all I have to do is subtract (86400*n) from a time_t and the problem is solved.
23:55
<@ToxicFrog>
%s seconds since 1970-01-01 00:00:00 UTC
23:56
< MyCatVerbs>
ToxicFrog: yes, that's available as an output format.
23:56
<@ToxicFrog>
Yes, which is what you asked for.
23:56
< MyCatVerbs>
ToxicFrog: No, it's not. What I need it as is an input format to -d. Which would actually have been quite useful and solved the problem lickety-split.
23:56
<@ToxicFrog>
Then you should have said that.
23:56
<@ToxicFrog>
"there's apparently no sane way to get date to print a date which equates to a given unix timestamp"
23:57
< MyCatVerbs>
Yes, I should. Which is why I did.
23:57
< MyCatVerbs>
ToxicFrog: what part of print a date equivalent to a given timestamp did you not get? I want to print the date and I have a timestamp.
23:57
<@ToxicFrog>
Aah.
23:57
< MyCatVerbs>
ToxicFrog: you parsed that sentence entirely backwards, dude.
23:58
< MyCatVerbs>
Invert ur stack plz, dood.
23:58
<@ToxicFrog>
So, in other words, you want -d "@$date_as_time_t"
23:58
< MyCatVerbs>
Yesh, that'd be wunderbar.
23:58
<@ToxicFrog>
If you precede a number with `@', it represents an internal time stamp
23:58
<@ToxicFrog>
as a count of seconds. The number can contain an internal decimal
23:58
<@ToxicFrog>
point (either `.' or `,'); any excess precision not supported by the
23:58
<@ToxicFrog>
internal representation is truncated toward minus infinity. Such a
23:58
<@ToxicFrog>
number cannot be combined with any other date item, as it specifies a
23:58
<@ToxicFrog>
complete time stamp.
23:58
<@ToxicFrog>
Internally, computer times are represented as a count of seconds
23:59
<@ToxicFrog>
since an epoch--a well-defined point of time. On GNU and POSIX
23:59
<@ToxicFrog>
systems, the epoch is 1970-01-01 00:00:00 UTC, so `@0' represents this
23:59
<@ToxicFrog>
time, `@1' represents 1970-01-01 00:00:01 UTC, and so forth. GNU and
23:59
<@ToxicFrog>
most other POSIX-compliant systems support such times as an extension
23:59
<@ToxicFrog>
to POSIX, using negative counts, so that `@-1' represents 1969-12-31
23:59
<@ToxicFrog>
23:59:59 UTC.
23:59
<@ToxicFrog>
I mean, that's how you do it
23:59
<@ToxicFrog>
Prefix the timestamp with @
23:59
<@ToxicFrog>
[ben@leela src]$ date -d @0
23:59
<@ToxicFrog>
Wed Dec 31 19:00:00 EST 1969
23:59
< MyCatVerbs>
ToxicFrog: great. Personally, I couldn't be arsed to dig my way through fourteen fucking pages of badly-linked out texinfo over a slow SSH link to find that.
--- Log closed Tue Feb 20 00:00:30 2007
code logs -> 2007 -> Mon, 19 Feb 2007< code.20070218.log - code.20070220.log >