123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443 |
- ************************************************************************
- * *
- * [[[ NOP ]]] SYSTEM EASY LOGIC ROUTINE *
- * by S.OKADA from 91/12/25 Wed 09:52 *
- * *
- ************************************************************************
- XDEF COLOR_COM_SET
- XDEF GEN_PCHILD,GEN_LCHILD
- XDEF INIT_MONO_SET,MONO_SET
- XDEF BASE_MONO_SET
- XREF ?A5
- SECT GAME,,C
- ; SECT.S SYS,,C
- INCLUDE SYS.INC
- INCLUDE NEO_GEO.INC
- INCLUDE LABEL.INC
- INCLUDE MACRO.INC
- ;
- ;
- ; *** system easy logic sub routines ***
- ;
- ;
- GEN_PCHILD:
- MOVE.L (SP)+,A1
- BSR FREE_PWORKE
- BEQ GEN_PCHILD_1
- MOVE.W (A1),D2
- MOVE.B WORK_No(A0),0(A6,D2.W)
- MOVE.L 2(A1),D2
- MOVE.W 6(A1),D3
- MOVE.W 8(A1),D4
- MOVE.W 10(A1),D5
- JSR.S PWORK_SET
- MOVEQ.L #01111111B,D0
- AND.B PHASE+1(A5),D0
- MOVE.B D0,MASTER_No(A0)
- MOVE.L 12(A1),ADRS1(A0)
- GEN_PCHILD_1:
- LEA.L 16(A1),A1
- JMP (A1)
- ;
- ; フリーのワークを見つける
- ;
- FREE_PWORKE:
- LEA.L PWORK_START+2000H(A5),A0
- MOVEQ.L #64-1,D0
- FREE_WORK_1:
- TST.W TYPE(A0)
- BEQ FREE_WORK_2
- LEA.L 100H(A0),A0
- DBRA D0,FREE_WORK_1
- FREE_WORK_2:
- ADDQ.W #1,D0
- RTS
- GEN_LCHILD:
- MOVE.L (SP)+,A1
- JSR.S AFTER_FREE_WORK
- BEQ.S GEN_LCHILD_1
- MOVE.W (A1),D2
- MOVE.B WORK_No(A0),0(A6,D2.W)
- MOVE.W 2(A1),TYPE(A0)
- MOVE.L 4(A1),ADRS1(A0)
- MOVEQ.L #01111111B,D0
- AND.B PHASE+1(A5),D0
- MOVE.B D0,MASTER_No(A0)
- CLR.B STEP1(A0)
- GEN_LCHILD_1:
- ADDQ.W #8,A1
- JMP (A1)
- COLOR_COM_SET:
- ; color command set
- ; in) return address = command data top address
- ; command data format
- ; (set palette No)*200H,color coomand
- ; ................
- ; -1,(true return address)
- MOVEM.L A0-A1,-(SP)
- MOVE.L 8(SP),A1
- LEA.L COLOR_BUFFER(A5),A0
- COLOR_COM_SET_1:
- MOVE.W (A1)+,D0
- BMI.S COLOR_COM_SET_2
- MOVE.W (A1)+,0(A0,D0.W)
- BRA.S COLOR_COM_SET_1
- COLOR_COM_SET_2:
- MOVE.B #1,COLOR_STATE(A5)
- MOVE.L A1,8(SP)
- MOVEM.L (SP)+,A0-A1
- RTS
- INIT_MONO_SET:
- ; in) REG_D0 tagert RGB max,min(6 word)
- ; BYTE_FLAG+80H start palette
- ; BYTE_FLAG+82H palette count
- ; BYTE_FLAG+84H speed
- BSR TARGET_GRADE_SET
- CLR.W BYTE_FLAG+86H(A5)
- RTS
- TARGET_GRADE_SET:
- MOVEQ.L #0,D0
- MOVEQ.L #0,D1
- MOVEQ.L #0,D2
- MOVE.W REG_D0+0(A5),D0
- MOVE.W REG_D0+2(A5),D1
- MOVE.W REG_D0+4(A5),D2
- MOVE.W REG_D0+6(A5),D3
- MOVE.W REG_D0+8(A5),D4
- MOVE.W REG_D0+10(A5),D5
- SUB.W D3,D0
- SUB.W D4,D1
- SUB.W D5,D2
- MOVEQ.L #3+8,D6
- LSL.L D6,D0
- LSL.L D6,D1
- LSL.L D6,D2
- LEA.L BYTE_FLAG(A5),A0
- MOVEQ.L #32-1,D7
- TGS_1:
- MOVE.B D3,0(A0)
- MOVE.B D4,1(A0)
- MOVE.B D5,2(A0)
- SWAP D3
- SWAP D4
- SWAP D5
- ADD.L D0,D3
- ADD.L D1,D4
- ADD.L D2,D5
- SWAP D3
- SWAP D4
- SWAP D5
- ADDQ.W #4,A0
- DBRA D7,TGS_1
- RTS
- MONO_TO_BG:
- ADDQ.W #2,A0
- MOVEQ.L #15-1,D6
- MONO_TO_BG_1:
- MOVE.W -2000H(A0),(A0)+
- DBRA D6,MONO_TO_BG_1
- SUBQ.W #1,REG_D7(A5)
- BNE MONO_TO_BG
- MOVE.W BYTE_FLAG+84H(A5),D0
- ADD.W #100H,D0
- MOVE.W D0,BYTE_FLAG+86H(A5)
- RTS
- BASE_MONO_SET:
- BSR TARGET_GRADE_SET
- LEA.L COLOR_BUFFER(A5),A0
- MOVE.W BYTE_FLAG+80H(A5),D0
- LSL.W #5,D0
- LEA.L 0(A0,D0.W),A0
- LEA.L MONO_DATA(PC),A2
- LEA.L R_TYPE+64,A3
- LEA.L BYTE_FLAG(A5),A4
- MOVE.W BYTE_FLAG+82H(A5),REG_D7(A5)
- BASE_MONO_SET_1:
- ADDQ.W #2,A0
- MOVE.W #15,REG_D6(A5)
- BASE_MONO_SET_2:
- MOVEQ.L #0FH,D2
- AND.B (A0),D2
- MOVE.W (A0),D1
- MOVE.W D1,D3
- MOVEQ.L #0FH,D4
- AND.W D3,D4
- ADD.W D1,D1
- ADD.W D1,D1
- ADDX.B D2,D2 R
- LSR.B #4,D3
- AND.W #0FH,D3
- ADD.W D1,D1
- ADDX.B D3,D3 G
- ADD.W D1,D1
- ADDX.B D4,D4 B
- MOVE.W D2,D5
- ADD.W D4,D5
- ADD.W D3,D5
- MOVE.B 0(A2,D5.W),D5
- MOVEQ.L #0,D2
- MOVEQ.L #0,D3
- MOVEQ.L #0,D4
- MOVE.B 0(A4,D5.W),D2
- MOVE.B 1(A4,D5.W),D3
- MOVE.B 2(A4,D5.W),D4
- ADD.W D2,D2
- ADD.W D3,D3
- ADD.W D4,D4
- MOVE.W -64(A3,D2.W),D1
- OR.W 000(A3,D3.W),D1
- OR.W 064(A3,D4.W),D1
- MOVE.W D1,(A0)+
- SUBQ.W #1,REG_D6(A5)
- BNE BASE_MONO_SET_2
- SUBQ.W #1,REG_D7(A5)
- BNE BASE_MONO_SET_1
- RTS
- MONO_SET:
- LEA.L COLOR_BUFFER(A5),A0
- MOVE.W BYTE_FLAG+80H(A5),D0
- LSL.W #5,D0
- LEA.L 0(A0,D0.W),A0
- LEA.L MONO_DATA(PC),A2
- LEA.L R_TYPE+64,A3
- LEA.L BYTE_FLAG(A5),A4
- MOVE.W BYTE_FLAG+82H(A5),REG_D7(A5)
- MOVE.W BYTE_FLAG+86H(A5),D6
- CMP.W #100H,D6
- BEQ MONO_TO_BG
- BCC MONO_SET_3
- MONO_SET_1:
- ADDQ.W #2,A0
- MOVE.W #15,REG_D6(A5)
- MONO_SET_2:
- MOVEQ.L #0FH,D2
- AND.B (A0),D2
- MOVE.W (A0)+,D1
- MOVE.W D1,D3
- MOVEQ.L #0FH,D4
- AND.W D3,D4
- ADD.W D1,D1
- ADD.W D1,D1
- ADDX.B D2,D2 R
- LSR.B #4,D3
- AND.W #0FH,D3
- ADD.W D1,D1
- ADDX.B D3,D3 G
- ADD.W D1,D1
- ADDX.B D4,D4 B
- MOVE.W D2,D5
- ADD.W D4,D5
- ADD.W D3,D5
- MOVE.B MONO_DATA(PC,D5.W),D5
- MOVEQ.L #0,D0
- MOVE.B 0(A4,D5.W),D0
- SUB.W D2,D0
- MOVE.B D0,(A5)
- MOVE.W (A5),D0
- MULS D6,D0
- SWAP D0
- ADD.W D0,D2
- MOVE.B 1(A4,D5.W),D0
- SUB.W D3,D0
- MOVE.B D0,(A5)
- MOVE.W (A5),D0
- MULS D6,D0
- SWAP D0
- ADD.W D0,D3
- MOVE.B 2(A4,D5.W),D0
- SUB.W D4,D0
- MOVE.B D0,(A5)
- MOVE.W (A5),D0
- MULS D6,D0
- SWAP D0
- ADD.W D0,D4
- ADD.W D2,D2
- ADD.W D3,D3
- ADD.W D4,D4
- MOVE.W -64(A3,D2.W),D1 14
- OR.W 000(A3,D3.W),D1 14
- OR.W 064(A3,D4.W),D1 14
- MOVE.W D1,-2002H(A0)
- SUBQ.W #1,REG_D6(A5)
- BNE MONO_SET_2
- MOVE.L A0,D5
- SUB.W #2020H,D5
- AND.W #0FE00H,D5
- MOVE.L D5,A1
- MOVE.W #1,(A1)
- SUBQ.W #1,REG_D7(A5)
- BNE MONO_SET_1
- MOVE.W BYTE_FLAG+84H(A5),D0
- ADD.W D0,D6
- MOVE.W D6,BYTE_FLAG+86H(A5)
- MONO_SET_3:
- RTS
- MONO MACRO TOTAL
- DC.B (TOTAL/3)*4
- ENDM
- MONO_DATA:
- MONO 00H
- MONO 01H
- MONO 02H
- MONO 03H
- MONO 04H
- MONO 05H
- MONO 06H
- MONO 07H
- MONO 08H
- MONO 09H
- MONO 0AH
- MONO 0BH
- MONO 0CH
- MONO 0DH
- MONO 0EH
- MONO 0FH
- MONO 10H
- MONO 11H
- MONO 12H
- MONO 13H
- MONO 14H
- MONO 15H
- MONO 16H
- MONO 17H
- MONO 18H
- MONO 19H
- MONO 1AH
- MONO 1BH
- MONO 1CH
- MONO 1DH
- MONO 1EH
- MONO 1FH
- MONO 20H
- MONO 21H
- MONO 22H
- MONO 23H
- MONO 24H
- MONO 25H
- MONO 26H
- MONO 27H
- MONO 28H
- MONO 29H
- MONO 2AH
- MONO 2BH
- MONO 2CH
- MONO 2DH
- MONO 2EH
- MONO 2FH
- MONO 30H
- MONO 31H
- MONO 32H
- MONO 33H
- MONO 34H
- MONO 35H
- MONO 36H
- MONO 37H
- MONO 38H
- MONO 39H
- MONO 3AH
- MONO 3BH
- MONO 3CH
- MONO 3DH
- MONO 3EH
- MONO 3FH
- MONO 40H
- MONO 41H
- MONO 42H
- MONO 43H
- MONO 44H
- MONO 45H
- MONO 46H
- MONO 47H
- MONO 48H
- MONO 49H
- MONO 4AH
- MONO 4BH
- MONO 4CH
- MONO 4DH
- MONO 4EH
- MONO 4FH
- MONO 50H
- MONO 51H
- MONO 52H
- MONO 53H
- MONO 54H
- MONO 55H
- MONO 56H
- MONO 57H
- MONO 58H
- MONO 59H
- MONO 5AH
- MONO 5BH
- MONO 5CH
- MONO 5DH
- MONO 5EH
- MONO 5FH
- INCLUDE WORK.INC
|