私は、以前、MSXで結構プログラムを書いていました。いくつかは、同人や、マイコンBASICマガジンに掲載されたりました。
押し入れを整理していたら、フロッピーが出てきたので、公開しようかと・・。
当然、汚いプログラムなんですが、今でもMSXプログラム書いている方が、もしや、居るかもしれないので、どうぞ参考にしてください。
私も、ほとんど記憶にないので、問い合わせには答えられません。
一応、著作権は放棄しません。誰の代物が分かったもんじゃないので・・・・。すいません
いくつか、エミュレータで動作を見てみました。私が作ったと思うゲームソフトが、途中でフリーズ・・・・・残念 orz
そのまま公開しちゃいますので、持っててください
悪用厳禁!(作者の方から、ご連絡をいただきましたので、選別するのも面倒ですし・・・、残念ですが、公開を控えます2006/8。私が作ったコードでしたら、無償で提供します。ご連絡ください)
あるプログラムのソースコード
これは、俺が書いたやつなので、公開自由だな。たぶん。
Z80ニーモニックで書いてるよぉ〜涙。はぁ、すげー懐かしい。
WPTITLE.MACの内容 |
; white poet title program + SCREEN 7 'WP-TITLE.SC7'
; ver 1.1
.Z80
WPTL: ld a,7 ;screen 7
ld ix,0d1h
call 015fh
ld hl,0f3e9h ;color 15,1,1
ld (hl),15
inc hl
ld (hl),0
inc hl
ld (hl),0
ld a,7
ld ix,0111h
call 015fh
XOR A ;setpage 0,0
LD (0FAF5H),A
LD (0FAF6H),A
LD IX,013DH
CALL 015FH
LD A,(0F3E0H) ;not view
AND 10111111B
LD (0F3E0H),A
LD B,A
LD C,1
LD IX,012DH
CALL 015FH
LD A,(0FFE7H)
OR 10B
LD (0FFE7H),A
LD B,A
LD C,8
LD IX,012DH
CALL 015FH ;sprite off
DI ;fill
LD BC,2*256+0
FLLOP: PUSH BC
LD L,C
CALL WAIT.VDP
LD DE,1
LD A,(0007H)
LD C,A
INC C
LD A,32
OUT (C),A
LD A,80H+17
OUT (C),A
INC C
INC C
LD B,7
REPOT2: OUT (C),D
DJNZ REPOT2
OUT (C),L ; DY (HIGH)
LD HL,512 ; NX
OUT (C),L
OUT (C),H
LD A,212 ; NY
OUT (C),A
OUT (C),D
LD A,255
OUT (C),A ; CLR
OUT (C),D
LD A,11000000B
OUT (C),A
POP BC
INC C
DJNZ FLLOP
DI ; PALLETE SET UP (10-15)
LD A,(7H) ; # VDP
LD C,A
INC C
LD A,10
OUT (C),A
LD A,90H ; pl:rg16
OUT (C),A
INC C
LD HL,PALLET
LD B,6
PT.LOOP: LD A,(HL)
OUT (C),A
AND 7
OUT (C),A
INC HL
DJNZ PT.LOOP
EI
LD HL,FILENM ; FILE > VRAM
LD (0F562H),HL
XOR A
LD H,A
LD L,A
LD (0F566H),HL
INC H
LD (0F568H),HL
LD (0F56FH),A
LD HL,0F562H
LD IX,019DH
CALL 015FH
JP TEST
FILENM: DB
22H,'WPTITLE.DT7',22H,0
TEST: LD
A,(0F3E0H) ; ON VIEW
OR 01000000B
LD (0F3E0H),A
LD B,A
LD C,1
LD IX,012DH
CALL 015FH
LD B,8
LD D,15
LD IX,014DH
CLLOP: LD A,3
CALL WAIT
LD A,8
SUB B
LD E,A
ADD A,A
ADD A,A
ADD A,A
ADD A,A
OR E
CALL 015FH ; PALLET SET (15)
DJNZ CLLOP
LD A,60*1 ; WAIT
CALL WAIT
LD DE,0001H
LD B,160
MLOOP: DEC B ; LOOP COUNT
LD A,E
CALL WAIT
LD A,E ; A<1
CALL COPY
LD A,2
CALL COPY
LD A,3
CALL COPY
LD A,B
CP 103
JP NC,MLOOP
LD A,60 ; WAIT
CALL WAIT
LD HL,NEKODT
LD B,6
NEKOLP: DI
CALL WAIT.VDP
LD A,(0007H)
LD C,A
INC C
LD A,32
OUT (C),A
LD A,80H+17
OUT (C),A
INC C
INC C
XOR A
LD DE,264
OUT (C),E ; SX ( PAGE 1 - )
OUT (C),D
OUT (C),A ; SY
OUT (C),D
LD E,(HL)
INC HL
SLA E
OUT (C),E ; DX
LD E,A
RL E
OUT (C),E
LD E,(HL)
INC HL
OUT (C),E ; DY
OUT (C),A
LD E,41
OUT (C),E ; NX
OUT (C),A
LD E,22
OUT (C),E ; NY
OUT (C),A
OUT (C),A
OUT (C),A
LD E,10011000B
OUT (C),E
EI
PUSH BC
LD B,1
LD C,23
LD IX,012DH
CALL 015FH
LD A,7
LD E,10110111B
CALL 0093H
LD A,8
LD E,12
CALL 0093H
LD A,6
LD E,12
CALL 0093H
LD A,1
CALL WAIT
LD A,8
LD E,0
CALL 0093H
LD B,0
LD C,23
LD IX,012DH
CALL 015FH
LD A,4
CALL WAIT
POP BC
DEC B
JP NZ,NEKOLP
RET
NEKODT: DB 143,181,103,156,137,116,94,91,111,43,72,13
; ***** VRAM COPY SUB PROGRAM *****
COPY: LD C,B
LD HL,COPYDT-7
LD B,A
LD A,L ; ADDRESS KEISAN
CP.LOP: ADD A,7
JP NC,LBL_NC
INC H
LBL_NC: DJNZ CP.LOP
LD L,A
LD B,C
DI
CALL WAIT.VDP
LD A,(0007H)
LD C,A
INC C
LD A,32
OUT (C),A
LD A,80H+17
OUT (C),A
INC C
INC C
OUT (C),D ; SX ( PAGE 1 - )
OUT (C),D
CALL READDT ; SY
OUT (C),E
CALL READDT ; DX
OUT (C),D
CALL READDT ; DY
CALL READDT
CALL READDT ; NX
OUT (C),E
CALL READDT ; NY
OUT (C),D
OUT (C),D
OUT (C),D
CALL READDT
EI
RET
READDT: LD A,(HL)
INC HL
INC A
JP NZ,CP_L2
OUT (C),B
RET
CP_L2: DEC A
OUT (C),A
RET
; SY DX DY NX NY MODE
COPYDT: DB 0, 0,255,1, 8, 44,11010000B
DB 44, 0,147,1, 8, 12,10011000B ; 59
DB 103,124, 80,0, 8, 56,11010000B
PALLET: DB 01110111B,01100110B,01010101B,00110011B,00100010B,0
;***** VDP COMMAND WAITTING SUB PROGRAM *****
WAIT.VDP: PUSH BC
LD A,(0006H)
LD C,A
INC C
LD B,8FH
WAIT.L1: LD A,2
CALL GET.VDP
RRA
JP C,WAIT.L1
XOR A
CALL GET.VDP
POP BC
RET
GET.VDP: OUT (C),A
OUT (C),B
IN A,(C)
RET
WAIT: LD (0FCA2H),A
XOR A
LD (0FCA3H),A
WAIT_0: LD A,(0FCA2H)
OR A
JP NZ,WAIT_0
RET
END
|
MAIN.MACの内容 |
;MAIN MODULE DATE H05/04/07
.Z80
VRAM EQU 0D100H
PUBLIC MAIN_H
EXTRN RE_STR,START,ENDING
;
EXTRN G_SETUP ;SUB PROGRAMS(MODULE2,3)
EXTRN BLKPUT,CRASH,PTCLR,V.WAIT,RND,NEXTPUT,NEXTCLR,WORKPUT,SUBPUT
EXTRN BLOCK,SEARCH,LINECR,LINEMC,SWICH,T_WAIT,OJAMA,RENGA
;
EXTRN SWMOVE ;MODULE3
EXTRN SWCHSV,MAINSV,NEXTSV,METSET,METER,LIGHT,SPR_ON,SPROFF,BATU,SOUND
;
EXTRN FADEIO,PALETE
EXTRN FONT8P ;MODULE4
EXTRN FONT4P,SC_PUT,SPRKIL,WINDOW,WINSYS,WINGKL,TR_CHK
;
EXTRN CHRPUT ;'HINAYO'
EXTRN CHRSET,FMSTOP,FMSTRT
;
MAIN_H: LD HL,(0D01DH) ;ORIGINAL TIMER LOADヨウ
LD (0D019H),HL ;ORIGINAL TIMER
XOR A
LD (0D01BH),A ;LEVEL COUNT
;
MAIN: DI
LD A,1
CALL T_WAIT
LD A,(0D004H)
DEC A
LD (0D004H),A ;UNDER MOVE COUNT
LD E,0 ;MOVE FLAG
LD HL,(0D006H) ;PARTS XY POINT
JP NZ,CANMV
LD A,(0D005H) ;UNDER MOVE CT. BASE
LD (0D004H),A
INC H
INC E ;MOVE FLAG ON
LD A,(0D000H)
CALL CRASH
JP NC,ONSTKA
;チャクチ
LD A,(7) ;ROLL -1
INC A
LD C,A
LD A,255
DI
OUT (C),A
LD A,10010111B
OUT (C),A
LD A,1
CALL SOUND
EI
LD HL,(0D006H)
LD A,(0D000H)
CALL WORKPUT
CALL SUBPUT
LD A,2
CALL T_WAIT
LD A,(7) ;ROLL +1
INC A
LD C,A
XOR A
DI
OUT (C),A
LD A,10010111B
OUT (C),A
EI
CALL SEARCH
OR A ;CLEAR?
JP Z,NB_L00
PUSH AF ;**
LD C,A
push de
XOR A
CALL SC_PUT
LD A,C
RLCA
DEC A
LD D,A ;n> n x m
LD A,(0D018H)
LD E,A ;m>
INC E
LD A,1
CALL SC_PUT ;BONUS
XOR A
LD B,E
BNS_KS: ADD A,D
DJNZ BNS_KS
pop de
LD HL,(0D015H) ;SCORE
ADD A,L
JP NC,L1
INC H
L1: LD L,A
LD (0D015H),HL
LD A,8
CALL CHRPUT
POP AF ;**
CALL OJAMA
CALL LINECR ;LINE CLEAR
CALL LINEMC
LD HL,(0D015H) ;SCORE PUT
LD A,2
CALL SC_PUT
LD A,(0D018H) ;light
INC A
CP 4
JP NC,NB_LL0
LD (0D018H),A
CALL LIGHT
JP NB_LL0
;>>>>>>>>>>>
NB_L00: XOR A
LD (0D018H),A ;LIGHT 0
CALL LIGHT
NB_LL0: CALL GMOVER ;*** game over ? ***
LD A,(0D013H) ;SWICH
INC A
LD (0D013H),A
LD B,A
LD A,(0D014H)
SUB B
JP NZ,NB_L11
LD (0D013H),A
LD A,(0D012H)
INC A
CP 6
JP C,NB_L01
ld a,2
call chrput
CALL SWMOVE ; SWICH BOM!
LD A,(0D010H)
OR 128
ld b,a
CALL RND
cp 64
LD A,1110000B
jp c,NB_LL1
call rnd
and 1110000b
NB_LL1: or b
LD (0D010H),A ; OJAMA BLOCK!
CALL NEXTPUT
LD A,30
CALL T_WAIT
ld a,7
call chrput
LD A,1
NB_L01: LD (0D012H),A
CALL SWICH
;
NB_L11: CALL BLOCK
CALL NEXTCLR
CALL NEXTPUT
JP PRGEND
;
CANMV: LD A,(0D000H) ; カイテン READ
LD B,A
LD A,5 ; カイテン PRG.
CALL 0141H ; KEY MATRIX READ 'ZYXWVUTS'
INC A
JP NZ,ONKEYM ; ON PUSH KEY
push bc
LD A,1
CALL 00D8H ; TRIGER READ st-1 OR st-3(I/O PORT 1)
LD D,A
LD A,3
CALL 00D8H
pop bc
;
ld c,a
OR D
JP NZ,ONTRG0
LD (LOKKEY+1),A
JP NOKTEN
ONTRG0: INC C
LD A,11100000B
JP NZ,ONKEYM
LD A,10000000B
;
ONKEYM: DEC A ;レンゾク KEY-SCYAN?
LD C,A
LOKKEY: LD A,0
CP C
JP Z,NOKTEN
LD A,C
LD (LOKKEY+1),A
;
CP 00011111B ;'XYZ' ANOTHER TECH.
JP NZ,RIGHKT
CALL METER
RIGHKT: CP 11011111B ;'X'
JP NZ,LEFTKT
INC B
JP KAITEN
LEFTKT: CP 01111111B ;'Z'
JP NZ,NOKTEN
DEC B
;
KAITEN: LD A,B
AND 11B
CALL CRASH ; カイテン デキルカ?
JP C,NOKTEN
LD E,1
LD A,(0D000H)
LD (0D011H),A
LD A,B
AND 11B
LD (0D000H),A
XOR A
CALL SOUND
JP ONSTKA
;
NOKTEN: PUSH HL
XOR A ; tr-0 COUSOLE DATA READ
CALL 00D5H
OR A
JP NZ,ONSTCK
INC A ; tr-1 JOY-STICK DATA READ
CALL 00D5H
ONSTCK: POP HL
;
OR A ; RND ケイレツ カエル
JP Z,RNDMZ
LD C,A
ld a,r
ld (rnd+1),a
LD A,C
RNDMZ: CP 5
LD C,A
JP Z,ONSTK0
;
LD C,A
AUTO_S: LD A,0 ; AUTO SCYAN
CP C
JP NZ,AUTO_0
AUTO_1: LD A,0
CP 6
JP NC,ONSTK0
INC A
LD (AUTO_1+1),A
JP ONSTKA
AUTO_0: XOR A
LD (AUTO_1+1),A
LD A,C
LD (AUTO_S+1),A
;
ONSTK0: LD A,C
CP 3
JP NZ,ONSTK1
INC L ; +1 RIGHT
LD E,1
JP ONSTKA
ONSTK1: CP 7
JP NZ,ONSTK2
LD E,1
DEC L ; -1 LEFT
JP ONSTKA
ONSTK2: CP 5
JP NZ,ONSTKA
LD A,1
LD (0D004H),A
JP PRGEND
ONSTKA: DEC E
JP NZ,PRGEND
;
LD A,(0D000H)
CALL CRASH ; MOVE OK?
JP C,PRGEND
LD DE,(0D006H)
LD (0D00DH),DE
LD (0D006H),HL
CALL PTCLR
CALL BLKPUT
LD A,(0D000H)
LD (0D011H),A
;
PRGEND: call renga
LD A,(0D017H) ;CLEAR CHECK!
CP 30
JP Z,CLEAR
;
LD HL,(0D019H) ;LEVEL UP ?
LD A,L
OR H
JP NZ,MAIN
; ;*** LEVEL UP PRG.
LD A,(0D01BH) ;LEVEL READ
INC A
AND 11B
JP NZ,WN_LB1 ;1-3 ニスル
LD A,1
WN_LB1: LD (0D01BH),A
LD HL,WN_STR
LD B,A
ADD A,'1'
LD (WN_STR+14),A
LD A,B
LD (0D00AH),A
PUSH HL
LD HL,86*256+90 ;WINDOW PUT
LD DE,9*256+6
CALL WINDOW
POP HL
LD B,3
LD DE,9
WN_LB0: CALL FONT8P
ADD HL,DE
DJNZ WN_LB0
LD A,60
CALL T_WAIT
CALL WINGKL
;
LD HL,(0D01DH)
LD (0D019H),HL ;ORG.TIMER
LD A,(0D01FH)
LD (0D01CH),A ;ケィゾク COUNT
;
LD A,(0D005H) ;ラッカソクドUP
DEC A
JP Z,MAIN
LD (0D005H),A
JP MAIN
WN_STR: DB 98,104,9,'LEVEL',0
DB 98,116,9,'- 2 -',0
;
; GAME OVER ノチニ STACKヲ アワセル.
;
GMOVER: PUSH HL
PUSH DE
PUSH BC
LD HL,VRAM+41+3
LD B,3
GMO_LP: LD A,(HL)
OR A
JP NZ,GMO_L1 ;> GAME OVER
INC HL
DJNZ GMO_LP
POP BC
POP DE
POP HL
RET
; < GAME OVER >
GMO_L1: POP BC
POP DE
POP HL
POP AF ;'RET'ステル
LD A,4
CALL SOUND
LD A,2
CALL CHRPUT
XOR A ;バツ
CALL BATU
CALL FMSTOP
LD HL,32*256+183 ;GAMEガメン アミ ケシ
LD DE,53*256+204
LD B,76
LD A,(7)
LD C,A
INC C
GMO_L2: PUSH BC
PUSH DE
LD DE,32*256+91H
CALL V.WAIT
OUT (C),D
OUT (C),E
POP DE
INC C
INC C
XOR A
LD B,184
OUT (C),B ;>
OUT (C),A
OUT (C),H ;
LD B,1
OUT (C),B
LD B,87
OUT (C),B ;<
OUT (C),A
OUT (C),D ;
OUT (C),A
LD B,72
OUT (C),B ;NX
OUT (C),A
LD B,1
OUT (C),B ;NY
OUT (C),A
OUT (C),A ;
OUT (C),A
LD A,11010000B
OUT (C),A
DEC C
DEC C
PUSH DE
LD DE,32*256+91H
CALL V.WAIT
OUT (C),D
OUT (C),E
POP DE
INC C
INC C
XOR A
LD B,184
OUT (C),B ;>
OUT (C),A
OUT (C),L ;
LD B,1
OUT (C),B
LD B,87
OUT (C),B ;<
OUT (C),A
OUT (C),E ;
OUT (C),A
LD B,72
OUT (C),B ;NX
OUT (C),A
LD B,1
OUT (C),B ;NY
OUT (C),A
OUT (C),A ;
OUT (C),A
LD A,11010000B
OUT (C),A
POP BC
LD A,2
CALL T_WAIT
INC H
INC H
INC D
INC D
DEC L
DEC L
DEC E
DEC E
DEC B
JP NZ,GMO_L2
;
LD A,1
CALL FMSTRT
LD HL,86*256+90 ;WINDOW PUT
LD DE,9*256+9
CALL WINDOW
LD B,4
LD HL,GMO_ST
LD DE,11
GMO_L3: CALL FONT8P
ADD HL,DE
DJNZ GMO_L3
LD HL,96*256+118
LD A,2
CALL WINSYS ;window system?
;
PUSH AF
LD A,8
LD B,1
CALL FADEIO
CALL FMSTOP
POP AF
OR A
JP Z,CONTIN
JP RE_STR ;GAME END >TITLE
;
CONTIN: LD A,(0D020H) ;CONTINU
AND 11100B ;WORLDハジメ START
LD (0D020H),A
LD HL,0
LD (0D015H),HL
LD A,1
CALL BATU
CALL WINGKL
JP START
;
GMO_ST: DB 94, 98,9,'G A M E',0
DB 94,106,9,'O V E R',0
DB 94,124,9,' CONT',0
DB 90,140,9,' END',0
;
; STAGE CLEAR!
;
CLEAR: CALL FMSTOP
LD A,6
CALL CHRPUT
CALL BATU
XOR A
LD (0D017H),A
CALL METSET
LD B,30
LD D,0
CLR_LP: PUSH BC
LD A,D
INC A
CP 7
JP C,CLR_L1
LD A,1
CLR_L1: LD D,A
CALL SWICH
LD A,B
AND 3
LD (0D018H),A
CALL LIGHT
CALL METER
LD A,2
CALL T_WAIT
POP BC
DJNZ CLR_LP
;
LD A,(0D020H) ;ALL CLEAR CHECK
CP 11
JP NC,ALLCLR
;
LD HL,86*256+90 ;WINDOW PUT
LD DE,9*256+8
CALL WINDOW
LD B,4
LD HL,CLR_ST
LD DE,11
CLR_L3: CALL FONT8P
ADD HL,DE
DJNZ CLR_L3
LD A,30
CALL T_WAIT
LD HL,(0D015H)
LD DE,50
ADD HL,DE
LD (0D015H),HL
LD A,2
CALL SC_PUT
LD A,2
CALL SOUND
;
CLR_L4: CALL TR_CHK
JP NC,CLR_L4
LD A,8
LD B,1
CALL FADEIO
LD A,(0D020H)
INC A
LD (0D020H),A
LD A,128
LD (0D01CH),A ;LEVEL UP STOP
CALL WINGKL
LD A,4
CALL CHRPUT
JP START
;
; ALL STAGE CLEAR!
;
ALLCLR: LD HL,86*256+90 ;WINDOW PUT
LD DE,9*256+8
CALL WINDOW
LD B,4
LD HL,CLR_S2
LD DE,11
ALR_L3: CALL FONT8P
ADD HL,DE
DJNZ ALR_L3
LD A,60
CALL T_WAIT
LD HL,(0D015H)
LD DE,100
ADD HL,DE
LD (0D015H),HL
LD A,2
CALL SC_PUT
CALL SOUND
CALL SOUND
ALR_L4: CALL TR_CHK
JP NC,ALR_L4
LD A,16
LD B,1
CALL FADEIO
JP ENDING
;
CLR_ST: DB 94, 98,9,' STAGE ',0
DB 94,106,9,' CLEAR ',0
DB 94,124,9,'-BONUS-',0
DB 94,132,9,' 500 ',0
CLR_S2: DB 94, 98,9,' ALL ',0
DB 98,106,9,'CLEAR! ',0
DB 94,124,9,'-BONUS-',0
DB 98,132,9,' 1000 ',0
END
|
|