home *** CD-ROM | disk | FTP | other *** search
- ; > plotcfill
-
- .CINCLUDE "h.ploth"
-
- a1 = 0
- a2 = 1
- a3 = 2
- a4 = 3
-
- v1 = 4
- v2 = 5
- v3 = 6
- v4 = 7
- v5 = 8
- v6 = 9
-
- sl = 10
- fp = 11
- ip = 12
- sp = 13
-
- lr = 14
- pc = 15
-
- .AREA WA$$code,.CODE,.READONLY
-
- ; extern void plot_circlefill(int x, int y, int r, unsigned col);
-
- x = a1
- y = a2
- r = a3
- col = a4
- col1 = v1
- col2 = col
- yadr = v2
- ydif = y
- x1 = v3
- x2 = x
- e = v4
- dxe = r
- dye = v5
- padr = v6
- len = sl
- mask = lr
-
- v_screen_adr: .ADDRESS screen_adr
-
- plot_circlefill::
- STMFD sp!, {v1-v6, sl, fp, lr}
-
- ADD r, r, #3
- MOV r, r, ASR #2
- ADD x, x, #640
- MOV x, x, ASR #2
- RSB y, y, #512
- MOV y, y, ASR #2
-
- TST y, #1
- MOVNE col, col, ROR #16
- MOV col1, col, LSL #16
- MOV col2, col, LSR #16
- ORR col1, col1, col1, LSR #16
- ORR col2, col2, col2, LSL #16
- TST x, #1
- MOVNE col1, col1, ROR #4
- MOVNE col2, col2, ROR #4
- EOR col2, col2, col1
-
- SUB x1, x, r
- ADD x2, x, r
- LDR ip, v_screen_adr
- MOV y, y, ASL #5
- ADD y, y, y, ASL #2
- LDR ip, [ip]
- ADD yadr, y, ip
- MOV ydif, #0
-
- AND ip, r, #3
- RSB lr, ip, r, ASL 1
- MOV e, #0
- TST ip, #1
- MOVNE e, lr
- TST ip, #2
- ADDNE e, e, lr, ASL #1
- MOV e, e, ASR #4
- RSBS e, e, #0
-
- BEQ plotcirc_1
- RSB lr, e, #0
- ADD ip, e, #1
- ADDS ip, ip, r, ASL #1
- RSBMI ip, ip, #0
- CMP ip, lr
- ADDMI r, r, #1
- MOV e, ip
- plotcirc_1:
-
- MOV dxe, r, LSL #1
- RSB dxe, dxe, #1
- MOV dye, #1
-
- ADD e, e, dxe
- ADD e, e, dye
-
- plotcirc_E:
- CMP x1, x2
- LDMGTFD sp!, {v1-v6, sl, fp, pc}^
-
- plotcirc_L:
- RSBS ip, dxe, e, ASL #1
- ADDGT x1, x1, #1
- SUBGT x2, x2, #1
- ADDGT dxe, dxe, #2
- ADDGT e, e, dxe
-
- RSBS ip, dye, e, ASL #1
- BGT plotcirc_E
-
- ADD dye, dye, #2
- ADD e, e, dye
-
- AND ip, x1, #7
- MOV ip, ip, ASL #2
- MVN mask, #0
- MOV mask, mask, LSL ip
-
- MOV ip, x1, ASR #3
- ADD padr, yadr, ip, ASL #2
- RSBS len, ip, x2, ASR #3
- BEQ plotcirc_6
-
- LDR ip, [padr, ydif]
- EOR ip, ip, col1
- BIC ip, ip, mask
- EOR ip, ip, col1
- STR ip, [padr, ydif]
-
- LDR ip, [padr]
- EOR ip, ip, col1
- BIC ip, ip, mask
- EOR ip, ip, col1
- STR ip, [padr], #4
-
- SUBS len, len, #1
- BEQ plotcirc_4
-
- TST len, #1
- STRNE col1, [padr, ydif]
- STRNE col1, [padr], #4
- BICS len, len, #1
- BEQ plotcirc_4
-
- MOV mask, col1
- ADD ip, padr, ydif
-
- plotcirc_3:
-
- STMIA ip!, {col1, mask}
- STMIA padr!, {col1, mask}
- SUBS len, len, #2
- BNE plotcirc_3
-
- plotcirc_4:
-
- AND ip, x2, #7
- MOV ip, ip, ASL #2
- MVN mask, #15
- MVN mask, mask, LSL ip
-
- plotcirc_5:
-
- LDR ip, [padr, ydif]
- EOR ip, ip, col1
- BIC ip, ip, mask
- EOR ip, ip, col1
- STR ip, [padr, ydif]
-
- LDR ip, [padr]
- EOR ip, ip, col1
- BIC ip, ip, mask
- EOR ip, ip, col1
- STR ip, [padr]
-
- SUB yadr, yadr, #0xA0
- ADD ydif, ydif, #0x140
- EOR col1, col1, col2
-
- B plotcirc_E
-
- plotcirc_6:
-
- AND ip, x2, #7
- MOV ip, ip, ASL #2
- RSB ip, ip, #28
- MOV mask, mask, LSL ip
- MOV mask, mask, LSR ip
-
- B plotcirc_5
-