2018-12-03 15:51:47 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
#include "aclib.h"
|
|
|
|
|
2019-06-02 02:09:45 +00:00
|
|
|
#pragma opt_code_speed
|
|
|
|
|
2019-05-27 01:54:37 +00:00
|
|
|
// set entire palette at once (8 bytes to port 0xb)
|
|
|
|
// bytes in array should be in reverse
|
2019-05-28 01:52:00 +00:00
|
|
|
void set_palette(byte palette[8]) __z88dk_fastcall {
|
2019-05-27 01:54:37 +00:00
|
|
|
palette;
|
|
|
|
__asm
|
|
|
|
ld bc,#0x80b ; B -> 8, C -> 0xb
|
2019-05-28 01:52:00 +00:00
|
|
|
otir ; write C bytes from HL to port[B]
|
2019-05-27 01:54:37 +00:00
|
|
|
__endasm;
|
|
|
|
}
|
|
|
|
|
2019-05-31 19:05:33 +00:00
|
|
|
// set entire sound registers at once (8 bytes to port 0x18)
|
|
|
|
// bytes in array should be in reverse
|
|
|
|
void set_sound_registers(byte regs[8]) __z88dk_fastcall {
|
|
|
|
regs;
|
|
|
|
__asm
|
|
|
|
ld bc,#0x818 ; B -> 8, C -> 0x18
|
|
|
|
otir ; write C bytes from HL to port[B]
|
|
|
|
__endasm;
|
|
|
|
}
|
|
|
|
|