--- Log opened Mon Apr 21 00:00:33 2014 |
00:02 | | Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code |
00:02 | | mode/#code [+o Orthia] by ChanServ |
00:45 | | Turaiel is now known as Turaiel[Offline] |
01:43 | | * Vornicus examines jerith's depixel code. |
02:02 | | * Vornicus writes lots of comments and docstrings, first, so he knows what's up. |
02:23 | | Turaiel[Offline] is now known as Turaiel |
02:41 | <~Vornicus> | Okay first question for you, jerith: in your de Boor thing you corner case the situation in which the u value lands exactly on the last knot in the domain... but only for degree 0. WOuldn't landing there in higher degree also have the same sort of problem? |
02:48 | | Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds] |
02:55 | | io\passed_out is now known as iospace |
02:56 | | Turaiel is now known as Turaiel[Offline] |
03:04 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
03:34 | | Turaiel[Offline] is now known as Turaiel |
03:55 | <~Vornicus> | wait, figured it out. reason is that in the others you end up with at least one data point anyway |
04:13 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
04:26 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
04:26 | | mode/#code [+o himi] by ChanServ |
04:42 | | Kindamoody[zZz] is now known as Kindamoody |
05:00 | | Derakon is now known as Derakon[AFK] |
05:10 | <&McMartin> | OK, I've caught VICE in what I'm pretty sure is an emulation anomaly |
05:11 | <&McMartin> | But I think it's actually the NTSC/PAL CRT emulation that's getting the shortcut here. |
05:14 | <~Vornicus> | Are you now the commissioner of crazytown county? |
05:15 | <&McMartin> | This is much less crazy, except for one brilliant reality-bending technique I stole from Atari 2600 hackers. |
05:16 | <~Vornicus> | Tell me more |
05:17 | <&McMartin> | Well, it will have to wait until dinner is further along. I'm hungry. |
05:17 | <~Vornicus> | eat crazily |
05:19 | <&McMartin> | All right. My goal here is to investigate how many cycles after a raster interrupt I have before graphical glitches will occur - basically, how long is my HBLONK |
05:19 | <&McMartin> | HBLANK, even |
05:19 | <&McMartin> | It turns out to be possible to be both early and late, based on my experiments earlier. |
05:20 | <&McMartin> | So I need some way of very quickly flipping between code that delays a graphics write in ways that give me fine control over cycles. |
05:20 | <~Vornicus> | BLONK |
05:20 | <&McMartin> | What I have, with this program, is a routine that, if I POKE a value between 0 and 48 into a certain memory location, will delay for exactly 56-(that value) cycles before the write.. |
05:21 | <&McMartin> | This is more impressive than it sounds because the NOP instruction does nothing for *two* instructions. |
05:21 | <&McMartin> | And if I wanted two-cycle precision, that would indeed be quite dull |
05:22 | <&McMartin> | Mmm. perhaps I am inured. |
05:23 | <&McMartin> | The "2-cycle precision" technique is to have your interrupt routine start with a big old string of no-ops, and then you can make the delay be longer or shorter by moving the interrupt target forwards or backwards through the list of no-ops. |
05:23 | <&McMartin> | At a rate of 2 cycles per memory location |
05:24 | <&McMartin> | So here's where it gets fun. Instead of a string of no-ops, you instead have a string of "cmp #$c9", ending in a "cmp $ea". |
05:25 | <&McMartin> | Of note is that $c9 is the opcode for "cmp, immediate", and $ea is the opcode for no-op. |
05:25 | <&McMartin> | So, if you start at the $ea, that's a no-op, and you do nothing for 2 cycles. |
05:26 | <&McMartin> | if you start one byte before it, you execute cmp $ea, which reads $ea and sets some flags you're ignoring, and is an instruction that takes three cycles. |
05:26 | <&McMartin> | Go back two bytes, and you have $c9,$c5,$ea, which is CMP #$c9 (sets flags, but otherwise costs 2 cycles), and then the NOP for a total of four. |
05:27 | <&McMartin> | three, and it's $c9,$c9,$c5,$ea, CMP #$C9 (2 cycles) CMP $EA (3 cycles), for five |
05:28 | <&McMartin> | And then as you go back through the sea of $C9s, it just keeps flipping the last instruction between a 3-cycle instruction and two 2-cycle instructions, so it keeps increasing by one cycle per byte |
05:28 | <&McMartin> | And as long as I make sure that all of the C9s and the C5,EA coda are all in the same chunk of 256 bytes in memory, I can change the interrupt vector atomically to point to any of them becuase it's just poking one byte of the address. |
05:29 | <&McMartin> | So I put that in front of a fairly standard split-screen interrupt thing to make half the screen be one color and half the screen be the other |
05:29 | <&McMartin> | And then wrapped it with a BASIC program to display the current status and let you mess with it more conveniently, as well as do the setup and teardown |
05:30 | <&McMartin> | And I've noticed that in VICE, the display after the HBLANK never does mid-scanline color changes, and instead is either one or the other. |
05:30 | <&McMartin> | Which means it's "dropping its guard" at various points during startup. |
05:31 | <&McMartin> | It's noticing that I'm not polling the raster register, and it knows that there's no pending graphical interrupt for at least some thousands of cycles, so it cuts corners. |
05:34 | <&McMartin> | When it isn't cutting corners, though, it's definitely behaving with my understanding of Proper Accuracy. |
05:48 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
05:52 | | macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code |
05:52 | | mode/#code [+o macdjord] by ChanServ |
06:01 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
06:01 | | mode/#code [+o himi] by ChanServ |
06:22 | | RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.] |
06:25 | | RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code |
06:36 | | Turaiel is now known as Turaiel[Offline] |
07:38 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
07:38 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out] |
07:51 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
07:51 | | mode/#code [+o himi] by ChanServ |
08:02 | <@celticminstrel> | Hm, need to decide where to store the cursor hotspots. |
08:02 | <@celticminstrel> | Try to understand .cur format? (Which as I recall is just a .bmp with some extra data.) Put them in a plaintext file next to the image? |
08:03 | <@celticminstrel> | Currently they're gifs, though. |
08:03 | <@celticminstrel> | Although I do have .cur versions of them. |
08:05 | <@celticminstrel> | The hotspots are currently embedded in the code, but I'd like to change that. |
08:06 | <@celticminstrel> | Oh, I only have .cur versions of some of them, apparently. |
08:08 | | Kindamoody is now known as Kindamoody|out |
08:14 | <@celticminstrel> | I kinda prefer having a single file, but I doubt Cocoa (or X-windows for that matter) has any built-in handling for .cur, so if I used that I'd have to manually extract the hotspot, I think. |
08:48 | | HotShot [fake@Nightstar-l2nbvd.sfldmi.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
08:48 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
08:48 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
08:52 | | HotShot [fake@Nightstar-l2nbvd.sfldmi.sbcglobal.net] has joined #code |
08:52 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Operation timed out] |
08:53 | | Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code |
08:53 | | mode/#code [+o Orthia] by ChanServ |
09:01 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
09:01 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
09:02 | | Syk [the@Nightstar-3j1.p6c.166.101.IP] has quit [Ping timeout: 121 seconds] |
09:06 | | celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
09:46 | | Syk [the@Nightstar-3j1.p6c.166.101.IP] has joined #code |
09:51 | | Reiv [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code |
09:51 | | mode/#code [+o Reiv] by ChanServ |
09:52 | | Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds] |
09:55 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
10:02 | | Reiv [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [[NS] Quit: Going dooooown...] |
10:02 | | Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code |
10:02 | | mode/#code [+o Orthia] by ChanServ |
10:09 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
10:09 | | mode/#code [+o himi] by ChanServ |
10:35 | | Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
10:56 | | Syk [the@Nightstar-3j1.p6c.166.101.IP] has quit [Ping timeout: 121 seconds] |
10:58 | | Syk [the@Nightstar-3j1.p6c.166.101.IP] has joined #code |
10:59 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
11:13 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
11:13 | | mode/#code [+o himi] by ChanServ |
11:28 | | Orthia is now known as Reivles |
12:06 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
12:09 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Operation timed out] |
12:23 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
12:23 | | mode/#code [+o himi] by ChanServ |
13:28 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has joined #code |
13:28 | | mode/#code [+o JackKnife] by ChanServ |
13:46 | | Syk [the@Nightstar-3j1.p6c.166.101.IP] has quit [[NS] Quit: sdkubdfugirdvd] |
14:12 | | macdjord is now known as macdjord|wurk |
15:42 | | gnolam [lenin@Nightstar-471pis.cust.bredbandsbolaget.se] has quit [[NS] Quit: Gone] |
15:56 | <@ErikMesoy> | I want to generate an open-ended random number (similar to exploding or floating dice in various RPGs) that has a 10% chance of coming up 1, 9% chance of coming up 2, 8.1% chance of coming up 3, 7.29% chance of coming up 4, and so forth. |
15:56 | <@ErikMesoy> | The slow and stupid way of doing this is to repeatedly roll 1d10 and check "have I stopped yet" which has ungodly running time for generating a simple number. |
15:57 | <@ErikMesoy> | The faster but incredibly ugly and probably still stupid way is to use a binary tree - check if it's going to come up more or less than 6, if less, check if it's going to come up more or less than 2, etc. |
15:58 | <@ErikMesoy> | Is there some elegant way of doing this? |
15:59 | <@ErikMesoy> | I'm thinking something vaguely like lookuptable/dict , where I can set [0.0-0.1) as key for 1, [0.1-0.19) as key for 2, etc. but that would require a dict-like thing which can take ranges as keys. |
16:32 | | Kindamoody|out is now known as Kindamoody |
16:38 | | celticminstrel [celticminst@Nightstar-57p13c.dsl.bell.ca] has joined #code |
16:38 | | mode/#code [+o celticminstrel] by ChanServ |
16:48 | | gnolam [lenin@Nightstar-lhk.n94.131.88.IP] has joined #code |
16:48 | | mode/#code [+o gnolam] by ChanServ |
17:30 | | Turaiel[Offline] is now known as Turaiel |
18:59 | | JackKnife [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds] |
19:17 | | HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has joined #code |
19:40 | <@Tamber> | x86 is /weird/. |
19:41 | <@Tamber> | This message brought to you by "How hard can it be to poke a byte to memory when there's no memory protection?!" |
19:41 | | Kindamoody is now known as Kindamoody[zZz] |
19:42 | <@Tamber> | (Turns out, if you don't know the magic combinations of which segment registers you're allowed to use with which registers... uh, very.) |
19:55 | | Turaiel is now known as Turaiel[Offline] |
20:02 | | HotShot[ipad] [HotShot@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed] |
20:03 | <&McMartin> | Yeah, one of the things RISC did to make life easier was fewer but more generic instructions. |
20:03 | <&McMartin> | x86 is more properly an "extended accumulator" architecture than a general register one. |
20:15 | <@gnolam> | RISC architecture is gonna change everything. |
20:15 | | gnolam [lenin@Nightstar-lhk.n94.131.88.IP] has quit [[NS] Quit: Gone] |
20:15 | <&McMartin> | It did! x86_64 registers are much more generic ;-) |
20:16 | <@Tamber> | Which seems glorious when you're still pig-wallowing around in the mud of real mode. :p |
21:26 | | Derakon[AFK] [Derakon@Nightstar-5fqf0m.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
21:26 | | Derakon_ [Derakon@Nightstar-5fqf0m.ca.comcast.net] has joined #code |
22:20 | <&McMartin> | Heh |
22:20 | <&McMartin> | Yeah, most of my own assembler work is in a true accumulator-based arch, which is even more restricted |
22:20 | <&McMartin> | OTOH, it's less to remember, because the answer to "can I...?" is basically always "no" |
22:22 | <@Tamber> | Hee |
22:22 | <&McMartin> | AX-equivalent or GTFO |
22:44 | | ErikMesoy is now known as ErikMesoy|sleep |
23:07 | | Turaiel[Offline] is now known as Turaiel |
--- Log closed Tue Apr 22 00:00:48 2014 |