Browse Source

Speaker updates

CPU MHz is now rounded at hbios initialization.
pull/247/head
b1ackmai1er 4 years ago
parent
commit
7057bfcf05
  1. 2
      Source/Doc/Architecture.md
  2. 9
      Source/HBIOS/spk.asm

2
Source/Doc/Architecture.md

@ -1476,7 +1476,7 @@ This function applies the previously specified volume and period by
programming the sound chip with the appropriate values. The values
are applied to the specified channel of the chip.
For example, to play a specific note on Audio Device UNit 0,
For example, to play a specific note on Audio Device Unit 0,
the following HBIOS calls would need to be made:
```

9
Source/HBIOS/spk.asm

@ -160,14 +160,7 @@ SP_QUERY_DEV:
;======================================================================
;
SP_SETTBL:
LD HL,(CB_CPUKHZ) ; GET CPU SPEED.
LD DE,1000 ; CONVERT TO MHZ
CALL DIV16
;
LD DE,900 ; IF MHZ IS WITHIN 10% OF
SBC HL,DE ; NEXT INTEGER INCREMENT
JP M,SP_SETTBL3 ; THEN BUMP UP. I.E. 9.928MHZ
INC C ; BECOMES 10MHZ
LD BC,(CB_CPUMHZ) ; GET MHZ CPU SPEED (IN C).
;
SP_SETTBL3:
LD B,SP_NOTCNT ; SET NUMBER OF NOTES TO

Loading…
Cancel
Save