I've added several commands that send values from EhBasic to my graphics routines, and can thus draw lines and change colors, etc.
However, I'm having trouble figuring out how to send values back the other way. I just get a syntax error.
Can someone give some example code to do such a thing? I'd like to do the same with two or three parameters as well.
I have two commands, VEEK and VOKE. Much like PEEK and POKE, but it does the same with my TMS9918a VRAM. VOKE works just fine.
I'd like to do something like:
Code:
10 A = VEEK(2035)
or
Code:
20 IF PIXEL(230,61) = 1 THEN A$="You hit a wall"
What am I missing?
Here's EhBasic's code:
Code:
BAS_PEEK
JSR BAS_F2FX ; save integer part of FAC1 in temporary integer
LDX #$00 ; clear index
LDA (Itempl,X) ; get byte via temporary integer (addr)
TAY ; copy byte to Y
JMP BAS_1FD0 ; convert Y to byte in FAC1 AND return
Here's my code: I don't touch X at all.
Code:
basVEEK: ; get a byte from an address in the TMS VRAM
JSR BAS_F2FX ; save integer part of FAC1 in temporary integer
LDA Itempl ; get byte via temporary integer (addr)
STA TMS_TMP_ADDRESS
LDA Itemph
STA TMS_TMP_ADDRESS +1
JSR tmsVRAMAddrSetRead
NOP
NOP
NOP
NOP
NOP
LDY TMS_VRAM
CLI
JMP BAS_1FD0 ; convert Y to byte in FAC1 AND return
Robb