Journals

Striker14 years ago2010-05-13 17:44:47 UTC 6 comments
My desk is covered with maths formulas and types of exercises and math exercises papers... I'm tired. I hope I get at least 8 out of 10.
The semester test is tomorrow.

Wish me luck! :D
DiscoStu14 years ago2010-05-13 16:05:03 UTC 4 comments
The Perfect Clock: The code behind it

A few days ago, I posted the theoretical point of view of a perfect PIC clock. Today, I'll present you with a few code snippets. TWHL could really, really use [code] or [ pre ] tags, and I don't mean just for this.

*Remember to define variable names - i.e seconds equ 0x25

I'll start easy. This is the interrupt routine. There's nothing special in it.
;*******************
Interrupt:

	call	Clock_step
	bcf	INTCON, T0IF	;Clear interrupt flag to be able to return
	retfie
The above code is called on each timed interrupt - every 8.192ms. Now you need to make something useful of that. The following is only a 122-interrupt second, just to show context.

;*******************
Clock_step:
	incf	tick
	movfw	tick
	sublw	D'122'		;Count 122 cycles, add 1 second
	btfss	STATUS,Z
	goto	Clock_end

	clrf	tick		;I have 1 second, reset int counter.
	call	Seconds_inc	;Increment seconds counter
	movfw	seconds
	btfss	STATUS,Z	;On seconds=0, increment minutes
	goto	Clock_end

	call	Minutes_inc	;Increment minutes counter
	movfw	minutes
	btfss	STATUS,Z	;On minutes=0, increment hours
	goto	Clock_end

	call	Hours_inc	;Increment hours counter
	;--snip-- you get the idea.

Clock_end:
	return

;*******************
Seconds_inc:
	incf	seconds
	movfw	seconds
	sublw	D'60'
	btfsc	STATUS,Z
	clrf	seconds		;Reset on 60 seconds
	return

Minutes_inc:
	;--snip-- again, you get the idea.
Remember, this is only the imprecise clock, only to show the concept. Now you'll need to adjust for 122 and 123 cycles and all that shizzle I mentioned in the other journal.

To do this, I have allocated a tick_wait variable, to store whether my next cycle should be 122 or 123 interrupts long. I have also allocated adj_s to count 14-second cycles, and adj_c, to count 64 14-second cycles.

We must make a few changes to the code above.

;*******************
Clock_step:
	incf	tick
	movfw	tick
	[b]subwf	tick_wait,w[/b]	;Instead of 122, check against tick_wait
	btfss	STATUS,Z
	goto	Clock_end

	clrf	tick		;I have 1 second, reset int counter.
	[b]call	Tick_adj[/b]	;Check if next cycle counts 122 o 123

	call	Seconds_inc	;Increment seconds counter
	;--snip-- same as previous sample.

Clock_end:
	return
;*******************
Seconds_inc:
	;--snip-- same as previous sample.

;*******************
; NEW CODE BELOW
;*******************
Tick_adj:
	incf	adj_s
	movfw	adj_s
	sublw	D'14'
	btfss	STATUS,Z	;If 14, I'm done with 14s cycle
	goto	tick_adj2	;Otherwise, check if it's 13
	clrf	adj_s		;reset 14s cycle
	movlw	D'122'
	movwf	tick_wait
	goto	tick_adj_end

tick_adj2
	movfw	adj_s
	sublw	D'13'
	btfss	STATUS,Z	;If 13, it's adjust time
	goto	tick_adj_end	;if not 13 either, nothing to do

	incf	adj_c
	movfw	adj_c
	sublw	D'64'
	btfsc	STATUS,Z
	goto	tick_adj_end	;if this is the 64th adj cycle, ignore it

	incf	tick_wait	;14th second is next, lasts 123
	movfw	adj_c
	sublw	D'65'		;Check if 65
	btfsc	STATUS,Z
	clrf	adj_c		;If 65, reset count

tick_adj_end:
	return
As you can see, the code has grown quite a bit. But here we have our (theoretically) perfect clock.

I had to revise this code before posting, as the code I've written has functions to decrement seconds, minutes, and hours (so there's no need to wrap around incrementing if you missed 1 minute) as well as date keeping and alarm. What I posted here is only a fraction of it, but feel free to use this code in any clocks you intend to make.

By the way, since I still haven't built it, I'm not sure how to store years. Therefore I risk being subject to either the year 2256 bug (returns to 2000) or the year 2999 (returns to 2000 too). It could also be in 9999, but it'd be wishful thinking to expect it not to break before that :P

I hope you have found this an educational experience :)

Edit: Wow, [ pre ] works! Although only sometimes. WTF?
Edit2: I just found out why. Dude, at least let it respect tabs.
Edit3: No, I was wrong. It appears to be random. TWHL BACKEND NO WORKIE!
DiscoStu14 years ago2010-05-13 14:26:59 UTC 6 comments
I'm downloading Portal right now (thanks Huntey for the shoutbox post) Now, I have incoherent information displayed to me. The main window says "Downloading: 76%, 208.2 KB/s", but the taskbar icon tooltip says "Steam - downloading at 121.2 KB/s / Portal (77%)"

This would be the first time I'm using Steam for anything. Which one am I supposed to believe?
User posted image
Dark Tree14 years ago2010-05-12 23:09:04 UTC 3 comments
Back for my annual journal post. Got into DigiPen... going to be a sophomore this coming fall!

Bachelor of Arts in Game Design is my degree :)

Working over the summer on a HL2E2 mod project with some friends while teaching some Game Design to High School students at DigiPen. Kind of excited to maybe see this mapping/mod idea possibly come into fruition that I've had for over four years!

I love the TWHL community, it has stayed strong over the years, I am proud to still be a part of it.
hlife_hotdog14 years ago2010-05-12 22:02:49 UTC 6 comments
So I have been debating this for a long time now and decided to ask the world what they think.

What do you call a device that moves matter from one location to another by deconstructing it, moving it, and putting it back together at the end.

Would you call it a Transporter or a Teleporter?

Btw, I'm on twitter now.

http://twitter.com/hlife_hotdog
2muchvideogames14 years ago2010-05-11 21:02:46 UTC 2 comments
This week let's view one of the most idiosyncratic mod I have ever met. It's an australian project called escape from woomera. It's even got its own wikipedia article! Now that's something.

I cannot lie-- with this mod openGL is required to see the textboxes that the entire game hinges on. That's right, you talk to people with text boxes much like a roleplaying game (which it is). As a software gameplaying chum, I therefore cannot complete it. But even in openGL the game crashes somewhere down the line for me. But of course, what kind of game is this? Is it even a game so to speak.

In this "game", there are no weapons, no monsters, none of the usual. This mod is much like a political announcement, and political stuff I have observed to be a very hot topic in twhl, just look at that one thread about how americans were stupid on a late nite tv show watched by doctors.

Aside from it, this mod has a bit of stealth element that I never got to. Like I said it crashed for me. Maybe you will have the better luck.
monster_urby14 years ago2010-05-11 17:04:45 UTC 7 comments
So, since I started working as a web designer, I have discovered that as soon as you start doing something 5 days a week, to strict deadlines, it can quickly become very grating.

In light of this fact, I have been trying to focus a lot more on creative writing. It is something I have always enjoyed doing, got me high grades during my GCSEs, and some of you have read and enjoyed some of my fan fiction work which I have posted on the forums. I am currently making notes and brainstorming ideas for what will hopefully be my first novel.

I'll post more info about this as it develops. :)
Moaby14 years ago2010-05-11 10:59:55 UTC 4 comments
Right,

Just completed Uncharted2 on my 60GB PS3 in about 7 hrs [in 2 days]. If you want a mix between a puzzle game and Assassins Creed then here you go.

The game is ridiculously difficult; I (re)check-pointed 121 times! I did about half the game on Medium difficulty and had to turn it down to Easy on about Chapter 25, I think. Half the deaths were do to him jumping to far out of cover and flying off the cliff.

The bonus features on the game seem to only be unlocked when you have completed it once, slightly annoying but I probably will do it again. I completed all the MGS games more then... 7 times so, not to much trouble. :D

I would recommend it to all the you sensible PS3 users out there.
Rimrook14 years ago2010-05-10 18:00:48 UTC 12 comments
/me has the flu.

Fuck CEDA.
DiscoStu14 years ago2010-05-10 10:52:02 UTC 5 comments
Just a general question to other Electronics fans (I asked Tetsu0 but I thought there might be someone else interested too)

What is your preferred method to make PCBs? I mean, after the breadboard phase, when you want the definitive PCB. I learned several methods while in school but they were inconvenient in one way or another.

The easy one is to draw the circuit straight on the board with a permanent marker, but this isn't so neat for complicated designs.

Then there was another method which required some expensive blue paper, then convincing someone at a press to print the circuit on it, then stick it to the blank board (copper side) and iron it. I hated this one.

The last one was to trace the design on vinyl with a cutting plotter, then sticking it to the board. I preferred this one, but I don't have a cutting plotter.

So anyway, what's your preference?
satchmo14 years ago2010-05-08 23:58:56 UTC 14 comments
I built this Lego gun this afternoon:
User posted image
And my son loved taking it apart:

Video.
Captain Terror14 years ago2010-05-08 21:55:51 UTC 5 comments
Everything in my life up to this point has been simply a means to bring me to this day. Behold:
User posted image
ZOMG thanks to Saribous for the hookup!!!
Jessie14 years ago2010-05-08 21:13:15 UTC 5 comments
Alright... here's the story.

Around a couple of months ago, I was annoyed to find the computer would not start up properly one morning. The computer made an unusual beeping noise near the start, and the monitor remained blank (I was aware that the beeping meant something, I just didn't know what). I checked the cords, and knew that they weren't the problem (the screen showed a different message when it was unplugged to when it just wasn't working). After a short while, it became apparent that while the monitor was not functioning, the computer was still turning on. So I turned it off and back on again a few times, just to make sure. Then I went to do something else. That afternoon, I found the computer was working again. No-one had done anything, and it seemed ok then.

Over the next few weeks, every now and then it would do it again, leaving me and my parents (it was their computer) no choice but to wait it out.

Then one weekend my brother came over, and when the computer screwed up again, he had a look at it. He knows far more about this stuff. He found the manual for the motherboard (after some searching), and told me that the beeping meant there was a problem with the video card. He got into the case and swapped the slot the video card was in (or so he says, i wasn't watching). It seemed to do the trick, as for the next month or so there was no problem again.

Then, a few days ago, as I was playing Serious Sam HD, the game froze up for a second, then the monitor dropped out, in the same way it wasn't working before. The sounds still playing where subtly stopping. So naturally, I turned the computer off and on again. It did the beeping jank again.

After a little bit I found that it only seemed to stop working after a couple of minutes playing Serious Sam. Nothing else had ever made it drop out while I was actually doing something. I also found it strange that it didn't do that before, as by the time it started to drop out, I had just about finished the game. It didn't seem to matter where I was or what I was doing, it just dropped out randomly.

Now we come to about an hour ago. I was bored, and decided to play Titan Quest. After about two minutes, the game dropped out. This was unexpected. So again, I turned it off and on again. Then, to my shock and annoyance, the computer started up... at about 800x600 resolution. I head into control panel, display, and tried to put the resolution back up. It appeared to do absolutely nothing. Confused, I closed everything again, and then a message comes up saying that "there is no graphics driver installed, or it is not working properly", or something like that. I decided to install some (possibly) newer drivers (not something I've done before), and restarted the computer. It seemed to do the trick.

So when it started up again at the right resolution, as if nothing had happened, I typed this up because this computer is really starting to get on my nerves, and I'm really pissed off.

Tl;dr? Computer has started f**king itself in the ear when I try to play Serious Sam HD for more'n a few minutes. It majorly screwed itself an hour ago, I fixed it, not sure if I want to tempt fate by booting up the game again.

Hope all that made some kinda sense.
Skals14 years ago2010-05-08 03:33:32 UTC 3 comments
I went paintballing yesterday with some people from my school. Besides being shot in the head It was alrite. I did some cool stuff like sneaking into the enemy base and taking out most of them from behind. The last match was a 50 v 50 war like invasion game, but everyone was camping -.- . Was a fun day, and I didn't have to pay for it.
monster_urby14 years ago2010-05-07 14:28:54 UTC 6 comments
I have a friend who is half South-African and half German. His German father, Detlef, is a chef. His grasp of the English language is pretty good, however with most foreign people, he gets confused with regards to homonyms. The pub where he works recently changed their menu and one of the new meals was "Battered Haddock." The first day using the new menu, the landlord was getting ready to open the doors when he heard an incredible racket emanating from the kitchen. He rushed in to see what was going on, only to see Detlef beating the shit out of a cold dead fish with a large rolling pin.