[MSX] Interrupt time Z80 for work with sound effect in assembler MSX

andrea gasparrini andreagasparrini at yahoo.it
Thu Jul 23 17:03:19 CEST 2009


Hello Guys,

I sent you, 2 source programm in assembler for make interrupt time Z80 for
work with sound effect in assembler MSX.
But it unfortunately doesn't work, it is not interrupt time, then is not good
for MSX BASIC!!

Can you help me? Please? Please?  ^_^

I hope than you have free time for make this litte work for me, OK??

You remember, than I job with CHAOS ASSEMBLER for Windows.

See you to soon.....
Andrea Gasparrini from Italy

; [YOUR GROUP] MSX Z80 source file.
;
; Prog: 
; Code: [YOUR HANDLE]
; Date:
;
; cmnt:
;
; Coded in TeddyWareZ' Chaos Assembler 3
;
; (C) 2001 [YOUR GROUP]!



	.org $B000 - 7

	.db $fe
	.dw startProgram,endProgram,startProgram

startProgram:
;*************************************************************
;   List 2.4   How to use HOOK safety
;	       This routine uses TIMER INTERRUPT HOOK
;				   and turn on/off CAPS LOCK
;	       To start, do  DEF USR=&HB000 : A=USR(0)
;	       To end,	 do  DEF USR=&HB030 : A=USR(0)
;*************************************************************
;
CHGCAP .EQU	0132H		;CAPS LAMP on/off
CAPST	 .EQU	0FCABH		;CAPS LOCK status
TIMI	 .EQU	0FD9FH		;timer interrupt hook
JPCODE .EQU	0C3H
TIMER	 .EQU	020H


;----- interrupt on ----- Note:  restore the former hook
				 ;when changing the hook
      
 CALL START  ; load and initialize STAR MUSIC

 .ORG $B020   ; CONTINUE MUSIC

INTON:	
      DI
	LD	HL,TIMI 	;OLD HOOK SAVE
	LD	DE,HKSAVE
	LD	BC,5
	LDIR

	LD	A,JPCODE	;NEW HOOK SET
	LD	(TIMI),A
	LD	HL,INT
	LD	(TIMI+1),HL
	EI
	RET

	.ORG	$B050  ; PAUSE MUSIC

;----- interrupt off ----- Note:  restore the reserved hook and exit

INTOFF:
      DI
	LD	HL,HKSAVE
	LD	DE,TIMI
	LD	BC,5
	LDIR
	EI  
	CALL $90 ; resetta canale audio
	RET

;----- interrupt routine -----

INT:	PUSH	AF
	LD	A,(CAPST)
	OR	A
	JR	Z,CAPON

CAPOFF: 
   ; silence

CAPON:
   ; play 1 quark
   
FIN:
 	POP	AF
	CALL	HKSAVE		;old HOOK call

	RET

COUNT1:           
      .DB TIMER
COUNT2:
      .DB TIMER

HKSAVE: 
      NOP			;old HOOK save area
	NOP
	NOP
	NOP
	RET   

;----- interrupt routine -----

#INCLUDE "bomba2.asm"
endProgram:

.end


start:

 LD A,7
 LD E,254
 CALL 147
 LD A,8
 LD E,15
 CALL 147
 LD E,40
CICLO:
 LD A,0
 CALL 147
 LD A,10
RITARDO:
 PUSH AF
 LD A,255
MENO:
 DEC A
 JP NZ,MENO
 POP AF
 DEC A
 JP NZ,RITARDO
 LD A,E
 SUB 150
 JP Z,NEXT
 ADD A,151
 LD E,A
 JP CICLO
NEXT:
 LD A,0
 LD E,0
 CALL 147
 LD A,7
 LD E,247
 CALL 147
 LD A,0
NEXT1: 
 PUSH AF   
 LD E,A
 CALL 147
 LD A,50
PIPPO:
 PUSH AF
 LD A,255
PLUTO: 
 DEC A
 JP NZ,PLUTO
 POP AF
 DEC A
 JP NZ,PIPPO
 POP AF
 SUB 31
 JP Z,RITA
 ADD A,32
 JP NEXT1
RITA:
 LD A,100
RITA1:
 PUSH AF
 LD A,255
RITA2:
 DEC A
 JP NZ,RITA2
 POP AF
 DEC A
 JP NZ,RITA1
 LD A,7
 LD E,255
 CALL 147
 RET
  
end:




      


More information about the msx mailing list