Skip to content

Commit

Permalink
Improve TMS Reset & SN76489 Early Init
Browse files Browse the repository at this point in the history
- The TMS reset function was missing a call to re-initialize the CRT registers.  This has been added.
- The SN76489 powers up in a dreadful state where it is emitting loud noise until initialized.  Added a PREINIT entry point to initialize the registers earlier.  Still not great, but a lot better.
  • Loading branch information
wwarthen committed Apr 1, 2024
1 parent 874cc45 commit d50593a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Source/HBIOS/hbios.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1967,19 +1967,19 @@ HB_CPU1:
LD (RTC_DISPACT),A ; RTC DEVICE
LD (DSKY_DISPACT),A ; DSKY DEVICE
;
#IF (SN76489ENABLE)
CALL SN76489_PREINIT
#ENDIF
#IF (DSRTCENABLE)
CALL DSRTC_PREINIT
#ENDIF
;
#IF (DSKYENABLE)
#IF (ICMENABLE)
CALL ICM_PREINIT
#ENDIF
;
#IF (PKDENABLE)
CALL PKD_PREINIT
#ENDIF
;
#IF (H8PENABLE)
CALL H8P_PREINIT
#ENDIF
Expand Down
6 changes: 6 additions & 0 deletions Source/HBIOS/sn76489.asm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ CHANNEL_3_SILENT .EQU $FF
;
#INCLUDE "audio.inc"
;
; BLINDLY RESET THE PSG AS SOON AS WE CAN AFTER BOOT BECAUSE IT
; DOES NOT RESET ITSELF AT POWER ON AND MAKES UGLY NOISE.
;
SN76489_PREINIT:
JR SN7_RESET
;
SN76489_INIT:
LD IY, SN7_IDAT ; POINTER TO INSTANCE DATA
LD BC, SN7_FNTBL ; BC := FUNCTION TABLE ADDRESS
Expand Down
7 changes: 6 additions & 1 deletion Source/HBIOS/tms.asm
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ TMS_VDARES:
#IF (CPUFAM == CPU_Z180)
CALL TMS_Z180IO
#ENDIF
TMS_VDARES1: ; ENTRY POINT TO AVOID TMS_Z180IO RECURSION
CALL TMS_CRTINIT
;
; ENTRY POINT USED BY TMS_INIT TO AVOID DUPLICATE CALL TO TMS_CRTINIT
; AND TMS_Z180IO.
;
TMS_VDARES1:
LD DE,0 ; ROW = 0, COL = 0
CALL TMS_XY ; SEND CURSOR TO TOP LEFT
LD A,' ' ; BLANK THE SCREEN
Expand Down
2 changes: 1 addition & 1 deletion Source/ver.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#DEFINE RMN 5
#DEFINE RUP 0
#DEFINE RTP 0
#DEFINE BIOSVER "3.5.0-dev.20"
#DEFINE BIOSVER "3.5.0-dev.21"
#define rmj RMJ
#define rmn RMN
#define rup RUP
Expand Down
2 changes: 1 addition & 1 deletion Source/ver.lib
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ rmn equ 5
rup equ 0
rtp equ 0
biosver macro
db "3.5.0-dev.20"
db "3.5.0-dev.21"
endm

1 comment on commit d50593a

@wrljet
Copy link

@wrljet wrljet commented on d50593a Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"100" years ago my college roommate had a summer intern job at Texas Instruments.
He came back with a "suitcase full" of various ICs.

Among those were the 76489 sound generators.
They were early prototypes, and defective.
The attenuator was not monotonically increasing with the bit values.

We added one to our hand wired 8080A, and had to adjust the sound levels with a lookup table to fix the bug in the chip.

Add to that he managed to wire up the pins backwards on the socket, so we wound up bending the leads on the IC package folded back on itself.

Good times!

Remembering those days is why I'm interested now in this whole effort!

Bill

Please sign in to comment.