123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482 |
- ************************************************************************
- * *
- * [[[ NOP ]]] EASY CML MACRO DEFINITIONS *
- * by S.OKADA from 92/01/07 Tue 14:56 *
- * *
- ************************************************************************
- ;
- ; *** easy command macro ***
- ;
- EASY_START MACRO
- MOVE.L ADRS1(A6),A0
- JMP (A0)
- ENDM
- EASY_CALL MACRO
- MOVE.L ADRS1(A6),A0
- JSR (A0)
- ENDM
- STEP_SAVE MACRO No,ADRS
- MOVE.B #No,STEP1(A6)
- MOVE.L #ADRS,ADRS1(A6)
- ENDM
- NEXT_CHECK MACRO BRC,No,ADRS
- \1 SET_\3
- RTS
- SET_\3
- MOVE.B #No,STEP1(A6)
- MOVE.L #ADRS,ADRS1(A6)
- ENDM
- END_NEXT MACRO No,ADRS
- MOVE.B #No,STEP1(A6)
- MOVE.L #ADRS,ADRS1(A6)
- RTS
- ENDM
- SEC_TIMER MACRO OFFS
- LEA.L OFFS(A6),A0
- JSR.S SEC_TIME
- ENDM
- SEC_TIMER_SET MACRO TIME,OFFS
- MOVE.B #TIME,OFFS(A6)
- MOVE.B SECOND_VALUE(A5),OFFS+1(A6)
- ENDM
- SUB_WORK MACRO No,AREG,LP
- MOVEP.W No(A6),D0
- CLR.B D0
- LEA.L -LP(A5,D0.W),AREG
- ENDM
- XREF GEN_PCHILD
- XREF GEN_LCHILD
- PCHILD MACRO NUM,TYPE,ACT_No,X,Y,PRI,CML
- JSR.S GEN_PCHILD
- DC.W \1,\2,\3,\4,\5,\6
- DC.L \7
- ENDM
- LCHILD MACRO NUM,SYS_TYPE,CML
- JSR.S GEN_LCHILD
- DC.W \1,\2
- DC.L \3
- ENDM
- OBJ_MAP MACRO ADRS
- LEA.L ADRS(PC),A0
- JSR.S OBJ_MAP_SET
- ENDM
- XREF COLOR_COM_SET
- COLOR_COMMAND MACRO
- JSR.S COLOR_COM_SET
- ENDM
- PALETTE MACRO PAL,PG,COMMAND
- DC.W PAL*20H
- DC.B PG
- DC.B COMMAND
- ENDM
- PG_SET EQU 10000000B
- FADE_OUT EQU 01110000B
- FADE_IN EQU 01110100B
- FADE_COLOR EQU 01111000B
- B_OUT EQU 01100000B
- B_IN EQU 01100100B
- B_COLOR EQU 01101000B
- G_OUT EQU 01010000B
- G_IN EQU 01010100B
- G_COLOR EQU 01011000B
- GB_OUT EQU 01000000B
- GB_IN EQU 01000100B
- GB_COLOR EQU 01001000B
- R_OUT EQU 00110000B
- R_IN EQU 00110100B
- R_COLOR EQU 00111000B
- RB_OUT EQU 00100000B
- RB_IN EQU 00100100B
- RB_COLOR EQU 00101000B
- RG_OUT EQU 00010000B
- RG_IN EQU 00010100B
- RG_COLOR EQU 00011000B
- RGB_OUT EQU 00000000B
- RGB_IN EQU 00000100B
- RGB_COLOR EQU 00001000B
- BASE_COLOR EQU 00001100B
- CC_SPEED0 EQU 0 128/60
- CC_SPEED1 EQU 1 64/60
- CC_SPEED2 EQU 2 32/60
- CC_SPEED3 EQU 3 16/60
- PALETTE_END MACRO
- DC.W -1
- ENDM
- PAL_WAIT MACRO No
- TST.W No*20H+COLOR_BUFFER(A5)
- DC.W 6702H BEQ.S *+2
- RTS
- ENDM
- CONT_FIX_SET MACRO
- MESS_ON
- MOVE.L A6,(A0)+
- SUBQ.B #2,-4(A0)
- MOVE.L A0,MESS_POINT(A5)
- MESS_OFF
- ENDM
- FIX_WORK_MESS MACRO ADRS
- MESS_ON
- MOVE.L A6,(A0)+
- SUBQ.B #1,-4(A0)
- MOVE.L #ADRS,(A0)+
- MESS_OFF
- ENDM
- ;
- ; *** nop mess out ***
- ;
- ; No 0 command end
- FIX_END MACRO NEXT,SAVE_CML
- MODE SET 0
- IFC 'RAM',\1
- MODE SET 8000H
- ENDC
- IFC 'SAVE',\2
- MODE SET MODE+100H
- ENDC
- DC.W MODE
- ENDM
- ; No 1 data format
- FIX_FORMAT MACRO TYPE,PARM
- MODE SET 301H
- IFC 'B',\0
- MODE SET 101H
- ENDC
- IFC 'CODE',\1
- MODE SET MODE-100H
- ENDC
- DC.W MODE,PARM
- ENDM
- FIX_FORMAT_T MACRO TYPE
- MODE SET 301H
- IFC 'B',\0
- MODE SET 101H
- ENDC
- IFC 'CODE',\1
- MODE SET MODE-100H
- ENDC
- DC.W MODE
- ENDM
- FIX_FORMAT_TP MACRO PARM
- DC.W PARM
- ENDM
- ; No 2 auto increment value
- FIX_AUTO MACRO INC
- DC.W INC*100H+2
- ENDM
- ; No 3 output v-ram address
- FIX_ADRS MACRO X,Y
- DC.W 3
- IFEQ NARG-1
- DC.W X
- ELSEC
- DC.W 7000H+20H*X+Y
- ENDM
- FIX_ADRS_T MACRO
- DC.W 3
- ENDM
- FIX_ADRS_TP MACRO X,Y
- IFEQ NARG-1
- DC.W X
- ELSEC
- DC.W 7000H+20H*X+Y
- ENDM
- ; No 4 get data address and data output
- FIX_DATA_ADRS MACRO ADRS
- DC.W 4
- DC.L ADRS
- ENDM
- ; No 5 address increment
- ; No 14 address increment byte type
- FIX_NEXT MACRO X,Y
- MODE SET X
- IFEQ NARG-2
- MODE SET X*20H+(Y)
- ENDC
- IFGE MODE+80H
- IFLT MODE-80H
- DC.W MODE*100H+14H
- ELSEC
- DC.W 5,MODE
- ENDC
- ELSEC
- DC.W 5,MODE
- ENDC
- ENDM
- FIX_NEXT_T MACRO
- DC.W 5
- ENDM
- FIX_NEXT_TP MACRO X,Y
- DC.W X*20H+(Y)
- ENDM
- NEXT_DIRECT MACRO X,Y
- MODE SET X
- IFEQ NARG-2
- MODE SET X*20H+(Y)
- ENDC
- IFGE MODE+80H
- IFLT MODE-80H
- DC.W MODE*100H+14H,7
- ELSEC
- DC.W 5,MODE,7
- ENDC
- ELSEC
- DC.W 5,MODE,7
- ENDC
- ENDM
- ; No 6 data continue output
- FIX_DATA_CONT MACRO
- DC.W 6
- ENDM
- ; No 7 direct data
- FIX_DIRECT_DATA MACRO
- DC.W 7
- ENDM
- ; No 8 common Fix 8*16 font output
- FIX_DOUBLE MACRO HI
- DC.W HI*100H+8
- ENDM
- ; No 9 common Fix 8*16 font output
- FIX_KANA MACRO HI
- DC.W HI*100H+9
- ENDM
- ; No 9 common Fix 16*16 font output
- FIX_KNJ MACRO HI
- DC.W HI*100H+18H
- ENDM
- ; No 0A sub data call
- FIX_CALL MACRO ADRS
- DC.W 0AH
- DC.L ADRS
- ENDM
- ; No 0B sub data return
- FIX_RETURN MACRO
- DC.W 0BH
- ENDM
- ; No 0C same data output
- FIX_SAME MACRO COUNT,CODE
- DC.W COUNT*100H+0CH,CODE
- ENDM
- ; No 0D increment data output
- FIX_INC_OUT MACRO COUNT,CODE
- DC.W COUNT*100H+0DH,CODE
- ENDM
- ; No 0E A6 work change
- FIX_WORK_CHANGE MACRO TARGET
- IFC 'MASTER',\1
- DC.W 800EH
- ELSEC
- DC.W TARGET*100H+0EH
- ENDC
- ENDM
- ; No 0F command table call
- FIX_TABLE MACRO WORK,OFS,TABLE
- IFC 'A6',\1
- DC.W 0FH
- ELSEC
- DC.W 10FH
- ENDC
- DC.W OFS
- DC.W TABLE-*
- ENDM
- ; No 17 single command table call
- FIX_TABLE_SING MACRO WORK,OFS,TABLE
- IFC 'A6',\1
- DC.W 17H
- ELSEC
- DC.W 117H
- ENDC
- DC.W OFS
- DC.W TABLE-*
- ENDM
- WORD_TBL MACRO ADRS
- DC.W ADRS-*
- ENDM
- ; No 10 command pointer to cml
- FIX_CML_POINT MACRO
- DC.W 10H
- ENDM
- ; No 11 cml pointer save
- FIX_CML_SAVE MACRO
- DC.W 11H
- ENDM
- ; No 12 BCD convert data table set
- FIX_BCD_TABLE MACRO ADRS
- DC.W 12H
- DC.L ADRS
- ENDM
- ; No 13 BCD data output by BCD table
- FIX_BCD_OUT MACRO ZERO,BASE,OFS,START,COUNT,X,Y,HI
- MODE SET 8013H+(COUNT-1)*100H
- IFC \0,'B'
- MODE SET MODE-8000H
- ENDC
- IFC 'MASK',\1
- MODE SET MODE+4000H
- ENDC
- IFC 'A6',\2
- MODE SET MODE+1000H
- ENDC
- IFC 'LOW',\4
- MODE SET MODE+2000H
- ENDC
- DC.W MODE,7000H+20H*X+Y,OFS
- DC.B HI,0
- ENDM
- ; No 15 fix continue output
- FIX_CONT_MODE MACRO
- DC.W 15H
- ENDM
- ; No 16 C language printf
- FIX_PRINTF MACRO
- DC.W 16H
- ENDM
- PARM MACRO COUNT,ADRS
- DC.B '%',COUNT
- DC.W ADRS-?A5
- ENDM
- ;
- ; *** fix countinue command ***
- ;
- ; CF No 00 data end
- CF_END MACRO
- DC.B CTRL_CH,0
- ENDM
- ; CF No 01 first parm set
- CF_FIRST MACRO BX,BY,CH_INC,LINE_INC,ATTR
- DC.B CTRL_CH,1
- DC.W 7000H+20H*BX+BY
- DC.W CH_INC,LINE_INC,ATTR
- ENDM
- ; CF No 02 line feed
- CF_LINE_FEED MACRO
- DC.B CTRL_CH,02
- ENDM
- ; CF No 03 next page
- CF_NEXT_PAGE MACRO
- DC.B CTRL_CH,03
- ENDM
- ; CF No 04 temporary 1 line clear
- CF_LINE_CLEAR MACRO X
- DC.B CTRL_CH,04,X
- ENDM
- ; CF No 05 page clear
- CF_PAGE_CLEAR MACRO X,Y
- DC.B CTRL_CH,05,X,Y
- ENDM
- ; CF No 06 table sub data call with d16(A5)
- ; CF No 07 table sub data call with d16(A6)
- CF_TABLE_SUB MACRO BASE,OFS,TABLE
- DC.B CTRL_CH
- IFC 'A5',\1
- DC.B 7
- ELSEC
- DC.B 6
- ENDC
- DC.W OFS
- DC.W TABLE-*
- ENDM
- ; CF No 08 return from sub data
- CF_SUB_RETURN MACRO
- DC.B CTRL_CH,08
- ENDM
- ; CF No 09 word output
- CF_WORD_OUT MACRO CHH,CHL
- DC.B CTRL_CH,09,CHH,CHL
- ENDM
- ; CF No 0A CHAR_ATTR change
- CF_ATTR_CHANGE MACRO CHH
- DC.B CTRL_CH,0AH,CHH
- ENDM
|