Jump to content

Photo

Using PEEKV and POKEV to covert MiniMem game Light Race to T.I. XB

W.I.P. Help needed

11 replies to this topic

#1 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • 137 posts
  • RUN "CS1"

Posted Sat Jul 14, 2018 6:34 AM

I have this minimem program, and apart from the use of POKEV and POKEV, it looks like plain basic.

I think i can insert the BXB routine to get the characters it needs in XB, but PEEKV and POKEV would still be missing.

Which brings me to this question:
Is there a sub routine i can insert in XB to take the place of PEEKV and POKEV?

Spoiler

Attached File  LITERACE_M.zip   2.67KB   6 downloads


Edited by jrhodes, Fri Jul 20, 2018 7:24 AM.


#2 ti99iuc OFFLINE  

ti99iuc

    Stargunner

  • 1,483 posts
  • Location:Italy

Posted Sat Jul 14, 2018 6:48 AM

oh yes, i like it too, a nice funny game.

 

i also just catalogued e bug fixed version (compared to the one present in the GameBase v2.1)

 

here is it:


Edited by ti99iuc, Sat Jul 14, 2018 6:49 AM.


#3 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 137 posts
  • RUN "CS1"

Posted Sat Jul 14, 2018 7:37 AM

Thanks for the updated version.

But i still wonder about the original question:

Is there a sub routine i can use from XB in place of PEEKV and POKEV?



#4 TheBF OFFLINE  

TheBF

    Dragonstomper

  • 650 posts
  • Location:The Great White North

Posted Sat Jul 14, 2018 7:58 AM

I have not run the game to check my assumptions, but it looks like they are using POKEV and PEEKV for faster access to the screen by reading and writing directly to the video screen VDP RAM.

 

To emulate POKEV in BASIC you can use HCHAR in a FOR/NEXT loop to write characters but it will be slower.

But where it is writing the same character repeated into screen position, HCHAR or VCHAR will work very well.

For PEEKV you would have to use GCHAR to read the screen which is also slower.

 

I don't use MINI-MEMORY but it appears the the screen memory is the same as the E/A cartridge switched to Graphics mode.

It starts at VDP address 0 and ends at VDP address 768.

 

Disclaimer: These are assumptions at this point in  time. 



#5 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 137 posts
  • RUN "CS1"

Posted Thu Jul 19, 2018 4:19 PM

I just discovered this, have not had a chance yet to play with it.

Implementation of PEEKV and POKEV in XB: (found here: http://ftp.whtech.co...ion/U_1/UP1.ZIP)

100 REM  ******************
110 REM  * EXTENDED BASIC *
120 REM  * POKEV AND PEEKV*
130 REM  * BY BILL PROTHRO*
140 REM  ******************
150 REM  This program allows you to poke values into vdp ram and peek values from the vdp ram within a running program in extended basic.
160 REM  To poke successive bytes you will have to use data statements and a for next loop.
170 REM  To peek successive bytes a for next loop is all that is needed.
180 REM  32K memory expansion is required to use this utility.
190 CALL INIT
200 CALL CLEAR
210 REM  These load statements load a machine code program into the memory expansion that can be accessed with extended basic.
220 CALL LOAD(16368,80,79,75,69,86,32,48,52,80,69,69,75,86,32,48,32)
230 CALL LOAD(12320,2,224,48,0,192,32,255,254,6,160,48,88,216,32,136,0,255,253,16,11,2,224,48,0,192,32)
240 CALL LOAD(12346,255,254,2,32,64,0,6,160,48,88,216,32,255,253,140,0,4,192,216,0,131,124)
250 CALL LOAD(12368,2,224,131,224,4,96,0,112,6,192,216,0,140,2,6,192,216,0,140,2,4,91)
260 CALL LOAD(8196,63,240)
270 REM  In a free running program equate pokeadd to the address you want to poke in VDP ram.
280 INPUT "WHICH ADDRESS? ":POKEADD
290 REM  Equate pokeval to the value you want to poke.
300 INPUT "VALUE TO POKE ":POKEVAL
310 GOSUB 390
320 REM  Equate peekadd to the address you want to peek.
330 INPUT "ADDRESS TO PEEK? ":PEEKADD
340 GOSUB 400
350 REM  The value you peek is returned in peekval.
360 PRINT PEEKVAL
370 STOP
380 REM  These subroutines divide the address into msb and lsb values and link to the machine code program.
390 ADD=POKEADD/256 :: MSB=INT(ADD) :: LSB=(ADD-MSB)*256 :: CALL LOAD(-3,POKEVAL,MSB,LSB) :: CALL LINK("POKEV") :: RETURN
400 ADD=PEEKADD/256 :: MSB=INT(ADD) :: LSB=((ADD-MSB)*256) :: CALL LOAD(-2,MSB,LSB) :: CALL LINK("PEEKV") :: CALL PEEK(-3,PEEKVAL)
410 RETURN



#6 RXB OFFLINE  

RXB

    River Patroller

  • 3,254 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jul 19, 2018 6:02 PM

Many alternate XB carts like RXB, XB 2.7 and Superbasic have built in VPOKE or VPEEK



#7 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 137 posts
  • RUN "CS1"

Posted Thu Jul 19, 2018 6:28 PM

Indeed, that is why i intend on getting a physical RXB cartridge some day.

Until  then i will keep goodies like this handy for playing around with.


Edited by jrhodes, Thu Jul 19, 2018 6:46 PM.


#8 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,229 posts
  • Location:Eagan, MN, USA

Posted Fri Jul 20, 2018 6:06 AM

oh yes, i like it too, a nice funny game.

 

i also just catalogued e bug fixed version (compared to the one present in the GameBase v2.1)

 

here is it:

 

I can't get it to run with the MM module option 1(LOAD AND RUN). How do you run it?



#9 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 137 posts
  • RUN "CS1"

Posted Fri Jul 20, 2018 6:27 AM

OK, here is what i have so far.
This is a modified version of Lightrace that uses the above PEEKV and POKEV routines, but is right now still incomplete and not working yet.
I need to somehow modify a version of BXB/VDPUtil so that both it and the above PEEKV and POKEV routines can be used in the same program.
I attempted to change the name of the assembly routine from POKEV to VPOKE by changing

32716 CALL LOAD(16360,80,79,75,69,82,32,38,12,80,79,75,69,86,32,37,164,80,69,69,75,86,32,37,36)

to

32716 CALL LOAD(16360,80,79,75,69,82,32,38,12,86,80,79,75,69,32,37,164,80,69,69,75,86,32,37,36)

I think if i can get BXB or something that works like it put in its place to redefine the higher character sets, it might work.

Spoiler

Edited by jrhodes, Fri Jul 20, 2018 10:27 PM.

  • RXB likes this

#10 jrhodes OFFLINE  

jrhodes

    Chopper Commander

  • Topic Starter
  • 137 posts
  • RUN "CS1"

Posted Fri Jul 20, 2018 8:04 AM

I don't get it. I keep getting

 

SUBPROGRAM NOT FOUND

IN 32740

IN CHAR

CALLED FROM 1520

I know this VDPUTIL2 is used by other programs, and works fine. All i did was swap out the name POKEV for VPOKE so the other routine could use POKEV as a name.

 

Can anyone please help me get this working?

 

As proof that changing the name from POKEV to VPOKE should not be a error on my part, here is galactic war, which used BXB, using my new VPOKE name.

I can also confirm that the POKEV and PEEKV routines listed in this thread earlier work, as it includes a demo program which works as expected.

Nothing was changed in the POKEV or PEEKV routines, only in BXB/VDPUTIL.

Attached File  GW-VPOKE.zip   2.99KB   3 downloads


Edited by jrhodes, Fri Jul 20, 2018 9:28 AM.


#11 ti99iuc OFFLINE  

ti99iuc

    Stargunner

  • 1,483 posts
  • Location:Italy

Posted Fri Jul 20, 2018 10:30 AM

 

I can't get it to run with the MM module option 1(LOAD AND RUN). How do you run it?

 

yes, you can load it in TI-BASIC with MM inserted.



#12 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 3,229 posts
  • Location:Eagan, MN, USA

Posted Sun Jul 22, 2018 7:35 AM

Fun little game, but there is a bug... Apparently it fails to check for an open path to the exit, and therefore one can end up with a situation where an obstacle blocks the exit and there is no way to continue. Path checking is actually pretty complex, so I can imagine why this was not implemented. 

 

Attached File  Light Race.jpg   218.06KB   2 downloads







Also tagged with one or more of these keywords: W.I.P., Help needed

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users