## VRAM Access by 1bit Matrix

VRAM Access by 1bit Matrix
<C.Basic>

This content is checked by fx-9860GII (OS 2.04).
This is on-going project, any changes may be made.

Model

fx-9860G Series

Description

i. C.Basic provides a unique matrix to directly access VRAM. The unique marix is a 1 bit matrix and an element Exy directly corresponds to
an(x, y) pixel data of VRAM. The (x, y)  is a coorinate in Device Coorinates System of VRAM. Left-TOP pixel is in coorinate (1, 1) and right-bottom pixel is in coordinate (127, 63)

ii. When the VRAM access matrix is allocated, the matrix data corresponds to VRAM bitmap data.

Syntax

1. Allocation: {127,63}→Dim Mat A.v or {127,63}→Dim Mat A.V
2. Matrix expression: Mat A[] ~ Mat Z[], Mat a[] ~ Mat z[]A[] ~ Z[], a[] ~ z[]
3. Value of the matrix is 0 (zero) or 1 (one).
4. A value A[x,y] = Exy corresponds to a pixel data (0 or 1) in coordinate (column x, row y) of VRAM.

Note

Example 1

ClrGraph
For -1→Y To 1 Step 0.1
PlotOn 0,Y
Next
{127,63}→Dim Mat A.v
0→P
For 1→Y To 63
For 1→X To 127
P+A[X,Y]→P
Next
Next
Locate 1,1,P

This code display as follows;

21

{127,63}→Dim Mat A.v sets bitmap data of VRAM in Mat A. When a graphics command is processed automatically the VRAM bitmap reflected to the Mat A.

This code draws 21 dots at first then define Mat A.v. At this time the Mat A is directly reflected to bitmap data of VRAM. An element of the Mat A is 0 or 1,

After allocating the Mat A, interestingly this matrix has already bitmap data of VRAM. Then calculating summary of all the elements should be a number of drawn dots. The dysplayed result shows the number of total drawn dots is 21.

Example 2

Exampl 1 is a sample to read out VRAM bitmap data. This Example 2 is to reflect VRAM bitmap data to LCD screen.

ClrGraph
Screen.G
{127,63}→Dim Mat A.v
For 53→X To 73
1→A[X,31]
Next
PutDispDD

Before running a graphics drawing command, automatically text screen is selected, then swap to graphics screen by Screen.G. Mat A is allocated after ClirGraph then every element of the matrix is 0. Following code sets 21 pixels to 1. PutDispDD command transfers the VRAM data to LCD screen.

テーマ : プログラム関数電卓
ジャンル : コンピュータ

コメントの投稿

カテゴリ
Online Counter

プロフィール

Author:やす (Krtyski)
since Oct 30, 2013

プログラム電卓は、プログラムを作って、使ってナンボ！

プログラム電卓を実際に使って気づいたこと、自作プログラム、電卓での Casio Basic, C.Basic そして Casio Python プログラミングについて書いています。

なお管理人はカシオ計算機の関係者ではありません。いつでもどこでもプログラミングができるプログラム電卓が好きな１ユーザーです。

リンク

Sitemap

ブロとも申請フォーム

この人とブロともになる

ＱＲコード