-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
210 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
|
||
defc PSG_ADDR = $a0 | ||
defc PSG_DATA = $a1 | ||
defc PSG_DATAIN = $a1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
@video/upd7220/video_upd7220.lst | ||
target/bic/psg/set_psg | ||
target/bic/psg/set_psg_callee | ||
target/bic/psg/get_psg | ||
target/bic/psg/psg_init | ||
target/bic/psg/asm_wyz_hardware_out | ||
target/bic/psg/asm_vt2_hardware_out | ||
@psg/ay/psg.lst | ||
@psg/ay/wyz/psg_wyz.lst | ||
@psg/ay/vt2/psg_vt2.lst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
; Vortextracker II player | ||
; | ||
; Hardware output routine for MSX | ||
; | ||
; | ||
|
||
SECTION code_psg | ||
|
||
PUBLIC asm_vt_hardware_out | ||
PUBLIC asm_vt_hardware_out_A0 | ||
|
||
EXTERN asm_VT_AYREGS | ||
|
||
|
||
asm_vt_hardware_out: | ||
XOR A | ||
asm_vt_hardware_out_A0: | ||
LD C,$A0 | ||
LD HL,asm_VT_AYREGS | ||
LOUT: | ||
OUT (C),A | ||
INC C | ||
cp 7 | ||
jr nz,not_r7 | ||
ld d,a | ||
ld a,(hl) | ||
cpl | ||
out (c),a | ||
ld a,d | ||
jr continue | ||
not_r7: | ||
OUTI | ||
continue: | ||
DEC C | ||
INC A | ||
CP 13 | ||
JR NZ,LOUT | ||
OUT (C),A | ||
LD A,(HL) | ||
AND A | ||
RET M | ||
INC C | ||
OUT (C),A | ||
RET | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
; WYZ player | ||
; | ||
; Hardware output routine for MSX | ||
; | ||
; | ||
|
||
SECTION code_psg | ||
|
||
PUBLIC asm_wyz_hardware_out | ||
|
||
EXTERN asm_wyz_PSG_REG | ||
EXTERN asm_wyz_PSG_REG_SEC | ||
EXTERN asm_wyz_ENVOLVENTE_BACK | ||
|
||
|
||
asm_wyz_hardware_out: | ||
LD A,(asm_wyz_PSG_REG+13) | ||
AND A ;ES CERO? | ||
JR Z,NO_BACKUP_ENVOLVENTE | ||
LD (asm_wyz_ENVOLVENTE_BACK),A ;08.13 / GUARDA LA ENVOLVENTE EN EL BACKUP | ||
XOR A | ||
NO_BACKUP_ENVOLVENTE: | ||
LD C,$A0 | ||
LD HL,asm_wyz_PSG_REG_SEC | ||
LOUT: | ||
OUT (C),A | ||
INC C | ||
cp 7 | ||
jr nz,not_r7 | ||
ld d,a | ||
ld a,(hl) | ||
cpl | ||
out (c),a | ||
ld a,d | ||
jr continue | ||
not_r7: | ||
OUTI | ||
continue: | ||
DEC C | ||
INC A | ||
CP 13 | ||
JR NZ,LOUT | ||
OUT (C),A | ||
LD A,(HL) | ||
AND A | ||
RET Z | ||
INC C | ||
OUT (C),A | ||
XOR A | ||
LD (asm_wyz_PSG_REG_SEC+13),A | ||
LD (asm_wyz_PSG_REG+13),A | ||
RET | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
SECTION code_clib | ||
PUBLIC get_psg | ||
PUBLIC _get_psg | ||
|
||
INCLUDE "target/bic/bic.def" | ||
|
||
get_psg: | ||
_get_psg: | ||
ld a,l | ||
|
||
out (PSG_ADDR),a | ||
in a,(PSG_DATAIN) | ||
ld h,0 | ||
ld l,a ; NOTE: A register has to keep the same value | ||
ret ; internal code is using it ! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
SECTION code_clib | ||
PUBLIC psg_init | ||
PUBLIC _psg_init | ||
psg_init: | ||
_psg_init: | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
; | ||
; MSX specific routines | ||
; by Stefano Bodrato, December 2007 | ||
; | ||
; int msx_sound(int reg, int val); | ||
; | ||
; Play a sound by PSG | ||
; | ||
; | ||
; $Id: set_psg.asm,v 1.3 2016-06-10 21:13:58 dom Exp $ | ||
; | ||
|
||
SECTION code_clib | ||
PUBLIC set_psg | ||
PUBLIC _set_psg | ||
|
||
EXTERN asm_set_psg | ||
|
||
set_psg: | ||
_set_psg: | ||
|
||
pop bc | ||
pop de | ||
pop hl | ||
|
||
push hl | ||
push de | ||
push bc | ||
jp asm_set_psg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
SECTION code_clib | ||
PUBLIC set_psg_callee | ||
PUBLIC _set_psg_callee | ||
|
||
PUBLIC asm_set_psg | ||
|
||
INCLUDE "target/bic/bic.def" | ||
|
||
set_psg_callee: | ||
_set_psg_callee: | ||
|
||
pop hl | ||
pop de | ||
ex (sp),hl | ||
.asm_set_psg | ||
|
||
ld a,l | ||
cp 7 | ||
jr nz,not_reg7 | ||
ld a,e | ||
cpl | ||
ld e,a | ||
ld a,l | ||
not_reg7: | ||
di | ||
out (PSG_ADDR),a | ||
push af | ||
ld a,e | ||
out (PSG_DATA),a | ||
ei | ||
pop af | ||
|
||
ret | ||
|