Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <memcopy.bas>
- border 0
- paper 0
- ink 6
- cls
- ASM
- di ; disable intsd
- LD A,(23388) ; load a with previos port value
- AND 248 ; and 11111000
- OR 4 ; OR 1 to 11111001 (page 1)
- LD BC,32765 ; load BC with
- LD (23388),A
- OUT (C),A
- EI
- END ASM
- PRINT PEEK 23388
- ' the playsoutine expects the music to be at 51310, so lets copy the music there
- memcopy(@music, 51310, @musicend-@music)
- ' The play routine expects to be at 49152, so lets copy it there
- memcopy(@ayplay, 49152, 1617)
- ' This is routine that will be called every frame, lets copy it to its correct location
- memcopy(@Ints, $6060, 60)
- 'memcopy(@ayplay, 24672, 1617)
- 'memcopy(@exe, 24064, 1200)
- 'randomize USR 24064
- ' we need to init our play routine, so call it
- randomize usr 49152
- 'print "WAITING": pause 0
- PRINT "DONE2"
- randomize USR @IMStart
- END
- ayplay:
- asm
- incbin "vt49152.bin"
- END asm
- music:
- asm
- incbin "bomb2stg1.mide.pt3"
- END asm
- musicend:
- Ints:
- asm
- di ; disable interrupts
- push af ; save all std regs
- push bc
- push de
- push hl
- push ix ; save ix & iy
- push iy
- ;ex (sp),hl
- ex af, af' ; and shadow af
- push af
- ;exx
- ;push bc
- LD A,(23388) ; load a with previos port value
- AND 248 ; and 11110000
- OR 4 ; OR 1 to 11111001 (page 1)
- LD BC,32765 ; load BC with
- LD (23388),A
- OUT (C),A
- call 49157 ; play the current tune
- LD A,(23388) ; load a with previos port value
- AND 248 ; and 11111000
- OR 0 ; OR 0 to 11111001 (page 1)
- LD BC,32765 ; load BC with
- LD (23388),A
- OUT (C),A
- ;pop bc
- ;exx
- pop af
- ex af, af' ; restore af
- ;ex (sp),hl
- pop iy
- pop ix ; restore ix & iy
- pop hl
- pop de
- pop bc
- pop af ; restore all std regs
- ei ; enable interrupts
- ;ret ; done
- jp 56
- ;rst 56
- END asm
- IMStart:
- asm
- DI
- LD A,(23388) ; load a with previos port value
- AND 248 ; and 11110000
- OR 4 ; OR 1 to 11111001 (page 1)
- LD BC,32765 ; load BC with
- LD (23388),A
- OUT (C),A
- ; this code creates a 256 byte vector table at $FE00, then sets IM2
- ld hl, $5e00
- ld de, $5e01
- ld bc, 256
- ld a, h
- ld i, a
- ld a, $60
- ld (hl), a
- ldir
- im 2
- LD A,(23388) ; load a with previos port value
- AND 248 ; and 11111000
- OR 0 ; OR 1 to 11111001 (page 1)
- LD BC,32765 ; load BC with
- LD (23388),A
- OUT (C),A
- ei
- ret
- END asm
- IMOff:
- ASM
- DI
- IM 1
- EI
- RET
- END ASM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement