I put a new function in basic
drawchar
Цитата:
void Basic_drawchar(SHORTINT gfx,SHORTINT x,SHORTINT y)
{
__asm
#ifdef __SDCC
PUSH IX
LD IX,#0
ADD IX,SP
#endif
LD D,4(IX)
LD B,5(IX)
LD C,6(IX)
LD HL,#16384
LD A,B
ADD A,L
LD L,A
LD A,C
CP #8
JP NC,secondthird$
RRC A
RRC A
RRC A
OR L
LD L,A
JP drawing$
secondthird$:
CP #16
JP NC,thirdthird$
LD A,#8
ADD A,H
LD H,A
LD A,C
SUB #8
RRC A
RRC A
RRC A
OR L
LD L,A
JP drawing$
thirdthird$:
LD A,#16
ADD A,H
LD H,A
LD A,C
SUB #16
RRC A
RRC A
RRC A
OR L
LD L,A
drawing$:
LD A,D
CP #1
JP NZ,dontdraw$
LD A,#255
LD (HL),A
INC H
LD (HL),#129
INC H
LD (HL),#129
INC H
LD (HL),#129
INC H
LD (HL),#129
INC H
LD (HL),#129
INC H
LD (HL),#129
INC H
LD (HL),#255
dontdraw$:
LD A,4(IX)
CP #2
JP NZ,dontdraw2$
dontdraw2$:
#ifdef __SDCC
POP IX
#endif
__endasm;
}
check out the attachment to see it in action
Im putting the bytes of the graphic inside the drawing function but I want to make function accept a pointer to some graphics, how would I do that?
Could I put some numbers(bytes) into an oberon array and pass the pointer to the array to asm?
Also it seems that SHORTINT is signed -127 to 128
I need an unsigned byte but SHORTCARD isn't accepted by ofront