Hi, I wrote a simple program with SDCC than design a simple pixel in the screen, this is the code:
#include "graphic.h"
#include "cio.h"
int main()
{
screen(2);
pset(100,50);
while(1){};
return 0;
}
This is the code's library for pset():
#include "graphic.h"
void pset(unsigned char x, unsigned char y)
{
__asm
{
ld h, 4(ix)
ld l, 5(ix)
call #0x006D ; ---> BIOS call for design a pixel in the screen
}
}
void paint(unsigned char x, unsigned char y)
{
__asm
{
ld h, 4(ix)
ld l, 5(ix)
call #0x0069 ; ---> BIOS call for color the screen
}
}
char vpeek(int address){
_asm
{
ld l,4(ix)
ld h,5(ix)
call 0x004a ;BIOS call for read a VRAM value
ld h,#0x00
ld l,a
}
}
void vpoke(int address, char value){
_asm
{
ld l,4(ix)
ld h,5(ix)
ld a,6(ix)
call 0x004d ;BIOS call for write a VRAM value
}
}
I compiled with the follow script .bat:
sdcc –debug –no-std-crt0 -mz80 –code-loc 0×0200 –data-loc 0x8000 -o main.ihx main.c graphic.c cio.c crt0msx.s makebin -s 65536 main.ihx main.mem dd if=main.mem of=main.rom bs=16384 skip=1 count=2
and i obtained a main.rom file than didn't start with Bluemsx, it didn't show the pixel in the screen.
Nobody can help me about this problem?
Login or register to post comments

