FAQ  •  Register  •  Login

displaying 8x8 patterns like tms9918 (msx1, sg1000, etc)

<<

nitrofurano

Posts: 210

Joined: Thu Sep 29, 2011 12:44 pm

Location: Porto, Portugal

Post Sun Nov 06, 2011 5:59 pm

displaying 8x8 patterns like tms9918 (msx1, sg1000, etc)

recently i were trying to use the zx-spectrum display like 8x8 patterns used on tms9918 (used on msx1, Sega-sg1000, Colecovision, ti99/4, etc. - and somehow similar on what is used on Sega-MasterSystem or NES)

i'm curious on using the display like this, specially when we see some games this way, if i'm not mistaking, 'Stop the ITA-Express' (Hudson), King's Valley (originally Konami, converted from Retroworks), etc.

besides tms9918 uses 2 banks of 2kb (one for bitmap, and another for 8x1 attributes), on the charmap01.bas i'm using 2k for bitmap and 256 bytes for attributes

issues: just like 32x24print example, and i'm not using asm routines, i'm having performance problems as expected (i really wished to be more skilled on assembly for that)

example.bas
  Code:
#include "library/vpokechr.bas"
#include "library/charmap01.bas"
border 0:cls
vpcls(32,@charmap01)
vpprint(6*32+3,@charmap01,"hello world!") :'- not working... (?)
'- for i=0 to 767:vpokechr(i, 128+int(rnd*127) ,@charmap01):next i
for i=0 to 767:vpokechr(i, int(rnd*255) ,@charmap01):next i
for i=0 to 255:vpokechr(i,i,@charmap01):next i
pause 0


library/vpokechr.bas
  Code:
dim adrv2 as uinteger

sub vpokechr(adrv as uinteger,chrv as uinteger,chmadr as uinteger)
  adrv=adrv mod 768
  poke 22528+adrv,peek(chmadr+2048+chrv)
  for i=0 to 7
    poke 16384+(adrv band 255)+((int(adrv/256))*2048)+(i*256),peek (chmadr+(chrv*8)+i)
    next
  end sub

sub vpcls(chrv as uinteger,chmadr as uinteger)
  for adrv2=0 to 767
    poke 22528+adrv2,peek(chmadr+2048+chrv)
    for i=0 to 7
      poke 16384+(adrv2 band 255)+((int(adrv2/256))*2048)+(i*256),peek (chmadr+(chrv*8)+i)
      next
    next
  end sub

sub vpprint(adrv1 as uinteger,chmadr2 as uinteger,textv$ as string)
  for adrv2=0 to len(textv)
    vpokechr(adrv1+adrv2,val(textv$(adrv2)),chmadr2)
    next
  end sub


library/charmap01.bas
  Code:

poke uinteger 23606,@charmap01:poke uinteger 23675,@charmap01
goto end01

charmap01:
asm
  defb 038h,000h,000h,000h,000h,000h,000h,000h
  defb 0f8h,048h,040h,03ch,03ch,000h,01ch,01ch
  defb 000h,000h,0ffh,0ffh,087h,0ffh,0ffh,071h
  defb 003h,0ffh,0ffh,03fh,0ffh,0ffh,0ffh,0f8h
  defb 0ffh,087h,0d3h,0ffh,007h,093h,000h,000h
  defb 0ffh,0ffh,0ffh,0ffh,0f0h,000h,000h,0f0h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,000h
  defb 01ch,0ffh,01fh,03fh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0fch,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 00fh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0c1h,0c1h,000h,0c1h,0c1h,0c1h,0e1h,0f1h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0fch,0fch,0fch,0fch,0ffh,0ffh,0ffh
  defb 076h,000h,002h,000h,000h,012h,0c3h,03fh
  defb 000h,070h,07fh,03fh,003h,000h,000h,0fch
  defb 000h,000h,000h,0fdh,0f3h,060h,000h,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,087h
  defb 0f9h,0ffh,080h,000h,0cah,0a8h,0b2h,007h
  defb 0ffh,0ffh,0ffh,000h,070h,000h,000h,078h
  defb 0c1h,0ffh,03fh,03fh,01fh,01fh,01fh,00fh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0e0h,0f0h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 037h,000h,0c9h,041h,073h,0ffh,0ffh,03fh
  defb 0c0h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 000h,091h,0c3h,0ffh,0ffh,0ffh,0fch,0ffh
  defb 0ffh,0ffh,0e9h,0f0h,0c0h,0e8h,0e4h,0e6h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,07fh,0ffh,01fh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,000h
  defb 0ffh,03eh,07ch,0ffh,0c8h,0a0h,000h,000h
  defb 000h,0e0h,000h,000h,000h,000h,003h,01fh
  defb 000h,000h,000h,000h,000h,000h,000h,000h
  defb 030h,078h,078h,030h,030h,000h,030h,000h
  defb 06ch,06ch,06ch,000h,000h,000h,000h,000h
  defb 06ch,06ch,0feh,06ch,0feh,06ch,06ch,000h
  defb 030h,07ch,0c0h,078h,00ch,0f8h,030h,000h
  defb 000h,0c6h,0cch,018h,030h,066h,0c6h,000h
  defb 038h,06ch,038h,076h,0dch,0cch,076h,000h
  defb 060h,060h,0c0h,000h,000h,000h,000h,000h
  defb 018h,030h,060h,060h,060h,030h,018h,000h
  defb 060h,030h,018h,018h,018h,030h,060h,000h
  defb 000h,066h,03ch,0ffh,03ch,066h,000h,000h
  defb 000h,030h,030h,0fch,030h,030h,000h,000h
  defb 000h,000h,000h,000h,000h,070h,030h,060h
  defb 000h,000h,000h,0fch,000h,000h,000h,000h
  defb 000h,000h,000h,000h,000h,030h,030h,000h
  defb 006h,00ch,018h,030h,060h,0c0h,080h,000h
  defb 078h,0cch,0dch,0fch,0ech,0cch,078h,000h
  defb 030h,0f0h,030h,030h,030h,030h,0fch,000h
  defb 078h,0cch,00ch,038h,060h,0cch,0fch,000h
  defb 078h,0cch,00ch,038h,00ch,0cch,078h,000h
  defb 01ch,03ch,06ch,0cch,0feh,00ch,00ch,000h
  defb 0fch,0c0h,0f8h,00ch,00ch,0cch,078h,000h
  defb 038h,060h,0c0h,0f8h,0cch,0cch,078h,000h
  defb 0fch,0cch,00ch,018h,030h,060h,060h,000h
  defb 078h,0cch,0cch,078h,0cch,0cch,078h,000h
  defb 078h,0cch,0cch,07ch,00ch,018h,070h,000h
  defb 000h,000h,030h,030h,000h,030h,030h,000h
  defb 000h,000h,030h,030h,000h,070h,030h,060h
  defb 018h,030h,060h,0c0h,060h,030h,018h,000h
  defb 000h,000h,0fch,000h,0fch,000h,000h,000h
  defb 060h,030h,018h,00ch,018h,030h,060h,000h
  defb 078h,0cch,00ch,018h,030h,000h,030h,000h
  defb 07ch,0c6h,0deh,0deh,0deh,0c0h,078h,000h
  defb 030h,078h,0cch,0cch,0fch,0cch,0cch,000h
  defb 0fch,066h,066h,07ch,066h,066h,0fch,000h
  defb 03ch,066h,0c0h,0c0h,0c0h,066h,03ch,000h
  defb 0fch,06ch,066h,066h,066h,06ch,0fch,000h
  defb 0feh,062h,068h,078h,068h,062h,0feh,000h
  defb 0feh,062h,068h,078h,068h,060h,0f0h,000h
  defb 03ch,066h,0c0h,0c0h,0ceh,066h,03eh,000h
  defb 0cch,0cch,0cch,0fch,0cch,0cch,0cch,000h
  defb 078h,030h,030h,030h,030h,030h,078h,000h
  defb 01eh,00ch,00ch,00ch,0cch,0cch,078h,000h
  defb 0e6h,066h,06ch,078h,06ch,066h,0e6h,000h
  defb 0f0h,060h,060h,060h,062h,066h,0feh,000h
  defb 0c6h,0eeh,0feh,0d6h,0c6h,0c6h,0c6h,000h
  defb 0c6h,0e6h,0f6h,0deh,0ceh,0c6h,0c6h,000h
  defb 038h,06ch,0c6h,0c6h,0c6h,06ch,038h,000h
  defb 0fch,066h,066h,07ch,060h,060h,0f0h,000h
  defb 078h,0cch,0cch,0cch,0dch,078h,01ch,000h
  defb 0fch,066h,066h,07ch,078h,06ch,0e6h,000h
  defb 078h,0cch,0e0h,038h,01ch,0cch,078h,000h
  defb 0fch,0b4h,030h,030h,030h,030h,078h,000h
  defb 0cch,0cch,0cch,0cch,0cch,0cch,0fch,000h
  defb 0cch,0cch,0cch,0cch,0cch,078h,030h,000h
  defb 0c6h,0c6h,0c6h,0d6h,0feh,0eeh,0c6h,000h
  defb 0c6h,0c6h,06ch,038h,06ch,0c6h,0c6h,000h
  defb 0cch,0cch,0cch,078h,030h,030h,078h,000h
  defb 0feh,0cch,098h,030h,062h,0c6h,0feh,000h
  defb 078h,060h,060h,060h,060h,060h,078h,000h
  defb 0c0h,060h,030h,018h,00ch,006h,002h,000h
  defb 078h,018h,018h,018h,018h,018h,078h,000h
  defb 010h,038h,06ch,0c6h,000h,000h,000h,000h
  defb 000h,000h,000h,000h,000h,000h,000h,0ffh
  defb 030h,030h,018h,000h,000h,000h,000h,000h
  defb 000h,000h,078h,00ch,07ch,0cch,076h,000h
  defb 0e0h,060h,07ch,066h,066h,066h,0bch,000h
  defb 000h,000h,078h,0cch,0c0h,0cch,078h,000h
  defb 01ch,00ch,00ch,07ch,0cch,0cch,076h,000h
  defb 000h,000h,078h,0cch,0fch,0c0h,078h,000h
  defb 038h,06ch,060h,0f0h,060h,060h,0f0h,000h
  defb 000h,000h,076h,0cch,0cch,07ch,00ch,0f8h
  defb 0e0h,060h,06ch,076h,066h,066h,0e6h,000h
  defb 030h,000h,070h,030h,030h,030h,078h,000h
  defb 018h,000h,078h,018h,018h,018h,0d8h,070h
  defb 0e0h,060h,066h,06ch,078h,06ch,0e6h,000h
  defb 070h,030h,030h,030h,030h,030h,078h,000h
  defb 000h,000h,0ech,0feh,0d6h,0c6h,0c6h,000h
  defb 000h,000h,0f8h,0cch,0cch,0cch,0cch,000h
  defb 000h,000h,078h,0cch,0cch,0cch,078h,000h
  defb 000h,000h,0dch,066h,066h,07ch,060h,0f0h
  defb 000h,000h,076h,0cch,0cch,07ch,00ch,01eh
  defb 000h,000h,0d8h,06ch,06ch,060h,0f0h,000h
  defb 000h,000h,07ch,0c0h,078h,00ch,0f8h,000h
  defb 010h,030h,07ch,030h,030h,034h,018h,000h
  defb 000h,000h,0cch,0cch,0cch,0cch,076h,000h
  defb 000h,000h,0cch,0cch,0cch,078h,030h,000h
  defb 000h,000h,0c6h,0c6h,0d6h,0feh,06ch,000h
  defb 000h,000h,0c6h,06ch,038h,06ch,0c6h,000h
  defb 000h,000h,0cch,0cch,0cch,07ch,00ch,0f8h
  defb 000h,000h,0fch,098h,030h,064h,0fch,000h
  defb 01ch,030h,030h,0e0h,030h,030h,01ch,000h
  defb 018h,018h,018h,000h,018h,018h,018h,000h
  defb 0e0h,030h,030h,01ch,030h,030h,0e0h,000h
  defb 076h,0dch,000h,000h,000h,000h,000h,000h
  defb 010h,038h,06ch,0c6h,0c6h,0c6h,0feh,000h
  defb 000h,000h,000h,0ffh,07ch,03ch,034h,000h
  defb 0ffh,078h,000h,000h,000h,000h,000h,000h
  defb 0ffh,0ffh,01ch,0ffh,022h,01bh,01fh,0ffh
  defb 0dfh,0dfh,0ffh,0ffh,0ffh,0ffh,0d0h,0ffh
  defb 0ffh,0ffh,01fh,000h,000h,000h,000h,013h
  defb 0ffh,0ffh,077h,0c1h,000h,000h,000h,000h
  defb 07fh,0ffh,0ffh,000h,00ch,004h,000h,00eh
  defb 0ffh,0ffh,0e3h,083h,003h,083h,000h,0feh
  defb 0d8h,0ffh,0ffh,0ffh,0f9h,0ffh,0f3h,0f0h
  defb 00fh,0a0h,0ffh,0ffh,091h,010h,0f3h,0ffh
  defb 0ffh,078h,0ffh,0ffh,0ffh,0ffh,0f8h,0f8h
  defb 000h,000h,0f9h,068h,0e9h,0ffh,0ffh,0ffh
  defb 000h,03eh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 00ch,000h,0c4h,00bh,0ffh,0ffh,0ffh,0ffh
  defb 03fh,0ffh,0ffh,0ffh,0f8h,01fh,000h,040h
  defb 0ffh,0ffh,0fch,01fh,01fh,0ffh,01fh,018h
  defb 0ffh,0ffh,0ffh,0c3h,0ffh,0ffh,08fh,0f8h
  defb 0ffh,0ffh,0ffh,0ffh,01fh,038h,0ffh,01fh
  defb 007h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0e0h,0f0h,0f0h,0e0h,0f8h,0f0h,0f0h,0f0h
  defb 0ffh,0ffh,0ffh,042h,000h,023h,000h,000h
  defb 0f3h,0e3h,0ffh,0c3h,003h,0e1h,024h,01fh
  defb 06bh,0ffh,079h,0ffh,0cdh,0b5h,0ffh,0ffh
  defb 00ah,003h,027h,0ffh,0ffh,0e6h,0ffh,0ffh
  defb 0f0h,0f0h,0f8h,0f0h,0e0h,070h,0e0h,000h
  defb 000h,006h,006h,00eh,000h,000h,01eh,0ffh
  defb 007h,007h,00fh,00fh,01fh,0ffh,0fch,01ch
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0e7h,0ffh,0ffh
  defb 080h,000h,001h,000h,000h,000h,061h,031h
  defb 087h,087h,083h,083h,083h,083h,083h,083h
  defb 000h,0e1h,0c0h,000h,000h,0c0h,0c0h,000h
  defb 01eh,01eh,01eh,01fh,00fh,00fh,00fh,00bh
  defb 000h,0ffh,0ffh,0ffh,0ffh,07ch,0fch,07ch
  defb 000h,0ffh,0ffh,0ffh,0ffh,000h,03ah,000h
  defb 03fh,0ffh,0ffh,0ffh,0ffh,000h,04bh,000h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h,000h
  defb 0ffh,0ffh,0f0h,0f0h,0f0h,000h,000h,000h
  defb 0ffh,0ffh,009h,000h,004h,000h,000h,000h
  defb 0ffh,0ffh,00ch,00ch,016h,000h,000h,000h
  defb 0ffh,0ffh,010h,011h,011h,048h,0ceh,006h
  defb 000h,000h,000h,0ffh,0ffh,010h,01ch,01ch
  defb 0ffh,0ffh,0ffh,0f8h,0ffh,000h,03dh,019h
  defb 0c0h,000h,0ffh,0ffh,07fh,010h,0b4h,0bch
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h,038h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h,002h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h,060h
  defb 0e8h,08fh,080h,0ffh,0ffh,000h,000h,0c0h
  defb 01dh,0c7h,000h,087h,0f0h,047h,002h,002h
  defb 09fh,000h,08fh,000h,090h,0ffh,0ffh,0ffh
  defb 000h,03eh,000h,010h,000h,0ffh,0ffh,0ffh
  defb 060h,03eh,0ffh,007h,007h,0ffh,0ffh,0ffh
  defb 000h,070h,0e0h,0f0h,000h,0e3h,0c7h,0c7h
  defb 017h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 05fh,0ffh,0ffh,0ffh,0dch,0c4h,02eh,03ch
  defb 0ffh,0b7h,0ffh,0ffh,0ffh,0ffh,067h,079h
  defb 0ffh,0f0h,0f5h,04fh,0ffh,0ffh,077h,0ffh
  defb 0c0h,000h,0c0h,0c0h,080h,080h,080h,000h
  defb 00ch,01eh,03eh,01eh,00eh,03fh,007h,066h
  defb 000h,03ch,03ch,03ch,03ch,07ch,0ffh,07ch
  defb 034h,070h,020h,001h,000h,000h,001h,000h
  defb 019h,000h,007h,000h,083h,0c3h,0e0h,0e3h
  defb 083h,083h,083h,083h,083h,083h,083h,0e3h
  defb 000h,000h,000h,0c0h,000h,000h,000h,0c0h
  defb 0ebh,0f9h,0f9h,0f9h,0fch,0fch,0fch,0fch
  defb 07ch,0ffh,0fch,0feh,0fch,0fch,0fch,0fch
  defb 000h,000h,000h,007h,007h,007h,00fh,000h
  defb 000h,000h,000h,0f0h,0ffh,0ffh,0ffh,063h
  defb 000h,000h,000h,000h,0f8h,0feh,0ffh,0ffh
  defb 000h,000h,000h,000h,000h,0ffh,000h,0d9h
  defb 000h,000h,000h,000h,0ffh,0d0h,050h,03fh
  defb 000h,000h,000h,0ffh,0ceh,046h,026h,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 01ch,019h,000h,000h,000h,000h,008h,008h
  defb 001h,087h,007h,007h,007h,007h,007h,007h
  defb 038h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 078h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 000h,000h,030h,030h,022h,000h,000h,000h
  defb 0ffh,0ffh,0f0h,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,013h,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 000h,000h,000h,008h,000h,000h,000h,000h
  defb 0ffh,0ffh,0ffh,000h,0ffh,0d6h,000h,0eah
  defb 0ffh,0ffh,0ffh,007h,0b7h,007h,037h,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h
  defb 0ffh,0ffh,0f8h,000h,0cch,00ch,000h,000h
  defb 0ffh,00fh,00fh,007h,007h,003h,003h,003h
  defb 080h,080h,0ddh,08ch,084h,0c7h,0c7h,0c7h
  defb 079h,039h,0ffh,0beh,000h,08ch,0c6h,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,00fh,027h,00fh
  defb 0f0h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 07eh,0ffh,0fch,0ffh,0f0h,0ffh,0ffh,0ffh
  defb 0fch,0fch,0fch,0fch,0ffh,0ffh,0ffh,0ffh
  defb 000h,0fah,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0e0h,0f0h,0f0h,0f0h,0f0h,0f0h,0f0h,0f0h
  defb 0f3h,09fh,000h,0a3h,063h,0c3h,007h,007h
  defb 000h,0d0h,0ffh,0ffh,0c7h,0c7h,0cfh,0ffh
  defb 0ffh,0ffh,074h,014h,01ch,00ch,0cch,0ffh
  defb 0fch,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 01ch,0ffh,0ffh,0ffh,0ffh,0e0h,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0e3h,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0fch,0ffh,0ffh,02bh,0ffh
  defb 0ffh,0aeh,0cah,0bch,0e7h,0e7h,0a7h,0e7h
  defb 0ffh,0fch,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0cdh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,076h,0f0h,000h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,01ch,000h,000h
  defb 0ffh,000h,0c4h,000h,0ffh,000h,000h,000h
  defb 0ffh,000h,000h,000h,0f8h,0e8h,000h,000h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,000h,000h,000h
  defb 0ffh,0ffh,0feh,0ffh,0ffh,09ch,000h,000h
  defb 0ffh,000h,060h,0f0h,0e0h,000h,000h,030h
  defb 000h,000h,000h,000h,000h,000h,000h,000h
  defb 000h,020h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 000h,042h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 060h,0ffh,0ffh,0f8h,0f8h,0ffh,0ffh,00ah
  defb 0f8h,000h,000h,000h,000h,014h,000h,000h
  defb 08dh,001h,001h,001h,049h,0edh,0e1h,000h
  defb 0c7h,0ffh,0ffh,0ffh,0ffh,0ffh,0feh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,01dh,01ch
  defb 0c7h,0e1h,0f1h,0f0h,0f0h,0ffh,0ffh,0e7h
  defb 0ffh,0ffh,0ffh,0ffh,03fh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0ffh,0feh,0fch,0ffh,0ffh
  defb 0ffh,0ffh,03fh,05fh,0dfh,03fh,007h,01ch
  defb 0f0h,0ffh,0ffh,0f8h,0f8h,0feh,0ffh,0fch
  defb 007h,000h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 0ffh,0ffh,0ffh,0fdh,0ffh,000h,0c1h,0c1h
  defb 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
  defb 010h,010h,010h,010h,010h,010h,030h,010h
  defb 038h,010h,078h,010h,030h,010h,072h,072h
  defb 008h,010h,010h,010h,038h,008h,07eh,038h
  defb 038h,010h,030h,030h,010h,010h,010h,032h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 070h,070h,070h,070h,070h,070h,070h,070h
  defb 010h,010h,010h,010h,010h,050h,050h,010h
  defb 010h,010h,010h,010h,010h,010h,038h,038h
  defb 038h,038h,038h,078h,010h,010h,010h,010h
  defb 070h,070h,072h,072h,072h,078h,070h,050h
  defb 010h,010h,010h,010h,010h,010h,010h,010h
  defb 010h,010h,010h,010h,010h,010h,010h,010h
  defb 038h,03ah,03ah,072h,010h,010h,010h,010h
  defb 070h,030h,038h,050h,070h,078h,070h,07ah
  defb 050h,050h,010h,050h,010h,010h,010h,062h
  defb 050h,050h,010h,010h,010h,032h,072h,050h
  defb 032h,030h,010h,070h,010h,010h,038h,030h
  defb 030h,038h,038h,010h,030h,038h,03ah,07ah
  defb 010h,010h,010h,020h,010h,010h,010h,032h
  defb 072h,072h,010h,010h,032h,032h,032h,034h
  defb 010h,010h,010h,070h,010h,010h,010h,032h
  defb 010h,018h,030h,010h,030h,07eh,03ah,038h
  end asm

end01:
<<

nitrofurano

Posts: 210

Joined: Thu Sep 29, 2011 12:44 pm

Location: Porto, Portugal

Post Sun Nov 06, 2011 9:03 pm

Re: displaying 8x8 patterns like tms9918 (msx1, sg1000, etc)

with the libraries above, i think this example is not bad, for showing a better idea of that - i made similar example on msx, but this one lacks those tms9918 hardware sprites

  Code:
#include "library/vpokechr.bas"
#include "library/charmap01.bas"

poke 23693,peek(@charmap01+2048+32):border 0:cls
dim p1,p2,s1,s2,vl as integer

p1=int(rnd*767):p2=int(rnd*767)
s1=int(rnd*32)+8:s2=int(rnd*32)+8

lp01:
  'vl=int(rnd*255)
  vl= (128+int(rnd*160))band 255

  vpokechr(p1,vl,@charmap01)
  p1=(p1+1)mod 768
  s1=s1-1
  if s1<1 then: p1=int(rnd*767):s1=int(rnd*32)+8:end if
  vpokechr(p2,32,@charmap01)
  p2=(p2+1)mod 768
  s2=s2-1
  if s2<1 then: p2=int(rnd*767):s2=int(rnd*32)+8:end if

  pause 1
  goto lp01


a screenshot of it:
Image
<<

LCD

Posts: 571

Joined: Fri Feb 13, 2009 3:11 pm

Location: Vienna, Austria

Post Mon Nov 07, 2011 8:47 am

Re: displaying 8x8 patterns like tms9918 (msx1, sg1000, etc)

There is somewhere PutChar SUB by Britlion posted in this forum, written in Assembler, check that.
Random numbers are slow anyway.

Edit: how-to-tutorials/topic468.html
------------------------------------------------------------
http://lcd-one.da.ru redirector is dead
Visit my http://members.inode.at/838331/index.html home page!
<<

britlion

Posts: 722

Joined: Mon Apr 27, 2009 7:26 pm

Location: Slough, Berkshire, UK

Post Mon Nov 07, 2011 12:10 pm

Re: displaying 8x8 patterns like tms9918 (msx1, sg1000, etc)

Putchars is here: how-to-tutorials/topic468.html

Though this does look like a very complex way of putting character data on screen, compared to using "print".....

If you've reset the system font, or it's in the UDG area you can just print it. Putchars is designed to be a very specialised print routine that is as fast as I could get it - it's designed to output character based data from memory, however, without necessarily doing all the font changes.

Return to Wishlist

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO