home *** CD-ROM | disk | FTP | other *** search
- include amscls.inc ;ì\æóë╗âAâZâôâuâëélé`ébéqénér
- $_init GEN ;Åëè·ë╗â}âNâì
- ;---------------------------------------------------------------
- ; é`élérébékérüDéhémébé╠âTâôâvâïâvâìâOâëâÇ
- ; juba.asm
- ; Copyright Hortense S. Endoh 1991
- ; éSésé`éaé┼Åæé⌐éΩé─éóé▄é╖üD
- ;---------------------------------------------------------------
- SLOWWALK = 10000 ;ò\Īæ¼ôxüi100ü`20000 Æ÷ôxé╠Ælüj
- WALKWAVE = 10 ;ò\Īæ¼ôxé╠ò╧ë╗é╠ë┴æ¼ôx
- SPEEDLAW = 1000 ;ì┼Æßò\Īæ¼ôx
- SPEEDHIGH = 15000 ;ì┼ìéò\Īæ¼ôx
- ATTRIBUTE0 = 0e1h ;Æ╩Åφé╠ò╢ÄÜò\Īé╠âAâgâèârâàü[âg
- ATTRIBUTE1 = 0c1h ;éiubaîNé╠ÉF1üiâ}âXâNüj
- ATTRIBUTE2 = 081h ;éiubaîNé╠ÉF2üiâfâtâHâïâgüj
- BEEPTIME = 30h ;ârü[âvë╣é╠Æ╖é│
- ;---------------------------------------------------------------
- $_ms2vram macro $_msg ;è┐ÄÜé▄é╢éΦò╢ÄÜù±é≡98é╠éuéqé`élâCâüü[âWé┼ÆΦï`
- hl_flag = 0
- irpc chr, <$_msg>
- $_ms2vr1 <chr>
- endm
- endm
-
- $_ms2vr1 macro $_chr
- ife hl_flag
- if (('&$_chr' GE 20h) and ('&$_chr' LE 7eh)) or (('&$_chr' GE 0a0h) and ('&$_chr' LE 0dfh))
- DB '&$_chr', 0
- else
- hl_flag = hl_flag xor 1
- chr_h = '&$_chr' shl 1
- endif
- else
- hl_flag = hl_flag xor 1
- chr_l = '&$_chr' - 1fh
- ife chr_l and 80h
- if chr_l LT 061h
- chr_l = chr_l - 33
- else
- chr_l = chr_l - 34
- endif
- endif
- jis_code = (chr_h * 256) + chr_l + 1fa1h and 07f7fh
- vram_code = (jis_code and 0ffh) * 256 + (jis_code shr 8)
- vram_code = vram_code - 20h
- DW vram_code
- DW vram_code or 8000h
- endif
- endm
- ;---------------------------------------------------------------
- CR equ 13 ;é▒éñéóéñé╞é▒éδé╔ò¬é⌐éΦé½é┴é╜âRâüâôâgé≡Åæé¡é╠é═
- LF equ 10 ;â_âTâCé⌐üH
- EOS equ '$'
- ON equ 0
- OFF equ -1
- ;---------------------------------------------------------------
- code SEGMENT WORD PUBLIC ;é▒é▒é⌐éτâvâìâOâëâÇé¬Äné▄éΘ
- ORG 100H
- ASSUME cs:code, ds:code, es:code
- main PROC NEAR
- PUBLIC main
-
- mov ax, 0a000h ;éuéqé`élé╠âAâhâîâX
- mov es, ax
-
- $_for <mov BX, 0>, <<cmp BX, displeng+30>, L>, <add BX, 10>
- call worm01 ;jubaîNé≡Åæé¡
- $_enddo ;âüâbâZü[âWé╠Æ╖é│é╔ë₧é╢é─îJéΦò╘é╡é─
- ;éóéΘéφé»é┼é╖üD
- mov ax,4c00H
- int 21H ;éαé┴é╞ÉFïCé╠éáéΘÅIéΦò√é═
- main ENDP ;é┼é½é╚éóé╠é⌐üH
-
- ;---------------------------------------------------------------
- assume ds:code ;jubaîNé╠éPâTâCâNâïüi16âJâbâgüjé≡
- worm01 proc ;Åæé¡
- mov si, offset wormfig ;jubaîNé╠âfü[â^âIâtâZâbâg
- mov di, 0 ;
- mov cx, 16 ;
- $_do ;16âJâbâgë±éΘ
- $_push <cx, di>, 02
- lodsw
- $_while <cmp ah, 0>, G ;jubaîNé╠âfü[â^é≡ô¬é⌐éτÅæéóé─éóé¡
- mov cx, speedfact ;âfâBâîâCé≡æ¥î╕é╖éΘ
- $_if <cmp speed_dir, 0>, E
- sub cx, WALKWAVE
- $_if <cmp cx, SPEEDLAW>, L
- mov speed_dir, 1
- $_endif
- $_else
- add cx, WALKWAVE
- $_if <cmp cx, SPEEDHIGH>, G
- mov speed_dir, 0
- $_endif
- $_endif
- mov speedfact, cx
- $_do ;âfâBâîâCé≡é⌐é»éΘ
- $_until <LOOP>
-
- xor cx, cx
- $_for <mov cl, ah>, <<cmp cx, 0>, NE>, <dec cx>
- call draw1cut ;éPò╢ÄÜé╛é»jubaîNé≡Åæé¡
- add di, 2
- $_enddo
- lodsw
- $_enddo
- call draw1cut
- $_pop 02
- $_until <LOOP>
- ret
- worm01 endp
- ;---------------------------------------------------------------
- draw1cut proc near ;jubaîNé╠êΩòöüiéPò╢ÄÜüjé≡
- $_push <ax, cx>, 04 ;Åæé¡
- and ah, 0
- mov cx, bx
- add cx, di
- mov dx, cx
- call drawchk ;ëµû╩é⌐éτé═é▌Åoé╡é─éóé╚éóé⌐
-
- $_if <cmp al, '#'>, NE ;Åæé½Åoé╖ôαùeé╔éµéΘÅêù¥
- $_if <cmp al, 'O'>, E, OR
- $_c <cmp al, 'Q'>, E
- $_if <cmp word ptr es:[bx + di ], 0020h>, NE, AND
- $_c <cmp word ptr es:[bx + di ], 004Fh>, NE, AND
- $_c <cmp word ptr es:[bx + di ], 0051h>, NE
- mov beepflag, 1 ;ò╢ÄÜé≡ÉHé╫é╜éτë╣é≡Åoé╖éµéñé╔
- $_else ;âtâëâOé≡É▌ÆΦé╖éΘ
- mov beepflag, 0
- $_endif
- $_endif
-
- $_if <cmp al, ' '>, E ;âüâbâZü[âWé≡éPbytesò¬Åoé╖
- $_push <di>, 05
- mov di, dispindx
- inc dispindx
- inc dispindx
- mov ax, dispmsg[di]
- $_pop 05
- $_if <cmp ax, 0>, E
- mov ax, ' '
- mov dispindx, 0
- $_endif
- call beep
- mov es:[bx + di ], ax
- mov ax, ATTRIBUTE0
- mov es:[bx + di + 02000h], ax
- $_else
- mov cx, es:[bx + di + 31] ;jubaîNé╠û{æ╠é╔é═üCÉFé≡òté»
- mov es:[bx + di ], ax ;é─ò\Īé╖éΘ
- shr cx, 1
- shr cx, 1
- shr cx, 1
- and cx, ATTRIBUTE1
- or cx, 01h
- $_if <cmp cx, 01h>, E
- mov cx, ATTRIBUTE2
- $_endif
- mov es:[bx + di + 02000h], cx
- $_endif
-
- $_if <cmp beepflag, 1>, E ;ò╢ÄÜé≡ÉHé╫é─éóéΘé╞é½ë╣é≡Åoé╖
- call Beep
- $_endif
- $_endif
-
- $_pop 04
- ret
- draw1cut endp
- ;---------------------------------------------------------------
- drawchk proc near
- $_if <cmp dx, displeng>, GE
- mov al, '#'
- $_endif
- ret
- drawchk endp
- ;---------------------------------------------------------------
- Beep proc near
- $_push <cx,ax>, 06
- mov al,6
- out 37h,al
- mov cx, BEEPTIME
- loop $
- mov al,7
- out 37h,al
- $_pop 06
- ret
- Beep endp
- ;---------------------------------------------------------------
-
- wormfig label byte ;jubaîNé╠âfü[â^
- db 'n',1,'m',5,'n',5,'Q',0
- db 'n',2,'m',5,'n',4,'Q',0
- db 'n',3,'m',5,'n',3,'Q',0
- db 'n',4,'m',5,'n',2,'Q',0
- db 'n',5,'m',5,'n',1,'Q',0
- db 'n',6,'m',5,'O',0
- db 'n',8,'m',4,'O',0
- db 'n',10,'m',3,'O',0
- db 'n',12,'m',2,'O',0
- db 'n',14,'m',1,'Q',0
- db 'n',16,'Q',0
- db ' ',1,'m',1,'n',14,'Q',0
- db '#',1,' ',1,'m',2,'n',12,'O',0
- db '#',2,' ',1,'m',3,'n',10,'O',0
- db '#',3,' ',1,'m',4,'n',8,'O',0
- db '#',4,' ',1,'m',5,'n',6,'O',0
-
- even
- beepflag dw 0
- speedfact dw SLOWWALK
- speed_dir dw 0
- startmsg db CR, LF
- db "Juba (C) 1991 by Hortense Endoh (Baka-papa-ware)", CR, LF, EOS
-
- dispindx dw 0
-
- dispmsg label word
- $_ms2vram < >
- $_ms2vram < üyì\æóë╗âAâZâôâuâëélé`ébéqénérü^AMSCLSüz >
- $_ms2vram <ü@ü@ AMSCLS.INC Ver.2.10 / Copyright (C) Hortense S. Endoh 1986, 1987, 1991 >
- $_ms2vram < âTâôâvâïâvâìâOâëâÇÄ└ìsÆå >
- $_ms2vram <é▒é╠âvâìâOâëâÇé╠â\ü[âXâRü[âhé╠û`ô¬é╔éáéΘÆlüCSLOWWALKüCWALKWAVEüCATTRIBUTE0üCATTR>
- $_ms2vram <IBUTE1üCBEEPTIMEé╠Ælé≡ò╧ìXé╖éΘé╞üCjubaîNé╠ô«é½é¬ò╧éφéΘüDâüâbâZü[âWé≡Åæé½è╖éªéΘé╞>
- $_ms2vram <ò\Īé│éΩéΘâüâbâZü[âWéαò╧éφéΘüDî╗ì▌é╠Å≤æ╘é┼é═üCéPôxïNô«é╡é╜éτì┼îπé▄é┼âüâbâZü[âWé≡>
- $_ms2vram <ô╟é▄é│éΩé─é╡é▄éóé▄é╖üDé╚é¿üCé▒é╠â\ü[âXé╠ë≡ò·âRü[âhé╔Åæé⌐éΩé─éóéΘâ}âNâì$_ms2vram >
- $_ms2vram <é═üCè┐ÄÜé▄é╢éΦé╠âüâbâZü[âWé≡98é╠éuéqé`élâCâüü[âWé┼ÆΦï`é╖éΘéαé╠é┼é╖üDé▒éΩé≡éuéqé`>
- $_ms2vram <élé╠âAâhâîâXé╔æùé┴é─âAâgâèârâàü[âgé≡âZâbâgé╖éΘé╛é»é┼éuéqé`élé╠Æ╝Åæé½é┼é½éΘéµé±üD>
- $_ms2vram < 13/Feb/1991 âoâJâpâpâEâFâA >
- dw 0
- displeng equ ($ - offset dispmsg - 1) - 2
-
- ;---------------------------------------------------------------
- code ENDS
- END main