From 5608453aea5a72532fe1c9966163e181b7fc545c Mon Sep 17 00:00:00 2001 From: ZeroByteOrg Date: Mon, 8 Aug 2022 16:16:37 -0500 Subject: [PATCH] Fixed YM2151 struct to match HW behavior --- asminc/cx16.inc | 6 +++--- include/cx16.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/asminc/cx16.inc b/asminc/cx16.inc index 268d701d6..1a916ecdb 100644 --- a/asminc/cx16.inc +++ b/asminc/cx16.inc @@ -538,11 +538,11 @@ NMIVec := $0318 ; YM2151 audio chip .struct YM2151 .org $9F40 - .union - STATUS .byte ADDR .byte - .endunion + .union DATA .byte + STATUS .byte + .endunion .endstruct ; X16 Emulator device diff --git a/include/cx16.h b/include/cx16.h index 42495c862..66f21843e 100644 --- a/include/cx16.h +++ b/include/cx16.h @@ -285,11 +285,11 @@ struct __vera { /* Audio chip */ struct __ym2151 { + unsigned char reg; /* Register number for data */ union { - unsigned char reg; /* Register number for data */ + unsigned char data; unsigned char status; /* Busy flag */ }; - unsigned char data; }; #define YM2151 (*(volatile struct __ym2151 *)0x9F40)