I tried to implement Steven McDonald zx81 Pseudo Hires routines (http://www.pictureviewerpro.com/hosting ... ighres.txt, my assembly knowledge is very basic and maybe I have mistakes somewhere ?
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <input.h>
#include <zx81.h>
int hr_d_file @26431; // 0x673f
void SetPseudoHiRes(void)
{
#asm
hires: halt
ld a,(04034h)
ld c,a
sync1: ld a,(04034h)
cp c
jr z, sync1
ld a,c
ld i,a
ld ix,hresgen
ret
hresgen: ld hl,0e71eh
ld de,0021
di
ld c,0feh
ld b,16
sync3: djnz sync3
ld b,0c0h
genline: in a,(c)
out (0ffh),a
add hl,de
call ulaout
dec b
jp nz, genline
call 0292
call 0220
ld ix,hresgen
jp 02a4h
ulaout: jp (hl)
#endasm
}
void SetLoRes(void)
{
#asm
lores: halt
ld a,(04034h)
ld c,a
sync2: ld a,(04034h)
cp c
jr z, sync2
ld a,01eh
ld i,a
ld ix,0281
ret
#endasm
}
main()
{
int i,j;
char *Ptr = (char *) hr_d_file;
SetPseudoHiRes(); // a bizarre image pattern is displayed, I guess it's in hires
for(i=0; i <= 31;++i)
for(j=0; j <= 191;++j)
*(Ptr + i + j*33) = 0; // nothing happens on the display
in_WaitForKey();
SetLoRes();
}
https://drive.google.com/open?id=1iIxh_ ... exlhCP6790
The new pseudo hires d_file should be located at 0x673f but nothing happens when I write into the hires display file.
Thank you !