I have managed to run the Z80. sega16 (www.sega-16.com) says EA has done it with LHX and M1 Abrahams. So, here it is.
First of all, you write a program for the Z80, let's say a loop that increment a value 15 times :
Code: Select all
LD A,15 ; ...
LD (402h),A ; int *counter = 0x402;
; *n = 15;
JR Z,18h ; if (zero) goto end
LD A,(400h) ; int *value = 0x400;
INC A ; *value++;
LD (400h),A ;
LD A,(402h) ;
DEC A ; counter--;
LD (402h),A
JP 2h
end:
HALT
Code: Select all
3E0F ; 0000 LD A,15
320204 ; 0002 LD (402h),A
281800 ; 0005 JR Z,18h
3A0004 ; 0008 LD A,(400h)
3C ; 0011 INC A
320004 ; 0012 LD (400h),A
3A0204 ; 0015 LD A,(402h)
3D ; 0018 DEC A
320204 ; 0019 LD (402h),A
C30200 ; 0022 JP 2h
76 ; 0025 HALT
0
Code: Select all
z80:
dc.b $3E,$0F ; 0000 LD A,15
dc.b $32,$02,$04 ; 0002 LD (402h),A
dc.b $28,$18,$00 ; 0005 JR Z,18h
dc.b $3A,$00,$04 ; 0008 LD A,(400h)
dc.b $3C ; 0011 INC A
dc.b $32,$00,$04 ; 0012 LD (400h),A
dc.b $3A,$02,$04 ; 0015 LD A,(402h)
dc.b $3D ; 0018 DEC A
dc.b $32,$02,$04 ; 0019 LD (402h),A
dc.b $C3,$02,$00 ; 0022 JP 2h
dc.b $76 ; 0025 HALT
dc.b $0
Here's how to load the program :
Code: Select all
move.w #$0100,$A11200 ; Stop the RESET Z80 process
move.w #$0100,$A11100 ; Request the Z80 Bus
lea z80,a2 ; Load program. label z80 has been declared above
moveq #25,d0 ; d0 = program length
move.l #$A00000,a3 ; a3 = start of z80 memory
loop_z80:
move.b (a2)+,(a3)+ ; copy program
dbra d0,loop_z80
move.w #$0000,$A11200 ; Start the RESET Z80 process
move.w $A11200,d0 ; d0 wil watch is the Z80 RESET process is over
wait_z80_reset:
cmp #0,d0
move.w $A11200,d0
bne wait_z80_reset
move.w #$0000,$A11100 ; Release the Z80 Bus
move.w #$0100,$A11200 ; Stop the RESET Z80 process
What for ?
3D, typically. You can compute a normal to a polygon, determine wheter it is to be rendered, and what should be the color. Meanwhile, the 68k compute every point of that polygon. Actually, it's almost parallel processing !!! Think Saturn !!!
Hope it helps.