The testcase is this:
Code: Select all
#include <arch/zx.h>
int main(void)
{
uint16_t x;
uint8_t y;
for( y=0; y<192; y++ )
{
for( x=0; x<256; x++ )
{
uint8_t *test = zx_pxy2saddr( x, y );
*test = 255;
}
}
return 0;
}
zcc +zx -vn -clib=sdcc_iy -startup=4 main.c -o vectors -create-app --c-code-in-asm --std-c99 --list -m -s
On a hunch, I went to the header file and changed:
Code: Select all
extern unsigned char *zx_pxy2saddr(unsigned char x,unsigned char y) __preserves_regs(b,c,d,e,iyl,iyh);
extern unsigned char *zx_pxy2saddr_callee(unsigned char x,unsigned char y) __preserves_regs(b,c,d,e,iyl,iyh) __z88dk_callee;
#define zx_pxy2saddr(a,b) zx_pxy2saddr_callee(a,b)
Code: Select all
extern unsigned char *zx_pxy2saddr(unsigned char x,unsigned char y);
extern unsigned char *zx_pxy2saddr_callee(unsigned char x,unsigned char y) __z88dk_callee;
#define zx_pxy2saddr(a,b) zx_pxy2saddr_callee(a,b)
I've built z88dk with
Code: Select all
export BUILD_SDCC=1
Code: Select all
export BUILD_SDCC_HTTP=1
I'm out of my depth! Can someone else take a look?