Add beep for apple2

This commit is contained in:
Colin Leroy-Mira 2024-01-18 13:55:18 +01:00 committed by Oliver Schmidt
parent 6c7106c9d9
commit 2ba176372e
6 changed files with 49 additions and 1 deletions

View File

@ -330,6 +330,7 @@ usage.
<item>_dos_type
<item>_filetype
<item>_datetime
<item>beep
<item>get_ostype
<item>gmtime_dt
<item>mktime_dt

View File

@ -331,6 +331,7 @@ usage.
<item>_dos_type
<item>_filetype
<item>_datetime
<item>beep
<item>get_ostype
<item>gmtime_dt
<item>mktime_dt

View File

@ -95,6 +95,7 @@ function.
<itemize>
<item>_dos_type
<item><ref id="beep" name="beep">
<item><ref id="get_ostype" name="get_ostype">
<item><ref id="gmtime_dt" name="gmtime_dt">
<item><ref id="mktime_dt" name="mktime_dt">
@ -106,6 +107,7 @@ function.
<itemize>
<item>_dos_type
<item><ref id="beep" name="beep">
<item><ref id="get_ostype" name="get_ostype">
<item><ref id="gmtime_dt" name="gmtime_dt">
<item><ref id="mktime_dt" name="mktime_dt">
@ -1771,10 +1773,11 @@ used in presence of a prototype.
<descrip>
<tag/Function/Beep sound.
<tag/Header/<tt/<ref id="sym1.h" name="sym1.h">/
<tag/Header/<tt/<ref id="apple2.h" name="apple2.h">/
<tag/Declaration/<tt/void beep(void);/
<tag/Description/<tt/beep/ makes a brief tone.
<tag/Notes/<itemize>
<item>The function is specific to the Sym-1.
<item>The function is specific to the Sym-1 and Apple2 platforms.
</itemize>
<tag/Availability/cc65
<tag/See also/

View File

@ -197,6 +197,9 @@ extern void a2_lo_tgi[];
void beep (void);
/* Beep beep. */
unsigned char get_ostype (void);
/* Get the machine type. Returns one of the APPLE_xxx codes. */

20
libsrc/apple2/beep.s Normal file
View File

@ -0,0 +1,20 @@
;
; Colin Leroy-Mira, 2024
;
; void beep(void)
;
.export _beep
.import BELL
.include "apple2.inc"
.segment "LOWCODE"
_beep:
lda CH ; Bell scrambles CH in 80col mode on IIgs, storing
pha ; it in OURCH and resetting CH to 0. Save it.
jsr BELL
pla
sta CH ; Restore CH
rts

20
libsrc/apple2/bell.s Normal file
View File

@ -0,0 +1,20 @@
;
; Colin Leroy-Mira, 2024
;
; BELL routine
;
.export BELL
.include "apple2.inc"
.segment "LOWCODE"
BELL:
; Switch in ROM and call BELL
bit $C082
jsr $FF3A ; BELL
; Switch in LC bank 2 for R/O and return
bit $C080
rts