M1

Militant 1

was formerly/ is also know as CDP,
Character DisPlay. 

Parses two commands
(yes, a whole 2!)
from a plaintext file (TESTIN.TXT)
and works on them.

---]

Emulates a minute portion of the C64:
The 16-color PALETTE; 
The 320x200 pixel screen;
And two commands I always wished I had:
PrintAt and Color. (read on!)

Runs Natively in 640x480x8bpp.
Or should I say, Crawls...

---]

Command Line Arguments!!!

t = enable test mode. 
Instead of parsing TESTIN.TXT; m1 do some internal test routines... 
and print the entire charset to the screen... hopefully...

d = enable debug mode.
Regarless of mode, 
SOMETHING is written to m1bug.log...
using this flag will include debugging info as well.

v = increase verbosity.
The more v's u use, the mor everbose the M1BUG.LOG file
will be. I won't go above 3 if I were u...
You've been warned.
In fact, there's little reason to use this... unless u wanna hack at the C src...

[NEW! - 990122/12:15Hrs GMT-4] Updated since initial release!!!
u = Use the Upper Case/Graphic char. set (default)
l = Use the Lower Case char. set (this was rearly used on a read C64 but it's good for
word processing and such like... i.e. it's boring!)

[NEW! - 990123/15:30Hrs GMT-4] Updated since second release!!!
o = display border (Not  Yet Implemented)
n = display background

[NEW! - 990123/20:30Hrs GMT-4] Updated since third release!!!
s = debugmode; display debugging info to status bar.
if enabled, the current command and any syntax errors will
be printed to the lower "border" of the screen, a.k.a. status bar.
note that o is still NYI! Muhahahahaha!

//setkode: r10b/K/p/M/' '
[NEW - 990122/13:25Hrs GMT-4] Updated before update was released!
r[constant][exponent char] = set size of C99ASIC workspace (BASIC RAM)
constant is an unsigned long int, while [exponent char] is one of:
b = byte;
K = Kilobyte, 1024 bytes;
p = C64 page, 256 bytes;
M = Megabyte, 1024 Kilobytes;
default = byte;

e.g. r38K 
e.g. r1M
e.g. r300b
e.g. r38911

also, note that a limit of 10 000 000 bytes in imposed.

[NEW - 990209/21:20Hrs GMT-4] Updated just after m1r7! 
you know , i've done more work on m1 today than I have 
for weeks... It's now officially a "research" project.
As I learn something new I'll test it out with m1.

g = enable conversion of uppercase characters to graphics;
implies u. In fact, It's useless without u.

---]

Files in use:

input:

CHAR.ROM : ROM dump of C64 CHARSET.

TEXTIN.TXT : the semi-tokenized program file to parse.

        format:

        @[column],[row],[literal]
        ...
        c[color]
        ...
        -

The @ indicates PrintAt, [column] = 0-39, [row] = 0-24
 (numeric constant literals);
and [literal] is a quote-enclosed string, e.g.

@1,1,"HELLO WORLD!"
@1,24,"GOODBYE WORLD!"

The c indicates COLOR, and is equivalent to POKE 646,[color]
on the C64. Thus [color] ranges form 0 to 15.
The C64's BASIC really needed this command!!!

***IMPORTANT!!!
Note that the hyphen ('-') is the EOF character...
forget it, and suffer in unspeakable pain.

---]

Architecture (how it works)

I don't feel like talking about it... to me, this is like crawling... the only point is
to move, not move well. When I walk, I'll explain how I walk...
Or at least why I put a bop in my step...

A few notes, though:

Press "PrintScreen" to take a screenshot
and dump it in dump.pcx. If it doesn't work,
and you run under 9x, Think ".pif" and the soln will
come to you.

CHAR.ROM is read, using fread, into RAM in one fell swoop.

TEXTIN.TXT is run thru an adhoc processor which ...
1) copies it to RAM
2) replaces \f and \l and such with 0
3) replaces the EOF with and 3 zeros (i fixed the 12-14 bug!
i.e. it simulates a C64's behaviour.

Know design flaws:

The rendering engine could not possibly be slower,
and the screen design is very haphazard.

Being design flaws, i will not fix them, 
I will redesign m2 to avoid these
issues.

Known bug:

Running with a zero-level verbosity
causes the mysterious 102 bug to appear:
it runs but at the end complains about and 
unrecognized token, 102. Odd, ain't it?
'f' is IBM ASCII for 102...

---]

Note:

The executable seems to random SIGSERV under 9x...
I'm not sure if this is:
1) A fault of 9x
2) A fault of PGCC 
3) A fault in Allegro 3.0
4) A fault in my coding practices
5) A fault of the Pentium F0 0F bug in my CPU

It seems to be 4) and 2), that is,
functions which declare variables and never use them
fail... sometimes... I find it really, really odd.

Please tell me if u have any similar experiences...
it seems that my exe behaves now.

Also, I compressed it with djp.

Check readme.log for soapbox-like ranting...

---Kei.

Keinall "Lord Granitor" Caddle
granitor@geocities.com


Note:

To compile m1,
use :

gcc -O6 m1.c -o m1.exx -lalleg

and, optionally:

djp m1.exe
That's all, basically.
Enjoy. And, don't complain. 
I am glad that I did this, 
but the quality is shameful.
Still better than WYSIWYG 
word processors, though!!!

---]

Frozen and final release 12:33 AM 2/6/99.
May I never make such crap again.
