PC 통신, 그 세월의 기록 (From 1993)

1993년 (내가 초등학교 5학년일 시절)

하이텔 SF/미스테리 게시판에는 이우혁님이 퇴마록을 게제하고 계셨다.
나우누리는 존재하지도 않았다.
한국통신에서는 2400bps 모뎀을 내장한 단말기를 무료로 보급중이었다. (얼마 지나지 않아 9600bps 모뎀으로 업그레이드 되었다.)
하이콤 이라는 터미널 프로그램을 사용했다.
단순한 그래픽으로 구현된 네트워크 바둑을 지웠했었다.
처음으로 CHAT라는 단어를 배웠다.

1994년 (내가 초등학교 6학년일 시절)

나우누리가 서비스를 시작했다. 위쪽 타이틀을 감싼 하얀 선이 깔끔해 보였다.
한국 최초의 머드게임 단군의 땅이 선을 보였다.
호롱불 등의 프로그램으로 사설 BBS를 만들어 보았다.
오프모임이라는 말을 처음 사용했으며 최초로 참가해 보았다.
TR이라는 명령어로 게임을 불법으로 주고 받을 수 있었다.
종량제라는 가격에 압박에 천리안을 접었다.
MIDI 파일을 다운 받아서 옥소리 사운드 카드로 플레이 한후 워크맨으로 녹음해서 듣고 다녔다.

1995년 (내가 중학교 1학년일 시절)

모뎀은 점점 고속화 되어서 33600bps 정도까지 지원되었던 것 같다.
Java로 돌아가는 애플릿을 처음 접했다. 그 유명한 커피에 김이 올라가는 애니메이션이었다. 이제 플랫폼에 종속되지 않은 한번만 코딩해도 어디서나 돌아갈수 있는 언어가 나왔다고 했다.
넷스케이프라는 프로그램을 처음 보았다. 그래픽 문서 뷰어 수준이라고 생각했다.
PC 통신은 점점 활발해 져서 각종 동호회, 채팅사이트 들은 언제나 만원이었다. 그래서 방을 999개까지 만들수 있는 나우누리가 인기였다.
14400bps 모뎀으로 업그레이드 했다. 이제 텍스트 화면이 한줄씩 스크롤 되면서 보이지 않았다.

1996년 (내가 중학교 2학년일 시절)

3메가 짜리 WAV 파일을 다운로드 받아서 도스에서 플레이했다. 이제 아무도 음반을 사지 않을 거라고 생각했다. MP2라는 생소한 포맷을 보았다.
Windows 95를 설치했다. 설치 CD에 들어있는 동영상을 몇번이고 반복해서 돌려보았다.
처음으로 인터넷에 접속해보았다. 말로만 듣던 www.yahoo.com 주소에 방문했다. PPP 접속은 어려웠다.
앞으로는 컴퓨터를 전공하는 사람이 돈을 많이 벌 것이라는 소리가 들렸다.

1997년 (내가 중학교 3학년일 시절)

MP3 라는 고음질의 음악 파일이 나왔으나 한번 다운로드 받으려면 몇십분씩 걸렸다.
리얼오디오, 리얼비디오 포맷 널리 사용되었으며 실시간 스트리밍을 지원한다는 것이 신기했다.

(기억력 감퇴로 일단 여기까지…)

Use Bit Flags

I have seen many programmers use dozens of chart-sized variables or Booleans to store simple on or off flags. This is a tremendous waste of space, as you only need a single bit to represent the true or false value of a flag. Instead, I like to use a lot of bit flags. Here is a hypothetical example:

We have a sprite structure for our game. This structure needs to keep track of whether the sprite is invisible and if the sprite can be collided against. If you were to have one member per flag, your structure might look like this:

typdef struct sprite_s
{
.
.
.
char nHidden
char nCollide
.
.
.

} sprite_t;
Sure, you are pretty crafty using bytes instead of whole integers to store this flag. But if you use bit flags, you can reduce this by half:

#define BITFLAG_HIDDEN 0x01
#define BITFLAG_COLLIDE 0x02

typdef struct sprite_s
{
.
.
.
unsigned char nFlags
.
.
.
} sprite_t;
Now we only need a single character, nFlags, to hold both flags. A byte is 8 bits. We use two of these to represent the hidden and collision states. For instance, if we want to set the hidden bit, simply OR in the bit flag defined up top:

nFlags |= BITFLAG_HIDDEN;

Now, the first bit is turned on. If we want to turn this bit on, we AND the flags with the inverse of the bit flag that we wish to remove:

nFlags &= ~BITFLAG_HIDDEN;
The first bit is now cleared. The great thing is that we can combine the flags like this:

nFlags |= (BITFLAG_HIDDEN | BITFLAG_COLLISION);
To determine if a bit flag is turned on, use the bitwise AND operation:

if (nFlags & BITFLAG_HIDDEN)
return;
In this case, bail out of the function if the sprite is not visible. This code fragment would be something that you may see in a sprite drawing loop.

Of course, we have only defined two bit flags. A byte can hold 8. If you need more, you can use a short for 16 bits or an integer for 32 bits. Make sure you define the flags field as unsigned. Otherwise, you will have issues reading the values in the debugger when you turn on the sign bit.