Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; =============================================================
- ; Macro to set VRAM write access
- ; Arguments: 1 - raw VRAM offset
- ; 2 - register to write access bitfield in (Optional)
- ; -------------------------------------------------------------
- vram macro
- if (narg=1)
- move.l #($40000000+((\1&$3FFF)<<16)+((\1&$C000)>>14)),($C00004).l
- else
- move.l #($40000000+((\1&$3FFF)<<16)+((\1&$C000)>>14)),\2
- endc
- endm
- ; =============================================================
- ; Macro to set CRAM write access
- ; Arguments: 1 - raw CRAM offset
- ; 2 - register to write access bitfield in (Optional)
- ; -------------------------------------------------------------
- cram macro offset,operand
- if (narg=1)
- move.l #($C0000000+(\1<<16)),VDP_Ctrl
- else
- move.l #($C0000000+(\1<<16)),\operand
- endc
- endm
- ; =============================================================
- ; Macro to direct copy data into VRAM via DMA
- ; Arguments: 1 - Source Offset
- ; 2 - Transfer Length (in bytes)
- ; 3 - Destination
- ; -------------------------------------------------------------
- writeVRAM macro
- lea VDP_Ctrl,a5
- move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
- move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
- move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
- move.w #$4000+(\3&$3FFF),(a5)
- move.w #$80+((\3&$C000)>>14),-(sp)
- move.w (sp)+,(a5)
- endm
- ; =============================================================
- ; Macro to direct copy data into CRAM via DMA
- ; Arguments: 1 - Source Offset
- ; 2 - Transfer Length (in bytes)
- ; 3 - Destination
- ; -------------------------------------------------------------
- writeCRAM macro
- lea VDP_Ctrl,a5
- move.l #$94000000+(((\2>>1)&$FF00)<<8)+$9300+((\2>>1)&$FF),(a5)
- move.l #$96000000+(((\1>>1)&$FF00)<<8)+$9500+((\1>>1)&$FF),(a5)
- move.w #$9700+((((\1>>1)&$FF0000)>>16)&$7F),(a5)
- move.w #$C000+(\3&$3FFF),(a5)
- move.w #$80+((\3&$C000)>>14),-(sp)
- move.w (sp)+,(a5)
- endm
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement