Hi guys, I was having a very weird bug in a little project I'm working on, and after a while tracing it back, I think it's due to a small issue with the RDPSG implementation in CBIOS. The current implementation looks like this (from: https://sourceforge.net/p/cbios/cbios/ci/master/tree/src/mai... ):
;--------------------------------
; $0096 RDPSG
; Function : Reads value from PSG-register
; Input : A - PSG-register read
; Output : A - value read
rdpsg:
out (PSG_REGS),a
in a,(PSG_STAT)
ret
What was happening to me is that in between the "out" and the "in", an interrupt was triggered (used to play music), which messed up everything (took me forever to find, btw!! hahaha). So, I now need to surround every call to RDPSG in my code by di/ei. If instead of CBIOS, I use some other bios (e.g. Philips VG8020), everything works fine. I noticed that other bios calls, such as WRTPSG do call di/ei inside, and are thus safe. But RDPSG does not... I was just wondering if this was intended or if it is a bug :)

