*---------------------------------------------------------------------* * File Name: general.h * * Copyright (c) 1994 Sega of America, Inc. All Rights Reserved. * * Author(s): Unni Pillai * Date: 6-02-94 * Description: * * History: * *---------------------------------------------------------------------* *------------------------------------------------------------------------- * Generic hardware equates, and macros * general.asm *------------------------------------------------------------------------- Z80BusReq equ $A11100 ; bit 8 (high=BusReq) Z80Reset equ $A11200 ; bit 8 (low=Reset) ZRAM equ $00a00000 ; z80's work ram 0000H ~ 3FFFH (16kbytes) Z80NoROM equ ZRAM+4 *----------------------------------- * MACRO TO DISABLE 68000 interrupts *----------------------------------- DI macro or.w #$0700,sr *disable 68000 interrupts endm *---------------------------------- * MACRO TO ENABLE 68000 interrupts *---------------------------------- EI macro and.w #$F8FF,sr *enable all 68000 interrupts endm *---------------------------------- * MACRO TO DISABLE Z80 off the BUS *---------------------------------- Z80di macro move.w #$100,Z80BusReq *Z80 bus request move.w #$100,Z80Reset *Z80 reset line high (NORMAL RUN STATE) btst.b #0,Z80BusReq *Z80 bus grant acknowledge? bne.s *-8 *wait until bus granted endm *--------------------------------------- * MACRO TO ENABLE Z80 onto the BUS *-------------------------------------- Z80ei macro move.w #0,Z80BusReq *Z80 bus release endm *---------------------------------------- * MACRO TO Reset Z80 *---------------------------------------- Z80eiGO macro move.w #0,Z80Reset *Z80 reset line low Z80ei *release bus move.w #$100,Z80Reset *Z80 reset line high (i.e. it has pulsed low) endm *--------------------------------------- * MACRO TO SET VDP REGISTER *--------------------------------------- SetVdpRegister macro move.w #$8000|(\1<<8)|\2,VDPControl endm