Skip to content

Instantly share code, notes, and snippets.

@fu-sen
Last active March 10, 2025 09:50
Show Gist options
  • Save fu-sen/1850fa2f22f7ffde9a3d65a625f4d565 to your computer and use it in GitHub Desktop.
Save fu-sen/1850fa2f22f7ffde9a3d65a625f4d565 to your computer and use it in GitHub Desktop.
/*
zcc +g800 -create-app -bn ledg815 ledg815.c
*/
/*
gprint data
PC-G815 has 6x8 dots (Same as PC-G850)
char balloon[6] = {0x4e, 0x5f, 0x3f, 0x1d, 0x0e, 0x00};
*/
#include <stdio.h>
#include <stdlib.h>
void main()
{
while(getk());
outp (0x54,0xc0);
outp (0x58,0xc0); /* y scroll reset */
for (int y=0; y<8; y++) {
outp (0x54,0xb8+y);
outp (0x58,0xb8+y);
/* y position 0xb8+y (0-7 0xc0)
0xc0-0xff changes this state!
+---------------------------------------------+
|b8h | bch|
|b9h | bdh|
|bah | beh|
|bbh | bfh|
+---------------------------------------------+
*/
outp (0x54, 0x40);
outp (0x58, 0x40);
/*
0x54 - x position 040+x (0-59)
60 = 10 charcters x 6 dots
+---------------------------------------------+
|40h ... 7bh | 7bh ... 40h|
|40h ... 7bh | 7bh ... 40h|
|40h ... 7bh | 7bh ... 40h|
|40h ... 7bh | 7bh ... 40h|
+---------------------------------------------+
0x58 x position 040+x (0-11)
12 = 2 charcters x 6 dots
+---------------------------------------------+
| 40h ... 4bh|4bh ... 40h |
| 40h ... 4bh|4bh ... 40h |
| 40h ... 4bh|4bh ... 40h |
| 40h ... 4bh|4bh ... 40h |
+---------------------------------------------+
The right half is horizontally reversed!!
*/
for (int x=0; x<10; x++) {
/* 0x54 setiing to 0x56 write, 0x57 read */
outp (0x56, 0x4e);
outp (0x56, 0x5f);
outp (0x56, 0x3f);
outp (0x56, 0x1d);
outp (0x56, 0x0e);
outp (0x56, 0x00);
}
for (int x=0; x<2; x++) {
/* 0x58 setiing to 0x5a write, 0x5b read */
outp (0x5a, 0x4e);
outp (0x5a, 0x5f);
outp (0x5a, 0x3f);
outp (0x5a, 0x1d);
outp (0x5a, 0x0e);
outp (0x5a, 0x00);
}
}
while(!getk());
}
/*
scroll (0-63, line*8?)
outp (0x56, 0xc0+y);
outp (0x5a, 0xc0+y);
busy check
while (inp(0x55) & 0x80);
while (inp(0x59) & 0x80);
read
d = inp(0x57):
d = inp(0x5b):
*/
@fu-sen
Copy link
Author

fu-sen commented Feb 16, 2025

スクリーンショット 2025-02-16 10 25 23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment