The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RANDOMIZE USR issue
#1
I'm trying to compile a short menu program including a RANDOMIZE USR command which calls an external assembly routine (tested).

Using both the latest ZXB v.1.7.2 and the previous v.1.6.12, the compiled program freezes. Recompiling it without the RANDOMIZE USR command, all goes ok!
Even trying to change the memory addresses, it seems the problem persists between the RANDOMIZE USR instruction and something inside the code...

Code:
DIM y,a,i AS UBYTE y=10: a=0: i=1 10 BORDER 0: PAPER 0: INK 0: CLS: POKE 32005,0 RANDOMIZE USR (address of the external tested routine) 20 PRINT AT y,11; BRIGHT 1; OVER 1; INK i;" " IF a < 10 THEN a=a+1 ELSE a=0 END IF IF a=10 THEN IF i < 7 THEN i=i+1 ELSE i=1 END IF: END IF IF (INKEY="1" AND y <> 10) THEN GOSUB 70: y=10: POKE 32005,0: END IF IF (INKEY="2" AND y <> 11) THEN GOSUB 70: y=11: POKE 32005,1: END IF IF INKEY="3" THEN BEEP .04,50: RANDOMIZE USR (game start address): GO TO 10: END IF GO TO 20 70 PRINT AT y,11; BRIGHT 0; OVER 1; INK 7;" ": BEEP .04,50: RETURN

Thoughts?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)