From b774557422c0aef7f8a92f6fe0e94de23917f404 Mon Sep 17 00:00:00 2001 From: Steven Hugg Date: Mon, 9 Aug 2021 11:35:19 -0500 Subject: [PATCH] zx: fixes for msxbios --- presets/msx/msxbios.c | 15 ++++++++------- presets/msx/msxbios.h | 8 ++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/presets/msx/msxbios.c b/presets/msx/msxbios.c index 5241ce5a..5debea7e 100644 --- a/presets/msx/msxbios.c +++ b/presets/msx/msxbios.c @@ -9,6 +9,7 @@ https://www.msx.org/wiki/System_variables_and_work_area #define MSXUSR_LOAD_A() __asm__("ld a,l"); #define MSXUSR_LOAD_E() __asm__("ld e,h"); +#define MSXUSR_RTN_HL() #define MSXUSR_RTN_A() __asm__("ld l,a"); #define MSXUSR_RTN_Z()\ __asm__("ld l,#0");\ @@ -143,34 +144,34 @@ void INIMLT() __z88dk_fastcall { uint16_t CALPAT() __z88dk_fastcall { MSXUSR(0x0084); - MSXUSR_RTN_A(); + MSXUSR_RTN_HL(); } uint16_t CALATR() __z88dk_fastcall { MSXUSR(0x0087); - MSXUSR_RTN_A(); + MSXUSR_RTN_HL(); } -uint16_t GSPSIZ() __z88dk_fastcall { +uint8_t GSPSIZ() __z88dk_fastcall { MSXUSR(0x008a); MSXUSR_RTN_A(); } -uint16_t GRPPRT(char ch) __z88dk_fastcall { +void GRPPRT(char ch) __z88dk_fastcall { ch; MSXUSR_LOAD_A(); MSXUSR(0x008d); } -uint16_t GICINI() __z88dk_fastcall { +void GICINI() __z88dk_fastcall { MSXUSR(0x0090); } -uint16_t WRTPSG(uint16_t reg_data) __z88dk_fastcall { +void WRTPSG(uint16_t reg_data) __z88dk_fastcall { reg_data; MSXUSR_LOAD_A(); MSXUSR_LOAD_E(); - MSXUSR(0x0096); + MSXUSR(0x0093); } uint8_t CHSNS() __z88dk_fastcall { diff --git a/presets/msx/msxbios.h b/presets/msx/msxbios.h index 464816bc..3e80e589 100644 --- a/presets/msx/msxbios.h +++ b/presets/msx/msxbios.h @@ -122,13 +122,13 @@ uint16_t CALPAT() __z88dk_fastcall; // Returns the address of the sprite attribute table uint16_t CALATR() __z88dk_fastcall; // Returns current sprite size -uint16_t GSPSIZ() __z88dk_fastcall; +uint8_t GSPSIZ() __z88dk_fastcall; // Displays a character on the graphic screen -uint16_t GRPPRT(char ch) __z88dk_fastcall; +void GRPPRT(char ch) __z88dk_fastcall; // Initialises PSG and sets initial value for the PLAY statement -uint16_t GICINI() __z88dk_fastcall; +void GICINI() __z88dk_fastcall; // Writes data to PSG-register -uint16_t WRTPSG(uint16_t reg_data) __z88dk_fastcall; +void WRTPSG(uint16_t reg_data) __z88dk_fastcall; // Tests the status of the keyboard buffer uint8_t CHSNS() __z88dk_fastcall; // One character input (waiting)