code logs -> 2013 -> Sun, 13 Jan 2013< code.20130112.log - code.20130114.log >
--- Log opened Sun Jan 13 00:00:07 2013
--- Day changed Sun Jan 13 2013
00:00 iospace is now known as io\PACKERS
00:07 * TheWatcher wonders why his magic to make the current git annotated tag appear in his generated doxygen documentation isn't working properly
00:10
<@TheWatcher>
gah, `git tag -n1` prints out v3.1, v3.10, v3.2, etc... well, sort -V to the rescue
00:13 * McMartin nods at RichyB
00:13
<&McMartin>
So, I just had a grimly hilarious realization
00:13
< RichyB>
Oh?
00:14
<&McMartin>
You've got this code that says:
00:14
<&McMartin>
dx := abs(x1-x0) dy := abs(y1-y0) if x0 < x1 then sx := 1 else sx := -1 if y0 < y1 then sy := 1 else sy := -1
00:14
<&McMartin>
Oops
00:14
<&McMartin>
Well, anyway, that
00:14
<&McMartin>
This turns out to be much easier to render in assembler as:
00:14
< RichyB>
Yes. More semicolons next time, please. ;)
00:15
<&McMartin>
if ((dx = x1-x0) < ) then { dx = -dx; sx = -1; } else { sx = -1; }
00:15
<&McMartin>
Well, it was *supposed* to be multiline; a paste from the wiki
00:15
< RichyB>
:)
00:15
<&McMartin>
Also a 0 between < and )
00:16
< RichyB>
Both branches set sx=-1 and neither touches sy. Why?
00:16
<&McMartin>
Er, the else clause should also be sx = 1
00:16
<&McMartin>
Neither touches sy because it's analogous and this time I wasn't copy-pasting.
00:16
< RichyB>
Ah, k.
00:17
<&McMartin>
But basically, the act of assigning dx/dy sets the flags you need to check in order to (a) do the ABS and (b) do the later IF test, so you really might as well do it all right there.
00:17 * RichyB nod.
00:18
< RichyB>
The 6502 has a flags register like the i386's?
00:18
<&McMartin>
Similar, but there's some weird overlap and gaps, IIRC.
00:18
<&McMartin>
The Carry flag is overloaded, and there's an "overflow" that's defined in a way that makes signed stuff sorta work.
00:19
<&McMartin>
But the general notion is yeah, that you check greater than/less than by doing a subtraction and then checking to see if the Negative/Carry/Zero flag is set or clear or whatever
00:19
< RichyB>
Is the flags register a mostly-universal thing? Seems like it should be expensive to track the state of in a superscalar chip
00:20
< RichyB>
Especially a reordering one.
00:23 You're now known as TheWatcher[T-2]
00:23
<&McMartin>
It's a Hella Data Hazard, yes.
00:24
<&McMartin>
IIRC, MIPS gets around it by letting you repurpose other registers as the equivalent of flags
00:24
<&McMartin>
So you'd go "subtract R1 from R2, storing result in R3" and then "branch if R3 is positive/negative/whatever"
00:29
<&McMartin>
Oof
00:29
<&McMartin>
Once you start having to use memory as workspace, that's what *really* inflates your code size for 16 vs 8-bit math.
00:30 You're now known as TheWatcher[zZzZ]
00:36
<&McMartin>
Yeah. The need to do reloads from memory makes those two initialization lines be 11 instructions for Y (8 bit) and 24 for X (16 bit).
00:42
< RichyB>
The MIPS way of handling flags sounds like a good plan.
00:43
<&McMartin>
Note that it *does* still have the data hazard.
00:43
<&McMartin>
And some fixed reordering due to an unusually heedless pipeline
01:12 Derakon[AFK] is now known as Derakon
01:15 Orthia [orthianz@3CF3A5.E1CD01.5A78C0.03128C] has quit [Ping timeout: 121 seconds]
01:16 Nemu_ [NeophoxProd@Nightstar-4b37d7f7.asahi-net.or.jp] has quit [Client closed the connection]
01:17 Nemu [NeophoxProd@Nightstar-a984b1cd.asahi-net.or.jp] has joined #code
01:23 * McMartin finishes hand-compiling that algorithm.
01:23
<&McMartin>
Yeah, this is like a 25-50% decrease in code size.
01:25 Orthia [orthianz@3CF3A5.E1CD01.5A78C0.03128C] has joined #code
01:25 mode/#code [+o Orthia] by ChanServ
01:45 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Client exited]
01:55 * gnolam vomits bile over all of humanity.
02:00
<&McMartin>
On the other hand, it doesn't actually work.
02:09
<&McMartin>
Aaand, now it works
02:10 * McMartin had managed to buffer overflow one of his integers~
02:10
<&McMartin>
Sign extension is your friend~
02:13
<&McMartin>
OK. that works, but it's not any faster, probably because I haven't done the pen-based optimization yet.
02:13
<&McMartin>
But the part where it's deciding which points to plot is now working.
02:17
< RichyB>
Sweet.
02:19 syksleep is now known as Syk
02:31
<&McMartin>
And, that's the pen-based optimization done.
02:31
<&McMartin>
It's a 35% speedup.
02:33
<~Vornicus>
pen-based optimization?
02:34
<&McMartin>
Instead of recomputing the memory address and bitmask at each point on the line, cache them and transform them as needed.
02:34
< Syk>
it's where you get a BiC and threaten your codebase until it stops being slow
02:34
<&McMartin>
Oh, it's still pretty slow.
02:34
<&McMartin>
But it's now slow like BASIC-on-a-286 slow, not slow like, well, non-demoscene Commodore 64 slow.
02:35 Kindamoody[zZz] is now known as Kindamoody
02:36
< Syk>
heh
02:36
< Syk>
demoscene c64 was some insane shit
02:51 Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code
02:51 mode/#code [+ao Derakon Derakon] by ChanServ
02:57
<&McMartin>
Ahahaha, oh, that's great
02:58
<&McMartin>
Yeah, OK, I'm pretty much honor-bound to write Mystify now, that is *hilarious*
02:58
<&McMartin>
Apparently a standard technique is to set one of the channels to be volume-0 high-frequency noise and then read that channel's sound output as your random number generator
03:08
<&Derakon>
Mystify?
03:10
<&McMartin>
An old Windows screensaver that involves progressive wandering lines a la the old game "Qix"
03:10
<&McMartin>
But which requires a random element, which in machine language is often Kind Of Hard To Do without big support libraries, etc.
03:10
<&McMartin>
... or you can just tap into the sound chip, apparently.
03:11
<&Derakon>
Ahh.
03:12
< RichyB>
I do not want to admit how much of my life I have spent staring at a running copy of Mystify. ;)
03:12
<&Derakon>
Heh.
03:12
<&Derakon>
I used to write screensavers for my TI-83+.
03:12
<&Derakon>
Can't remember if any of them were line-drawers, though I know I wrote a drawing program as well.
03:13
<&Derakon>
All very, very crude programs, mind.
03:14
<&ToxicFrog>
I didn't write screensavers, but I did write a (terrible) roguelike.
03:15
<&ToxicFrog>
And a program for storing images in matrix variables.
03:15
<&ToxicFrog>
I'm not sure why I thought that latter was useful, given that the 83+ has intrinsic support for saving and loading images, too.
03:19
<&Derakon>
I never really worried about images on my calculator, considering the hilariously crude display.
03:24 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has joined #code
03:44 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has quit [Ping timeout: 121 seconds]
03:45 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:56 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has joined #code
04:08
<&McMartin>
Oy
04:08
<&McMartin>
OK, my next task involves SCIENCE
04:08
<&McMartin>
Also spans of time for which the most appropriate unit is microseconds
04:08
<&McMartin>
This would have been so much cooler 20 years ago.
04:13
<&Derakon>
What, are microseconds old hat now?
04:14
<&McMartin>
Well, I'm doing a little cyclecounting
04:15
<&McMartin>
I rather imagine one needs ns for that now to be comfy.
04:16
<&McMartin>
And once you leave a single computer, ms seem to be the way to go, and always have been
04:16
<&Derakon>
Ahh.
04:17 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
04:17
<&ToxicFrog>
These days, cyclecounting means tenths of nanoseconds (or hundreds of picoseconds, if you prefer)
04:18
<&McMartin>
I'd usually go with .1 ns, just as I'd usually go with .1ms over 100 us.
04:18
<&Derakon>
3GHz = .33ns/cycle, if I did my math right.
04:18
<&McMartin>
Right
04:18
<&McMartin>
Meanwhile, I'm working with a machine at roughly 1 Mhz.
04:19
<&McMartin>
So I need to work out how fast the sound chip's oscillator changes compared to how much computation I can do.
04:19
<&Derakon>
I.e. how often you need a new random number?
04:19
<&McMartin>
How often I *can get* a new random number, and thus maybe need to buffer stuff up
04:20
<&McMartin>
I'll have plenty new at the outer loop, which is 20 ms long, because VSYNC is a cruel and foreign overlord.
04:20
<&Derakon>
Heh.
04:20
<&Derakon>
I wasn't aware that the C64 was locked to 50FPS.
04:20
<&Derakon>
Isn't that the PAL rate?
04:21
<&McMartin>
It is
04:21 io\PACKERS is now known as iospace
04:21
<&McMartin>
The C64 was much, much bigger in Europe than the US, so all recreations of it and arhived programs &c are all PAL.
04:21
<&Derakon>
Hunh.
04:21
<&Derakon>
My dad had a C64 and tons of disks of downloaded software.
04:21
<&Derakon>
So I never really associated it with "foreign".
04:21
<&McMartin>
Yeah, so did I.
04:22
<&McMartin>
...oops, sec
04:22
<&McMartin>
OK
04:22
<&McMartin>
So, I also had lots of software of dubious provenance
04:23
<&McMartin>
... and it turns out that I was playing most of them about 15% too fast~
04:23
<&McMartin>
Which is where my reflexes were trained up
04:23
<&Derakon>
Heh.
04:23
<&Derakon>
I don't think I was ever very good at the games -- I was pretty young -- so I don't remember if they seemed unusually fast.
04:23
< Syk>
i trained my reflexes in CoD4 multiplayer on ps3
04:24
< Syk>
i had 400-600ms lag
04:24
<&McMartin>
Yeah, I didn't twig to this until tracking them down again 20 years later
04:24
<&McMartin>
Sometimes by the soundtrack
04:24
< Syk>
so i had to have a reaction time in the negatives to ever win anything :(
04:24
< Syk>
AKA firing shotguns around corners preemptively
04:24
<&McMartin>
(Thank you, Jeroen Tel, for being extremely distinctive as a composer.)
04:30 * Derakon watches a C64 games montage on YouTube.
04:30
<&Derakon>
There's some pretty seriously impressive stuff here.
04:30
<&Derakon>
...including R-Type, apparently. O_o
04:32
<&Derakon>
And something that looks suspiciously like Aleste.
04:32
<&Derakon>
Haha, and there goes Star Control.
04:33 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has quit [Ping timeout: 121 seconds]
04:41
<&McMartin>
OK, looks like it updates with my default settings about once a scanline.
04:41
<&McMartin>
60 microseconds or so.
04:42
<&McMartin>
So as long as I don't poll it *too* frequently I can probably get away with this, or I can put in a time delay loop to guarantee it
04:51 RichyB [mycatverbs@Nightstar-86656b6c.cable.virginmedia.com] has quit [[NS] Quit: Aaaaaaa, run away!]
04:51 RichyB [mycatverbs@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
04:51 RichyB [mycatverbs@Nightstar-86656b6c.cable.virginmedia.com] has quit [Connection closed]
05:07
<&Derakon>
class Timer(things.thing.Thing):
05:07 * Derakon sighs.
05:09
<&McMartin>
-_-
05:11
< Syk>
hmm okay
05:11 * Syk has a bit of a think about this
05:24 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has joined #code
05:31
<~Vornicus>
Der: what the fuck
05:34
<&Derakon>
Vorn: well, I have a base class Thing which has a bunch of child classes, so they all go in the things package, and Thing is in the things.thing module.
05:34
<&Derakon>
I guess Thing could be moved into things, but it still weirds me out to put stuff into __init__.py files.
05:37 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has quit [Ping timeout: 121 seconds]
06:19 ErikMesoy1 [Erik@Nightstar-be32adc8.80-203-17.nextgentel.com] has joined #code
06:21 ErikMesoy [Erik@Nightstar-be32adc8.80-203-17.nextgentel.com] has quit [Ping timeout: 121 seconds]
06:57 Derakon is now known as Derakon[AFK]
07:44 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has joined #code
09:19 * Vornicus gets around the need for data-ifying his klotski solver puzzle format by writing the bounds data in the shape of the actual bounds.
09:32 * TheWatcher[zZzZ] eyes DHS
09:33 You're now known as TheWatcher
09:38
<~Vornicus>
http://pastebin.com/FEHV42dw basically, never do this.
09:41 AnnoDomini [AnnoDomini@Nightstar-27936bbc.dynamic.chello.pl] has quit [Ping timeout: 121 seconds]
10:26 Kindamoody is now known as Kindamoody|out
11:34 d4de [olorin@687AAB.1E386D.9FE338.92E600] has quit [Ping timeout: 121 seconds]
11:35 d4de [olorin@687AAB.1E386D.9CFB14.25391C] has joined #code
12:28 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Client closed the connection]
12:40 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
13:05 ErikMesoy1 is now known as ErikMesoy
15:15 Syk [the@A6D346.0C1313.97001D.1140D4] has quit [Client closed the connection]
15:18 Syka [the@A6D346.0C1313.97001D.1140D4] has joined #code
15:18 thalass [thalass@Nightstar-724ec5eb.bigpond.net.au] has joined #code
16:15 thalass is now known as Thalassleep
16:16 Syka is now known as syksleep
16:19 Thalassleep [thalass@Nightstar-724ec5eb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
17:17 Kindamoody|out is now known as Kindamoody
17:22 Derakon[AFK] is now known as Derakon
17:41 Kindamoody is now known as Kindamoody|afk
17:56 ErikMesoy is now known as Dainna
18:05 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
18:05 mode/#code [+o celticminstrel] by ChanServ
18:07 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
18:07 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
18:07 mode/#code [+o celticminstrel] by ChanServ
19:02 Kindamoody|afk is now known as Kindamoody
19:09 Kindamoody is now known as Kindamoody[zZz]
19:58 OrthiaLap [orthia@3CF3A5.E1CD01.5A78C0.03128C] has quit [Ping timeout: 121 seconds]
20:06
<@Alek>
"A couple weeks ago I was helping a friend pick out an ebook reader. I was looking at the hardware specs and figuring out if it'd run apache+php on freebsd. A fracking e-book with a server."
20:07
< Dainna>
much like every program attempts to expand until it can read email, so every platform expands until it can run a server.
20:07
< Dainna>
See also: running Linux on a dead badger
21:25 Vornicus [vorn@Nightstar-221158c7.sd.cox.net] has joined #code
21:25 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:27
<@Reiv>
"It works, we just have a few issues with hardware stability"
22:46 Dainna is now known as ErikMesoy
23:09
<@iospace>
oh that's cool, analogue triggers, like the ones on an 360 controller, are potentiometers at their core... which relays to an ADC
23:10
<&McMartin>
Yeah, they show up as joystick axes on a USB HID.
23:11
<@Reiv>
... there was ever doubt they'd be anything else?
23:12
<&McMartin>
Sometimes they show up as the same axis >_<
23:12
<@Reiv>
I mean, they were just really short joysticks, so they'd be, y'know, joystick tech. Yes?
23:12
<@Reiv>
snrk
23:12
<&McMartin>
Unfucking this is the difference between XInput and DirectInput
23:13
<@Reiv>
?
23:15 * Reiv remains vaugely convinced that the console would be a reasonably sensible place for a space sim game; the dual joysticks would let you steer with one and mouselook with the other far more gracefully than WASD does, and even the steering-lag would be acceptable (Vehicle mass on one hand, turret servos on the other)...
23:15
<@Reiv>
And yet, no-one has done a Freespace Xbox or anything. I wonder what stops it.
23:15
<&McMartin>
The enormous piles of money made by the Saint's Row series
23:16
<@Reiv>
:/
23:31 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
23:35 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has left #code ["Leaving"]
23:35 mac [mac@Nightstar-fe8a1f12.il.comcast.net] has joined #code
23:44 ErikMesoy is now known as ErikMesoy|sleep
--- Log closed Mon Jan 14 00:00:47 2013
code logs -> 2013 -> Sun, 13 Jan 2013< code.20130112.log - code.20130114.log >

[ Latest log file ]