Skip to content

Commit

Permalink
(bic) Untested AY code
Browse files Browse the repository at this point in the history
  • Loading branch information
suborb committed Apr 11, 2023
1 parent 9e05e51 commit 4a72000
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/features/features.csv
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cpm,,__CPM__,__PX8__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,1,0,
,,__CPM__,__SMC777__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,Doesn't seem to have a disk format - ignoring,__CPM__,__PASOPIA__,z80,,1,1,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,,__CPM__,__MSX__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,-1,-1,128,1,1,1,1,1
,A5105,__CPM__,__BIC__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,A5105,__CPM__,__BIC__,z80,,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,,__CPM__,__EXCALI64__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,Camputers Lynx,__CPM__,__LYNX__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
,,__CPM__,__SHARPX1__,z80,,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,-1,-1,0,0,0,0,0,0
Expand Down
6 changes: 3 additions & 3 deletions include/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@
#define __HAVE_GETK 1
// #define __HAVE_INKEY 0
// #define __HAVE_ONEBITSOUND 0
// #define __HAVE_PSG_AY 0
// #define __HAVE_PSG_AY_WYZ 0
// #define __HAVE_PSG_AY_VT2 0
#define __HAVE_PSG_AY 1
#define __HAVE_PSG_AY_WYZ 1
#define __HAVE_PSG_AY_VT2 1
// #define __HAVE_PSG_AY_ARKOS 0
// #define __HAVE_PSG_SN76489 0
// #define __HAVE_PSG_SAA1099 0
Expand Down
1 change: 1 addition & 0 deletions libsrc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ bic.lib:
@echo '--- Building A5105 Library ---'
@echo ''
$(MAKE) -C video/upd7220 TARGET=bic
$(MAKE) -C psg TARGET=cpm SUBTYPE=bic
TARGET=bic TYPE=z80 $(LIBLINKER) -DSTANDARDESCAPECHARS -DFORbic -x$(OUTPUT_DIRECTORY)/bic @$(TARGET_DIRECTORY)/bic/bic.lst

# QX10 library
Expand Down
6 changes: 6 additions & 0 deletions libsrc/target/bic/bic.def
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
9 changes: 9 additions & 0 deletions libsrc/target/bic/bic.lst
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
45 changes: 45 additions & 0 deletions libsrc/target/bic/psg/asm_vt2_hardware_out.asm
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

53 changes: 53 additions & 0 deletions libsrc/target/bic/psg/asm_wyz_hardware_out.asm
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

17 changes: 17 additions & 0 deletions libsrc/target/bic/psg/get_psg.asm
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 !
8 changes: 8 additions & 0 deletions libsrc/target/bic/psg/psg_init.asm
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
31 changes: 31 additions & 0 deletions libsrc/target/bic/psg/set_psg.asm
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
36 changes: 36 additions & 0 deletions libsrc/target/bic/psg/set_psg_callee.asm
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

0 comments on commit 4a72000

Please sign in to comment.