Jump to content
IGNORED

8x8 random CALL CHAR junk?


S1500

Recommended Posts

How hard would it be, whether XB or assembly, to have a program make a totally random "CALL CHAR" to a character and cycle through random variants really fast?

 

We've seen this before in tons of games where it just randomly turns off & on pixels to signify static on a TV or an explosion.

 

I'd love to see a TI do that instead of pre-defined 8x8 pixel junk graphics.

Link to comment
Share on other sites

That would be pretty easy to do. =) In assembly you could randomize and use hex. Since BASIC doesn't understand hex as numeric (for the most part) it would be quite a bit slower, but fun anyway. I bet Karsten or Marc Hull has something to show on this... give them just a minute or two. =) Probably by the time I'm done posting this response, the ol' Hullinator will have it whipped up. :lust:

Link to comment
Share on other sites

How hard would it be, whether XB or assembly, to have a program make a totally random "CALL CHAR" to a character and cycle through random variants really fast?

 

We've seen this before in tons of games where it just randomly turns off & on pixels to signify static on a TV or an explosion.

 

I'd love to see a TI do that instead of pre-defined 8x8 pixel junk graphics.

 

TI BASIC and Extended BASIC are slow... neither are particularly good at animation this way, you can see the "wipe" effect as the old pattern overwrites the new one.

 

Very easy in assembly, using a random routine to pad out an 8-byte value. This would create an extremely "chaotic" pattern that wildly changes rapidly.

 

A trickier one is to have the pattern change in an incremental fashion... having it stay more or less the same but only have a few pixels change value at a time.

 

Off the top of my head, the easiest way to do this is to create a random "bit mask" with very sparse changes, and then apply it with an XOR over top the old pattern so that it only gradually changes a few pixels at a time to different bit values.

 

Adamantyr

Link to comment
Share on other sites

Here's a demo cartridge that does just that. It was named "no signal". A followup was named "television".

 

:cool:

 

nosignal.jpg

 

Edit: Oops, the television demo does not work with Classic99. Works fine with Win994a and MESS. I probably have to revisit the source and do a complete VDP register set or something.

Edited by sometimes99er
Link to comment
Share on other sites

I coundn't resist. I need some assembly practice.

 

STATIC.zip

 

      DEF  START
      REF  VSBW,VMBW,VWTR,KSCAN

WS1    BSS  32
RNDPTN BSS  10
SEED   EQU  >83C0
STATUS EQU  >837C
SAVRTN DATA 0
NOISE  BYTE >05,>9F,>BF,>DF,>E4,>F0,254
      BYTE >01,>FF,0

START  MOV  R11,@SAVRTN
      LWPI WS1

* SOUND TABLE -> VDP
      LI   R0,>1800
      LI   R1,NOISE
      LI   R2,10
      BLWP @VMBW

* COLORS
      LI   R0,>0713
      BLWP @VWTR
      LI   R0,>380
      LI   R1,>1F00
L1     BLWP @VSBW
      INC  R0
      CI   R0,>400
      JLT  L1

* SCREEN
      CLR  R5
L8     LI   R0,30
      BL   @RAND
      CLR  R1
      MOV  R0,R1
      AI   R1,65
      SWPB R1
      MOV  R5,R0
      BLWP @VSBW
      INC  R5
      CI   R5,32*24
      JLT  L8

* RANDOM PATTERNS (CHARS 0..29)
      LI   R6,>1000
L5     LI   R5,30
L4     LI   R4,RNDPTN
L3     LI   R0,>100
      BL   @RAND
      SWPB R0
      MOVB R0,*R4+
      CI   R4,RNDPTN+8
      JLT  L3
      MOV  R5,R0
      DEC  R0
      AI   R0,65
      SLA  R0,3
      A    R6,R0
      LI   R1,RNDPTN
      LI   R2,8
      BLWP @VMBW
      DEC  R5
      JNE  L4
      CI   R6,>1000
      JNE  L6
      LI   R6,>800
      LI   R0,>0402
      BLWP @VWTR
      JMP  L2
L6     LI   R6,>1000
      LI   R0,>0401
      BLWP @VWTR

* START SOUND
L2     MOVB @>83CE,@>83CE
      JNE  L7
      LIMI 0
      LI   R0,>1800
      MOV  R0,@>B000
      MOV  R0,@>83CC
      LI   R1,>0100
      SOCB R1,@>83FD
      MOVB R1,@>83CE
      LIMI 2

* KEYBOARD
L7     LIMI 2
      LIMI 0
      BLWP @KSCAN
      MOVB @STATUS,R0
      ANDI R0,>2000
      JEQ  L5

* QUIT
      LI   R0,>0401
      BLWP @VWTR
      MOV  @SAVRTN,R11
      CLR  @STATUS
      RT

RAND   LI   R1,>6EF5
      MPY  @SEED,R1
      AI   R2,>7AB9
      MOV  R2,@SEED
      CLR  R1
      SWPB R2
      DIV  R0,R1
      MOV  R2,R0
      RT

Link to comment
Share on other sites

I coundn't resist. I need some assembly practice.

 

RAND   LI   R1,>6EF5
      MPY  @SEED,R1
      AI   R2,>7AB9
      MOV  R2,@SEED
      CLR  R1
      SWPB R2
      DIV  R0,R1
      MOV  R2,R0
      RT

 

You might want to check out this thread:

 

http://www.atariage.com/forums/topic/163646-not-prime/

 

You can get a much faster, and smaller, random number routine.

Link to comment
Share on other sites

You can get a much faster, and smaller, random number routine.

 

Thank you. :)

 

I've been using the same random number generator fin my assembly programs for about 25 years now, and I got it straight from the Tombstone City code that came with the E/A package.

 

I actually found it the ROM (TI-99/4A Intern Book) in the GPL interpreter. But I made a typing error it is >6FE5, not >6EF5.

 

Also, the code above has the non random feature of producing an odd number, then even, then odd, then even, etc. Not very random.

 

I saw that in my exemple. I first used 4 random words and they were fixed lines on the screen. Then I used 8 random bytes and it worked.

Link to comment
Share on other sites

Little XB effort....

 

100 ! XBSTATIC
110 DIM A$(16) :: RANDOMIZE
120 FOR I=1 TO 16 :: READ A$(I) :: NEXT I :: FOR I=1 TO 9 :: FOR D=1 TO 16 :: B$(I)=B$(I)&A$(RND*15+1) :: NEXT D :: NEXT I
130 CALL CLEAR :: CALL COLOR(1,16,2) :: CALL SCREEN(2)
140 FOR I=1 TO 9 :: CALL COLOR(1,2,16) :: CALL CHAR(32,B$(I)) :: CALL COLOR(1,16,2) :: NEXT I :: GOTO 140
150 DATA 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

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...