Code: Select all
ts_vmod(IO_TVM_HIRES_WHITE);
Code: Select all
z80_outp(0xFF, IO_TVM_HIRES_WHITE);
Code: Select all
ts_vmod(IO_TVM_HIRES_WHITE);
Code: Select all
z80_outp(0xFF, IO_TVM_HIRES_WHITE);
ts_vmod is intended to take a paper colour in its argument:Stefan123 wrote:I have a problem with ts_vmod() in zxn.h. When I use the following line, I can verify in the ZEsarUX debugger that the 0xFF port is to 0x06 but not 0x3E as you would have expected:
Code: Select all
ts_vmod(IO_TVM_HIRES_WHITE);
Code: Select all
// timex video mode
#define TVM_SPECTRUM __IO_TVM_DFILE_1 // 256x192 pix, 32x24 attr
#define TVM_HICOLOR __IO_TVM_HICOLOR // 256x192 pix, 32x192 attr
#define TVM_HIRES __IO_TVM_HIRES // 512x192 pix or with paper colour
extern void ts_vmod(unsigned char mode) __preserves_regs(b,c,d,e,iyl,iyh);
extern void ts_vmod_fastcall(unsigned char mode) __preserves_regs(b,c,d,e,iyl,iyh) __z88dk_fastcall;
#define ts_vmod(a) ts_vmod_fastcall(a)
Code: Select all
asm_ts_vmod:
; change video mode
;
; enter : l = mode
;
; uses : af, l
ld a,l
xor $38
and $3f
ld l,a
in a,($ff)
and $c0
or l
out ($ff),a
ret
I forgot those were there. Anything with IO in front has to do with io ports:Stefan123 wrote:I thought the IO_TVM_HIRES_BLACK, IO_TVM_HIRES_BLUE, ..., IO_TVM_HIRES_WHITE macros in zxn.h were supposed to be used as arguments to ts_vmod().
Code: Select all
__sfr __at 0xff IO_FF;
__sfr __at __IO_TIMEX_VIDEO_MODE IO_TIMEX_VIDEO_MODE;
Code: Select all
// 0xff, IO_TIMEX_VIDEO_MODE
#define IO_TVM_DISABLE_ULA_INTERRUPT __IO_TVM_DISABLE_ULA_INTERRUPT
#define IO_TVM_DFILE_1 __IO_TVM_DFILE_1
#define IO_TVM_DFILE_2 __IO_TVM_DFILE_2
#define IO_TVM_HICOLOR __IO_TVM_HICOLOR
#define IO_TVM_HIRES __IO_TVM_HIRES
#define IO_TVM_HIRES_BLACK __IO_TVM_HIRES_BLACK
#define IO_TVM_HIRES_BLUE __IO_TVM_HIRES_BLUE
#define IO_TVM_HIRES_RED __IO_TVM_HIRES_RED
#define IO_TVM_HIRES_MAGENTA __IO_TVM_HIRES_MAGENTA
#define IO_TVM_HIRES_GREEN __IO_TVM_HIRES_GREEN
#define IO_TVM_HIRES_CYAN __IO_TVM_HIRES_CYAN
#define IO_TVM_HIRES_YELLOW __IO_TVM_HIRES_YELLOW
#define IO_TVM_HIRES_WHITE __IO_TVM_HIRES_WHITE
Code: Select all
// timex video mode
#define TVM_SPECTRUM __IO_TVM_DFILE_1 // 256x192 pix, 32x24 attr
#define TVM_HICOLOR __IO_TVM_HICOLOR // 256x192 pix, 32x192 attr
#define TVM_HIRES __IO_TVM_HIRES // 512x192 pix or with paper colour
extern void ts_vmod(unsigned char mode) __preserves_regs(b,c,d,e,iyl,iyh);
extern void ts_vmod_fastcall(unsigned char mode) __preserves_regs(b,c,d,e,iyl,iyh) __z88dk_fastcall;
#define ts_vmod(a) ts_vmod_fastcall(a)
Code: Select all
// timex video mode
#define TSVM_SPECTRUM __IO_TVM_DFILE_1 // 256x192 pix, 32x24 attr
#define TSVM_HICOLOR __IO_TVM_HICOLOR // 256x192 pix, 32x192 attr
#define TSVM_HIRES __IO_TVM_HIRES // 512x192 pix or with paper colour
Code: Select all
#define IO_FF_DISABLE_ULA_INTERRUPT __IO_TVM_DISABLE_ULA_INTERRUPT
#define IO_FF_DFILE_1 __IO_TVM_DFILE_1
#define IO_FF_DFILE_2 __IO_TVM_DFILE_2
#define IO_FF_HICOLOR __IO_TVM_HICOLOR
#define IO_FF_HIRES __IO_TVM_HIRES
#define IO_FF_HIRES_BLACK __IO_TVM_HIRES_BLACK
#define IO_FF_HIRES_BLUE __IO_TVM_HIRES_BLUE
#define IO_FF_HIRES_RED __IO_TVM_HIRES_RED
#define IO_FF_HIRES_MAGENTA __IO_TVM_HIRES_MAGENTA
#define IO_FF_HIRES_GREEN __IO_TVM_HIRES_GREEN
#define IO_FF_HIRES_CYAN __IO_TVM_HIRES_CYAN
#define IO_FF_HIRES_YELLOW __IO_TVM_HIRES_YELLOW
#define IO_FF_HIRES_WHITE __IO_TVM_HIRES_WHITE