pouët.net

Christmas Diamonds

!!! Happy New Year for Everybody !!!

Author: NiOl
Category: Christmas Challenge (+wild "VC3`2023_fun.bin")
System:   BK-0010 (or any BK-001x.x with loaded BK-0010 BIOS)
Language: Assembler for "PDPy crossasm"
Len source code: 1338 (with comments)
Len exe file:    38 (with header dw "Start Addr"; dw "Len")
Len code only:   34
Instructions:
	for GID emulator: gid.pdp-11.ru (and look for the 1st *blue* link)
	install & run	* its still only on russian, see ani-gif or:
	1. Select 2nd menu "Konfugypauua" (Model+modules), select "ctapt bk0010-01" (start bk0010-01) - You get Basic
	2. Click into Screen, Exit to "Monitor" (BIOS with CLI): type "MO"[Enter]
	3. Here is b/w mode 64x24 (512x256px). For best results switch to 4-color 32x24: [Alt]+[;]
	* if picture on the screen b/w - press icon with 3 vertical color lines: Red, Green & Blue to switch Color Mode
	4. Load demo from tape (tape device - "Magnitophone" on russian): type "M" [Enter] BK ask for the File Name: "NMR?" press [Enter] and get "File Open Dialog", select .BIN-file to run, [Enter]
	5. (if no errors) File Loaded in to the RAM. Now we ready to Run it by "S"(Start)command. But !!! for best result with a bit preparing:
	5.1. Press "S", then [Alt]+[:] (turn cursor off), then [F8] - "ClrScr"-key on BK ([CBP] on graphic kbd) - Screen cleaned, but command still in buffer, and then press [Enter]
Description:
	Using shift on difference 3x chars with space: 3x6=18pos. and width of picture = 19, X-position will go on right by 1 (19-3x6) on next line.
	So, we draw in Y-loop from 19 to 1, and substract 6 from previous X-pos. It makes 4 "/" diagonal lines on the screen.
	For "\"-diagonal lines we use mirrored X2 value. X1 "/" and X2 "\" calculated at 1 time by Add 6 and Sub 6 to X1 & X2:
	X1 stored in lo(r1), X2 stored in hi(r1). Add -6*256+6 constant (o175006) to r1 make it.
	BIOS "set cursor" func. (emt 24) use "r1 mod 64" value for X and "r2 mod 100" for Y, so we call it for lo(r1) and hi(r1) values by swapping bytes in r1 (swab - "swap bytes")
	When X2 comes out of screen (negative value) we add 19 to X1 & X2 (19*256+19 constant, o11355) and come to next line.
	We use short unstadart loop for X1 & X2: after setting pos to X,Y (emt 24) and Printing "*" (emt 16, r0=42), we increment PC by 1 and jump back, repeat
	* BK didn`t halt on odd PC-address like native PDP11, ignore while read RAM, but remember bit0. In second increment of PC, its become even with skipping 1 dw address. Its enought to skip jump of infinitive loop.
	r0 contain const. 42 = "*". To load it we use lo() of PC=o1052 (512+42) by changing Starting address to .LA=1050 (standart .LA=1000) LA:Load Address. movb r7,r0 command takes lo(PC) and put into r0. When command loaded, PC=PC+2, and only then command executed.
Comments: File "VC3`2023_fun.bin" a same, but use change of color mask to make NY-animation (+4 bytes), so You realy need to switch driver to color mode! (see 3.)

BK not native PDP11 computer, but can run adapted RT11 OS and apps.
Its use 1801vm1 CPU with PDP11/30 opcodes, developed based on description of PDP11, so 1801 a bit different to PDP11/30. CPU speed 3MHz, up to 250k ops (or 4MHz for BK-0011(M) model)
Total RAM different to models: 32kB on BK-0010(.01), 128kB on BK-0011(M) models. (BK-0010 with Focal and only b/w connector, BK-0010.01 with Basic, b/w and color conectors, BK-0011 uncompartable to BK-0010x in Sound generation, resolved in BK-0011M)
Screen: 16kB raw graphic data with output on 2 monitors: 
- for b/w connector we have 512x256px 2/3 aspect ratio (Text: 64x24 +1 system line).
- for RGB connector (to Scart): 256x256px 4/3 aspect ratio (Text: 32x24 +1 system line), 4-color: Red, Green, Blue, Black (model 11x have fixed palletes, BG allways Black, other colors - set of RrGB values in 4-bit ROM)
- Screen have h/w vertical scroller by 1px for faster text moving.
- BK-0011(M) model have 2 switchable screens, so You can prepare one Screen, while see another.
- BK have 16-bit QBUS-compartable bus and 16-bit parallel 16bit input and 16bit output (separated) ports, like old LPT have 9-bit output and 5-bit input port. Model-10 have bitbang sofware UART - with standart speeds up to 9600 via BIOS calls and TTL levels.
- BK have 2 bitbang Speaker/Beeper signals, for sound and Tape data, with different volume. You can use it like 2-bit DAC. BK-0011 have 3 bits DAC.