1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2025-02-19 07:30:55 +00:00

zx: fixes for msxbios

This commit is contained in:
Steven Hugg 2021-08-09 11:35:19 -05:00
parent ee64907fb5
commit b774557422
2 changed files with 12 additions and 11 deletions

View File

@ -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_A() __asm__("ld a,l");
#define MSXUSR_LOAD_E() __asm__("ld e,h"); #define MSXUSR_LOAD_E() __asm__("ld e,h");
#define MSXUSR_RTN_HL()
#define MSXUSR_RTN_A() __asm__("ld l,a"); #define MSXUSR_RTN_A() __asm__("ld l,a");
#define MSXUSR_RTN_Z()\ #define MSXUSR_RTN_Z()\
__asm__("ld l,#0");\ __asm__("ld l,#0");\
@ -143,34 +144,34 @@ void INIMLT() __z88dk_fastcall {
uint16_t CALPAT() __z88dk_fastcall { uint16_t CALPAT() __z88dk_fastcall {
MSXUSR(0x0084); MSXUSR(0x0084);
MSXUSR_RTN_A(); MSXUSR_RTN_HL();
} }
uint16_t CALATR() __z88dk_fastcall { uint16_t CALATR() __z88dk_fastcall {
MSXUSR(0x0087); MSXUSR(0x0087);
MSXUSR_RTN_A(); MSXUSR_RTN_HL();
} }
uint16_t GSPSIZ() __z88dk_fastcall { uint8_t GSPSIZ() __z88dk_fastcall {
MSXUSR(0x008a); MSXUSR(0x008a);
MSXUSR_RTN_A(); MSXUSR_RTN_A();
} }
uint16_t GRPPRT(char ch) __z88dk_fastcall { void GRPPRT(char ch) __z88dk_fastcall {
ch; ch;
MSXUSR_LOAD_A(); MSXUSR_LOAD_A();
MSXUSR(0x008d); MSXUSR(0x008d);
} }
uint16_t GICINI() __z88dk_fastcall { void GICINI() __z88dk_fastcall {
MSXUSR(0x0090); MSXUSR(0x0090);
} }
uint16_t WRTPSG(uint16_t reg_data) __z88dk_fastcall { void WRTPSG(uint16_t reg_data) __z88dk_fastcall {
reg_data; reg_data;
MSXUSR_LOAD_A(); MSXUSR_LOAD_A();
MSXUSR_LOAD_E(); MSXUSR_LOAD_E();
MSXUSR(0x0096); MSXUSR(0x0093);
} }
uint8_t CHSNS() __z88dk_fastcall { uint8_t CHSNS() __z88dk_fastcall {

View File

@ -122,13 +122,13 @@ uint16_t CALPAT() __z88dk_fastcall;
// Returns the address of the sprite attribute table // Returns the address of the sprite attribute table
uint16_t CALATR() __z88dk_fastcall; uint16_t CALATR() __z88dk_fastcall;
// Returns current sprite size // Returns current sprite size
uint16_t GSPSIZ() __z88dk_fastcall; uint8_t GSPSIZ() __z88dk_fastcall;
// Displays a character on the graphic screen // 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 // Initialises PSG and sets initial value for the PLAY statement
uint16_t GICINI() __z88dk_fastcall; void GICINI() __z88dk_fastcall;
// Writes data to PSG-register // 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 // Tests the status of the keyboard buffer
uint8_t CHSNS() __z88dk_fastcall; uint8_t CHSNS() __z88dk_fastcall;
// One character input (waiting) // One character input (waiting)