forked from OldSkoolCode/Sega-Nuclear-Rush
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMACROS.INC
executable file
·41 lines (32 loc) · 1.06 KB
/
MACROS.INC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
**************************************************************************
** MACROS *
**************************************************************************
testheld macro
tst.b KeyTab1+\1*2 ;see if a joystick button is current pressed
endm
testhit macro
bclr.b #0,KeyTab1+\1*2+1 ;see if a joystick button has been pressed (since last time)
endm
clearhit macro
sf KeyTab1+\1*2+1 ;flag joystick button has not been pressed
endm
DI macro
or.w #$0700,sr ;disable 68000 interrupts
endm
EI macro
and.w #$F8FF,sr ;enable all 68000 interrupts
endm
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
Z80ei macro
move.w #0,Z80BusReq ;Z80 bus release
endm
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