mirror of https://github.com/wwarthen/RomWBW.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
794 B
52 lines
794 B
var LOMEM: [uint8];
|
|
@asm "ld hl, __Hbss";
|
|
@asm "ld (", LOMEM, "), hl";
|
|
|
|
var HIMEM: [uint8];
|
|
@asm "ld hl, (6)";
|
|
@asm "ld (", HIMEM, "), hl";
|
|
|
|
sub Exit() is
|
|
@asm "rst 0";
|
|
end sub;
|
|
|
|
sub ExitWithError() is
|
|
@asm "rst 0";
|
|
end sub;
|
|
|
|
sub AlignUp(in: intptr): (out: intptr) is
|
|
out := in;
|
|
end sub;
|
|
|
|
sub get_char(): (c: uint8) is
|
|
@asm "ld c, 1";
|
|
@asm "call 5";
|
|
@asm "ld (", c, "), a";
|
|
end sub;
|
|
|
|
sub print_char(c: uint8) is
|
|
if c == 10 then
|
|
@asm "ld e, 13";
|
|
@asm "ld c, 2";
|
|
@asm "call 5";
|
|
end if;
|
|
@asm "ld a, (", c, ")";
|
|
@asm "ld e, a";
|
|
@asm "ld c, 2";
|
|
@asm "call 5";
|
|
end sub;
|
|
|
|
sub MemSet(buf: [uint8], byte: uint8, len: uint16) is
|
|
var bufend := buf + len;
|
|
loop
|
|
if buf == bufend then
|
|
return;
|
|
end if;
|
|
[buf] := byte;
|
|
buf := buf + 1;
|
|
end loop;
|
|
end sub;
|
|
|
|
include "common.coh";
|
|
|
|
|
|
|