Not bad...
"and naked women turn to dressed ones. "
Wasn´t it supposed to be the other way around?
Wasn´t it supposed to be the other way around?
UNIT Alphanum;
INTERFACE
TYPE c20 = ARRAY[0..19] OF CHAR;
PROCEDURE Mode13h; Inline($B8/$13/$00/$CD/$10);
PROCEDURE Clear_top_row(bg, fg1, fg2: BYTE);
PROCEDURE Clear_bot_row(bg, fg1, fg2: BYTE);
PROCEDURE Recol_top_row(fg1, fg2: BYTE);
PROCEDURE Recol_bot_row(fg1, fg2: BYTE);
PROCEDURE Write_top_row(VAR s: c20);
PROCEDURE Write_bot_row(VAR s: c20);
IMPLEMENTATION
PROCEDURE Clear_top_row(bg, fg1, fg2: BYTE); EXTERNAL;
PROCEDURE Clear_bot_row(bg, fg1, fg2: BYTE); EXTERNAL;
PROCEDURE Recol_top_row(fg1, fg2: BYTE); EXTERNAL;
PROCEDURE Recol_bot_row(fg1, fg2: BYTE); EXTERNAL;
PROCEDURE Write_top_row(VAR s: c20); EXTERNAL;
PROCEDURE Write_bot_row(VAR s: c20); EXTERNAL;
{$L ALPHANUM}
END.
TITLE "Routines to emulate a 16-segment alphanumeric display."
SUBTTL "Routines set for TOS/BOS."
IDEAL
MODEL TPASCAL
; mode = 13h
; ES = 0A000h
; SI, DI = sacred to offset into screen
; AL = sacred to colour
; BX = sacred to colour sequence
dull_colour = 8
bright_colour = 15
CODESEG
PUBLIC Clear_bot_row, Recol_bot_row, Write_bot_row
PUBLIC Clear_top_row, Recol_top_row, Write_top_row
; Each starburst is 16x24 pixels.
; Shape:
; - -
; |\|/|
; - -
; |/|\|
; - -
; Following are the sequences by which the segments are drawn.
; Lower-case letters contain alternatives to upper-case.
; Order: --|\|/|--|/|\|-- --|\|/|--|/|\|--
col_seqs DW 0000000000000000b, 0000000000000000b ; , !
DW 0000101000000000b, 0000101110010111b ; ", #
DW 1110100110010111b, 1010110110110101b ; $, %
DW 1001110101011110b, 0000010000000000b ; &, '
DW 0000010000001000b, 0001000000100000b ; (, )
DW 0001110110111000b, 0000100110010000b ; *, +
DW 0000000000100000b, 0000000110000000b ; ,, -
DW 0000000000010010b, 0001000000001000b ; ., /
DW 0100101000010101b, 0000011000000100b ; 0, 1
DW 0100001010010001b, 0100001010000101b ; 2, 3
DW 0000101010000100b, 0100100010000101b ; 4, 5
DW 0100100010010101b, 0100001000000100b ; 6, 7
DW 0100101010010101b, 0100101010000101b ; 8, 9
DW 1000000100000000b, 1000000000100000b ; :, ;
DW 0000010000001000b, 0000000110000011b ; <, =
DW 0001000000100000b, 1110001010010000b ; >, ?
DW 0000000000000000b, 1110001111000100b ; @, A
DW 1100101010010111b, 1110000001000011b ; B, C
DW 1100101000010111b, 1110000101000011b ; D, E
DW 1110000101000000b, 1110000011000111b ; F, G
DW 0010001111000100b, 1100100000010011b ; H, I
DW 1100100001010010b, 0010010101001000b ; J, K
DW 0010000001000011b, 0011011001000100b ; L, M
DW 0011001001001100b, 1110001001000111b ; N, O
DW 1110001111000000b, 1110001001001111b ; P, Q
DW 1110001111001000b, 1110000110000111b ; R, S
DW 1100100000010000b, 0010001001000111b ; T, U
DW 0010010001100000b, 0010001001101100b ; V, W
DW 0001010000101000b, 0010001110010000b ; X, Y
DW 1100010000100011b, 0100100000010001b ; Z, [
DW 0001000000001000b, 1000100000010010b ; \, ]
DW 1110001000000000b, 0000000000000011b ; ^, _
DW 0001000000000000b, 0100101010010100b ; `, a
DW 0000100010010101b, 0000000010010001b ; b, c
DW 0000001010010101b, 0100100010010001b ; d, e
DW 0100100010010000b, 1110000011000111b ; f, g
DW 0010001111000100b, 1100100000010011b ; h, i
DW 1100100001010010b, 0010010101001000b ; j, k
DW 0010000001000011b, 0011011001000100b ; l, m
DW 0011001001001100b, 1110001001000111b ; n, o
DW 1110001111000000b, 1110001001001111b ; p, q
DW 1110001111001000b, 1110000110000111b ; r, s
DW 1100100000010000b, 0010001001000111b ; t, u
DW 0001001000001100b, 0010001001101100b ; v, w
DW 0001010000101000b, 0010001110000111b ; x, y
DW 1100010000100011b, 0100100100010001b ; z, {
DW 0000100000010000b, 1000100010010010b ; |, }
DW 1010101010000000b, 1111111111111111b ; ~, #127
top_fg1 DB dull_colour
top_fg2 DB bright_colour
bot_fg1 DB dull_colour
bot_fg2 DB bright_colour
PROC Clear_bot_row FAR bg: BYTE, fg1: BYTE, fg2: BYTE;
MOV AL, [fg1]
MOV [CS:bot_fg1], AL
MOV AL, [fg2]
MOV [CS:bot_fg2], AL
MOV CX, 3840
MOV AX, 0A000h
MOV ES, AX
MOV DI, 0DC00h
MOV AL, [bg]
MOV AH, AL
CLD
REP STOSW
RET
ENDP Clear_bot_row
PROC Recol_bot_row FAR fg1: BYTE, fg2: BYTE;
MOV AL, [fg1]
MOV [CS:bot_fg1], AL
MOV AL, [fg2]
MOV [CS:bot_fg2], AL
RET
ENDP Recol_bot_row
PROC Write_bot_row FAR s: DWORD
MOV AL, [CS:bot_fg1]
MOV [BYTE PTR CS:SelCol_1+1], AL
MOV AL, [CS:bot_fg2]
MOV [BYTE PTR CS:SelCol_2+1], AL
PUSH DS
MOV AX, 0A000h
MOV ES, AX
LDS SI, [s]
MOV CX, 20
MOV DX, 0DC00h+642
CLD
WB_1:
XOR BH, BH
MOV BL, [DS:SI]
INC SI
AND BL, 7Fh
SUB BL, 32
SHL BX, 1
ADD BX, OFFSET CS:col_seqs
MOV BX, [CS:BX]
PUSH SI
MOV SI, DX
CALL Write_segments
ADD DX, 16
POP SI
LOOP WB_1
POP DS
RET
ENDP Write_bot_row
PROC Clear_top_row FAR bg: BYTE, fg1: BYTE, fg2: BYTE;
MOV AL, [fg1]
MOV [CS:top_fg1], AL
MOV AL, [fg2]
MOV [CS:top_fg2], AL
MOV CX, 3840
MOV AX, 0A000h
MOV ES, AX
XOR DI, DI
MOV AL, [bg]
MOV AH, AL
CLD
REP STOSW
RET
ENDP Clear_top_row
PROC Recol_top_row FAR fg1: BYTE, fg2: BYTE;
MOV AL, [fg1]
MOV [CS:top_fg1], AL
MOV AL, [fg2]
MOV [CS:top_fg2], AL
RET
ENDP Recol_top_row
PROC Write_top_row FAR s: DWORD
MOV AL, [CS:top_fg1]
MOV [BYTE PTR CS:SelCol_1+1], AL
MOV AL, [CS:top_fg2]
MOV [BYTE PTR CS:SelCol_2+1], AL
PUSH DS
MOV AX, 0A000h
MOV ES, AX
LDS SI, [s]
MOV CX, 20
MOV DX, 642
CLD
WT_1:
XOR BH, BH
MOV BL, [DS:SI]
INC SI
AND BL, 7Fh
SUB BL, 32
SHL BX, 1
ADD BX, OFFSET CS:col_seqs
MOV BX, [CS:BX]
PUSH SI
MOV SI, DX
CALL Write_segments
ADD DX, 16
POP SI
LOOP WT_1
POP DS
RET
ENDP Write_top_row
Write_segments:
MOV DI, SI
CALL Hbar
CALL Hbar
MOV DI, SI
CALL Vbar
MOV DI, SI
CALL Bslash
ADD SI, 6
MOV DI, SI
CALL Vbar
MOV DI, SI
CALL Fslash
ADD SI, 6
MOV DI, SI
CALL Vbar
ADD SI, 2868
MOV DI, SI
CALL Hbar
CALL Hbar
MOV DI, SI
CALL Vbar
MOV DI, SI
CALL Fslash
ADD SI, 6
MOV DI, SI
CALL Vbar
MOV DI, SI
CALL Bslash
ADD SI, 6
MOV DI, SI
CALL Vbar
ADD SI, 2868
MOV DI, SI
CALL Hbar
CALL Hbar
RET
SelCol:
SHL BX, 1
JC SelCol_2
SelCol_1:
MOV AL, dull_colour
JMP SHORT SelCol_3
SelCol_2:
MOV AL, bright_colour
SelCol_3:
RET
Hbar:
CALL SelCol
INC DI
STOSB
STOSB
STOSB
STOSB
STOSB
RET
Vbar:
CALL SelCol
ADD DI, 320
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
ADD DI, 319
STOSB
RET
Bslash:
CALL SelCol
ADD DI, 321
STOSB
ADD DI, 320
STOSB
ADD DI, 319
STOSB
ADD DI, 320
STOSB
ADD DI, 319
STOSB
ADD DI, 320
STOSB
ADD DI, 319
STOSB
ADD DI, 320
STOSB
RET
Fslash:
CALL SelCol
ADD DI, 2561
STOSB
SUB DI, 320
STOSB
SUB DI, 321
STOSB
SUB DI, 320
STOSB
SUB DI, 321
STOSB
SUB DI, 320
STOSB
SUB DI, 321
STOSB
SUB DI, 320
STOSB
RET
ENDS CODE
END
Cheb wrote:
That's for the monsters. I don't remember exact details of their target selection algorithm but if they detect a girl nearby they perform a melee attack that does 0 damage but converts the object type to "naked" with a "rrrip" sound.
I was going to make the tied girls rescueable NPC followers but as with everything I failed to find means of producing sprite sets. If you look closely, even the ogre is a retouched arch-vile from Doom 2.
I would happily use clay models, even had a vinyl disk player to sacrifice as a base, but I simply did not have a digital camera (((
Maybe it was a good thing, though, since the code is a mess and its efficiency is atrocious (required a pentium 266 to render some maps smoothly)
Never got as far as making a game.
Games? I ported Spacewar to the CDC 3100 using a mix of a Fortran driving routine and 3100 assembly language subroutines. Mostly I used scaling to handle division and multiplication, but for the Sun's gravity, I had to go over to floating point. Definitely not machine-independent.
Té Rowan wrote:Never wrote a game, yes; but I did port one named Slingshot to my 286. Same idea as Spacewar but with no movement except for the torps, many suns and even black holes. One had to type in a direction (real) and initial acceleration time (integer) to fire a torp, wait until it hit something or left the game, and then the other guy had a chance. Of course it tended to devolve into who could keep the torp longer in flight and make it do prettier curves.
Gratuitous floating point and an N-body problem… I’m glad I did buy that 287XL.
Spokavriel wrote:Well Monkey.BAS was fun and you had two apes tossing explosive bananas at each other. Similar limitations on mobility.
Spica75 wrote:And the AI part took up something like 99% of the total program...
Spacewar
Gratuitous floating point and an N-body problem…
I’m glad I did buy that 287XL.
That's how games should be!
People making games that could run on such machines were, like, mighty heroes of legend. Prince of Persia, Death Track... I'm awed they could make the magic work on 640Kb and EGA.
Users browsing this forum: No registered users