First Spear Posted May 8, 2019 Share Posted May 8, 2019 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! Quote Link to comment Share on other sites More sharing options...
mr_me Posted May 8, 2019 Share Posted May 8, 2019 The last 43 locations of grom is exec program/data. As graphics it should look like junk. What does gram look like before you write anything to it? Quote Link to comment Share on other sites More sharing options...
intvnut Posted May 8, 2019 Share Posted May 8, 2019 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). 1 Quote Link to comment Share on other sites More sharing options...
carlsson Posted May 8, 2019 Share Posted May 8, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
intvnut Posted May 8, 2019 Share Posted May 8, 2019 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. 2 Quote Link to comment Share on other sites More sharing options...
+Lathe26 Posted May 9, 2019 Share Posted May 9, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
First Spear Posted May 10, 2019 Author Share Posted May 10, 2019 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. Quote Link to comment Share on other sites More sharing options...
+nanochess Posted May 10, 2019 Share Posted May 10, 2019 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 Quote Link to comment Share on other sites More sharing options...
First Spear Posted May 10, 2019 Author Share Posted May 10, 2019 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. #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 Quote Link to comment Share on other sites More sharing options...
+nanochess Posted May 11, 2019 Share Posted May 11, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
intvnut Posted May 12, 2019 Share Posted May 12, 2019 The --rand-mem flag on jzintv will randomize memory at startup. FWIW, I recommend folks test their games with this flag if they intend to put them on cartridges. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.