<commit_before>''
'' VGA driver 320x256 (dual cog) - demo
''
''        Author: <NAME>
'' Last modified: 2019/06/17
''       Version: 0.2.yx.2
''
CON
  _clkmode = XTAL1|PLL16X
  _xinfreq = 5_000_000

CON
  columns  = driver#res_x / 8
  rows     = driver#res_y
  bcnt     = columns * rows

  flash    = FALSE
  
  mbyte    = $7F | flash & $80
  mlong    = mbyte * $01010101

OBJ
  driver: "waitvid.320x256.driver.2048"
    font: "generic8x8-1font"
  
VAR
  long  scrn[bcnt /4]                                   ' screen buffer
  long  attr[bcnt /4]                                   ' colour buffer

  long  link[driver#res_m]                              ' mailbox
  long  base
  
PUB selftest : n | x, y

  link{0} := @scrn{0}
  link[1] := @attr{0}
  driver.init(-1, @link{0})                             ' start driver

  base := font.addr
  frqa := frqb := cnt

  repeat                                                  
    fill_1

PRI fill_1 : n | x, y

  repeat y from 0 to 31         
    repeat x from 0 to 39       
      print(x, y, n++, ?frqb & mbyte)
      waitcnt(clkfreq/120 + cnt)

  scroll<commit_msg>[kuroneko] added 8+2 test code<commit_after>''
'' VGA driver 320x256 (dual cog) - demo
''
''        Author: <NAME>
'' Last modified: 2019/06/19
''       Version: 0.2.yx.3
''
'' 20190619: added test for 8+2 in 6+2 environments
''
CON
  _clkmode = XTAL1|PLL16X
  _xinfreq = 5_000_000

CON
  columns  = driver#res_x / 8
  rows     = driver#res_y
  bcnt     = columns * rows

  flash    = FALSE
  
  mbyte    = $7F | flash & $80
  mlong    = mbyte * $01010101

OBJ
  driver: "waitvid.320x256.driver.2048"
    font: "generic8x8-1font"
  
VAR
  long  scrn[bcnt /4]                                   ' screen buffer
  long  attr[bcnt /4]                                   ' colour buffer

  long  link[driver#res_m]                              ' mailbox
  long  base

  long  sH[32], sV[32]
  
PUB selftest : n | x, y

  link{0} := (2 << 9 | %%333_0) << 21 | @scrn{0}
  link[1] := (2 << 9 | %%000_3) << 21 | @attr{0}
  driver.init(-1, @link{0})                             ' start driver

' cognew(plink(16, 2, 0), @sV{0})                       ' |
' cognew(plink(17, 3, 1), @sH{0})                       ' H/V bit links

  base := font.addr
  frqa := frqb := cnt

  repeat                                                  
    fill_1

PRI plink(a,{<<}b,{<<}c)

  dira := |< a | |< b
  ctra := %0_01001_000 << 23 | a << 9 | b               ' outa[a] := !ina[b]
  ctrb := %0_01001_000 << 23 | b << 9 | c               ' outa[b] := !ina[c]

  waitpne(0, 0, 0)
  
PRI fill_1 : n | x, y

  repeat y from 0 to 31         
    repeat x from 0 to 39       
      print(x, y, n++, ?frqb & mbyte)
      waitcnt(clkfreq/120 + cnt)

  scroll
{'fraction_non_alphanumeric': 0.13065693430656936, 'fraction_numerical': 0.07773722627737226, 'mean_word_length': 1.462713387241689, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4607208', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1017, 'n_words': 263}