Last active
April 19, 2025 02:12
-
-
Save fu-sen/56bb1b2dd26237e6b6d2cfb41459691e to your computer and use it in GitHub Desktop.
Balloons - PC-E200 / G siries - z88dk C language https://poke-com.jimdofree.com/z88dk-%E3%81%A7%E3%82%AF%E3%83%AD%E3%82%B9%E9%96%8B%E7%99%BA%E3%81%99%E3%82%8B/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Balloons | PC-E200 / G series | z88dk C language | |
| Copyright (c) 2025 BALLOON | FU-SEN | |
| The MIT License (MIT) - https://mit.balloon.net.eu.org/#2025 | |
| zcc +g800 -create-app -bn balloons balloons.c | |
| --> MON | |
| R | |
| G100 | |
| */ | |
| #include <stdlib.h> | |
| void putchr(char posx, char posy, char pchr) | |
| { | |
| #asm | |
| ld ix,0 | |
| add ix,sp | |
| ld a,(ix+2) ; pchr | |
| ld d,(ix+4) ; posy | |
| ld e,(ix+6) ; posx | |
| call 0be62h | |
| #endasm | |
| } | |
| void putimg(char posx, char posy, int addr, char size) | |
| { | |
| #asm | |
| ld ix,0 | |
| add ix,sp | |
| ld b,(ix+2) ; size | |
| ld l,(ix+4) ; addr | |
| ld h,(ix+5) | |
| ld d,(ix+6) ; posy | |
| ld e,(ix+8) ; posx | |
| call 0bfd0h | |
| #endasm | |
| } | |
| void scrup() | |
| { | |
| #asm | |
| call 0bfebh | |
| #endasm | |
| } | |
| void getcodei() | |
| { | |
| #asm | |
| call 0be53h | |
| ld l,a | |
| ld h,0 | |
| #endasm | |
| } | |
| char balloon [] = { 0x0e, 0x1f, 0x7f, 0x9d, 0x0e }; | |
| char ribbon [] = { 0x00, 0x00, 0x26, 0x19, 0x00 }; | |
| /* PC-G850 */ | |
| /* | |
| int screeny = 6; | |
| int wait = 30; | |
| */ | |
| /* PC-E200, G serius */ | |
| int screeny = 4; | |
| int wait = 15; | |
| void main(){ | |
| for(int y=0; y<screeny; y++) { | |
| for(int x=0; x<24; x++) { | |
| putchr(x, y, ' '); | |
| } | |
| } | |
| while(getcodei()) {} | |
| while(!getcodei()) | |
| { | |
| int x=rand()%24; | |
| putimg(x, screeny-1, balloon, 5); | |
| if(getcodei()) | |
| { | |
| break; | |
| } | |
| csleep(wait); | |
| for(int x=0; x<24; x++) { | |
| putchr(x, 0, ' '); | |
| } | |
| scrup(); | |
| putimg(x, screeny-1, ribbon, 5); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PC-G815

PC-G850 (change source)
