Skip to content

Instantly share code, notes, and snippets.

@fu-sen
Last active April 19, 2025 02:12
Show Gist options
  • Select an option

  • Save fu-sen/56bb1b2dd26237e6b6d2cfb41459691e to your computer and use it in GitHub Desktop.

Select an option

Save fu-sen/56bb1b2dd26237e6b6d2cfb41459691e to your computer and use it in GitHub Desktop.
/*
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);
}
}
@fu-sen
Copy link
Copy Markdown
Author

fu-sen commented Feb 13, 2025

スクリーンショット 2025-02-13 12 57 52

PC-G815
スクリーンショット 2025-02-13 12 57 02

PC-G850 (change source)
スクリーンショット 2025-02-13 12 55 56

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