code logs -> 2012 -> Tue, 29 May 2012< code.20120528.log - code.20120530.log >
--- Log opened Tue May 29 00:00:52 2012
00:09
<~Vornicus>
Given a location in your data arrays or something like it - a lat-long, or a healpix coordinate, or something like that - you should be able to quickly determine the rendering-space location that that data refers to.
00:09
<~Vornicus>
By doing so you can quickly rejigger low-detail data into high detail form.
00:16 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
00:19
< Rhamphoryncus>
yeah
00:20
< Rhamphoryncus>
Without projection I can just repeatedly apply the 4-way split (3 corner triangles and 1 center triangle). That can even be sped up by doing multiple stages at once
00:20
< Rhamphoryncus>
But with projection..
00:21
< Rhamphoryncus>
Not to mention needing to raytrace a screen coordinate back to a map location
00:23
< Rhamphoryncus>
Hmm. I bet I could cache most of those calculates for loaded cells
00:29
< Rhamphoryncus>
*ponders* A supercell could be the 20 triangles of an icosahedron, labelled A through T, with cells being a fixed relative to the train (on the order of 10000 in a game), with the scale between them configurable
00:32
< Rhamphoryncus>
So 256 cells in a supercell. 4 levels of subdivision
00:34
< Rhamphoryncus>
Greater subdivision being possible if you want to focus on one area of the globe. The supercells would be capable of sparse storage with most of the possible cells being blocked from generating
00:38
< Rhamphoryncus>
So you'd have coordinates of maybe F023.0142832.1034537
00:39
< Rhamphoryncus>
That's supercell, cell, tile, subtile
00:46 You're now known as TheWatcher[T-2]
00:49 You're now known as TheWatcher[zZzZ]
00:52
< Rhamphoryncus>
5629499534213120 points
00:52
< Rhamphoryncus>
Which.. is 52 bits XD
00:54
< Rhamphoryncus>
20*4**24
01:02 McM[laptop] [mcmartin@D82662.D31C25.6679A5.329716] has joined #code
01:02
< McM[laptop]>
Ah, it seem Rham isn't around
01:02
< McM[laptop]>
I got my little King AI working.
01:03
< McM[laptop]>
It appears to have a 78% success rate without taking land sales into account, over a million trials.
01:03
< Rhamphoryncus>
Not around?
01:03
< McM[laptop]>
Alternately, I guess tab completion doesn't work on this client.
01:03
< Rhamphoryncus>
indeed
01:03
< Rhamphoryncus>
nice
01:04
< McM[laptop]>
I think I can reorganize it.
01:04
< McM[laptop]>
I just discovered "Marginalia", which is *awesome*
01:04
< Rhamphoryncus>
huh?
01:04
< McM[laptop]>
Literate-programming approach to docstrings and an autoformatter to go with it
01:04
< McM[laptop]>
Here is its source code processed through it: http://fogus.me/fun/marginalia/
01:11
< McM[laptop]>
Also, while I was out, I added a dozen issues or so to Ophis and specced out Ophis 2.0, so hooray for that
01:12
< Rhamphoryncus>
:)
01:12
< Rhamphoryncus>
I've figured out the grid system for YASTTC
01:13
< Rhamphoryncus>
over the past several hours with lots of help from vorn
01:14
< McM[laptop]>
woot
01:14
< Rhamphoryncus>
Start with an icosahedron, then recursively subdivide each triangle into 4 more triangles. That's the basic idea but there's a lot of specifics
01:15
< Rhamphoryncus>
The exact shape of the triangles will be tweaked a bit to reduce the size variation between those with the most and those with the least distortion
01:16
< Rhamphoryncus>
Normally each of the 20 large triangles, which I'm calling a supercell, will be subdivided into 256 cells
01:16
< Rhamphoryncus>
And each cell has 4**10 tiles
01:17
< Rhamphoryncus>
But if you want a smaller map area you can sparsely allocate within the supercell, keeping the total number of cells the same
01:18
< Rhamphoryncus>
objects within a cell (which are positioned as objects, not tile attributes), have a coordinate system that further subdivides each tile by 4**10
01:21 * McM[laptop] nods
01:21
< McM[laptop]>
GOod luck
01:21 * McM[laptop] should go eat a little before leaving on a jet plane. See all y'all on the other side of the San Gabriels
01:21
< Rhamphoryncus>
This is assuming the map on disk takes on the order of 10 gigs
01:21
< McM[laptop]>
Also: https://github.com/michaelcmartin/Ophis/issues?milestone=2&page=1&state=open
01:22
< Rhamphoryncus>
Smaller will be possible by reducing the number of cells
01:22 McM[laptop] [mcmartin@D82662.D31C25.6679A5.329716] has quit [[NS] Quit: Leaving on a jet plane]
01:27
< Rhamphoryncus>
I wonder if it would be sufficient to place the midpoint of each subdivided triangle halfway along the projected median?
01:59
< Rhamphoryncus>
Well, that's mildly inconvenient. Now that I've figured this all out I look at opengl and.. their tessellation is nothing like what I've decided on
02:03
< Rhamphoryncus>
I'll have to do a more traditional set of vertex templates instead
02:15 Attilla [Obsolete@Nightstar-99e308f6.as43234.net] has quit [Ping timeout: 121 seconds]
02:19 io|GF is now known as iospace
02:19 Kindamoody[zZz] is now known as Kindamoody
02:27 Vash [Vash@Nightstar-a60eef95.ct.comcast.net] has joined #code
02:27 mode/#code [+o Vash] by ChanServ
02:55
< celticminstrel>
I suppose overloading % to mean "contains" isn't exactly a good idea, but it's slightly less unintuitive than having a named function and much better than doing all the calculations inline every time.
02:55
< celticminstrel>
And the ideal option (making a contains() member function) isn't one.
02:58
< Rhamphoryncus>
what language?
02:58
< celticminstrel>
C++
03:00
< celticminstrel>
On an unrelated note, I like how shared_ptr lets me forget about freeing the surface. All I need to do is pass SDL_FreeSurface as the deleter.
03:00
< Rhamphoryncus>
Hrm. std::set uses .find()
03:00
< Rhamphoryncus>
Yeah. Refcounting win
03:01
< celticminstrel>
(Also, the "overloading %" applied to SDL_Rect and my point class.)
03:03
< Rhamphoryncus>
If .find()'s API works in your case I would do that to avoid duplication, but I'm doubtful it will
03:04
< celticminstrel>
Huh?
03:04
< celticminstrel>
Oh, you thought I meant contains for a container, not a rectangle.
03:04
< celticminstrel>
Sorry. <_<
03:05
< Rhamphoryncus>
oops, I do mean a container
03:06
< Rhamphoryncus>
Your comment about SDL_Rect suddenly makes much more sense :)
03:07
< Rhamphoryncus>
Your usage is closer to a set subset test
03:07
< Rhamphoryncus>
Python uses >,>=,<,<= for set subset tests, but that's a bit ugly IMO
03:10
< celticminstrel>
I think I agree... it might be a little less strange than %, though. I only chose that because it's not (inherently) arithmetic and doesn't map to a set operation as &^| do.
03:11
< Rhamphoryncus>
Yeah, you want a boolean result
03:11
< celticminstrel>
(I actually overloaded | for intersect as well, just in case I might need it later.)
03:12
< Rhamphoryncus>
... aww C++11 has alignas() to add padding but not remove it :(
03:13
< celticminstrel>
I think it might also have align attributes, but I don't think clang supports those yet.
03:14
< Rhamphoryncus>
I'm using the unreleased clang 3.2
03:14
< celticminstrel>
...well, it supports [[unused]], so I guess I'm probably mistaken.
03:14
< celticminstrel>
I have 3.0 because I'm on Xcode 4.2 and lazy. <_<
03:15
< celticminstrel>
Was contemplating going to 3.1 for lambdas, but again, lazy.
03:17
< celticminstrel>
The clang cxx status page doesn't mention 3.2.
03:17
< Rhamphoryncus>
Yeah, I was on 3.0 for a while. It was missing a couple C++11 features I wanted though, and later I hit a compiler bug. I reported that and got a "Can you check against trunk?". I grumbled and installed trunk and indeed it was fixed
03:17
< Rhamphoryncus>
Oh, oops! 3.1 has been branched off trunk but isn't quite released
03:17
< Rhamphoryncus>
I am using trunk which in name has gone to 3.2
03:18
< celticminstrel>
I think I hit a compiler bug too...
03:18
< Rhamphoryncus>
Mine was just an assertion due to a parse error
03:18
< Rhamphoryncus>
(and yes, my code was malformed)
03:19
< Rhamphoryncus>
Missed a semicolon after class definition
03:21
< Rhamphoryncus>
oh, that's cute C++. Other people have already created their own hash_set so when C++11 added hash tables they named it unordered_set instead
03:22
< celticminstrel>
I don't think my code was malformed; I had an inline function or something, followed by a function with an enum class argument. I'm not really sure what caused it, but they didn't need to be separate functions, so I merged them and it compiled.
03:24
< Rhamphoryncus>
huh
03:24
< Rhamphoryncus>
That sounds like it could be a missing semicolon
03:25
< Rhamphoryncus>
I hit it several times and only one instance crashed. The rest gave bizarre errors down the line
03:35
< celticminstrel>
I suppose it could've been, but if so, I didn't see it. :P
03:35
< celticminstrel>
And the exact line code is lost between git revisions.
03:35
< celticminstrel>
^-line
03:35
< Rhamphoryncus>
yeah
03:36
< Rhamphoryncus>
Hum, maybe I only need two triangles templates: the first will be a plain triangle, the second will be a triangle with one of the faces subdivided into two
04:45 Vornucopia [NSwebIRC@Nightstar-a60eef95.ct.comcast.net] has joined #code
05:18 Vornucopia [NSwebIRC@Nightstar-a60eef95.ct.comcast.net] has quit [[NS] Quit: Page closed]
05:18 McMartin [mcmartin@Nightstar-56b4e70b.pltn13.sbcglobal.net] has joined #code
05:18 mode/#code [+ao McMartin McMartin] by ChanServ
05:26 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
05:39 iospace is now known as iospacedout
05:51 ErikMesoy|sleep is now known as ErikMesoy
06:13 Derakon is now known as Derakon[AFK]
06:43
<&McMartin>
w00t
06:43 * McMartin gets Ophis to build an Atari 2600 ROM.
06:43
<&McMartin>
This also highlighted a bug in my new instruction selector. >_>
06:46 Kindamoody is now known as Kindamoody|out
06:48 Vash is now known as VV
07:20 McMartin_ [mcmartin@Nightstar-4753de43.pltn13.sbcglobal.net] has joined #code
07:23 McMartin [mcmartin@Nightstar-56b4e70b.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
07:24 Reiv [reiverta@5B433A.F67240.F02BF2.29E651] has joined #code
07:32 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out]
07:33 ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code
07:33 mode/#code [+o ToxicFrog] by ChanServ
08:11 McMartin_ is now known as McMartin
08:11 mode/#code [+ao McMartin McMartin] by ChanServ
08:26 VV [Vash@Nightstar-a60eef95.ct.comcast.net] has quit [[NS] Quit: I <3Lovecraft<3 Vorn!]
08:52 rms [rstamer@Nightstar-e681a855.org] has quit [Ping timeout: 121 seconds]
08:58
< sshine>
Rhamphoryncus, you say that because a part of the map will be connected by train, it must be fully detailed. but why not send a train off to some unexplored blob that stores what kind of interaction it gets by rail, and if/when it gets explored, it has stored all those interactions chronologically which can then be used to procedurally generate its current situation. that way it will have those effects over time without the need to ...
08:58
< sshine>
... explicitly generate all the details at the time.
08:59
< sshine>
at the beginning of time*
08:59
< Rhamphoryncus>
sshine: I may well do that, but I still want an upper bound
09:02 rms [rstamer@Nightstar-e681a855.org] has joined #code
09:02 mode/#code [+o rms] by ChanServ
09:46 Attilla [Obsolete@Nightstar-99e308f6.as43234.net] has joined #code
09:58 You're now known as TheWatcher
11:30 * Reiv attacks Vornicus with clowns.
11:31
< Reiv>
A simple query, but I lack Excel
11:32
< Reiv>
Distribution curves: 2d20, Pick Highest & 2d20, Pick Lowest.
11:32
< Reiv>
Feel free to throw on a line for 5% for 1d20 if you want~
11:34 * TheWatcher huhs as he finds himself reusing yet more code from other projects in this monster
11:34 iospacedout is now known as iospace
11:35
<@TheWatcher>
I don't know about giving my 'main' project the acronym MCP, I think this thing might be more worthy of it...
11:35
< iospace>
MCP being?
11:36
<@TheWatcher>
You've never seen Tron, I take it?
11:36
< iospace>
nope
11:36
< iospace>
never have
11:38
<&McMartin>
TheWatcher: Do you have a different program you can call CLU?
11:38
<@TheWatcher>
Not yet >.>
11:39
<@TheWatcher>
iospace: MCP = Master Control Program, the main antagonist in the first tron film. It could assimilate and subvert other programs to extend itself.
11:40
< iospace>
ah
11:40
<&McMartin>
*** YES ***
11:41
< iospace>
TheWatcher: it's 0541
11:41
< iospace>
you can guess how aware i am at this given moment
11:42 * TheWatcher applies the Caffeinator
11:42 * iospace passes, applies concerta
11:52
<&McMartin>
So, I was gloating about this elsewhere, I might as well do it here
11:53
<&McMartin>
I have successfully hacked an Atari 2600 program, in a way that required reverse-engineering cycle-counting madness.
11:53
<&McMartin>
http://www.biglist.com/lists/stella/archives/199803/msg00201.html was the original source.
12:06 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
12:13 Kindamoody|out is now known as Kindamoody
12:32 Kindamoody [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has quit [[NS] Quit: I need to reboot, I'll be back in a bit. I hope. :P]
13:03 Kindamoody|out [Kindamoody@Nightstar-6154a72a.tbcn.telia.com] has joined #code
13:03 mode/#code [+o Kindamoody|out] by ChanServ
13:04 Kindamoody|out is now known as Kindamoody
13:21 * McMartin begins reverse-engineering the Display Kernel.
13:27 Vash [Vash@Nightstar-a60eef95.ct.comcast.net] has joined #code
13:27 mode/#code [+o Vash] by ChanServ
13:42
<&McMartin>
... oh my God
13:42 Reiv [reiverta@5B433A.F67240.F02BF2.29E651] has quit [Connection reset by peer]
13:43
<&McMartin>
What twisted genius originally did this
13:43 Reivles [reiverta@5B433A.F67240.F02BF2.29E651] has joined #code
13:43
<@TheWatcher>
?
13:44
<&McMartin>
I have to do more math first to prove it
13:44
<&McMartin>
But I just figured out how they got smooth horizontal motion despite horizontal placement involving cycle counts
13:46
<&McMartin>
He did.
13:46
<&McMartin>
OK
13:46
<&McMartin>
The way he gets variable cycle delay is by doing a jump-indirect into an array of numbers that are also instructions
13:47
<&McMartin>
These are chosen so that each time you increase your offset into the array by one, it takes exactly one less cycle to execute
13:47
<&McMartin>
And it does this by having most of those jumps be into what would, with other indices, be the middle of instructions
13:47
<&McMartin>
Since the minimum time to execute any given instruction is 2 cycles.
13:48
<&McMartin>
I think this will let me get rid of the last of the inexplicable boundary constants - they're direct pointers into this array.
13:49
<&McMartin>
That was how the X-Coordinate was being stored.
13:57 Vash is now known as VV
13:58
<@VV>
what's this game?
14:00
<&McMartin>
It's not a game
14:00
<&McMartin>
It's a demo of six simultaneous sprites on the same scanline on an Atari 2600
14:00
<&McMartin>
I am ripping its darkest secrets from its innermost heart.
14:01
<@VV>
That's really, really twisted and evil.
14:01
<&McMartin>
I've been trying to mod it
14:01
<&McMartin>
I have, in fact, been successful at modding it.
14:01
<&McMartin>
This is my first time truly Racing The Beam.
14:05
<&McMartin>
That said, my true companion in this journey is the same as it always is: the Commodore 64 Programmer's Manual
14:06
<@VV>
...for an atari 2600?
14:06
<&McMartin>
Same chip family
14:06
<&McMartin>
Extremely detailed timing information. Still valid.
14:06
<&McMartin>
And binary compatible, so I was able to map those .byte sequences into opcodes, and thus, timings
14:07
<@VV>
nice.
14:07
<@VV>
absolutely crazygobatshit
14:07
<@VV>
but nice.
14:08
<&McMartin>
The C64 Programmer's Manual has been my favorite manual for over 20 years now.
14:08
<&McMartin>
It still is.
14:08
<&McMartin>
Not kidding.
14:08
<&McMartin>
Chip pinouts, full spec of BASIC, the machine code, opcodes, timings...
14:08
<&McMartin>
... there's enough data in it to write a reasonably solid C64 emulator just from it.
14:09
<@ToxicFrog>
Sounds like my 68k manual.
14:09
<&McMartin>
I'm told there are also ones for the Z80.
14:09
<&McMartin>
Also, you should read the past few screens of backscroll in here and in #fleet for my latest Feat of Strength.
14:14
<@TheWatcher>
There's also one for the A500
14:14
<@TheWatcher>
Which includes the full circuit diagrams for the system
14:14
<@TheWatcher>
(I still have it in the attic somewhere)
14:20 Kindamoody is now known as Kindamoody[coding]
14:33 * iospace eyes this usb stick
14:38
<&McMartin>
Oh, you ruthless bastard.
14:38
<&McMartin>
I wondered why you weren't doing any wait-for-HBLANKs there.
14:38
<&McMartin>
It's because your loop is exactly one HBLANK long as long as you keep taking the branch back to the start of the loop.
14:39
< iospace>
this usb stick likes to write protect itself...
14:40
<@ToxicFrog>
o.O
14:40
<@ToxicFrog>
Are you sure it's the stick, and not filesystem damage causing the OS to remount it ro?
14:44
< iospace>
it's something
14:44
< iospace>
cause we were able to restore it to a non RO state, then it lockedup again after formatting
14:45
<@TheWatcher>
Sounds like the flash is dying.
14:46
< iospace>
either or
15:03 Reivles [reiverta@5B433A.F67240.F02BF2.29E651] has quit [Client closed the connection]
15:27
<&McMartin>
... this code appears to be impossible, or else those registers don't do anything remotely like what I think they do.
15:31
<@VV>
This thing you're doing is in fact Heroic, isnt it.
15:31
<&McMartin>
No
15:31
<@VV>
What's it look like it's trying to do.
15:32
<&McMartin>
This thing one of the authors of Stella is doing is heroic.
15:32
<&McMartin>
I am trying to do science to it and figure out what on Earth he did.
15:32
<&McMartin>
This is after I have successfully modified this code.
15:32
<&McMartin>
So, the 2600 has two "player" objects, and player objects can self-replicate on the same scan line
15:33
<&McMartin>
What I *thought* he was doing was rapidly shuffling between where the player objects got their graphics data, thus giving the effect of multiple objects on screen at once with different graphics.
15:33
<&McMartin>
But the graphic is 48 pixels wide, and the shuffling of where data comes from is taking places over 144 pixels, or very nearly an entire scanline.
15:34
<&McMartin>
I am forced to wonder if there's some kind of buffering the Television Interface Adaptor has, that it's hiding from us.
15:44
<&McMartin>
Answer: Looks like, appears to involve VDEL somehow.
15:53
<&McMartin>
Oh God, this is going to be like NES scrolling.
15:54 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
15:57
<&McMartin>
Yeah, OK
15:57
<&McMartin>
This is some fairly simple piece of hardware that got abused beyond recognition by everyone.
15:57
<&McMartin>
I will not be able to face this without laying in a great store of tea.
15:58
<@VV>
NES scrolling?
15:58
<@VV>
I remember doing some work with C64 scrolling.
15:58
<&McMartin>
C64 scrolling is comparatively direct
15:58
<@VV>
Which was crazy.
15:58
<@VV>
oh god
15:58
<&McMartin>
Let me find the relevant quote~
15:59
<&McMartin>
(I wrote one of the mid-level NES tutorials, and I think the first to popularize simple-easy scrolling code instead of the crazy pin-level emulation you needed to be an emu writer)
15:59 Kindamoody[coding] is now known as Kindamoody
16:00
<&McMartin>
"The basic protocol for scrolling works like this: (six step process, of which two are "write horizontal scroll value into $2005, then write vertical scroll value)"
16:00
<@VV>
link to the source when you're there
16:01
<&McMartin>
I don't think it's directly online anywhere, and I haven't updated it for Ophis properly yet.
16:01
<&McMartin>
"Failure to adhere to this protocol can produce astonishing results, some of which you may even have intended, and a few of which might even be emulated by your emulator of choice."
16:01
<&McMartin>
http://nesdev.parodius.com/NES101.zip is the old article and sample code.
16:01
<&McMartin>
But it uses Perl65, not Ophis proper.
16:02 Noah [nbarr@Nightstar-fefda721.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
16:03
<&McMartin>
""Another way of saying it is that to deal with a VCS you have to unlearn every good programming practice you've learned," said Mr. Mauer, who designed Space Invaders."
16:07 * McMartin has found a 1983 article from IEEE that explains the feature this "impossible" code appears to be using.
16:08
<@VV>
Nice.
16:10
<&McMartin>
However, in order to work out how it does what it does, I'm going to have to acquire more caffeine.
16:14 Noah [nbarr@Nightstar-fefda721.pools.spcsdns.net] has joined #code
16:16 * VV gives McM a rocket can.
16:20
<&McMartin>
Also, this book exists.
16:20
<&McMartin>
http://www.amazon.com/Racing-Beam-Computer-Platform-Studies/dp/026201257X/ref=sr _1_1?s=books&ie=UTF8&qid=1338304453&sr=1-1
16:23
<&McMartin>
VV: I say the C64 scrolling is straightforward because there was, IIRC, some register you wrote that was basically "please shift the whole display this many pixels to the left/down"
16:23
<@VV>
Yeah, it was awesome.
16:23
<&McMartin>
And left it to standard tile-blitting to scroll amounts larger than that.
16:23
<&McMartin>
NES has some amazing support for continuous scrolling in bulk that it gets by being poorly wired. -_-
16:24
< Noah>
You don't think it was deliberately wired that way?
16:24
<&McMartin>
(It has two full screens worth of tiles, but thinks it has four. By not connecting certain wires in the address lines on your cartridge, this gave you infinite horizontal and vertical scrolling.)
16:24
<&McMartin>
Oh, it was deliberate.
16:24
<&McMartin>
It was also the first thing to get bankswitched into Don't Do That, Stupid.
16:25
< Noah>
Heh
16:25
<@VV>
Yeah, I remember doing that - I would, as I scrolled far enough, advance the charmap pointer and update only one character out of forty.
16:26
<@VV>
Or at least I tried doing that, I think I ran into some stupid problem like "you've crashed program memory"
16:26
<&McMartin>
NES "characters" aren't as independent of each other as the C64's were, so that decision is kind of forced
16:26 * McMartin should consider doing the classic demo thing where you change the scroll amount every scanline like a boss
16:26
<@VV>
I wasn't a very good programmer back then.
16:27
<@VV>
yeah, I remember that happening in Caveman Games.
16:27
<@VV>
Thought that was awesome.
16:28
<&McMartin>
76 cycles per scanline, gotta make 'em count.
16:28
<&McMartin>
Oh yeah, that's right, things that are awesome
16:28
<&McMartin>
Having a register to read that tells you WHAT SCANLINE YOU ARE ON
16:28
<&McMartin>
Also to have it optionaly hit you with an IRQ upon hitting a named one
16:35
<@VV>
that's awesome.
16:35
<@VV>
what system is that?
16:39
<@VV>
...you know it occurs to me. Your modern TV has to dewtfify ntsc. That must be a pain.
16:41
<&McMartin>
Both of those things I named that were awesome were things the C64 would do for you
16:42
<&McMartin>
Not to mention that the binary OS-level linking that it needs to make a program LOADable is all of two bytes long.
16:42
<&McMartin>
In short, there are many reasons beyond personal history why Ophis has been C64-centric for the past ten years.
16:43
<&McMartin>
"You are the NaN, which must become Juffo-Wup or void *."
16:44
<&McMartin>
Anyway, the stunt being used here
16:45
<&McMartin>
The Atari 2600's Television Interface Adaptor had a feature called "Vertical Delay", which was intended to let you delay drawing objects for one scanline. The expectation is that most "pixels" would be two scanlines tall.
16:45
<&McMartin>
Since the TIA has no memory to speak of the concept of "pixels" is a little advanced
16:46
<&McMartin>
Anyway, it turns out that by abusing it in various ways you can use it to buffer graphics updates mid-scanline, and that looks like that's what this code is doing.
16:47
<&McMartin>
Oh, did I mention the Atari 2600 only has 128 bytes of RAM?
16:47
<&McMartin>
Because the Atari 2600 only has 128 bytes of RAM.
16:50
<&McMartin>
Yup, there's the Impossible Gap explained >_<
16:50 * McMartin gets a new sheet of paper, draws up a timing diagram
16:50
<@TheWatcher>
Did you just say 128 bytes of RAM
16:51
<@VV>
Welcome to the atari 2600.
16:51
<&McMartin>
I think I may have mentioned that
16:51
<@VV>
I knew ram was expensive back then but that's a little much
16:51
<&McMartin>
It came free with the timer chip.
16:52
<@TheWatcher>
I note that's the same amount of memory as the Manchester Baby, ffs.
16:53
<&McMartin>
And look how much smaller it is!
16:53
<@TheWatcher>
heh
16:53
<@TheWatcher>
This is true.
16:53
<&McMartin>
But yeah, the 2600 has no actual RAM chips or anything. The RAM is just part of its Peripheral Interface Adaptor.
16:54
<&McMartin>
Consoles always seem to have terrifyingly small amounts of RAM.
16:54
< Noah>
It's true
16:54
<&McMartin>
The NES had 2KB.
16:54 ErikMesoy is now known as Harrower
16:54
<&McMartin>
The C64 had, well, 64KB, and this was a Big Deal - it also had some weird number like 118KB of total addressable Stuff because of bankswitching.
16:54
< Noah>
But they aren't doing the multitasking that PCs do
16:54
< Noah>
Well
16:54
< Noah>
They are now, but yea
16:55
<&McMartin>
The IIe had 128KB and bankswitched it - not sure how.
16:55
<&McMartin>
Noah: Well. All these old machines are multiprocessor nightmares
16:55 Kindamoody is now known as Kindamoody|afk
16:55
<@VV>
128kb is a weird number.
16:55
<&McMartin>
The C64's the only one I've used that isn't packed with horrifyingly stateful memory-mapped I/O.
16:55
<@VV>
17 bits of address space.
16:56
<&McMartin>
No, 16 bits of address space, 15 of which are locked and the 16th of which is set with a bankswitch operator.
16:56
<@VV>
I'm surprised that the NES had so little RAM
16:56
<@VV>
It seemed like it could do more than that.
16:57
<&McMartin>
The best NES carts had a full megabyte of ROM.
16:57
<&McMartin>
The program doesn't go in RAM.
16:57
<@VV>
right, I got that bit
16:57
<&McMartin>
(Also, many carts put RAM where ROM was supposed to be)
16:59
<@VV>
(ah that's what I might have missed)
16:59
<&McMartin>
All games with savestate did this.
17:00
<&McMartin>
Usually RAM chips just were there to store the graphics data in use right now.
17:01
<&McMartin>
Gradius used Bankswitched ROM for the graphics data (and actually did two bankswitches each frame, since the status data at the bottom was a different tileset than the gameplay one)
17:01
<&McMartin>
Life Force, however, just was All Bankswitched PRG-ROM, with a CHR-RAM chip filled by the PRG-ROM as needed.
17:02
<&McMartin>
Super Mario Brothers had no Bankswitching, but wound up copying code out of CHR-ROM into RAM and running it there -_-
17:02
<&McMartin>
I'm Randomly Capitalizing Letters again, I must be Short on Sleep
17:02
<@TheWatcher>
I suggest addressing that, if possible.
17:03
<&McMartin>
The plan is for this to be a Lost Day, and so that I hard-reset and am back in form tomorrow.
17:03
< gnolam>
Yes. Sleep should use at least a long, not a short.
17:03
< Noah>
Maybe You're German and That's why You're capitalizing Nouns?
17:06
<@VV>
FF12 capitalizes words so ubiquitously that I made fun of it when it didn't.
17:08 EvilDarkLord is now known as Maze
17:46
<&McMartin>
AHAHAH
17:46
<&McMartin>
PERFECT
17:46
<&McMartin>
*FLAWLESS VICTORY*
17:47
<&McMartin>
The video and CPU cycle counts (which are different speeds >_<) match up with pixel precision
17:47
<&McMartin>
So it works after all~
17:47
<&McMartin>
Or rather, it always worked
17:47
<&McMartin>
And now I understand *why*
17:57 * McMartin finishes writing it up.
17:58
<&McMartin>
https://hkn.eecs.berkeley.edu/~mcmartin/hellovcs.txt
18:57 Kindamoody|afk is now known as Kindamoody
19:02
< Tarinaky>
Ohhh... f...
19:06 Harrower is now known as ErikMesoy
19:06 Maze is now known as EvilDarkLord
19:06 Alek [omegaboot@Nightstar-efc8dc53.il.comcast.net] has quit [Ping timeout: 121 seconds]
19:08 Kindamoody is now known as Kindamoody[zZz]
19:15
< celticminstrel>
I keep thinking I should rewrite this typeid comparison operator to use dynamic_cast somehow, rather than looking up the typeid in a mapping...
19:20
< celticminstrel>
But I think there are issues with that approach...
19:21
< Tarinaky>
Argh.
19:21
< Tarinaky>
Why do I get something completely different to the solution
19:21
< Tarinaky>
Argh.
19:23 * celticminstrel blinks. Somehow this entity managed to collide with itself.
19:33
<@ToxicFrog>
Tarinaky: ?
19:39
< Tarinaky>
I can't really type the whole thing out.
19:39
< Tarinaky>
It's ridiculong.
19:39
< Noah>
Redonkulong?
19:44
< Tarinaky>
Exactly.
20:32 * iospace has been watching this screen all day
20:32 * iospace wonders what the hell the windows installer is doing
20:33 Attilla_ [Obsolete@Nightstar-aae824b5.as43234.net] has joined #code
20:34 Attilla [Obsolete@Nightstar-99e308f6.as43234.net] has quit [Ping timeout: 121 seconds]
20:40
< Tarinaky>
Okay.
20:40
< Tarinaky>
I don't understand what I don't get here.
20:40
< Tarinaky>
I have a tank full of water.
20:40
< Tarinaky>
Of some volume V
20:41
< Tarinaky>
Into which a mass of concentrate (5g/l) is being pumped at 1/2 a litre per minute.
20:41
< Tarinaky>
Now, the rate-of-change of mass is M' = 2.5 - M/12 right?
20:41
< Tarinaky>
Sorry, V is 6
20:42
< Tarinaky>
That much follows the working
20:42
< Tarinaky>
Now, my initial thought is to use an integrating factor on that.
20:42 * celticminstrel makes use of GCC's "statement expressions".
20:42
< Tarinaky>
But that's not what the worked solution uses.
20:43
< Tarinaky>
And the worked solutoon gets an answer completely different to mine!
20:43
< Tarinaky>
I have no fucking idea what I'm doing :/
21:00 Attilla_ [Obsolete@Nightstar-aae824b5.as43234.net] has quit [Ping timeout: 121 seconds]
21:05 Attilla [Obsolete@Nightstar-30884e4a.threembb.co.uk] has joined #code
21:13
<@ToxicFrog>
Tarinaky: what are you actually trying to determine?
21:15
<@ToxicFrog>
Also, units. Rate of change of mass is (5g/L) * (0.5L/minute) == (2.5g/minute) == 0.041g/s. Make sure you aren't switching between minutes and seconds by accident somewhere.
21:15
< Tarinaky>
M as a function of time.
21:16
< Tarinaky>
I am not.
21:16
< Tarinaky>
All of the numbers on the page are in coherent units.
21:16
< Tarinaky>
And the issue isn't a wrong coefficient.
21:16
< Tarinaky>
The functions I get from solving the ODE in different ways are of different forms.
21:17
<@ToxicFrog>
Shouldn't M(t) just be (2.5 * t) where t is in minutes?
21:17
< Tarinaky>
No.
21:17
<@ToxicFrog>
(well, 2.5 * t + (mass of tank))
21:17
< Tarinaky>
Because the tank is filled with water which evacuates at the same rate that concentrate is added.
21:17
<@ToxicFrog>
See, these things are important to note.
21:17
< Tarinaky>
I thought I did.
21:18
< Tarinaky>
The concentrate and whatever's in the tank also mixes instantly
21:18
<@ToxicFrog>
My assumption was that the concentrate was being added to the water, not replacing it
21:18
< Tarinaky>
I did say these questions were ridonculously long.
21:19
<@ToxicFrog>
Ok, so, wait, the water is not evacuating, the water/concentrate mix is. the proportion of concentrate in the tank will asymptotically approach 1, I think...that is nasty.
21:19
< Tarinaky>
Well, the concentrate isn't 100%
21:19
< Tarinaky>
It's just a higher concentration than in the tank.
21:19
< Tarinaky>
But yeah.
21:30
<@ToxicFrog>
Ew.
21:32
< Tarinaky>
It's ODE. Of course it's icky and messy
21:32
< Tarinaky>
I still need to pass man.
21:34 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
21:43
< celticminstrel>
I think I figured out the reason that clang crashed awhile ago.
21:43
< celticminstrel>
Something to do with having an enum class that's declared but not defined.
21:44
< celticminstrel>
Trying to pass it to a function.
21:53
< Rhamphoryncus>
celticminstrel: odd
21:53
< Rhamphoryncus>
Woo. Solved a numerical problem by multiplying by a million ;)
21:58
< celticminstrel>
Huhwhat?
22:02
< Rhamphoryncus>
Modulus in C behaves differently when the numerator is negative vs positive
22:03
< Rhamphoryncus>
So if you want it to wrap the same even though you're sometimes subtracting the trick is to first add some multiple of the modulus
22:03
< Rhamphoryncus>
So if your modulus is 10 you could add 100. 100-2 = 98 % 10 = 8
22:05
< Rhamphoryncus>
I'm using a modulus of 360 and it's mouse motion events. I don't know what the worst-case is so I picked something way beyond what I could conceive. I used 360*1000000 as my offset
22:11
< gnolam>
If you don't know what the worst case is, then you're Doing It Wrong. :P
22:13
< Rhamphoryncus>
gnolam: so you tell me, what is the maximum amount of mouse motion possible in a single event?
22:13
< gnolam>
I do not know.
22:14
< gnolam>
Which is why you should do this /right/.
22:14
< Rhamphoryncus>
Which is how?
22:15
< gnolam>
By actually coding negative signs as a special case.
22:15
< gnolam>
*negative sign modulos
22:16
< Rhamphoryncus>
... right
22:17
< Rhamphoryncus>
That's overkill
22:17
< Rhamphoryncus>
And won't handle the case of the int overflowing
22:19
< Rhamphoryncus>
I know what I'm doing smells but it's really not solvable correctly
22:20
< gnolam>
What do you mean "won't handle the case of the int overflowing"?
22:20
< Rhamphoryncus>
How do I know the motion didn't overflow int before it got to me?
22:23
< Rhamphoryncus>
Hmm, I need to figure out proper x/y translation now, so dragging the map uses your current rotation
22:23
< gnolam>
Your version magically does?
22:23
< Rhamphoryncus>
nope. I just set the arbitrary "correctness" threshold to be a bit lower for convenience
22:25
< Rhamphoryncus>
Keep in mind that someone must have moved the mouse so fast as to rotate the view around a million times in a single event. It'll pick the wrong value from that event (but subsequent will be fine). Oh well?
22:28
< gnolam>
A correct version is, what, /3/ extra lines? Kludges are fine as long as they're documented and motivated.
22:28
< gnolam>
This... does not feel like a motivated case.
22:29 ErikMesoy is now known as ErikMesoy|sleep
22:29
< Rhamphoryncus>
Hrm. I could use a matrix to find my new location, but it doesn't support 2d yet, nor vector multiplication
22:29
< Rhamphoryncus>
adding more lines would be overkill
22:30
< Rhamphoryncus>
Normal behaviour will be a single step (you might turn 180 degrees to the left, but not 360). The extreme case would be two or three steps (still doesn't matter as you'll have lost your sense of orientation by then anyway). Everything beyond that is sheer overkill.
22:35
< Rhamphoryncus>
I only mentioned it because it's funny that I would normally consider it to be the wrong solution, but in this case it's the simplest and the defects aren't meaningful
23:44 * McMartin eyes the fuck out of himself
23:45
<&McMartin>
"Gosh, after that ordeal, I should be able to write a much simpler demonstration Atari 2600 program for use as a sample file."
23:48
<@VV>
y'
23:48
<@VV>
erp
23:49 himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
23:52
<@VV>
dy/dx = 2.5 - y/12 should be the ode
23:59
<@VV>
Which is separable: 12dy/(30-y)=dx, gives -12 ln(y - 30) = x + C; y - 30 = e^((-x + C)/12); y = Ce^(-x/12) + 30. This gives the amount of solute in the tank in grams after x minutes.
23:59
<@VV>
If you want concentration, merely divide by 6.
--- Log closed Wed May 30 00:00:08 2012
code logs -> 2012 -> Tue, 29 May 2012< code.20120528.log - code.20120530.log >

[ Latest log file ]