Jump to content
IGNORED

IntyBASIC Blast Junk to Screen?


Recommended Posts

Is there a way to write random contents of ROM or RAM to the screen, so it shows "random junk"? I want to make the display look as it does when frying Star Strike (push reset and turn the game off and on at the same time rapidly and it shows a mess).

 

Thanks!

Link to comment
Share on other sites

If you just want random characters in BACKTAB, you could copy a portion of the EXEC to BACKTAB with a for loop.

 

e.g.

.

FOR I = $200 to $2EF
  POKE I, PEEK($1000 + I)
NEXT I

.

Try different starting locations than $1000. This particular loop actually copies $1200 - $12EF to BACKTAB ($200 - $2EF).

  • Like 1
Link to comment
Share on other sites

I believe it should be #I because that is a variable holding a value larger than 255. Otherwise it works fine.

 

I tried to make a hack of the SCREEN function that also seems to work, except that for dynamic use you need to know on beforehand which variable is which:

 

  #a = $1000
  ASM MVI V1,R3 : REM V1 would be the address to #a and needs to be looked up
  ASM MVII #512,R2
  ASM MVII #20,R1
  ASM MVII #12,R0
  ASM CALL CPYBLK
It probably is not much faster than a FOR loop but introduces a couple levels of complexity. SCREEN as it is takes a label to DATA statements and while I tried to figure out if VARPTR in some way can be used, I failed to find a such solution so I duplicated the ASM output for SCREEN.
  • Like 1
Link to comment
Share on other sites

I believe it should be #I because that is a variable holding a value larger than 255. Otherwise it works fine.

 

Oops. You are correct. I had originally written "0 to 239" and was adding $200 inside the loop. Then I "optimized" it. Clearly I didn't try to run it.

 

 

I tried to make a hack of the SCREEN function that also seems to work, except that for dynamic use you need to know on beforehand which variable is which:

 

  #a = $1000
  ASM MVI V1,R3 : REM V1 would be the address to #a and needs to be looked up
  ASM MVII #512,R2
  ASM MVII #20,R1
  ASM MVII #12,R0
  ASM CALL CPYBLK
It probably is not much faster than a FOR loop but introduces a couple levels of complexity. SCREEN as it is takes a label to DATA statements and while I tried to figure out if VARPTR in some way can be used, I failed to find a such solution so I duplicated the ASM output for SCREEN.

 

 

IntyBASIC 1.4 uses predictable names for user variables, solving your first issue. Also, or could implement this as a CALLable assembly function instead and receive the address in a register. Replace "CALL CPYBLK" with "B CPYBLK."

 

If you really do just want to throw a chunk of EXEC code on the screen, you can do something sleazy like this:

.

ASM __cur: QSET $
ASM  ORG $1000, $1000, "-RWBN"
exec: DATA 0
ASM  ORG __cur

.

Now you have an IntyBASIC label named "exec" that points to the EXEC.

  • Like 2
Link to comment
Share on other sites

Thanks I did play with RAND a bit but there was no randomness, each time the program was run there was always the same junk on the screen, not random. Also adding a single WAIT inside and outside of the loop did not make a difference. Maybe I am misusing RAND?

#offSet =  RAND * 16
FOR #I = $200 to $2EF
  POKE #I, PEEK($1000 + #offSet + #I)
NEXT #I

To add to the randomness, you could also add RAND to $1000 so that the pixels are not the same each time (or maybe add 16*RAND so the ranges overlap less). Alternatively, you could XOR the RAND value with the EXEC data.

Link to comment
Share on other sites

Maybe this could help:

 

	'
	' Generate a trash screen
	'
	' by Oscar Toledo G.
	'
	' Creation date: May/10/2019.
	'

	CLS
	MODE 0,0,0,0,0

	WHILE 1

		WAIT

		#d = RANDOM(256) * 8
		#e = RANDOM(256) * 4 + $1000

		FOR c = 20 TO 119
			#backtab(c) = PEEK(#e + c) + #d
		NEXT c
		
		WAIT
		
		#d = RANDOM(256) * 8
		#e = RANDOM(256) * 4 + $1000

		FOR c = 120 to 219
			#backtab(c) = PEEK(#e + c) + #d
		NEXT c
	
	WEND

Link to comment
Share on other sites

This is odd. On each repeated run of that code, I get the same screen every time. I wonder if my runtime environment is making a RAND issue.

 

post-31694-0-16165800-1557521361_thumb.jpg

#d = RANDOM(256) * 8
#e = RANDOM(256) * 4 + $1000
FOR c = 20 TO 119
	#backtab(c) = PEEK(#e + c) + #d
NEXT c
WAIT
Print at 0 Color 7 , <4>#e
#d = RANDOM(256) * 8
#e = RANDOM(256) * 4 + $1000
FOR c = 120 to 219
	#backtab(c) = PEEK(#e + c) + #d
NEXT c
Print at 20 Color 7 , <4>#e
Print at 40 Color 7 , <4>#d
For #spinWait = 0 to 6610 : Wait : Next #spinWait


Maybe this could help:

	'
	' Generate a trash screen
	'
	' by Oscar Toledo G.
	'
	' Creation date: May/10/2019.
	'

	CLS
	MODE 0,0,0,0,0

	WHILE 1

		WAIT

		#d = RANDOM(256) * 8
		#e = RANDOM(256) * 4 + $1000

		FOR c = 20 TO 119
			#backtab(c) = PEEK(#e + c) + #d
		NEXT c
		
		WAIT
		
		#d = RANDOM(256) * 8
		#e = RANDOM(256) * 4 + $1000

		FOR c = 120 to 219
			#backtab(c) = PEEK(#e + c) + #d
		NEXT c
	
	WEND

 

Link to comment
Share on other sites

So you only need a frame of trash?

 

jzintv makes sure everything is set to zero, so it will show always the same trash.

 

I think it has a randomized memory flag that behaves like a real Intellivision.

 

Over a real Intellivision you would get always a slightly different "trash" screen because the pseudo-random values in RAM.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...