Project update to Fusion-C-v1.2

This commit is contained in:
SaffronCR
2019-12-06 19:02:17 +01:00
parent 0cd7176c66
commit 443f4cd0b7
77 changed files with 44928 additions and 1373 deletions

4
.gitignore vendored
View File

@@ -258,4 +258,6 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
*.pyc
openMSX/
Tools/

95
Makefile Normal file
View File

@@ -0,0 +1,95 @@
# ___________________________________________________________
#/ __ _ \
#| / _| (_) |
#| | |_ _ _ ___ _ ___ _ __ |
#| | _| | | / __| |/ _ \| '_ \ |
#| | | | |_| \__ \ | (_) | | | | |
#| |_| \__,_|___/_|\___/|_| |_| * |
#| |
#| The MSX C Library for SDCC |
#| V1.2 - August 2019 |
#| |
#| |
#| Compilation Script for MacOS |
#| (may be for linux too ! ?) |
#| |
#\___________________________________________________________/
#
# What does this file ?
# It generate an MSX DOS executable file ready to be launch on a MSX Computer with MSX-DOS
# It also start the openMSX emuilator if it isn't already started
#
#
.PHONY: all, clean, fclean, emulator, re
HEX2BINDIR = ./ # where is the hex2bin folder : ./ if installed in system
HEX2BIN = hex2bin # name of hex2bin command name
ASM = sdasz80 # ASM compilator command name
CC = sdcc # SDCC commpilator command name
C_FILES := $(CompFile) #test.c $(wildcard *.c) # which files to compil. File name must be sent by Sublime Text Build Systeme into the $(CompFile) variable
DEST := dsk/ # destination of executable files
ASM_FILES := $(wildcard *.s) # definition of sources files
REL_FILES := $(subst .s,.rel,$(ASM_FILES)) # definition of .rel files
IHX_FILES := $(subst .c,.ihx,$(C_FILES)) # definition of .ihx files
COM_FILES := $(subst .ihx,.com,$(IHX_FILES)) # definition of .com files
# Folder where to find other compiled files to include
INCLUDEDIR = ./fusion-c/include/
# Folder where to find Fusion.lib
LIBDIR = ./fusion-c/lib/
# standrd crt0
crt0 = $(INCLUDEDIR)crt0_msxdos.rel
# use this crt0 if you want to pass parameters to your program
#crt0 = $(INCLUDEDIR)crt0_msxdos_advanced.rel
#INC1 = $(INCLUDEDIR)
#INC2 = $(INCLUDEDIR)
#INC3 = $(INCLUDEDIR)
#INC4 = $(INCLUDEDIR)
#INC5 = $(INCLUDEDIR)
#INC6 = $(INCLUDEDIR)
#INC7 = $(INCLUDEDIR)
#INC8 = $(INCLUDEDIR)
#INC9 = $(INCLUDEDIR)
#INCA = $(INCLUDEDIR)
#INCB = $(INCLUDEDIR)
#INCC = $(INCLUDEDIR)
#INCD = $(INCLUDEDIR)
#INCE = $(INCLUDEDIR)
#INCF = $(INCLUDEDIR)
# Standard Code-loc adress
ADDR_CODE = 0x106
# use this parameter if you are using crt0_msxdos_advanced
#ADDR_CODE = 0x180
ADDR_DATA = 0x0
# The above line is the full command line used by SDD to compil and link your to source file to an MSX-DOS executable
CCFLAGS = --code-loc $(ADDR_CODE) --data-loc $(ADDR_DATA) --disable-warning 196 -mz80 --no-std-crt0 --opt-code-size fusion.lib -L $(LIBDIR) $(crt0) $(INC1) $(INC2) $(INC3) $(INC4) $(INC5) $(INC6) $(INC7) $(INC8) $(INC9) $(INCA) $(INCB) $(INCC) $(INCD) $(INCE) $(INCF)
########## END OF CONFIGURATION ######################
all: $(REL_FILES) $(COM_FILES) clean emulator
%.ihx: %.c
@SDCC $(CCFLAGS) $^
@echo "..•̀ᴗ•́)و .. $(CC) is Processing ... !"
%.com: %.ihx
@hex2bin -e com $^
@cp $@ $(DEST)
@echo "... (•̀ᴗ•́)و Updating files in $(DEST)... !"
%.rel: %.s
# $(AS) -o $^
clean:
@rm -f *.com *.asm *.lst *.sym *.bin *.ihx *.lk *.map *.noi *.rel
@echo "....(╯°□°) temp files removed!"
emulator:
# Starting emulator script
./openMSX/emul_start.sh

27885
Tools/_SDCC manual.pdf Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -16,8 +16,8 @@ SET proga=%1
SET INC1=%INCLUDEDIR%crt0_msxdos.rel
REM SET INC2=%INCLUDEDIR%
REM SET INC3=%INCLUDEDIR%
REM SET INC2=%INCLUDEDIR
REM SET INC3=%INCLUDEDIR
REM SET INC4=%INCLUDEDIR%
REM SET INC5=%INCLUDEDIR%
REM SET INC6=%INCLUDEDIR%
@@ -31,7 +31,7 @@ REM SET INCD=%INCLUDEDIR%
REM SET INCE=%INCLUDEDIR%
REM SET INCF=%INCLUDEDIR%
SET ADDR_CODE=0x107
SET ADDR_CODE=0x106
SET ADDR_DATA=0x0

BIN
dsk/bg.sf5 Normal file

Binary file not shown.

Binary file not shown.

BIN
dsk/walls.sf5 Normal file

Binary file not shown.

View File

@@ -0,0 +1,106 @@
//
// Fusion-C
// Mouse Control. VErsion 1 (Old Methd)
// ASM Help by GDX
//
#include "fusion-c/header/msx_fusion.h"
#include "fusion-c/header/vdp_sprites.h"
#include <stdio.h>
/* Set Sprite mouse Pointer */
static const unsigned char pointer_pattern[]={0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x12,
0x09,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x00,
0x80,0x40,0x30,0x3C,0x1F,0x1F,0x0E,0x0D,
0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,
0x80,0x40,0x20,0x00,0x00,0x00,0x00,0x00,
0x40,0x30,0x0C,0x03,0x00,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x80,
0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00};
/* --- Slot 0 */
/* mask 0 */
static const unsigned char pattern[]={0x1F,0x10,0x00,0x03,0x00,0x03,0x0B,0x0F,
0x03,0x0C,0x1E,0x11,0x0E,0x01,0x0F,0x1F,
0x20,0x20,0xC0,0x00,0x40,0x40,0x60,0xE0,
0xC0,0x00,0xC0,0xC0,0x80,0x00,0x00,0xE0,
0x00,0x07,0x1E,0x3C,0x3C,0x30,0x40,0x7F,
0x1F,0x3F,0x3F,0x3F,0x3F,0x10,0x1F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,
0xE0,0xC0,0xE0,0xE0,0xC0,0x00,0x80,0x00,
0x00,0x2F,0x3F,0x7C,0x7F,0x7C,0xF4,0x00,
0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,
0x00,0xD0,0x20,0xC0,0xA0,0xA0,0x90,0x00,
0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00};
static const unsigned char color1[]={0x01,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0A,
0x0A,0x06,0x06,0x06,0x0A,0x0B,0x06,0x01};
static const unsigned char color2[]={0x00,0x46,0x46,0x46,0x46,0x46,0x46,0x41,
0x41,0x41,0x41,0x41,0x41,0x46,0x41,0x00};
static const unsigned char color3[]={0x00,0x41,0x41,0x41,0x41,0x41,0x41,0x00,
0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00};
void main(void)
{
int mx,my,i;
unsigned int MouseOffset;
char a,b;
a=0;
b=0;
Screen(5);
SpriteReset();
Sprite16();
for (i = 0; i < 96; ++i) // Read sprite patterns and set them in Video Ram
{
Vpoke(0x7800+i,pointer_pattern[i]); // 0x7800 is the memory adress of Sprite shapes
}
SC5SpriteColors(0,color1); // Set Sprites colors
SC5SpriteColors(1,color2);
SC5SpriteColors(2,color3);
mx=125;
my=50;
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
while (Inkey()!=27) // Escape to Quit
{
MouseOffset=MouseRead(MousePort1);
a=MouseOffset >> 8;
b=MouseOffset & 0xFF;
mx=mx-(a);
my=my-(b);
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
}
Screen(0);
Exit(0);
}

Binary file not shown.

View File

@@ -0,0 +1,122 @@
//
// Fusion-C
// MouseReadTo Test .
//
#include "fusion-c/header/msx_fusion.h"
#include "fusion-c/header/vdp_graph2.h"
#include "fusion-c/header/vdp_sprites.h"
#include <stdio.h>
static MOUSE_DATA mouse;
/* Set Sprite mouse Pointer */
static const unsigned char pointer_pattern[]={0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x12,
0x09,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x00,
0x80,0x40,0x30,0x3C,0x1F,0x1F,0x0E,0x0D,
0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,
0x80,0x40,0x20,0x00,0x00,0x00,0x00,0x00,
0x40,0x30,0x0C,0x03,0x00,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x80,
0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00};
/* --- Slot 0 */
/* mask 0 */
static const unsigned char pattern[]={0x1F,0x10,0x00,0x03,0x00,0x03,0x0B,0x0F,
0x03,0x0C,0x1E,0x11,0x0E,0x01,0x0F,0x1F,
0x20,0x20,0xC0,0x00,0x40,0x40,0x60,0xE0,
0xC0,0x00,0xC0,0xC0,0x80,0x00,0x00,0xE0,
0x00,0x07,0x1E,0x3C,0x3C,0x30,0x40,0x7F,
0x1F,0x3F,0x3F,0x3F,0x3F,0x10,0x1F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,
0xE0,0xC0,0xE0,0xE0,0xC0,0x00,0x80,0x00,
0x00,0x2F,0x3F,0x7C,0x7F,0x7C,0xF4,0x00,
0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,
0x00,0xD0,0x20,0xC0,0xA0,0xA0,0x90,0x00,
0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00};
static const unsigned char color1[]={0x01,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0A,
0x0A,0x06,0x06,0x06,0x0A,0x0B,0x06,0x01};
static const unsigned char color2[]={0x00,0x46,0x46,0x46,0x46,0x46,0x46,0x41,
0x41,0x41,0x41,0x41,0x41,0x46,0x41,0x00};
static const unsigned char color3[]={0x00,0x41,0x41,0x41,0x41,0x41,0x41,0x00,
0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00};
void main(void)
{
int mx,my,i,px,py;
char a,b;
signed char dx=0,dy=0;
a=0;
b=0;
px=0;
py=0;
dx=0;
dy=0;
Screen(5);
SpriteReset();
Sprite16();
PutText(10,10,"MouseReadTo Test",0);
for (i = 0; i < 96; ++i) // Read sprite patterns and set them in Video Ram
{
Vpoke(0x7800+i,pointer_pattern[i]); // 0x7800 is the memory adress of Sprite shapes
}
SC5SpriteColors(0,color1); // Set Sprites colors
SC5SpriteColors(1,color2);
SC5SpriteColors(2,color3);
mx=125;
my=50;
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
while (Inkey()!=27) // Escape to Quit
{
MouseReadTo(0,&mouse);
if (mouse.dx!=dx || mouse.dy!=dy) {
dx=mouse.dx;
dy=mouse.dy;
if (px>255) px=255;
if (px<0) px=0;
px=px-dx;
if (py>211) py=211;
if (py<0) py=0;
py=py-dy;
PutSprite (0,0,px,py,0);
PutSprite (1,4,px,py,0);
PutSprite (2,8,px,py,0);
}
if (mouse.rbutton==0)
Pset(px,py,15,0);
if (mouse.lbutton==0)
Pset(px,py,6,0);
}
Screen(0);
Exit(0);
}

Binary file not shown.

View File

@@ -0,0 +1,117 @@
//
// Fusion-C
// Mouse Control. Version 2
// ASM Help by GDX
//
#include "fusion-c/header/msx_fusion.h"
#include "fusion-c/header/vdp_sprites.h"
#include "fusion-c/header/vdp_graph2.h"
#include <stdio.h>
static MOUSE_DATA md;
/* Set Sprite mouse Pointer */
static const unsigned char pointer_pattern[]={0x00,0x80,0x40,0x40,0x20,0x20,0x10,0x12,
0x09,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0x40,0x00,0x00,0x00,0x00,0x00,
0x80,0x40,0x30,0x3C,0x1F,0x1F,0x0E,0x0D,
0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,
0x80,0x40,0x20,0x00,0x00,0x00,0x00,0x00,
0x40,0x30,0x0C,0x03,0x00,0x00,0x01,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x80,
0x40,0x20,0x00,0x00,0x00,0x00,0x00,0x00};
/* --- Slot 0 */
/* mask 0 */
static const unsigned char pattern[]={0x1F,0x10,0x00,0x03,0x00,0x03,0x0B,0x0F,
0x03,0x0C,0x1E,0x11,0x0E,0x01,0x0F,0x1F,
0x20,0x20,0xC0,0x00,0x40,0x40,0x60,0xE0,
0xC0,0x00,0xC0,0xC0,0x80,0x00,0x00,0xE0,
0x00,0x07,0x1E,0x3C,0x3C,0x30,0x40,0x7F,
0x1F,0x3F,0x3F,0x3F,0x3F,0x10,0x1F,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,
0xE0,0xC0,0xE0,0xE0,0xC0,0x00,0x80,0x00,
0x00,0x2F,0x3F,0x7C,0x7F,0x7C,0xF4,0x00,
0x00,0x00,0x00,0x00,0x00,0x3E,0x00,0x00,
0x00,0xD0,0x20,0xC0,0xA0,0xA0,0x90,0x00,
0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00};
static const unsigned char color1[]={0x01,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0A,
0x0A,0x06,0x06,0x06,0x0A,0x0B,0x06,0x01};
static const unsigned char color2[]={0x00,0x46,0x46,0x46,0x46,0x46,0x46,0x41,
0x41,0x41,0x41,0x41,0x41,0x46,0x41,0x00};
static const unsigned char color3[]={0x00,0x41,0x41,0x41,0x41,0x41,0x41,0x00,
0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00};
void main(void)
{
int mx,my,i;
unsigned int MouseOffset;
char a,b;
a=0;
b=0;
Screen(5);
SpriteReset();
Sprite16();
for (i = 0; i < 96; ++i) // Read sprite patterns and set them in Video Ram
{
Vpoke(0x7800+i,pointer_pattern[i]); // 0x7800 is the memory adress of Sprite shapes
}
SC5SpriteColors(0,color1); // Set Sprites colors
SC5SpriteColors(1,color2);
SC5SpriteColors(2,color3);
mx=125;
my=50;
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
while (Inkey()!=27) // Escape to Quit
{
// MouseOffset=MouseRead(MousePort1);
MouseReadTo(1,&md);
// a=MouseOffset >> 8;
// b=MouseOffset & 0xFF;
mx=mx-(md.dx);
my=my-(md.dy);
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
if (md.lbutton==0) // If left Click Draw a Whitee pixel
PsetXY(mx,my,15);
if (md.rbutton==0) // If Right Click Draw a red pixel
PsetXY(mx,my,134);
}
Screen(0);
Exit(0);
}

Binary file not shown.

View File

@@ -587,7 +587,7 @@ void main(void)
RleWBToVram (&cat2[0],50*128);
RleToVram (&cat3[0],50*128);
RleWBToVram (&cat3[0],50*128);
RleWBToVram (&cat4[0],50*128);

View File

@@ -0,0 +1,61 @@
//
// FUSION-C Example
// Draw Line and, Box, Pixels on screen 7
//
//
//
#include "fusion-c/header/msx_fusion.h"
#include "fusion-c/header/vdp_graph2.h"
void main(void)
{
unsigned int i,j;
char c;
char p[10];
SetColors(15,5,7);
Screen(7);
SetColors(15,5,7);
Rect(50,100,500,200,2,255);
Rect(50,100,500,200,11,0);
BoxFill(250,20,512,100,12,0);
BoxFill(250,30,512,50,12,2);
BoxFill(250,40,512,60,12,3);
BoxFill(250,50,512,70,10,2);
for (j=10; j<30;j++)
{
for ( i = 10; i < 500; ++i)
{
Pset(i,j,6,0);
}
}
// now Drawing same lines
for ( i = 0; i < 511; ++i)
{
Line(256,106,i,0,10,0);
Line(256,106,i,211,9,0);
}
for ( i = 0; i < 211; ++i)
{
Line(256,106,0,i,6,0);
Line(256,106,511,i,12,0);
}
WaitKey();
Screen(0);
Exit(0);
}

Binary file not shown.

View File

@@ -2,12 +2,13 @@
#include "fusion-c/header/vdp_graph2.h"
#include <string.h>
static FCB file;
static FCB file; // Initialisatio de la structure pour le systeme de fichiers
unsigned char LDbuffer[2200];
unsigned char LDbuffer[2560]; // Création d'un buffer de 2560 octets (20 lignes en Sc5)
void FT_SetName( FCB *p_fcb, const char *p_name )
void FT_SetName( FCB *p_fcb, const char *p_name ) // Routine servant à vérifier le format du nom de fichier
{
char i, j;
memset( p_fcb, 0, sizeof(FCB) );
@@ -25,9 +26,8 @@ unsigned char LDbuffer[2200];
}
}
void FT_errorHandler(char n, char *name)
void FT_errorHandler(char n, char *name) // Gère les erreurs
{
InitPSG();
Screen(0);
SetColors(15,6,6);
switch (n)
@@ -49,59 +49,34 @@ void FT_errorHandler(char n, char *name)
Exit(0);
}
void FT_SC5Data( char *buffer, int y, int nbl)
{
int i,s;
s=0;
for ( i = 0; i < nbl*128; ++i)
{
Vpoke(y*128+s,buffer[i]);
s=s+1;
}
}
int FT_LoadSc5Image(char *file_name, unsigned int start_Y, char *buffer)
int FT_LoadSc5Image(char *file_name, unsigned int start_Y, char *buffer) // Charge les données d'un fichiers
{
int rd=2304;
int nbl=0;
InitPSG();
int rd=2560;
FT_SetName( &file, file_name );
if(fcb_open( &file ) != FCB_SUCCESS)
{
FT_errorHandler(1, file_name);
return (0);
FT_errorHandler(1, file_name);
return (0);
}
fcb_read( &file, buffer, 7 ); // Skip 7 first bytes of the file
while(rd!=0)
fcb_read( &file, buffer, 7 ); // Skip 7 first bytes of the file
while (rd!=0)
{
rd = fcb_read( &file, buffer, 2176 );
if (rd!=0)
{
nbl=rd/128;
//HMMC(buffer, 0,start_Y,256,nbl ); // Move the buffer to VRAM. 17 lines x 256 pixels from memory
FT_SC5Data( buffer, start_Y, nbl);
start_Y=start_Y+nbl;
}
}
if( fcb_close( &file ) != FCB_SUCCESS )
{
FT_errorHandler(2, file_name);
return (0);
}
rd = fcb_read( &file, buffer, 2560 ); // Read 20 lines of image data (128bytes per line in screen5)
HMMC(buffer, 0,start_Y,256,20 ); // Move the buffer to VRAM.
start_Y=start_Y+20;
}
return(1);
}
void main(void)
{
char a,l,r;
int i;
char mypalette[] = {
char mypalette[] = { // Palette SC5
0, 0,0,0,
1, 2,1,1,
2, 6,5,4,
@@ -122,8 +97,18 @@ void main(void)
Screen(5);
SetColors(15,0,0);
FT_LoadSc5Image("mona.sc5",0,LDbuffer);
Cls();
PutText(0,0,"Page 0-(Push a key to continue)",0); // Page 0
WaitForKey(); // Attend une touche
SetDisplayPage (2); // Page 2
SetActivePage(2);
Cls();
PutText(0,10,"Page 2-(Push a key to continue)",0);
WaitForKey(); // Attend une touche
SetActivePage(0);
FT_LoadSc5Image("mona.sc5",512,LDbuffer); // On charge l'umage
SetSC5Palette((Palette *)mypalette);

BIN
fusion-c/examples/mona.SC5 Normal file

Binary file not shown.

View File

@@ -0,0 +1,216 @@
//
// VRAM COPY tests
// Use FUSION-C 1.1b
//
// Eric Boez
#include <stdio.h>
#include "fusion-c/header/vdp_graph2.h"
#include "fusion-c/header/msx_fusion.h"
/* MSX Memory pages adress
page 0 #0000 - 3FFFF
page 1 #4000 - 7FFFF
page 2 #8000 - BFFFF
page 3 #C000 - FFFFF
*/
unsigned char buffer[5000]; // Set a Memory buffer in RAM at 0x8000
char mystr[10]; // Set a str buffer
void main (void)
{
unsigned char i,j;
Screen(5);
SetColors(1,0,1);
//
// All Test are copying a rectangle box from page 0 to page 1 , 20 Times at different x,y positions
//
//////////////////////////////////// TEST YMMM
SetDisplayPage(0);
SetActivePage(0);
Rect(0,0,255,211,4,255);
WaitKey();
HMMV( 0, 0, 256, 212, #0b01100110); /// HMMV test Fill
PutText (10,180,"HMMV Fill",8);
WaitKey();
Rect(10,10,50,30,211,255);
Rect(10,10,50,30,255,0);
HMMM( 10, 10, 60, 10, 41, 21); // Fast HMMM Copy to different X positions
HMMM( 10, 10, 110, 10, 41, 21);
HMMM( 10, 10, 160, 10, 41, 21);
PutText (14,14,"YMMM1",8);
PutText (64,14,"YMMM2",8);
PutText (114,14,"YMMM3",8);
PutText (164,14,"YMMM4",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
YMMM( 10, 10, 0, 256+10+j*40, 41, 21);
}
SetColors(15,0,1);
PutText (10,200,"YMMM copy test",8);
SetColors(1,0,1);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMMM
SetDisplayPage(0);
SetActivePage(0);
Rect(0,0,255,211,7,255);
Rect(10,10,50,30,115,255);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21);
}
}
SetColors(15,0,1);
PutText (10,200,"HMMM copy test",8);
SetColors(1,0,1);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST LMMM
Rect(0,0,255,211,8,255);
Rect(10,10,50,30,120,255);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21,0);
}
}
SetColors(15,0,1);
PutText (10,200,"LMMM copy test",8);
SetColors(1,0,1);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & LMMC
Rect(0,0,255,211,9,255);
Rect(10,10,50,30,55,255);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC5( 10, 10, 52, 32, buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMC( buffer, 10+i*50, 256+10+j*40, 42, 22, 0 );
}
}
SetColors(15,0,1);
PutText (10,200,"HMCM + LMMC copy test",8);
SetColors(1,0,1);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & HMMC
Rect(0,0,255,211,6,255);
Rect(10,10,50,30,149,255);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC5( 10, 10, 52, 32, &buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMC( &buffer, 10+i*50, 256+10+j*40, 42, 22 );
}
}
SetColors(15,0,1);
PutText (10,200,"HMCM + HMMC copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
Screen(0);
Exit(0);
}

View File

@@ -0,0 +1,266 @@
//
// VRAM COPY tests
// Use FUSION-C 1.1b
//
// Eric Boez
#include <stdio.h>
#include "fusion-c/header/vdp_graph2.h"
#include "fusion-c/header/msx_fusion.h"
/* MSX Memory pages adress
page 0 #0000 - 3FFFF
page 1 #4000 - 7FFFF
page 2 #8000 - BFFFF
page 3 #C000 - FFFFF
*/
unsigned char __at(0x8000) buffer[2500]; // Set a Memory buffer in RAM at 0x8000
char mystr[10]; // Set a str buffer
void BoxFill (int x1, int y1, int x2, int y2, char color, char op )
{
char scmode,sc5col,temp;
scmode=Peek (0xFCAF);
if (scmode == 5 || scmode==6)
{
temp=color;
sc5col=(color << 4);
color=(sc5col | temp);
}
if (op==0)
{
HMMV( x1, y1, x2-x1, y2-y1, color);
}
else
{
LMMV( x1, y1, x2-x1, y2-y1, color, op);
}
}
void main (void)
{
unsigned char i,j,c;
c=1;
Screen(8);
SetColors(255,0,1);
//
// All Test are copying a rectangle box from page 0 to page 1 , 20 Times at different x,y positions
//
//////////////////////////////////// TEST HMMV Test Filling
SetDisplayPage(0);
SetActivePage(0);
Cls();
BoxFill(0,0,255,212,99,0);
for ( i = 0; i < 110; i=i+10)
{
HMMV( i, i, 256-(2*i), 212-(2*i), 45+i);
}
PutText (10,180,"HMMV Fill",8);
WaitKey();
Cls();
//////////////////////////////////// TEST LMMV Test Filling
for (i=0; i<25; i++)
{
LMMV( i*10, 0, 10, 212, 4+i*10, 2); /// LMMV test Fill with LOGICAL_AND
}
PutText (10,180,"LMMV Fill",8);
WaitKey();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST YMMM
BoxFill(0,0,255,212,100,0);
BoxFill(10,10,50,30,211,0);
Rect(10,10,50,30,255,0);
HMMM( 10, 10, 60, 10, 41, 21); // Fast HMMM Copy to different X positions
HMMM( 10, 10, 110, 10, 41, 21);
HMMM( 10, 10, 160, 10, 41, 21);
PutText (14,14,"YMMM1",8);
PutText (64,14,"YMMM2",8);
PutText (114,14,"YMMM3",8);
PutText (164,14,"YMMM4",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
YMMM( 10, 10, 0, 256+10+j*40, 41, 21);
}
PutText (10,200,"YMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMMM
SetDisplayPage(0);
SetActivePage(0);
BoxFill(0,0,255,211,70,0);
BoxFill(10,10,50,30,115,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21);
}
}
PutText (10,200,"HMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST LMMM
BoxFill(0,0,256,212,89,0);
BoxFill(10,10,50,30,120,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21,0);
}
}
PutText (10,200,"LMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & LMMC
BoxFill(0,0,256,212,124,0);
BoxFill(10,10,50,30,55,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC8( 10, 10, 51, 31, buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMC( buffer, 10+i*50, 256+10+j*40, 41, 21, 0 );
}
}
PutText (10,200,"HMCM + LMMC copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & HMMC
BoxFill(0,0,256,212,3,0);
BoxFill(10,10,50,30,150,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC8( 10, 10, 51, 31, &buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMC( &buffer, 10+i*50, 256+10+j*40, 41, 21 );
}
}
PutText (10,200,"HMCM + HMMC copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
Screen(0);
Exit(0);
}

View File

@@ -0,0 +1,268 @@
//
// VDP Comands tests Screen 5
// Use FUSION-C 1.2
//
// Eric Boez
#include <stdio.h>
#include "fusion-c/header/vdp_graph2.h"
#include "fusion-c/header/msx_fusion.h"
/* MSX Memory pages adress
page 0 #0000 - 3FFFF
page 1 #4000 - 7FFFF
page 2 #8000 - BFFFF
page 3 #C000 - FFFFF
*/
unsigned char __at(0x8000) buffer[2500]; // Set a Memory buffer in RAM at 0x8000
char mystr[10]; // Set a str buffer
char FlipBit(char bit)
{
return (!bit);
}
void main (void)
{
unsigned char i,j,c,d;
c=1;
d=1;
Screen(5);
SetColors(15,0,1);
//
// All Test are copying a rectangle box from page 0 to page 1 , 20 Times at different x,y positions
//
//////////////////////////////////// TEST HMMV Test Filling
SetDisplayPage(0);
SetActivePage(0);
Cls();
BoxFill(0,0,255,212,5,0);
for ( i = 0; i < 110; i=i+10)
{
d++;
c=((d << 4) | d);
HMMV( i, i, 256-(2*i), 212-(2*i), c );
}
PutText (10,180,"HMMV Fill",8);
WaitKey();
Cls();
//////////////////////////////////// TEST LMMV Test Filling
for (i=0; i<25; i++)
{
LMMV( i*10, 0, 10, 212, 4+i, 2); /// LMMV test Fill with LOGICAL_AND
}
PutText (10,180,"LMMV Fill",8);
WaitKey();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST YMMM
BoxFill(0,0,255,212,7,0);
BoxFill(10,10,50,30,8,0);
Rect(10,10,50,30,15,0);
HMMM( 10, 10, 60, 10, 41, 21); // Fast HMMM Copy to different X positions
HMMM( 10, 10, 110, 10, 41, 21);
HMMM( 10, 10, 160, 10, 41, 21);
PutText (14,14,"YMMM1",8);
PutText (64,14,"YMMM2",8);
PutText (114,14,"YMMM3",8);
PutText (164,14,"YMMM4",8);
c=1;
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
YMMM( 10, 10, 256+10+j*40, 20, c);
c=FlipBit(c);
}
PutText (10,200,"YMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMMM
SetDisplayPage(0);
SetActivePage(0);
BoxFill(0,0,255,211,9,0);
BoxFill(10,10,50,30,10,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21);
}
}
PutText (10,200,"HMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST LMMM
BoxFill(0,0,256,212,11,0);
BoxFill(10,10,50,30,12,0);
Rect(10,10,50,30,15,0);
PutText (14,14,"LMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21,0);
}
}
PutText (10,200,"LMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & LMMC
BoxFill(0,0,256,212,13,0);
BoxFill(10,10,50,30,14,0);
Rect(10,10,50,30,15,0);
PutText (14,14,"LMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC8( 10, 10, 51, 31, buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMC( buffer, 10+i*50, 256+10+j*40, 41, 21, 0 );
}
}
PutText (10,200,"HMCM + LMMC copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & HMMC
BoxFill(0,0,256,212,3,0);
BoxFill(10,10,50,30,10,0);
Rect(10,10,50,30,15,0);
PutText (14,14,"HMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM( 10, 10, 52, 32, &buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMC( &buffer, 10+i*50, 256+10+j*40, 42, 22 );
}
}
PutText (10,200,"HMCM + HMMC copy test",8);
//////////////////////////////////// TEST Line
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
for (i=0;i<255;i++)
{
Line(128,106,i,0,i,0);
Line(128,106,i,212,20,0);
}
for (i=0;i<212;i++)
{
Line(128,106,0,i,i,0);
Line(128,106,255,i,30,0);
}
PutText (10,200,"Line test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
Screen(0);
Exit(0);
}

Binary file not shown.

View File

@@ -0,0 +1,266 @@
//
// VDP Comands tests Screen 8
// Use FUSION-C 1.2
//
// Eric Boez
#include <stdio.h>
#include "fusion-c/header/vdp_graph2.h"
#include "fusion-c/header/msx_fusion.h"
/* MSX Memory pages adress
page 0 #0000 - 3FFFF
page 1 #4000 - 7FFFF
page 2 #8000 - BFFFF
page 3 #C000 - FFFFF
*/
unsigned char __at(0x8000) buffer[2500]; // Set a Memory buffer in RAM at 0x8000
char mystr[10]; // Set a str buffer
char FlipBit(char bit)
{
return (!bit);
}
void main (void)
{
unsigned char i,j,c;
c=1;
Screen(8);
SetColors(255,0,1);
//
// All Test are copying a rectangle box from page 0 to page 1 , 20 Times at different x,y positions
//
//////////////////////////////////// TEST HMMV Test Filling
SetDisplayPage(0);
SetActivePage(0);
Cls();
BoxFill(0,0,255,212,99,0);
for ( i = 0; i < 110; i=i+10)
{
HMMV( i, i, 256-(2*i), 212-(2*i), 45+i);
}
PutText (10,180,"HMMV Fill",8);
WaitKey();
Cls();
//////////////////////////////////// TEST LMMV Test Filling
for (i=0; i<25; i++)
{
LMMV( i*10, 0, 10, 212, 4+i*10, 2); /// LMMV test Fill with LOGICAL_AND
}
PutText (10,180,"LMMV Fill",8);
WaitKey();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST YMMM
BoxFill(0,0,255,212,100,0);
BoxFill(10,10,50,30,211,0);
Rect(10,10,50,30,255,0);
HMMM( 10, 10, 60, 10, 41, 21); // Fast HMMM Copy to different X positions
HMMM( 10, 10, 110, 10, 41, 21);
HMMM( 10, 10, 160, 10, 41, 21);
PutText (14,14,"YMMM1",8);
PutText (64,14,"YMMM2",8);
PutText (114,14,"YMMM3",8);
PutText (164,14,"YMMM4",8);
c=1;
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
YMMM( 10, 10, 256+10+j*40, 20, c);
c=FlipBit(c);
}
PutText (10,200,"YMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMMM
SetDisplayPage(0);
SetActivePage(0);
BoxFill(0,0,255,211,70,0);
BoxFill(10,10,50,30,115,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21);
}
}
PutText (10,200,"HMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST LMMM
BoxFill(0,0,256,212,89,0);
BoxFill(10,10,50,30,120,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMM",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMM( 10, 10, 10+i*50, 256+10+j*40, 41, 21,0);
}
}
PutText (10,200,"LMMM copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & LMMC
BoxFill(0,0,256,212,124,0);
BoxFill(10,10,50,30,55,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"LMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC8( 10, 10, 51, 31, buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
LMMC( buffer, 10+i*50, 256+10+j*40, 41, 21, 0 );
}
}
PutText (10,200,"HMCM + LMMC copy test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
//////////////////////////////////// TEST HMCM & HMMC
BoxFill(0,0,256,212,3,0);
BoxFill(10,10,50,30,150,0);
Rect(10,10,50,30,255,0);
PutText (14,14,"HMMC",8);
PutText (10,200,"Push a key",8);
WaitKey();
SetDisplayPage(1);
SetActivePage(1);
HMCM_SC8( 10, 10, 51, 31, &buffer, 0 );
for (j=0;j<5;j++)
{
for (i=0;i<4;i++)
{
HMMC( &buffer, 10+i*50, 256+10+j*40, 41, 21 );
}
}
PutText (10,200,"HMCM + HMMC copy test",8);
//////////////////////////////////// TEST Line
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
for (i=0;i<255;i++)
{
Line(128,106,i,0,i,0);
Line(128,106,i,212,20,0);
}
for (i=0;i<212;i++)
{
Line(128,106,0,i,i,0);
Line(128,106,255,i,30,0);
}
PutText (10,200,"Line test",8);
WaitKey();
Cls();
SetDisplayPage(0);
SetActivePage(0);
Cls();
Screen(0);
Exit(0);
}

Binary file not shown.

412
fusion-c/header/g9klib.h Normal file
View File

@@ -0,0 +1,412 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.2 - August 2019. |
| |
| Eric Boez & Fernando Garcia |
| |
| G9klib is Fusion-C Library for GFX9000 Graphic Card |
| |
| This G9KLIB is a port of the ASM G9KLIB by Team Bomba |
| https://www.teambomba.net/gfx9klib.html |
| By Sylvain G. |
\___________________________________________________________/
* (°□°)
*
* This G9KLIB is currently in Beta Version. No manual Available at this time.
*/
#ifndef __G9KLIB_H__
#define __G9KLIB_H__
// Mode select defines for SetScreenMode
// Pattern mode 0 256 212
#define G9MODE_P1 0
// Pattern mode 1 512 212
#define G9MODE_P2 1
// Bitmap mode 1 256 212
#define G9MODE_B1 2
// Bitmap mode 2 384 240
#define G9MODE_B2 3
// Bitmap mode 3 512 212
#define G9MODE_B3 4
// Bitmap mode 4 768 240
#define G9MODE_B4 5
// Bitmap mode 5 640 400 (VGA)
#define G9MODE_B5 6
// Bitmap mode 6 640 480 (VGA)
#define G9MODE_B6 7
// Bitmap mode 7 1024 212 (Undocumented v9990 mode)
#define G9MODE_B7 8
// Stand by mode
#define G9SCR0_STANDBY 192
// Select Bit map mode
#define G9SCR0_BITMAP 128
// Select P1 mode
#define G9SCR0_P2 64
// Select P1 mode
#define G9SCR0_P1 0
// Master Dot clock not divided
#define G9SCR0_DTCLK 32
// Master Dot clock divided by 2
#define G9SCR0_DTCLK2 16
// Master Dot clock divided by 4
#define G9SCR0_DTCLK4 0
// 2 bits/dot
#define G9SCR0_2BIT 0
// 4 bits/dot
#define G9SCR0_4BIT 1
// 8 bits/dot
#define G9SCR0_8BIT 2
// 16 bits/dot
#define G9SCR0_16BIT 3
// Image size = 256
#define G9SCR0_XIM256 0
// Image size = 512
#define G9SCR0_XIM512 4
// Image size = 1024
#define G9SCR0_XIM1024 8
// Image size = 2048
#define G9SCR0_XIM2048 12
// G9MODE_B1 256, 212
// G9MODE_B2 384, 240
// G9MODE_B3 512, 212
// G9MODE_B4 768, 240
// G9MODE_B7 1024,212
#define G9ARG 44
//; Bit defines G9ARG
#define G9ARG_MAJ 1
#define G9ARG_NEG 2
#define G9ARG_DIX 4
#define G9ARG_DIY 8
#define G9LOP 45
#define G9LOP_WCSC 12
#define G9RED 32
#define G9GREEN 1024
#define G9BLUE 1
typedef struct {
int fileHandle; // Dos2 file handle of the openend G9B file
char bitDepth; // 2,4,8 or 16 bit
char colorType; // 0=64 color palette mode,64=256 color fixed ,128=YJK and 192=YUV mode
char nrColors; // Number of colors in palette mode
int width; // object width
int height; // object Height
char compression;// 0 = no compression, other value = compression used
char dataSize[3];// data size (24 bits!) [0] is the less significant byte, [2] is the most significant
} G9B_OBJECT;
typedef struct {
int fileHandle; // Dos2 file handle of the openend VFF file
char name[16]; // vff font name
char width; // width
char height; // height
char pitch; // 0 = Fixed : 1 = Variable (Still unsused)
int dataSize; // Data size
int ptrOffsetTab; // Pointer to a font offset table
int vramOffset; // Pointer to base address of font in vram starting at #70000
char ramFont; // 0 font data in vram, 1 font data in ram
} VFF_OBJECT;
typedef struct {
char y; // sprite y position
char pat; // sprite pattern number
char x; // sprite x position
char attr; // sprite attribute number
} SPRITE_ATTR;
/* Detect presence of the Gfx9000 */
extern unsigned char G9Detect( void );
/* */
extern void G9WriteReg( char, char );
/* Reset and initialize the Gfx9000 */
extern void G9Reset( void );
/* Enable display */
extern void G9DisplayEnable( void );
/* Disable display */
extern void G9DisplayDisable( void );
/* Set screen mode
inputs :
1 ; Mode
2 ; Bit per dot
3 ; Image size
4 ; Interlace
5 ; Palette control register
output :
nothing
*/
extern void G9SetScreenMode( unsigned char , unsigned char , unsigned char , unsigned char , unsigned char );
/* pointer to palette, number of bytes to write*/
extern void G9InitPalette( void *, unsigned char );
/* Write palette data to the Gfx9000
inputs :
1 ; pointer to palette data
2 ; Palette pointer offset
3 ; Number of bytes to write
*/
extern void G9WritePalette( void *, unsigned char, unsigned char );
/* Read palette data from the Gfx9000
inputs :
1 ; pointer to palette data
2 ; Palette pointer offset
3 ; Number of bytes to write
*/
extern void G9ReadPalette( void *, unsigned char, unsigned char );
/* Enable sprites/mouse cursor */
extern void G9SpritesEnable();
/* Disable sprites/mouse cursor */
extern void G9SpritesDisable();
/* Disables all sprites by setting PR1 bit of the sprite attribute */
extern void G9DisableAllSprites();
/* %000xyz0 (not checked)
xyz: bits A17,A16,A15 of VRAM address of the sprite pattern table start
usually =4 (=> address is $10000)*/
extern void G9InitSpritePattern( unsigned char );
/* sprite number (0 to 124) */
extern void G9SetSprite( unsigned char );
/* Set blitter command write mask */
extern void G9SetCmdWriteMask( unsigned int );
/* Set backdrop color
input : backdropcolor */
extern void G9SetBackDropColor( unsigned char );
/* Set blitter command color */
extern void G9SetCmdColor( int );
/* Set command back ground color */
extern void G9SetCmdBackColor( int );
/* */
extern void G9CmdWait( void );
/* */
extern void G9WaitVsync( void );
/* DrawFilledBox left,top,width,height,color */
//extern void G9DrawFilledBox( int *, int );
extern void G9DrawFilledBox( unsigned int, unsigned int, unsigned int, unsigned int, unsigned int );
/* DrawLine left,top,width,height,color */
extern void G9DrawLine( unsigned int, unsigned int, unsigned int, unsigned int, unsigned int );
/* x, y, color */
extern void G9SetPoint( unsigned int, unsigned int, unsigned int );
/*
inputs : int X int Y
output : color
2bpp b7 b6 b5 b4 b3 b2 b1 b0
color code unspecified
4bpp b7 b6 b5 b4 b3 b2 b1 b0
color code unspecified
8bpp b7 b6 b5 b4 b3 b2 b1 b0
color code
16bpp b7 b6 b5 b4 b3 b2 b1 b0
1st byte color code low byte
2nd byte color code high byte
*/
extern int G9GetPoint( unsigned int, unsigned int );
/* Adjust Gfx9000 display
horizontal adjust, vertical adjust
return 0: OK
return 1: Error in horizontal adjust
return 2: Error in vertical adjust
*/
extern unsigned char G9SetAdjust( unsigned char, unsigned char );
/* Set vram write address */
extern void G9SetVramWrite( unsigned char, unsigned int );
/* Set vram read address */
extern void G9SetVramRead( unsigned char, unsigned int );
/* pointer to parameters (format: left,top,width,height) */
extern void G9SetupCopyRamToXY( unsigned int * );
/* pointer to data, Bytes to copy */
extern void G9CopyRamToXY( void *, unsigned int );
/* pointer to parameters (format: left,top,width,height) */
extern void G9SetupCopyXYToRam( void * );
/* pointer to data, Bytes to copy */
extern void G9CopyXYToRam( void *, unsigned int );
/* pointer to bubber, number of bytes to send */
extern void G9CopyRamToVram( void *, int );
/* Pointer to data (format: SourceX,SourceY,DestX,DestY,Width,height) struct G9COPY_XY_XY */
extern void G9CopyXYToXY( void * );
extern void G9InitPatternMode();
/* pointer to pattern data
pattern number
layer number (0=A,1=B)
*/
extern void G9SetPatternData( void *, unsigned int, unsigned char );
/* pointer to pattern data
pattern number
layer number (0=A,1=B) */
extern void G9GetPatternData( void *, unsigned int, unsigned char );
/* pattern number in generator table (on screen patterns 0 to A=8159,B=7679)
pattern number in name table (on screen patterns 0 to 4095)
layer number (0=A,1=B)
*/
extern void G9SetPattern( unsigned int, unsigned int, unsigned char );
/* pattern number in generator table (on screen patterns 0 to A=8159,B=7679)
layer number (0=A,1=B)
return : pattern number in name table (on screen patterns 0 to 4095)
*/
extern int G9GetPattern( unsigned int, unsigned char );
/* not finished !
pointer to data (format: SrcAddress,DestAddress,NrBytes)
*/
extern void G9PCopyVramToVram( void * );
/* not finished ! */
extern void G9PCopyVramToVramARegister( void * );
extern void G9EnableLayerA();
extern void G9EnableLayerB();
extern void G9DisableLayerA();
extern void G9DisableLayerB();
/* ram address, destination tile, number of tiles */
extern void G9PrintTilesA( void *, unsigned int, unsigned char );
/* ram address, destination tile, number of tiles */
extern void G9PrintTilesB( void *, unsigned int, unsigned char );
/* interrupt function
interruption line
*/
extern void G9SetIntLine( unsigned int );
/* inputs :
1 ; 0 = load data in vram, 1 = load font data in ram
2 ; font name pointer
3 ; VFFOBJECT pointer
output :
error code. O if Ok
*/
extern unsigned char G9OpenVff( unsigned char, unsigned int *, void * );
/* inputs :
1 : Pointer to VFF object
2 : Pointer to font offset table, if it s zero it s not loaded
3 : Pointer to buffer for loading, or if it s a ram font the destination address
output :
error code. O if Ok
*/
extern unsigned char G9LoadFont( void *, void *, void * );
/* inputs : Pointer to VFF object */
extern void G9SetFont( void * );
/* inputs :
1 ; Pointer to image file name
2 ; Pointer to G9B header data
output :
error code. O if Ok
*/
extern unsigned char G9OpenG9B( void *, void * );
/*
1 : Pointer to G9B object struct
2 : Pointer to load buffer
3 : Size of load buffer
4 : Destination X
5 : Destination Y
6 : Palette offset in bytes. Only valid with palette modes. If a = 255 palette not loaded
*/
extern unsigned char G9ReadG9B( void *, void *, unsigned int, unsigned int, unsigned int, unsigned char );
/*
1 : Pointer to G9B/VFF object
*/
extern unsigned char G9Close( void * );
extern void G9PrintStringVram( void *, unsigned int, unsigned int );
/* pos x, pos y */
extern void G9Locate( unsigned int, unsigned int );
/* Set scroll mode
input: 0 = Roll by image space size
1 = Roll by 256 lines
2 = Roll by 512 lines
*/
extern void G9SetScrollMode( unsigned char );
/* Set scroll X Layer A
input : number of pixels to scroll X */
extern void G9SetScrollX( int );
/* Set scroll Y Layer A
input : number of pixels to scroll Y */
extern void G9SetScrollY( int );
/* Set scroll X Layer B
input : number of pixels to scroll X */
extern void G9SetScrollXB( int );
/* Set scroll Y Layer B
input : number of pixels to scroll Y */
extern void G9SetScrollYB( int );
#endif

View File

@@ -0,0 +1,296 @@
/*
GR8NET internetworking adapter
MSX TCP-IP UNAPI implementation version 1.0 for Fusion-C / header file
Initial release by Eugeny Brychkov 2019-05-31
License: keeps the same as TCP/IP UNAPI v.1.0 by Konamiman, plus requirement
to cite original author when this work or its derivatives are used
The workflow is the following:
1. Perform enumeration of the implementations using tcpip_enumerate(), it will reset active_implementation to 0. The routine
will check for maximum 4 implementations (e.g. 4 GR8NETs installed in the system), and return this value;
2. You set appropriate implementation number in the active_implementation, and work with this implementation getting its
capabilities, network properties etc.
3. If you need to work with another implementation, change active_implementation, and then all calls will be performed
to the respective implementation. Note that structures must be different for each connection-implementation as they
are socket-specific. Any UNAPI-related routine will return integer error code
*/
/* TCP/IP UNAPI management */
extern int tcpip_enumerate(void); /* performs checking for installed implementation and gets calling information
for 4 of them, returns number of implementations (max 4). Resets
active_implementation to 0 */
extern int active_implementation; /* currently active implementation: 0 to 3, being reset to 0 by tcpip_enumerate() */
extern int implementation_count; /* number of available implementations. Populated by tcpip_enumerate(),
intially set as 0 */
extern int ram_helper_call_address; /* RAM helper jump table address in CPU bank 3, populated by tcpip_enumerate() */
extern int tcpip_impl_getinfo(char** impl_string, /* UNAPI_GET_INFO: Obtain the implementation name and version. The implementation */
int* api_spec_version, /* is identified by the active_implementation (0..3). If active_implementation number */
int* api_impl_version); /* is wrong (not within 0..number of implementations-1) then ERR_INV_IMPL is returned */
/* Error codes, integer values */
#define ERR_OK 0 /* Operation completed successfully */
#define ERR_NOT_IMP 1 /* Capability not implemented */
#define ERR_NO_NETWORK 2 /* No network connection available */
#define ERR_NO_DATA 3 /* No incoming data available */
#define ERR_INV_PARAM 4 /* Invalid input parameter */
#define ERR_QUERY_EXISTS 5 /* Another query is already in progress */
#define ERR_INV_IP 6 /* Invalid IP address */
#define ERR_NO_DNS 7 /* No DNS servers are configured */
#define ERR_DNS 8 /* Error returned by DNS server */
#define ERR_NO_FREE_CONN 9 /* No free connections available */
#define ERR_CONN_EXISTS 10 /* Connection already exists */
#define ERR_NO_CONN 11 /* Connection does not exists */
#define ERR_CONN_STATE 12 /* Invalid connection state */
#define ERR_BUFFER 13 /* Insufficient output buffer space */
#define ERR_LARGE_DGRAM 14 /* Datagram is too large */
#define ERR_INV_OPER 15 /* Invalid operation */
#define ERR_INV_IMPL 255 /* Invalid implementation set by the active_implementation variable */
/* Network media states */
#define MEDIA_STATE_CLOSED 0
#define MEDIA_STATE_OPENING 1
#define MEDIA_STATE_OPEN 2
#define MEDIA_STATE_CLOSING 3
#define MEDIA_STATE_UNKNOWN 255
/* TCP communication states */
#define TCP_STATE_UNKNOWN 0
#define TCP_STATE_LISTEN 1
#define TCP_STATE_SYN_SENT 2
#define TCP_STATE_SYN_RECEIVED 3
#define TCP_STATE_ESTABLISHED 4
#define TCP_STATE_FIN_WAIT_1 5
#define TCP_STATE_FIN_WAIT_2 6
#define TCP_STATE_CLOSE_WAIT 7
#define TCP_STATE_CLOSING 8
#define TCP_STATE_LAST_ACK 9
#define TCP_STATE_TIME_WAIT 10
/* TCP communication close reasons */
#define TCP_CLOSER_UNKNOWN 0
#define TCP_CLOSER_NO_CONN 1 /* This connection has never been used since the implementation was initialized */
#define TCP_CLOSER_CLOSED 2 /* The TCPIP_TCP_CLOSE method was called */
#define TCP_CLOSER_ABORTED 3 /* The TCPIP_TCP_ABORT method was called */
#define TCP_CLOSER_RST 4 /* A RST segment was received (the connection was refused or aborted by the remote host) */
#define TCP_CLOSER_US_TOUT 5 /* The user timeout expired */
#define TCP_CLOSER_CE_TOUT 6 /* The connection establishment timeout expired */
#define TCP_CLOSER_LOST 7 /* Network connection was lost while the TCP connection was open */
#define TCP_CLOSER_UNREACH 8 /* ICMP "Destination unreachable" message received */
/* Connection types */
#define CONNTYPE_TRANSIENT 0
#define CONNTYPE_RESIDENT 1
/* Operation definitions for tcpip_config_ping */
#define CONFIG_PING_GET 0
#define CONFIG_PING_SET 1
typedef struct {
char proto_used; /* Link level protocol used */
int feat_flags; /* Features flags */
int capab_flags; /* Capabilities flags
*/
} tcpip_unapi_capab_flags_llproto;
typedef struct {
char max_tcp_conn; /* Maximum simultaneous TCP connections supported */
char max_udp_conn; /* Maximum simultaneous UDP connections supported */
char max_raw_conn; /* Maximum simultaneous raw IP connections supported */
char free_tcp_conn; /* Free TCP connections currently available */
char free_udp_conn; /* Free UDP connections currently available */
char free_raw_conn; /* Free raw IP connections currently available */
} tcpip_unapi_capab_connections;
typedef struct {
int max_outgoing_dtg_size; /* Maximum outgoing datagram size supported */
int max_incoming_dtg_size; /* Maximum incoming datagram size supported */
} tcpip_unapi_capab_dtg_sizes;
typedef struct {
char local_ip[4]; /* Local IP address */
char peer_ip[4]; /* Peer IP address */
char subnet_mask[4]; /* Subnet mask */
char gateway_ip[4]; /* Default gateway */
char dns_ip_pri[4]; /* Primary DNS server IP address */
char dns_ip_sec[4]; /* Secondary DNS server IP address */
} tcpip_unapi_ip_info;
typedef struct {
char dest_ip[4]; /* +0 (4): IP address of the destination machine */
char ttl; /* +4 (1): TTL for the datagram */
int icmp_id; /* +5 (2): ICMP identifier */
int seq_number; /* +7 (2): ICMP sequence number */
int data_length; /* +9 (2): Data length, 0 to maximum datagram size - 28 */
} tcpip_unapi_echo;
typedef struct {
char flags;
char state; /* note that state (reg B) and substate (reg C) have different meaning for tcpip_dns_q */
char substate; /* and tcpip_dns_s. Please refer to the UNAPI description for more information */
char host_ip[4]; /* Resolved IP address (only if no error occurred and state of 1 or 2 is returned)
*/
} tcpip_unapi_dns_q;
typedef struct {
char num_of_pend_dtg; /* Number of pending incoming datagrams */
int size_of_oldest_dtg; /* Size of oldest pending incoming datagram (data part only) */
int port_number; /* Local port number */
} tcpip_unapi_udp_state;
typedef struct {
char dest_ip[4]; /* +0 (4): Destination IP address */
int dest_port; /* +4 (2): Destination port */
int data_length; /* +6 (2): Data length to send or actual data length when receiving) */
} tcpip_unapi_udp_dtg_parms;
typedef struct {
char dest_ip[4]; /* +0 (4): Remote IP address (0.0.0.0 for unespecified remote socket) */
int dest_port; /* +4 (2): Remote port (ignored if unespecified remote socket) */
int local_port; /* +6 (2): Local port, 0FFFFh for a random value */
int user_timeout; /* +8 (2): Suggestion for user timeout value */
char flags; /* +10 (1): Flags */
char conn_state; /* +11 (1): Connection state updated by TCPIP_TCP_STATE */
char close_reason; /* +12 (1): Close reason (only if ERR_NO_CONN is returned) by TCPIP_TCP_STATE */
int incoming_bytes; /* +13 (2): Number of total available incoming bytes updated by TCPIP_TCP_STATE and TCPIP_TCP_RCV */
int urgent_incoming_bytes; /* +15 (2): Number of urgent available incoming bytes updated by TCPIP_TCP_STATE and TCPIP_TCP_RCV */
int send_free_bytes; /* +17 (2): Available free space in the output buffer (0FFFFh = infinite) updated by TCPIP_TCP_STATE */
} tcpip_unapi_tcp_conn_parms;
typedef struct {
char ip[4]; /* +0 (4): Destination IP address */
int data_length; /* +4 (2): Data length */
} tcpip_unapi_ipraw_parms;
typedef struct {
char proto_code; /* +0 (1): Associated protocol code */
int num_of_pend_dtg; /* +2 (2): Number of pending incoming datagrams */
int size_of_oldest_dtg; /* +4 (2): Size of the oldest pending incoming datagram */
} tcpip_unapi_ipraw_state;
/***** Network capabilities and state routines *****/
/* TCPIP_GET_CAPAB: Get information about the TCP/IP capabilities/features/link level protocol,
connection pool and datagram sizes */
extern int tcpip_get_capab_flags_llproto(tcpip_unapi_capab_flags_llproto* capab_flags_llproto);
extern int tcpip_get_capab_connections(tcpip_unapi_capab_connections* capab_connections);
extern int tcpip_get_capab_dtg_sizes(tcpip_unapi_capab_dtg_sizes* capab_dtg_sizes);
/* TCPIP_GET_IPINFO: Get IP address. Always returns ERR_OK, if was unable to acquire
specific IP address respective field is left as 0.0.0.0 */
extern int tcpip_get_ipinfo(tcpip_unapi_ip_info* ip_info);
/* TCPIP_NET_STATE: Get network state
*/
extern int tcpip_net_state(int* net_state);
/***** ICMP routines *****/
/* TCPIP_SEND_ECHO: Send ICMP echo message (PING)
. All values of the structure
must be populated before performing the call */
extern int tcpip_send_echo(tcpip_unapi_echo* echo_param_block);
/* TCPIP_RCV_ECHO: Retrieve ICMP echo response message. The call populates
the structure at the address passed
*/
extern int tcpip_rcv_echo(tcpip_unapi_echo* echo_param_block);
/***** Host name resoultion routines *****/
/* TCPIP_DNS_Q: Start a host name resolution query. Flags field in the structure
must be defined before performing the call:
- bit 0: Only abort the query currently in progress, if there is any (other flags and registers are then ignored)
- bit 1: Assume that the passed name is an IP address, and return an error if this is not true
- bit 2: If there is a query in progress already, do NOT abort it and return an error instead */
extern int tcpip_dns_q(char* hostname, tcpip_unapi_dns_q* dns_q);
/* TCPIP_DNS_S: Obtains the host name resolution process state and result. Flags field
in the structure must be defined perform performing the call:
- bit 0: Clear any existing result or error condition after the execution (except if there is a query in progress) */
extern int tcpip_dns_s(tcpip_unapi_dns_q* dns_q);
/***** UDP protocol related routines
*****/
/* TCPIP_UDP_OPEN: Open a UDP connection */
extern int tcpip_udp_open(int port_number, int conn_lifetime, int* conn_number);
/* TCPIP_UDP_CLOSE: Close a UDP connection */
extern int tcpip_udp_close(int conn_number);
/* TCPIP_UDP_STATE: Get the state of a UDP connection. Populates local port number,
number of pending datagrams and size of oldest pending datagram fields */
extern int tcpip_udp_state(int conn_number, tcpip_unapi_udp_state* udp_state);
/* TCPIP_UDP_SEND: Send an UDP datagram. Destination IP address, destination
port number and data size fields must be populated */
extern int tcpip_udp_send(int conn_number, tcpip_unapi_udp_dtg_parms* dtg_parms,
char* data);
/* TCPIP_UDP_RCV: Retrieve an incoming UDP datagram. Populates IP address,
source port and actual received data length fields */
extern int tcpip_udp_rcv(int conn_number, char* buffer, int dtg_maxsize,
tcpip_unapi_udp_dtg_parms* dtg_parms);
/***** TCP protocol related routines *****/
/* TCPIP_TCP_OPEN: Open a TCP connection. Remote IP address, port numbers,
timeout value and flags fields must be populated before performing the call */
extern int tcpip_tcp_open(tcpip_unapi_tcp_conn_parms* tcp_conn_params, int* conn_number);
/* TCPIP_TCP_CLOSE: Close a TCP connection */
extern int tcpip_tcp_close(int conn_number);
/* TCPIP_TCP_ABORT: Abort a TCP connection
*/
extern int tcpip_tcp_abort(int conn_number);
/* TCPIP_TCP_STATE: Get the state of a TCP connection. Puts information into connection state,
close reason, both incoming and free bytes fields. It will also put IP address and port
numbers in */
extern int tcpip_tcp_state(int conn_number, tcpip_unapi_tcp_conn_parms* tcp_conn_params);
/* TCPIP_TCP_SEND: Send data a TCP connection. Flags field must be defined
beform performing the call (bit 0: Send the data PUSHed; bit 1: The data is urgent) */
extern int tcpip_tcp_send(int conn_number, char* data, int data_length, int flags);
/* TCPIP_TCP_RCV: Receive data from a TCP connection. Updates both received byte numbers
within the structure */
extern int tcpip_tcp_rcv(int conn_number, char* buffer, int maxsize,
tcpip_unapi_tcp_conn_parms* tcp_conn_params);
/* TCPIP_TCP_FLUSH: Flush the output buffer of a TCP */
extern int tcpip_tcp_flush(int conn_number);
/***** Raw IP connections related routines
*****/
/* TCPIP_RAW_OPEN: Open a raw IP connection. IPRAW protocol list is here:
http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml */
extern int tcpip_ipraw_open(int protocol_number, int conn_lifetime, int* conn_number);
/* TCPIP_RAW_CLOSE: Close a raw IP connection */
extern int tcpip_ipraw_close(int conn_number);
/* TCPIP_RAW_STATE: Get the state of a raw IP connection */
extern int tcpip_ipraw_state(int conn_number, tcpip_unapi_ipraw_state* ipraw_state);
/* TCPIP_RAW_SEND: Send a raw IP datagram. Structure passed must contain
destination IP address and data size set before calling */
extern int tcpip_ipraw_send(int conn_number, char* data,
tcpip_unapi_ipraw_parms* ipraw_params);
/* TCPIP_RAW_RCV: Retrieve an incoming raw IP datagram
*/
extern int tcpip_ipraw_rcv(int conn_number, char* buffer, int maxsize,
tcpip_unapi_ipraw_parms* ipraw_params);
/***** Configuration related routines*****/
/* TCPIP_CONFIG_AUTOIP: Enable or disable the automatic IP addresses retrieval */
extern int tcpip_config_autoip_get(char* ip_mode);
extern int tcpip_config_autoip_set(char ip_mode);

View File

@@ -0,0 +1,48 @@
; .ifndef MACROS_INC
; .define MACROS_INC
;add A to HL
.macro ADD_HL_A
add a,l
ld l,a
jr nc,jpahl
inc h
jpahl:
.endm
; .endif
; macro to get a bit from the bitstream
; carry if bit is set, nocarry if bit is clear
; must be entered with second registerset switched in!
.macro GET_BIT_FROM_BITSTREAM ?.done
add a,a ; shift out new bit
jp nz,.done ; if remaining value isn't zere, we're done
ld a,(hl) ; get 8 bits from bitstream
inc hl ; increase source data address
rla ; (bit 0 will be set!!!!)
.done:
.endm
.macro LD_A_IXL
.db 0xDD,0x7D ; LD A,IXL
.endm
.macro LD_A_IXH
.db 0xDD,0x7C ; LD A,IXH
.endm
.macro LD_A_IYL
.db 0xFD,0x7D ; LD A,IYL
.endm
.macro LD_A_IYH
.db 0xFD,0x7C ; LD A,IXH
.endm
.macro LD_E_IYL
.db 0xFD,0x5D ; LD E,IYL
.endm

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.02 - 01-02-2019 |
| V1.2 - August -2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -25,16 +25,30 @@
#define NULL (void *)0
#endif
//Logical operators
//
// | or
// & and
// ^ xor
// >> Right Shifting
// << Left shifting
//
// Logical operators not implemented in C but must be programmed
// nor = ~(a|b);
// nand = ~(a&b);
#ifndef __MSX_FUSION__
#define __MSX_FUSION__
// Alias for deleted or renamed functions from V1.0 to 1.1, Trying to keep compatibility between versions 1.0 and 1.1
// Alias for deleted or renamed functions from V1.0 to 1.2, Trying to keep compatibility between versions 1.0 and 1.1 's source codes
#define WaitForKey WaitKey
#define KeyboardHit Inkey
#define Getcon Getche
#define EnableInterupt EnableInterrupt
#define DisableInterupt DisableInterrupt
#define HMCM_SC5 HMCM
#define Rect BoxLine
/// Fusion C ...
#define FCB_SUCCESS 0x00 /* return code */
@@ -84,8 +98,17 @@
#define UNPRESSED 0
#define PRESSED 255
#define MousePort1 0x9310
#define MousePort2 0xEC20
#define MousePort1 0x1310
#define MousePort2 0x6C20
// Structure for ReadMouseTo output data
typedef struct {
signed char dx;
signed char dy;
unsigned char lbutton;
unsigned char rbutton;
} MOUSE_DATA;
//Logical operations (OP) for Graphic Function
@@ -122,6 +145,11 @@ char Getche (void); // read and display char from console
void PrintChar (char c); // display char
void Locate (char x, char y); // set cursor to x,y
void PrintDec (int num); // displays signed integer value -32768 to 32767 (larges code)
void PrintHex (unsigned int num); // Print Hexadecimal representation of the Int variable passed
void PrintString(char* str); // Same as Print
void PutCharHex(char c); // Print Hexadecimal representation of the char variable passed
int CheckBreak(void); // Check CTRL-STOP. returns 0 if CTRL-STOP was not pressed, -1 otherwise
/* --------------------------------------------------------- */
/* miscellaneous functions */
@@ -142,7 +170,9 @@ void RleWBToRam (unsigned int *RamSource, unsigned int *RamDest); // RLE De
/* Joystick functions */
unsigned char JoystickRead(char joyNumber); // Read Joystick Port (joynumber)
unsigned char TriggerRead(char TriggerNumber); // Read Button state (Joynnmber)
unsigned int MouseRead(char MousePort); // Read Mouse Offset x and y
unsigned int MouseRead(int MousePort); // Read Mouse Offset x and y
void MouseReadTo(unsigned char MousePort, MOUSE_DATA *md); // Read Mouse Offset x and y, mouse button and return to the MOUSE_DATA Structure
/* --------------------------------------------------------- */
/* I/O port functions */
@@ -212,6 +242,8 @@ int StrPosChr( char *adr, char c ); // returns the last i, for which
void StrLeftTrim( char *adr ); // removes left spaces
void StrRightTrim( char *adr ); // removes right spaces
void StrReplaceChar( char *adr, char c, char nc ); // replaces all chars c to nc in string adr
char* StrReverse(char *str);
char* Itoa(int num, char* str, int base);
/* --------------------------------------------------------- */
@@ -424,5 +456,5 @@ JoystickRead
/* --------------------------------------------------------- */
/* FUSION-C Version tag */
static const unsigned char Done_Version[]="Made with FUSION-C 1.1 eb";
static const unsigned char Done_Version[]="Made with FUSION-C 1.2 (ebsoft)";
#endif

View File

@@ -8,24 +8,26 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.1b - August 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| vdp_graph2.h : Drawing and graphic functions for MSX2 |
| |
| Using BIOS only. Very basis, small code. |
| |
| |
\___________________________________________________________/
* (°□°)
* Most original code from SOLID MSX C - (c) 1997
* Some original code from SOLID MSX C - (c) 1997
* SDCC port 2015 by ?
* Some optimisation by BitVision (2019) for FUSION V1
* New functions and commands implementation Sylvain Cregut & Eric Boez for Fusion-c 1.1b
*
* ----------------------------------------------------------------------------
* | SCREEN 5 256 (horizontal) x 212 (vertical) dots |
* | 16 colours can be displayed at the same time |
* | each of 16 colours can be selected from 512 colours|
* | Command: high speed graphic by VDP command available |
* | Command: high speed graphic by VDP command available |
* | Memory requirements: 32kB for screen - 6A00H bytes |
* | (4 bits x 256 x 212) |
* ----------------------------------------------------------------------------
@@ -35,7 +37,7 @@
* | (Only 212 high are displayes) |
* | 256 colours can be displayed at the same time |
* | each color is unique and can't be changed (0 to 255|
* | Command: high speed graphic by VDP command available |
* | Command: high speed graphic by VDP command available |
* | Memory requirements: 64K from 0H to FFFFH for |
* | each of the 2 available pages |
* | (8 bits x 256 x 256) |
@@ -50,9 +52,9 @@
/* Palette */
typedef struct {
unsigned char colour; // colour number 0..15
unsigned char R; // 0..7 red brightness
unsigned char G; // 0..7 green brightness
unsigned char B; // 0..7 blue brightness
unsigned char R; // 0..7 red brightness
unsigned char G; // 0..7 green brightness
unsigned char B; // 0..7 blue brightness
} ColRGB;
typedef struct {
@@ -60,73 +62,70 @@ typedef struct {
} Palette;
int vMSX( void ); // 1-MSX1 , 2-MSX2 */
void WriteScr( unsigned int addr_from ); // Whole SC5 RAM <=> VRAM dumb copy (0x6A00 bytes) Writes screen from RAM memory address to VRAM, very dumb one time way, use HMMM! */
void ReadScr( unsigned int addr_to ); // Reads SC5 from VRAM to memory address, very dumb one time way, use HMMM! */
void SetSC5Palette (Palette *palette); // Set colors defined in given table
void RestoreSC5Palette ( void ); // Sets default MSX palette
/* PAGE 0 operations for X=0..255,Y=0..211 do not use for outside regions (16-bit AHL), then use smart fLMMM */
extern int vMSX( void ); // 1-MSX1 , 2-MSX2 */
extern void WriteScr( unsigned int addr_from ); // Whole SC5 RAM <=> VRAM dumb copy (0x6A00 bytes) Writes screen from RAM memory address to VRAM, very dumb one time way, use HMMM! */
extern void ReadScr( unsigned int addr_to ); // Reads SC5 from VRAM to memory address, very dumb one time way, use HMMM! */
extern void SetSC5Palette (Palette *palette); // Set colors defined in given table
extern void RestoreSC5Palette ( void ); // Sets default MSX palette
extern void Pset( int X, int Y, int colour, int OP ); /* puts pixel in (X,Y), logical OP=0 (just copy) sends data to VDP chip directly */
extern void PsetXY( int X, int Y, int colour ); /* method 2 by rst 30h, writes in VRAM */
extern int Point( int X, int Y ); /* gets colour 0..15 of pixel at (X,Y) */
extern int pgetXY( int X, int Y ); /* method 2 by rst 30h */
extern void Line( int X1, int Y1, int X2, int Y2, int colour, int OP ); /* draws line (X,Y)-(X2,Y2), with logical operation*/
extern void Rect( int X1, int Y1, int X2, int Y2, int colour, int OP ); /* draws rectangle (X,Y)-(X2,Y2), with logical operation, fills if OP is FILL_ALL */
extern void Paint( int X, int Y, int colour, int border_colour ); /* Paint for small regions. Split them if large. It is not the BASIC-subROM paint! Kind of bugPaint. Requires large stack of memory, slower than any image processing. */
extern void Draw( char *drawcommands ); /* Remake of BASICs "draw" with original commands (except A,X) syntax. */
extern char Point( int X, int Y ); /* gets colour 0..15 of pixel at (X,Y) */
extern char PgetXY( int X, int Y ); /* method 2 by rst 30h */
extern void Line( int x1, int y1, int x2, int y2, char color, char OP ); /* draws line (X1,Y)1-(X2,Y2), with logical operation*/
extern void Paint( int X, int Y, int colour, int border_colour ); /* Paint for small regions. Split them if large. It is not the BASIC-subROM paint! Kind of bugPaint. Requires large stack of memory, slower than any image processing. */
extern void Draw( char *drawcommands ); /* Remake of BASICs "draw" with original commands (except A,X) syntax. */
extern void BoxFill (int x1, int y1, int x2, int y2, char color, char op ); /* draws a filled rectangle (X1,Y1)-(X2,Y2), with logical operation and color */
extern void BoxLine( int x1, int y1, int x2, int y2, char color, char OP ); /* draws rectangle (X1,Y1)-(X2,Y2), with logical operation */
/* VDP COMMANDS
Hight speed graphic commands for the VDP.
*/
extern void HMMC( void *pixeldatas, int X, int Y, int DX, int DY ); // High speed copy from RAM buffer to VRAM (size = DX*DY), X=0..255,Y=0..211
extern void LMMC( void *pixeldatas, int X, int Y, int DX, int DY, unsigned char OP ); // Logical copy from RAM buffer to VRAM (size = DX*DY), X=0..255,Y=0..211
extern void HMCM( int X1, int Y1, int X2, int Y2, void *tobuffer, unsigned char OP ); // High speed rectangle (X1,Y1)-(X2,Y2) copying from VRAM to RAM buffer, no logical feature
extern void HMCM_SC8( int X1, int Y1, int X2, int Y2, void *tobuffer, unsigned char OP ); // High speed rectangle (X1,Y1)-(X2,Y2) copying from VRAM to RAM buffer, no logical feature
extern void LMMM( int XS, int YS, int XT, int YT, int DX, int DY, unsigned char OP ); // High speed copy rectangle image with logical OP from VRAM to VRAM at (Xt,Yt) position
extern void HMMM( int XS, int YS, int XT, int YT, int DX, int DY); // High speed copy rectangle image from VRAM to VRAM at (Xt,Yt) position
extern void YMMM( int XS, int YS, int DY, int NY, char DiRX); // High speed copy of a part of iage to another Y position (DY) Block to move start at XS,YS, is NY pixels hight, and end at x=255 or x=0 depending of parameter DirX 1 or 0
extern void HMMV( int XS, int YS, int DX, int DY, char COL); // High speed fill of a reactangle box
extern void LMMV( int XS, int YS, int DX, int DY, char COL, unsigned char OP); // High speed fill of a reactangle box with logical operation
/* Fast RAM <=> VRAM operations */
//updated by (BTV) Bitvision Software 2018
// Now Y & height could be greater than 255
extern void HMMC( void *pixeldatas, int X, int Y, int DX, int DY ); /* High speed copy from RAM buffer to VRAM (size = DX*DY), X=0..255,Y=0..211 */
extern void HMCM( int X1, int Y1, int X2, int Y2, void *tobuffer ); /* High speed rectangle (X1,Y1)-(X2,Y2) copying from VRAM to RAM buffer, no logical feature */
extern void HMCM_SC8( int X1, int Y1, int X2, int Y2, void *tobuffer ); /* High speed rectangle (X1,Y1)-(X2,Y2) copying from VRAM to RAM buffer, no logical feature */
extern void LMMM( int X, int Y, int DX, int DY, int Xt, int Yt, int OP ); /* High speed copy with logical OP from VRAM to VRAM at (Xt,Yt) position */
/*
High speed far copy with logical OP from VRAM to VRAM
VDP High speed commands are using the global system coordonates to adress the full 128KB of VRAM
To use all 128Kb VRAM, use (0,0)-(255,1023) coordinates and function fLMMM
Visible is memory block of active page. Hide image parts outside.
; Coordinate system of VRAM
; pages and memory blocks (32kb)
; (SCREEN 5)
; ------------------------------ 00000H
; | (0,0) (255,0) | |
; | Page 0 | |
; | (0,255) (255,255) | | Sprites reside 7400 - 7FFF
; ------------------------------ 08000H
; | (0,256) (255,256) | |
; | Page 1 | |
; | (0,511) (255,511) | |
; ------------------------------ 10000H
; | (0,512) (255,512) | |
; | Page 2 | |
; | (0,767) (255,767) | |
; ------------------------------ 18000H
; | (0,768) (255,768) | |
; | Page 3 | |
; | (0,1023) (255,1023) | |
; ------------------------------ 1FFFFH
(SCREEN 5) (SCREEN 6)
------------------------------ 00000H ------------------------------
| (0,0) (255,0) | | | (0,0) (511,0) |
| Page 0 | | | Page 0 |
| (0,255) (255,255) | | | (0,255) (511,255) |
|----------------------------| 08000H |----------------------------|
| (0,256) (255,256) | | | (0,256) (511,256) |
| Page 1 | | | Page 1 |
| (0,511) (255,511) | | | (0,511) (511,511) |
|----------------------------| 10000H |----------------------------|
| (0,512) (255,512) | | | (0,512) (511,512) |
| Page 2 | | | Page 2 |
| (0,767) (255,767) | | | (0,767) (511,767) |
|----------------------------| 18000H |----------------------------|
| (0,768) (255,768) | | | (0,768) (511,768) |
| Page 3 | | | Page 3 |
| (0,1023) (255,1023) | | | (0,1023) (511,1023) |
------------------------------ 1FFFFH ------------------------------
When using fLMMM then we work on coordinates level, not addressing.
fHMMM copies VRAM rectangle(X,Y)-(X+DX,X+DY) TO VRAM (X2,Y2)
----------------------------------------------------------
| Command name | Destination | Source | Units | Mnemonic |
----------------------------------------------------------
| | VRAM | CPU | bytes | HMMC |
| High speed | VRAM | VRAM | bytes | YMMM |
| move | VRAM | VRAM | bytes | HMMM |
| | VRAM | VDP | bytes | HMMV |
----------------------------------------------------------
| | VRAM | CPU | dots | LMMC |
| Logical | CPU | VRAM | dots | LMCM |
| move | VRAM | VRAM | dots | LMMM | default
| | VRAM | VDP | dots | LMMV |
----------------------------------------------------------
(SCREEN 8) (SCREEN 7)
------------------------------ 00000H ------------------------------
| (0,0) (255,0) | | | (0,0) (511,0) |
| Page 0 | | | Page 0 |
| (0,255) (255,255) | | | (0,255) (511,255) |
|----------------------------| 10000H |----------------------------|
| (0,256) (255,256) | | | (0,256) (511,256) |
| Page 1 | | | Page 1 |
| (0,511) (255,511) | | | (0,511) (511,511) |
------------------------------ 1FFFFH ------------------------------
*/
// (a) LOP to "or"|: operations by code.
#define opHMMC 0xF0
@@ -140,8 +139,6 @@ fHMMM copies VRAM rectangle(X,Y)-(X+DX,X+DY) TO VRAM (X2,Y2)
#define DIX_RIGHT 0
#define DIY_DOWN 0
// (b) DI to "or"|: scrolling backwards case only, X,Y,X2,Y2 should +DX,+DY
#define DIX_LEFT 4
#define DIY_UP 8

1290
fusion-c/include/g9klib.rel Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,473 @@
XL2
H 4 areas 27 global symbols
S .__.ABS. Def0000
A _CODE size 54F flags 0 addr 0
S _tcpip_config_ping_get Def04B2
S _tcpip_ipraw_state Def0424
S _tcpip_get_ipinfo Def01A3
S _tcpip_send_echo Def01FC
S _tcpip_config_ttltos_set Def04CD
S _tcpip_ipraw_send Def044E
S _tcpip_get_capab_flags_llproto Def0139
S _tcpip_config_ip Def04FC
S _tcpip_config_ping_set Def04A0
S _tcpip_tcp_rcv Def03C8
S _tcpip_udp_rcv Def02FE
S _tcpip_ipraw_open Def040E
S _tcpip_tcp_close Def02A1
S _tcpip_impl_getinfo Def00CF
S _tcpip_tcp_abort Def035B
S _tcpip_udp_close Def02A4
S _tcpip_get_capab_dtg_sizes Def0182
S _tcpip_config_autoip_get Def0522
S _tcpip_enumerate Def005C
S _tcpip_tcp_state Def036B
S _tcpip_net_state Def01E1
S _tcpip_tcp_flush Def03FE
S _tcpip_udp_state Def02BA
S _tcpip_rcv_echo Def0210
S _tcpip_ipraw_rcv Def0469
S _tcpip_tcp_send Def03A7
S _tcpip_config_autoip_set Def053D
S _tcpip_udp_send Def02E3
S _tcpip_dns_q Def021E
S _tcpip_dns_s Def025B
S _tcpip_tcp_open Def033A
S _tcpip_ipraw_close Def029E
S _tcpip_get_capab_connections Def015D
S _tcpip_udp_open Def0284
S _tcpip_config_ttltos_get Def04DF
A _INITIALIZED size 26 flags 0 addr 0
S _implementation_count Def0002
S _active_implementation Def0000
S _ram_helper_call_address Def0004
A _INITIALIZER size 26 flags 0 addr 0
A _CABS size 0 flags 8 addr 0
T 00 00
R 00 00 00 00
T 00 00 54 43 50 2F 49 50 00
R 00 00 00 00
T 00 00
R 00 00 01 00
T 00 00
R 00 00 01 00
T 02 00
R 00 00 01 00
T 02 00
R 00 00 01 00
T 04 00
R 00 00 01 00
T 04 00
R 00 00 01 00
T 06 00
R 00 00 01 00
T 06 00
R 00 00 01 00
T 07 00
R 00 00 00 00
T 07 00 F5 FD 7D 3C 20 04 F1 C3 1C 00
R 00 00 00 00
T 11 00
R 00 00 00 00
T 11 00 F1 E5 D5 2A 00 00 29 29 29 11 06 00 19 D1
R 00 00 00 00 00 06 01 00 00 0C 01 00
T 1F 00 E3 C9
R 00 00 00 00
T 21 00
R 00 00 00 00
T 21 00 DD E5 CD CA FF DD E1 C9
R 00 00 00 00
T 29 00
R 00 00 00 00
T 29 00 3A 00 00 2A 02 00 BD 30 1B 87 87 87 5F 16
R 00 00 00 00 00 03 01 00 00 06 01 00
T 37 00 00 21 06 00 19 23 23 23 5E 23 56 D5 FD E1
R 00 00 00 00 00 04 01 00
T 45 00 23 5E 23 56 D5 DD E1 C9
R 00 00 00 00
T 4D 00
R 00 00 00 00
T 4D 00 E1 DD E1 21 FF 00 C9
R 00 00 00 00
T 54 00
R 00 00 00 00
T 54 00 26 00 39 7E 23 66 6F C9
R 00 00 00 00
T 5C 00
R 00 00 00 00
T 5C 00 11 22 22 AF 67 6F 3D CD 21 00 22 04 00 21
R 00 00 00 00 00 0A 00 00 00 0D 01 00
T 6A 00 00 00 11 47 F8 01 07 00 ED B0 AF 6F 67 22
R 00 00 00 00 00 02 00 00
T 78 00 00 00 47 11 22 22 CD 21 00 78 FE 05 38 02
R 00 00 00 00 00 02 01 00 00 09 00 00
T 86 00 3E 04
R 00 00 00 00
T 88 00
R 00 00 00 00
T 88 00 B7 CA 59 01 47 0E 01 11 00 00 21 06 00
R 00 00 00 00 00 04 00 00 00 0D 01 00
T 95 00
R 00 00 00 00
T 95 00 C5 D5 E5 79 11 22 22 CD 21 00 E3 08 78 3C
R 00 00 00 00 00 0A 00 00
T A3 00 28 0C ED 5B 04 00 7B B2 20 07 D1 D1 18 15
R 00 00 00 00 00 06 01 00
T B1 00
R 00 00 00 00
T B1 00 11 1C 00
R 00 00 00 00
T B4 00
R 00 00 00 00
T B4 00 23 73 23 72 23 08 70 23 77 23 D1 73 23 72
R 00 00 00 00
T C2 00 23 23 D1 1C
R 00 00 00 00
T C6 00
R 00 00 00 00
T C6 00 C1 0C 10 CB EB 22 02 00 C9
R 00 00 00 00 00 08 01 00
T CF 00
R 00 00 00 00
T CF 00 DD E5 CD 29 00 AF CD 07 00 DD E1 B7 20 58
R 00 00 00 00 00 05 00 00 00 09 00 00
T DD 00 E5 2E 08 CD 54 00 73 23 72 2E 0A CD 54 00
R 00 00 00 00 00 06 00 00 00 0E 00 00
T EB 00 71 23 70 2E 06 CD 54 00 11 5E F5 73 23 72
R 00 00 00 00 00 08 00 00
T F9 00 FD 7D 3C 28 26 D1 DD E5 2A 04 00 23 23 23
R 00 00 00 00 00 0B 01 00
T 07 01 E5 DD E1 EB 11 5E F5
R 00 00 00 00
T 0E 01
R 00 00 00 00
T 0E 01 D5 01 19 01 C5 FD 7C FD 45 DD E9
R 00 00 00 00 00 04 00 00
T 19 01
R 00 00 00 00
T 19 01 D1 12 13 23 B7 20 EE DD E1 18 11
R 00 00 00 00
T 24 01
R 00 00 00 00
T 24 01 E1 11 5E F5
R 00 00 00 00
T 28 01
R 00 00 00 00
T 28 01 FD 7C D5 CD 0C 00 D1 12 13 23 B7 20 F3
R 00 00 00 00
T 35 01
R 00 00 00 00
T 35 01 6F 26 00 C9
R 00 00 00 00
T 39 01
R 00 00 00 00
T 39 01 DD E5 CD 29 00 3E 01 47 CD 07 00 DD E1 B7
R 00 00 00 00 00 05 00 00 00 0B 00 00
T 47 01 20 EC E5 2E 06 CD 54 00 70 23 73 23 72 23
R 00 00 00 00 00 08 00 00
T 55 01 D1 73 23 72
R 00 00 00 00
T 59 01
R 00 00 00 00
T 59 01 21 00 00 C9
R 00 00 00 00
T 5D 01
R 00 00 00 00
T 5D 01 DD E5 CD 29 00 3E 01 06 02 CD 07 00 DD E1
R 00 00 00 00 00 05 00 00 00 0C 00 00
T 6B 01 B7 20 C7 E5 2E 06 CD 54 00 70 23 71 23 C1
R 00 00 00 00 00 09 00 00
T 79 01 70 23 72 23 73 23 71 18 D7
R 00 00 00 00
T 82 01
R 00 00 00 00
T 82 01 DD E5 CD 29 00 3E 01 06 03 CD 07 00 DD E1
R 00 00 00 00 00 05 00 00 00 0C 00 00
T 90 01 B7 20 A2 E5 2E 06 CD 54 00 73 23 72 23 D1
R 00 00 00 00 00 09 00 00
T 9E 01 73 23 72 18 B6
R 00 00 00 00
T A3 01
R 00 00 00 00
T A3 01 DD E5 CD 29 00 2E 06 CD 54 00 E5 36 00 5D
R 00 00 00 00 00 05 00 00 00 0A 00 00
T B1 01 54 13 01 17 00 ED B0 01 01 06 E1
R 00 00 00 00
T BC 01
R 00 00 00 00
T BC 01 C5 E5 3E 02 41 CD 07 00 B7 20 14 4D 44 E1
R 00 00 00 00 00 08 00 00
T CA 01 71 23 70 23 73 23 72
R 00 00 00 00
T D1 01
R 00 00 00 00
T D1 01 23 C1 0C 10 E6
R 00 00 00 00
T D6 01
R 00 00 00 00
T D6 01 DD E1 C3 59 01
R 00 00 00 00 00 05 00 00
T DB 01
R 00 00 00 00
T DB 01 E1 23 23 23 18 F0
R 00 00 00 00
T E1 01
R 00 00 00 00
T E1 01 DD E5 CD 29 00 3E 03 CD 07 00 DD E1 B7 C2
R 00 00 00 00 00 05 00 00 00 0A 00 00
T EF 01 35 01 2E 04 CD 54 00 70 23 77 C3 59 01
R 00 00 00 00 00 02 00 00 00 07 00 00 00 0D 00 00
T FC 01
R 00 00 00 00
T FC 01 DD E5 CD 29 00 2E 06 CD 54 00 3E 04
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 08 02
R 00 00 00 00
T 08 02 CD 07 00
R 00 00 00 00 00 03 00 00
T 0B 02
R 00 00 00 00
T 0B 02 DD E1 C3 35 01
R 00 00 00 00 00 05 00 00
T 10 02
R 00 00 00 00
T 10 02 DD E5 CD 29 00 2E 06 CD 54 00 3E 05 18 EA
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 1E 02
R 00 00 00 00
T 1E 02 DD E5 CD 29 00 2E 08 CD 54 00 46 23 E5 AF
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 2C 02 06 06
R 00 00 00 00
T 2E 02
R 00 00 00 00
T 2E 02 77 23 10 FC 2E 08 CD 54 00 3E 06 CD 07 00
R 00 00 00 00 00 09 00 00 00 0E 00 00
T 3C 02 E3 70 23 36 00 23 08 78 08 C1 DD E1 B7 C2
R 00 00 00 00
T 4A 02 35 01 08 B7 CA 59 01
R 00 00 00 00 00 02 00 00 00 07 00 00
T 51 02
R 00 00 00 00
T 51 02 71 23 70 23 73 23 72 C3 59 01
R 00 00 00 00 00 0A 00 00
T 5B 02
R 00 00 00 00
T 5B 02 DD E5 CD 29 00 2E 06 CD 54 00 46 23 E5 3E
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 69 02 07 CD 07 00 E3 70 23 71 23 08 78 08 C1 DD
R 00 00 00 00 00 04 00 00
T 77 02 E1 B7 C2 35 01 08 FE 02 C2 59 01 18 CD
R 00 00 00 00 00 05 00 00 00 0B 00 00
T 84 02
R 00 00 00 00
T 84 02 DD E5 CD 29 00 2E 08 CD 54 00 45 2E 06 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 92 02 54 00 3E 08
R 00 00 00 00 00 02 00 00
T 96 02
R 00 00 00 00
T 96 02 CD 07 00 2E 08 C3 4B 03
R 00 00 00 00 00 03 00 00 00 08 00 00
T 9E 02
R 00 00 00 00
T 9E 02 0E 15 11
R 00 00 00 00
T A1 02
R 00 00 00 00
T A1 02 0E 0E 11
R 00 00 00 00
T A4 02
R 00 00 00 00
T A4 02 0E 09
R 00 00 00 00
T A6 02
R 00 00 00 00
T A6 02 DD E5 CD 29 00 2E 06 CD 54 00 45 79
R 00 00 00 00 00 05 00 00 00 0A 00 00
T B2 02
R 00 00 00 00
T B2 02 CD 07 00 DD E1 C3 35 01
R 00 00 00 00 00 03 00 00 00 08 00 00
T BA 02
R 00 00 00 00
T BA 02 DD E5 CD 29 00 2E 06 CD 54 00 45 3E 0A CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T C8 02 07 00 DD E1 B7 C2 35 01 E5 2E 08 CD 54 00
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0E 00 00
T D6 02 70 23 73 23 72 23 D1 73 23 72 C3 59 01
R 00 00 00 00 00 0D 00 00
T E3 02
R 00 00 00 00
T E3 02 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 08 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T F1 02 54 00 EB 2E 0A CD 54 00 3E 0B C3 B2 02
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0D 00 00
T FE 02
R 00 00 00 00
T FE 02 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 0A CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 0C 03 54 00 EB 2E 08 CD 54 00 3E 0C CD 07 00 B7
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0D 00 00
T 1A 03 C2 0B 02 EB E5 2E 0E CD 54 00 73 23 72 23
R 00 00 00 00 00 03 00 00 00 0A 00 00
T 28 03 D1 73 23 72 23 DD E5 D1 73 23 72 23 71 23
R 00 00 00 00
T 36 03 70 C3 D6 01
R 00 00 00 00 00 04 00 00
T 3A 03
R 00 00 00 00
T 3A 03 DD E5 CD 29 00 2E 06 CD 54 00 3E 0D CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 47 03 07 00 2E 06
R 00 00 00 00 00 02 00 00
T 4B 03
R 00 00 00 00
T 4B 03 DD E1 B7 C2 35 01 CD 54 00 AF 70 23 77 6F
R 00 00 00 00 00 06 00 00 00 09 00 00
T 59 03 67 C9
R 00 00 00 00
T 5B 03
R 00 00 00 00
T 5B 03 DD E5 CD 29 00 2E 06 CD 54 00 45 3E 0F C3
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 69 03 B2 02
R 00 00 00 00 00 02 00 00
T 6B 03
R 00 00 00 00
T 6B 03 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 08 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 79 03 54 00 3E 10 CD 07 00 B7 C2 0B 02 EB E5 2E
R 00 00 00 00 00 02 00 00 00 07 00 00 00 0B 00 00
T 87 03 0A CD 54 00 D5 11 0B 00 19 D1 70 23 71 23
R 00 00 00 00 00 04 00 00
T 95 03 73 23 72 23 D1 73 23 72 23 DD E5 D1 73 23
R 00 00 00 00
T A3 03 72 C3 D6 01
R 00 00 00 00 00 04 00 00
T A7 03
R 00 00 00 00
T A7 03 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 0C CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T B5 03 54 00 4D 2E 08 CD 54 00 EB 2E 0A CD 54 00
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0E 00 00
T C3 03 3E 11 C3 B2 02
R 00 00 00 00 00 05 00 00
T C8 03
R 00 00 00 00
T C8 03 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 08 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T D6 03 54 00 EB 2E 0A CD 54 00 3E 12 CD 07 00 DD
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0D 00 00
T E4 03 E1 B7 C2 35 01 E5 2E 0C CD 54 00 11 0D 00
R 00 00 00 00 00 05 00 00 00 0B 00 00
T F2 03 19 71 23 70 23 D1 73 23 72 C3 59 01
R 00 00 00 00 00 0C 00 00
T FE 03
R 00 00 00 00
T FE 03 DD E5 CD 29 00 2E 06 CD 54 00 45 3E 13 C3
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 0C 04 B2 02
R 00 00 00 00 00 02 00 00
T 0E 04
R 00 00 00 00
T 0E 04 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 08 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 1C 04 54 00 4D 3E 14 C3 96 02
R 00 00 00 00 00 02 00 00 00 08 00 00
T 24 04
R 00 00 00 00
T 24 04 DD E5 CD 29 00 2E 06 CD 54 00 45 3E 16 CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 32 04 07 00 DD E1 B7 C2 35 01 EB E5 2E 08 CD
R 00 00 00 00 00 02 00 00 00 08 00 00
T 3F 04 54 00 70 23 73 23 72 23 D1 73 23 72 C3
R 00 00 00 00 00 02 00 00
T 4C 04 59 01
R 00 00 00 00 00 02 00 00
T 4E 04
R 00 00 00 00
T 4E 04 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 0A CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 5C 04 54 00 EB 2E 08 CD 54 00 3E 17 C3 B2 02
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0D 00 00
T 69 04
R 00 00 00 00
T 69 04 DD E5 CD 29 00 2E 06 CD 54 00 45 2E 0A CD
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 77 04 54 00 EB 2E 08 CD 54 00 3E 18 CD 07 00 DD
R 00 00 00 00 00 02 00 00 00 08 00 00 00 0D 00 00
T 85 04 E1 B7 C2 35 01 EB E5 2E 0C CD 54 00 73 23
R 00 00 00 00 00 05 00 00 00 0C 00 00
T 93 04 72 23 D1 73 23 72 23 71 23 70 C3 59 01
R 00 00 00 00 00 0D 00 00
T A0 04
R 00 00 00 00
T A0 04 DD E5 CD 29 00 2E 06 CD 54 00 4D 06 01 3E
R 00 00 00 00 00 05 00 00 00 0A 00 00
T AE 04 1C C3 B2 02
R 00 00 00 00 00 04 00 00
T B2 04
R 00 00 00 00
T B2 04 DD E5 CD 29 00 06 00 3E 1C CD 07 00 DD E1
R 00 00 00 00 00 05 00 00 00 0C 00 00
T C0 04 B7 C2 35 01 2E 04 CD 54 00 71 C3 59 01
R 00 00 00 00 00 04 00 00 00 09 00 00 00 0D 00 00
T CD 04
R 00 00 00 00
T CD 04 DD E5 CD 29 00 2E 06 CD 54 00 EB 06 01 3E
R 00 00 00 00 00 05 00 00 00 0A 00 00
T DB 04 1B C3 B2 02
R 00 00 00 00 00 04 00 00
T DF 04
R 00 00 00 00
T DF 04 DD E5 CD 29 00 06 00 3E 1B CD 07 00 DD E1
R 00 00 00 00 00 05 00 00 00 0C 00 00
T ED 04 B7 C2 35 01 2E 04 CD 54 00 73 23 72 C3
R 00 00 00 00 00 04 00 00 00 09 00 00
T FA 04 59 01
R 00 00 00 00 00 02 00 00
T FC 04
R 00 00 00 00
T FC 04 DD E5 CD 29 00 2E 06 CD 54 00 01 01 06
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 09 05
R 00 00 00 00
T 09 05 5E 23 56 23 D5 5E 23 56 23 E3 C5 41 3E 1A
R 00 00 00 00
T 17 05 CD 07 00 C1 E1 0C 10 EA C3 D6 01
R 00 00 00 00 00 03 00 00 00 0B 00 00
T 22 05
R 00 00 00 00
T 22 05 DD E5 CD 29 00 06 00 3E 19 CD 07 00 DD E1
R 00 00 00 00 00 05 00 00 00 0C 00 00
T 30 05 B7 C2 35 01 2E 04 CD 54 00 71 C3 59 01
R 00 00 00 00 00 04 00 00 00 09 00 00 00 0D 00 00
T 3D 05
R 00 00 00 00
T 3D 05 DD E5 CD 29 00 2E 06 CD 54 00 4D 06 01 3E
R 00 00 00 00 00 05 00 00 00 0A 00 00
T 4B 05 19 C3 B2 02
R 00 00 00 00 00 04 00 00
T 00 00
R 00 00 02 00
T 00 00 00 00
R 00 00 02 00
T 02 00
R 00 00 02 00
T 02 00 00 00
R 00 00 02 00
T 04 00
R 00 00 02 00
T 04 00 00 00
R 00 00 02 00
T 06 00
R 00 00 02 00
T 06 00 C3 00 00 00 00 00 00 00 C3 00 00 00 00
R 00 00 02 00
T 13 00 00 00 00 C3 00 00 00 00 00 00 00 C3 00 00
R 00 00 02 00
T 21 00 00 00 00 00 00
R 00 00 02 00
T 26 00
R 00 00 02 00

View File

@@ -0,0 +1,104 @@
; crt0 for MSX ROM of 32KB, starting at 0x4000
; suggested options: --code-loc 0x4050 --data-loc 0xC000
; Example for compile and create a 32K ROM binary:
; sdcc -mz80 --code-loc 0x4050 --data-loc 0xC000 --use-stdout --no-std-crt0 crt0_MSX32kROM4000.rel CFILENAME.c
; hex2bin -e ROM -s 4000 -l 8000 CFILENAME.ihx <--- generate a binary file and fill to 32768 Bytes size (8000h)
; Version: 1.1
; Date: 12/04/2018
; Author: mvac7/303bcn
.globl _main
.area _HEADER (ABS)
; Reset vector
.org 0x4000
.db 0x41
.db 0x42
.dw init
.dw 0x0000
.dw 0x0000
.dw 0x0000
.dw 0x0000
.dw 0x0000
.dw 0x0000
init:
di
ld SP,(#0xFC4A) ;Stack at the top of memory.
ei
call find_rom_page_2
call _main
RST 0 ;CHKRAM
;------------------------------------------------
; find_rom_page_2
; original name : LOCALIZAR_SEGUNDA_PAGINA
; Original author : Eduardo Robsy Petrus
; Snippet taken from: http://karoshi.auic.es/index.php?topic=117.msg1465
;
; Rutina que localiza la segunda pagina de 16 KB
; de una ROM de 32 KB ubicada en 4000h
; -Basada en la rutina de Konami-
; Compatible con carga en RAM
; Compatible con expansores de slots
;------------------------------------------------
; Comprobacion de RAM/ROM
find_rom_page_2::
ld hl, #0x4000
ld b, (hl)
xor a
ld (hl), a
ld a, (hl)
or a
jr nz,5$ ; jr nz,@@ROM
; El programa esta en RAM - no buscar
ld (hl),b
ret
5$: ; ----------- @@ROM:
di
; Slot primario
call #0x0138 ; call RSLREG
rrca
rrca
and #0x03
; Slot secundario
ld c, a
ld hl, #0xfcc1
add a, l
ld l, a
ld a, (hl)
and #0x80
or c
ld c, a
inc l
inc l
inc l
inc l
ld a, (hl)
; Definir el identificador de slot
and #0x0c
or c
ld h, #0x80
; Habilitar permanentemente
call #0x0024 ; call ENASLT
ei
ret
;------------------------------------------------
.area _CODE
.area _DATA
.area _GSINIT
.area _GSFINAL

View File

@@ -53,8 +53,6 @@ init:
ld hl, #s__INITIALIZER
ldir
ld
jp _main
;; Ordering of segments for the linker.

View File

@@ -1,320 +1,58 @@
CLS
@echo off
echo " "
echo " F U S I O N - C "
echo " T h e U l t i m a t e SDCC L i b r a r y f o r M S X "
echo " Eric Boez & Fernando Garcia 2018-2019 : Made for coders !"
echo "_________________________________________________________________"
echo " "
echo " "
echo " "
echo "------------------------------------ FUSION-C" > log.txt
echo %date% %time% > log.txt
echo "------------------------------------" > log.txt
@echo "Now Building FUSION-C Library..."
cls
echo.
echo F U S I O N - C V 1 . 2
echo T h e U l t i m a t e SDCC L i b r a r y f o r M S X
echo Eric Boez ^& Fernando Garcia 2018-2019 : Made for coders !
echo _________________________________________________________________
echo.
echo.
echo.
echo ------------------------------------ FUSION-C >> log.txt
echo %date% %time% >> log.txt
echo ------------------------------------ >> log.txt
echo Now Building FUSION-C Library...
@del .\fusion.lib
@echo "... Compiling ASM Functions"
sdasz80 -o fcb_find.s > log.txt
sdasz80 -o fcb_open.s > log.txt
sdasz80 -o fcb_read.s > log.txt
sdasz80 -o inport.s > log.txt
sdasz80 -o outport.s > log.txt
sdasz80 -o outports.s > log.txt
sdasz80 -o putchar_msxdos.s > log.txt
sdasz80 -o getchar_msxdos.s > log.txt
sdasz80 -o screen.s > log.txt
sdasz80 -o vdpstatus.s > log.txt
sdasz80 -o vdpstatusni.s > log.txt
sdasz80 -o vdpwrite.s > log.txt
sdasz80 -o vdpwriteni.s > log.txt
sdasz80 -o exit.s > log.txt
sdasz80 -o doscls.s > log.txt
sdasz80 -o intdosbios.s > log.txt
sdasz80 -o settime.s > log.txt
sdasz80 -o setdate.s > log.txt
sdasz80 -o gettime.s > log.txt
sdasz80 -o getdate.s > log.txt
sdasz80 -o suspend.s > log.txt
sdasz80 -o memchr.s > log.txt
sdasz80 -o memfill.s > log.txt
sdasz80 -o memcopy.s > log.txt
sdasz80 -o memcopyreverse.s > log.txt
sdasz80 -o memcompare.s > log.txt
sdasz80 -o waitkey.s > log.txt
sdasz80 -o keyboardread.s > log.txt
sdasz80 -o printdec.s > log.txt
sdasz80 -o inputchar.s > log.txt
sdasz80 -o printchar.s > log.txt
sdasz80 -o inputstring.s > log.txt
sdasz80 -o getche.s > log.txt
sdasz80 -o inkey.s > log.txt
sdasz80 -o setbordercolor.s > log.txt
sdasz80 -o puttext.s > log.txt
sdasz80 -o setpalette.s > log.txt
sdasz80 -o spritemore.s > log.txt
sdasz80 -o readwritescr.s > log.txt
sdasz80 -o scblock.s > log.txt
sdasz80 -o vdp_graph2.s > log.txt
sdasz80 -o vdp_graph1.s > log.txt
sdasz80 -o ctype.s > log.txt
sdasz80 -o io.s > log.txt
sdasz80 -o rammapper.s > log.txt
sdasz80 -o pt3replayer.s > log.txt
sdasz80 -o strcopy.s > log.txt
sdasz80 -o nstrcopy.s > log.txt
sdasz80 -o strlen.s > log.txt
sdasz80 -o strconcat.s > log.txt
sdasz80 -o nstrconcat.s > log.txt
sdasz80 -o strcompare.s > log.txt
sdasz80 -o nstrcompare.s > log.txt
sdasz80 -o strchr.s > log.txt
sdasz80 -o strsearch.s > log.txt
sdasz80 -o strposchr.s > log.txt
sdasz80 -o chartolower.s > log.txt
sdasz80 -o chartoupper.s > log.txt
sdasz80 -o strposstr.s > log.txt
sdasz80 -o strlefttrim.s > log.txt
sdasz80 -o strrighttrim.s > log.txt
sdasz80 -o setdisktraddress.s > log.txt
sdasz80 -o getdisktraddress.s > log.txt
sdasz80 -o sectorread.s > log.txt
sdasz80 -o sectorwrite.s > log.txt
sdasz80 -o getdiskparam.s > log.txt
sdasz80 -o readsp.s > log.txt
sdasz80 -o vram.s > log.txt
sdasz80 -o interrupt.s > log.txt
echo ... Compiling ASM functions
set ErrorLevel=0
for %%x in (*.s) do (
echo %%x
sdasz80 -o %%x >> log.txt
if errorlevel 1 goto :error
)
echo ... Compiling C functions
echo " ... Compiling C functions"
sdcc --disable-warning 196 --use-stdout -mz80 -c printf.c > log.txt
sdcc --use-stdout -mz80 -c vpeek.c > log.txt
sdcc --use-stdout -mz80 -c vpeekfirst.c > log.txt
sdcc --use-stdout -mz80 -c vpoke.c > log.txt
sdcc --use-stdout -mz80 -c bchput.c > log.txt
sdcc --use-stdout -mz80 -c num2dec16.c > log.txt
sdcc --use-stdout -mz80 -c printfnumber.c > log.txt
sdcc --use-stdout -mz80 -c printnumber.c > log.txt
sdcc --use-stdout -mz80 -c getkeymatrix.c > log.txt
sdcc --use-stdout -mz80 -c readmsxtype.c > log.txt
sdcc --use-stdout -mz80 -c initpsg.c > log.txt
sdcc --use-stdout -mz80 -c killkeybuffer.c > log.txt
sdcc --use-stdout -mz80 -c fillvram.c > log.txt
sdcc --use-stdout -mz80 -c changecap.c > log.txt
sdcc --use-stdout -mz80 -c beep.c > log.txt
sdcc --use-stdout -mz80 -c showdisplay.c > log.txt
sdcc --use-stdout -mz80 -c hidedisplay.c > log.txt
sdcc --use-stdout -mz80 -c functionkeys.c > log.txt
sdcc --use-stdout -mz80 -c width.c > log.txt
sdcc --use-stdout -mz80 -c setscrollv.c > log.txt
sdcc --use-stdout -mz80 -c setscrollh.c > log.txt
sdcc --use-stdout -mz80 -c psgwrite.c > log.txt
sdcc --use-stdout -mz80 -c psgread.c > log.txt
sdcc --use-stdout -mz80 -c setactivepage.c > log.txt
sdcc --use-stdout -mz80 -c setdisplaypage.c > log.txt
sdcc --use-stdout -mz80 -c keysound.c > log.txt
sdcc --use-stdout -mz80 -c circle.c > log.txt
sdcc --use-stdout -mz80 -c circlefilled.c > log.txt
sdcc --use-stdout -mz80 -c joystickread.c > log.txt
sdcc --use-stdout -mz80 -c triggerread.c > log.txt
sdcc --use-stdout -mz80 -c getcpu.c > log.txt
sdcc --use-stdout -mz80 -c changecpu.c > log.txt
sdcc --use-stdout -mz80 -c pcmplay.c > log.txt
sdcc --use-stdout -mz80 -c silencepsg.c > log.txt
sdcc --use-stdout -mz80 -c sound.c > log.txt
sdcc --use-stdout -mz80 -c soundfx.c > log.txt
sdcc --use-stdout -mz80 -c setchannel.c > log.txt
sdcc --use-stdout -mz80 -c getsound.c > log.txt
sdcc --use-stdout -mz80 -c settoneperiod.c > log.txt
sdcc --use-stdout -mz80 -c setnoiseperiod.c > log.txt
sdcc --use-stdout -mz80 -c setenvelopeperiod.c > log.txt
sdcc --use-stdout -mz80 -c setvolume.c > log.txt
sdcc --use-stdout -mz80 -c playenvelope.c > log.txt
sdcc --use-stdout -mz80 -c locate.c > log.txt
sdcc --use-stdout -mz80 -c cls.c > log.txt
sdcc --use-stdout -mz80 -c print.c > log.txt
sdcc --use-stdout -mz80 -c setspritepattern.c > log.txt
sdcc --use-stdout -mz80 -c putsprite.c > log.txt
sdcc --use-stdout -mz80 -c sprite8.c > log.txt
sdcc --use-stdout -mz80 -c sprite16.c > log.txt
sdcc --use-stdout -mz80 -c spriteon.c > log.txt
sdcc --use-stdout -mz80 -c spriteoff.c > log.txt
sdcc --use-stdout -mz80 -c spritesmall.c > log.txt
sdcc --use-stdout -mz80 -c spritedouble.c > log.txt
sdcc --use-stdout -mz80 -c spritereset.c > log.txt
sdcc --use-stdout -mz80 -c spritecollision.c > log.txt
sdcc --use-stdout -mz80 -c setcolors.c > log.txt
sdcc --use-stdout -mz80 -c intswap.c > log.txt
sdcc --use-stdout -mz80 -c inttofloat.c > log.txt
sdcc --use-stdout -mz80 -c ispositive.c > log.txt
sdcc --use-stdout -mz80 -c mmalloc.c > log.txt
sdcc --use-stdout -mz80 -c vdp50hz.c > log.txt
sdcc --use-stdout -mz80 -c vdp60hz.c > log.txt
sdcc --use-stdout -mz80 -c readtpa.c > log.txt
sdcc --use-stdout -mz80 -c setrealtimer.c > log.txt
sdcc --use-stdout -mz80 -c realtimer.c > log.txt
sdcc --use-stdout -mz80 -c mouseread.c > log.txt
sdcc --use-stdout -mz80 -c covoxplay.c > log.txt
sdcc --use-stdout -mz80 -c sc2circle.c > log.txt
sdcc --use-stdout -mz80 -c sc2circlefilled.c > log.txt
sdcc --use-stdout -mz80 -c vdplinesswitch.c > log.txt
sdcc --use-stdout -mz80 -c rlewbtovram.c > log.txt
sdcc --use-stdout -mz80 -c rlewbtoram.c > log.txt
for %%x in (*.c) do (
echo %%x
sdcc --use-stdout -mz80 -c %%x >> log.txt
if errorlevel 1 goto :error
)
echo ... adding functions to the library
echo "... adding functions to the lib"
sdar -rc fusion.lib printf.rel
sdar -rc fusion.lib fcb_find.rel
sdar -rc fusion.lib fcb_open.rel
sdar -rc fusion.lib fcb_read.rel
sdar -rc fusion.lib inport.rel
sdar -rc fusion.lib outport.rel
sdar -rc fusion.lib outports.rel
sdar -rc fusion.lib putchar_msxdos.rel
sdar -rc fusion.lib getchar_msxdos.rel
sdar -rc fusion.lib screen.rel
sdar -rc fusion.lib vdpstatus.rel
sdar -rc fusion.lib vdpstatusni.rel
sdar -rc fusion.lib vdpwrite.rel
sdar -rc fusion.lib vdpwriteni.rel
sdar -rc fusion.lib exit.rel
sdar -rc fusion.lib doscls.rel
sdar -rc fusion.lib intdosbios.rel
sdar -rc fusion.lib settime.rel
sdar -rc fusion.lib setdate.rel
sdar -rc fusion.lib gettime.rel
sdar -rc fusion.lib getdate.rel
sdar -rc fusion.lib suspend.rel
sdar -rc fusion.lib vpeek.rel
sdar -rc fusion.lib vpeekfirst.rel
sdar -rc fusion.lib vpoke.rel
sdar -rc fusion.lib bchput.rel
sdar -rc fusion.lib num2dec16.rel
sdar -rc fusion.lib printfnumber.rel
sdar -rc fusion.lib printnumber.rel
sdar -rc fusion.lib getkeymatrix.rel
sdar -rc fusion.lib readmsxtype.rel
sdar -rc fusion.lib initpsg.rel
sdar -rc fusion.lib killkeybuffer.rel
sdar -rc fusion.lib fillvram.rel
sdar -rc fusion.lib changecap.rel
sdar -rc fusion.lib beep.rel
sdar -rc fusion.lib showdisplay.rel
sdar -rc fusion.lib hidedisplay.rel
sdar -rc fusion.lib functionkeys.rel
sdar -rc fusion.lib width.rel
sdar -rc fusion.lib setscrollv.rel
sdar -rc fusion.lib setscrollh.rel
sdar -rc fusion.lib psgwrite.rel
sdar -rc fusion.lib psgread.rel
sdar -rc fusion.lib setactivepage.rel
sdar -rc fusion.lib setdisplaypage.rel
sdar -rc fusion.lib keysound.rel
sdar -rc fusion.lib circle.rel
sdar -rc fusion.lib circlefilled.rel
sdar -rc fusion.lib joystickread.rel
sdar -rc fusion.lib triggerread.rel
sdar -rc fusion.lib getcpu.rel
sdar -rc fusion.lib changecpu.rel
sdar -rc fusion.lib pcmplay.rel
sdar -rc fusion.lib silencepsg.rel
sdar -rc fusion.lib sound.rel
sdar -rc fusion.lib soundfx.rel
sdar -rc fusion.lib setchannel.rel
sdar -rc fusion.lib getsound.rel
sdar -rc fusion.lib settoneperiod.rel
sdar -rc fusion.lib setnoiseperiod.rel
sdar -rc fusion.lib setenvelopeperiod.rel
sdar -rc fusion.lib setvolume.rel
sdar -rc fusion.lib playenvelope.rel
sdar -rc fusion.lib memchr.rel
sdar -rc fusion.lib memfill.rel
sdar -rc fusion.lib memcopy.rel
sdar -rc fusion.lib memcopyreverse.rel
sdar -rc fusion.lib memcompare.rel
sdar -rc fusion.lib waitkey.rel
sdar -rc fusion.lib keyboardread.rel
sdar -rc fusion.lib locate.rel
sdar -rc fusion.lib cls.rel
sdar -rc fusion.lib inputchar.rel
sdar -rc fusion.lib printchar.rel
sdar -rc fusion.lib inputstring.rel
sdar -rc fusion.lib getche.rel
sdar -rc fusion.lib inkey.rel
sdar -rc fusion.lib print.rel
sdar -rc fusion.lib setbordercolor.rel
sdar -rc fusion.lib puttext.rel
sdar -rc fusion.lib setpalette.rel
sdar -rc fusion.lib setspritepattern.rel
sdar -rc fusion.lib putsprite.rel
sdar -rc fusion.lib sprite8.rel
sdar -rc fusion.lib sprite16.rel
sdar -rc fusion.lib spriteon.rel
sdar -rc fusion.lib spriteoff.rel
sdar -rc fusion.lib spritesmall.rel
sdar -rc fusion.lib spritedouble.rel
sdar -rc fusion.lib spritereset.rel
sdar -rc fusion.lib spritemore.rel
sdar -rc fusion.lib spritecollision.rel
sdar -rc fusion.lib readwritescr.rel
sdar -rc fusion.lib scblock.rel
sdar -rc fusion.lib vdp_graph1.rel
sdar -rc fusion.lib vdp_graph2.rel
sdar -rc fusion.lib ctype.rel
sdar -rc fusion.lib io.rel
sdar -rc fusion.lib rammapper.rel
sdar -rc fusion.lib pt3replayer.rel
sdar -rc fusion.lib setcolors.rel
sdar -rc fusion.lib strcopy.rel
sdar -rc fusion.lib nstrcopy.rel
sdar -rc fusion.lib strlen.rel
sdar -rc fusion.lib strconcat.rel
sdar -rc fusion.lib nstrconcat.rel
sdar -rc fusion.lib strcompare.rel
sdar -rc fusion.lib nstrcompare.rel
sdar -rc fusion.lib strchr.rel
sdar -rc fusion.lib strsearch.rel
sdar -rc fusion.lib strposchr.rel
sdar -rc fusion.lib chartolower.rel
sdar -rc fusion.lib chartoupper.rel
sdar -rc fusion.lib strposstr.rel
sdar -rc fusion.lib strlefttrim.rel
sdar -rc fusion.lib strrighttrim.rel
sdar -rc fusion.lib printdec.rel
sdar -rc fusion.lib intswap.rel
sdar -rc fusion.lib inttofloat.rel
sdar -rc fusion.lib ispositive.rel
sdar -rc fusion.lib mmalloc.rel
sdar -rc fusion.lib VDP50Hz.rel
sdar -rc fusion.lib VDP60Hz.rel
sdar -rc fusion.lib readsp.rel
sdar -rc fusion.lib readtpa.rel
sdar -rc fusion.lib setrealtimer.rel
sdar -rc fusion.lib realtimer.rel
sdar -rc fusion.lib mouseread.rel
sdar -rc fusion.lib covoxplay.rel
sdar -rc fusion.lib sc2circle.rel
sdar -rc fusion.lib sc2circlefilled.rel
sdar -rc fusion.lib vdplinesswitch.rel
sdar -rc fusion.lib rlewbtovram.rel
sdar -rc fusion.lib rlewbtoram.rel
sdar -rc fusion.lib setdisktraddress.rel
sdar -rc fusion.lib getdisktraddress.rel
sdar -rc fusion.lib sectorread.rel
sdar -rc fusion.lib sectorwrite.rel
sdar -rc fusion.lib getdiskparam.rel
sdar -rc fusion.lib vram.rel
sdar -rc fusion.lib interrupt.rel
echo "... cleaning folder"
del .\*.rel
del .\*.asm
del .\*.lst
del .\*.sym
for %%x in (*.rel) do (
echo %%x
type %%x | findstr /v "O -mz80" > %%x.tmp
del %%x
ren %%x.tmp %%x
sdar -rc fusion.lib %%x
if errorlevel 1 goto :error
)
del *.sym
del *.rel
del *.lst
del *.asm
copy fusion.lib ..\..\lib\
echo " ... Have a good day sir"
echo Done...
exit /b 0
:error
echo Error
exit /b 1

View File

@@ -1,7 +1,7 @@
#!/bin/sh
clear
echo " "
echo " F U S I O N - C V 1 . 1"
echo " F U S I O N - C V 1 . 2"
echo " T h e U l t i m a t e SDCC L i b r a r y f o r M S X"
echo " Eric Boez & Fernando Garcia 2018-2019 : Made for coders !"
echo " (Library builder script)"
@@ -14,323 +14,60 @@ echo "------------------------------------ FUSION-C" >> log.txt
date >> log.txt
echo "------------------------------------" >> log.txt
echo "Now Building FUSION-C Library..."
rm fusion.lib
#-----------------------------------------------Building ASM .s functions
echo " ... Compiling ASM Functions"
sdasz80 -o fcb_find.s >> log.txt
sdasz80 -o fcb_open.s >> log.txt
sdasz80 -o fcb_read.s >> log.txt
sdasz80 -o inport.s >> log.txt
sdasz80 -o outport.s >> log.txt
sdasz80 -o outports.s >> log.txt
sdasz80 -o putchar_msxdos.s >> log.txt
sdasz80 -o getchar_msxdos.s >> log.txt
sdasz80 -o screen.s >> log.txt
sdasz80 -o vdpstatus.s >> log.txt
sdasz80 -o vdpstatusni.s >> log.txt
sdasz80 -o vdpwrite.s >> log.txt
sdasz80 -o vdpwriteni.s >> log.txt
sdasz80 -o exit.s >> log.txt
sdasz80 -o doscls.s >> log.txt
sdasz80 -o intdosbios.s >> log.txt
sdasz80 -o settime.s >> log.txt
sdasz80 -o setdate.s >> log.txt
sdasz80 -o gettime.s >> log.txt
sdasz80 -o getdate.s >> log.txt
sdasz80 -o suspend.s >> log.txt
sdasz80 -o memchr.s >> log.txt
sdasz80 -o memfill.s >> log.txt
sdasz80 -o memcopy.s >> log.txt
sdasz80 -o memcopyreverse.s >> log.txt
sdasz80 -o memcompare.s >> log.txt
sdasz80 -o waitkey.s >> log.txt
sdasz80 -o keyboardread.s >> log.txt
sdasz80 -o printdec.s >> log.txt
sdasz80 -o inputchar.s >> log.txt
sdasz80 -o printchar.s >> log.txt
sdasz80 -o inputstring.s >> log.txt
sdasz80 -o getche.s >> log.txt
sdasz80 -o inkey.s >> log.txt
sdasz80 -o setbordercolor.s >> log.txt
sdasz80 -o puttext.s >> log.txt
sdasz80 -o setpalette.s >> log.txt
sdasz80 -o spritemore.s >> log.txt
sdasz80 -o readwritescr.s >> log.txt
sdasz80 -o scblock.s >> log.txt
sdasz80 -o vdp_graph2.s >> log.txt
sdasz80 -o vdp_graph1.s >> log.txt
sdasz80 -o ctype.s >> log.txt
sdasz80 -o io.s >> log.txt
sdasz80 -o rammapper.s >> log.txt
sdasz80 -o pt3replayer.s >> log.txt
sdasz80 -o strcopy.s >> log.txt
sdasz80 -o nstrcopy.s >> log.txt
sdasz80 -o strlen.s >> log.txt
sdasz80 -o strconcat.s >> log.txt
sdasz80 -o nstrconcat.s >> log.txt
sdasz80 -o strcompare.s >> log.txt
sdasz80 -o nstrcompare.s >> log.txt
sdasz80 -o strchr.s >> log.txt
sdasz80 -o strsearch.s >> log.txt
sdasz80 -o strposchr.s >> log.txt
sdasz80 -o chartolower.s >> log.txt
sdasz80 -o chartoupper.s >> log.txt
sdasz80 -o strposstr.s >> log.txt
sdasz80 -o strlefttrim.s >> log.txt
sdasz80 -o strrighttrim.s >> log.txt
sdasz80 -o setdisktraddress.s >> log.txt
sdasz80 -o getdisktraddress.s >> log.txt
sdasz80 -o sectorread.s >> log.txt
sdasz80 -o sectorwrite.s >> log.txt
sdasz80 -o getdiskparam.s >> log.txt
sdasz80 -o readsp.s >> log.txt
sdasz80 -o vram.s >> log.txt
sdasz80 -o interrupt.s >> log.txt
echo "... Compiling ASM functions"
for file in *.s ; do
echo $file;tput cuu1;tput el;
sdasz80 -o $file >> log.txt
err=$?
if [ $err -gt 0 ];then
echo "Error when compiling $file"
exit 1
fi
done
#----------------------------------------------- Building C .c functions
echo " ... Compiling C functions"
sdcc --disable-warning 196 --use-stdout -mz80 -c printf.c >> log.txt
sdcc --use-stdout -mz80 -c vpeek.c >> log.txt
sdcc --use-stdout -mz80 -c vpeekfirst.c >> log.txt
sdcc --use-stdout -mz80 -c vpoke.c >> log.txt
sdcc --use-stdout -mz80 -c bchput.c >> log.txt
sdcc --use-stdout -mz80 -c num2dec16.c >> log.txt
sdcc --use-stdout -mz80 -c printfnumber.c >> log.txt
sdcc --use-stdout -mz80 -c printnumber.c >> log.txt
sdcc --use-stdout -mz80 -c getkeymatrix.c >> log.txt
sdcc --use-stdout -mz80 -c readmsxtype.c >> log.txt
sdcc --use-stdout -mz80 -c initpsg.c >> log.txt
sdcc --use-stdout -mz80 -c killkeybuffer.c >> log.txt
sdcc --use-stdout -mz80 -c fillvram.c >> log.txt
sdcc --use-stdout -mz80 -c changecap.c >> log.txt
sdcc --use-stdout -mz80 -c beep.c >> log.txt
sdcc --use-stdout -mz80 -c showdisplay.c >> log.txt
sdcc --use-stdout -mz80 -c hidedisplay.c >> log.txt
sdcc --use-stdout -mz80 -c functionkeys.c >> log.txt
sdcc --use-stdout -mz80 -c width.c >> log.txt
sdcc --use-stdout -mz80 -c setscrollv.c >> log.txt
sdcc --use-stdout -mz80 -c setscrollh.c >> log.txt
sdcc --use-stdout -mz80 -c psgwrite.c >> log.txt
sdcc --use-stdout -mz80 -c psgread.c >> log.txt
sdcc --use-stdout -mz80 -c setactivepage.c >> log.txt
sdcc --use-stdout -mz80 -c setdisplaypage.c >> log.txt
sdcc --use-stdout -mz80 -c keysound.c >> log.txt
sdcc --use-stdout -mz80 -c circle.c >> log.txt
sdcc --use-stdout -mz80 -c circlefilled.c >> log.txt
sdcc --use-stdout -mz80 -c joystickread.c >> log.txt
sdcc --use-stdout -mz80 -c triggerread.c >> log.txt
sdcc --use-stdout -mz80 -c getcpu.c >> log.txt
sdcc --use-stdout -mz80 -c changecpu.c >> log.txt
sdcc --use-stdout -mz80 -c pcmplay.c >> log.txt
sdcc --use-stdout -mz80 -c silencepsg.c >> log.txt
sdcc --use-stdout -mz80 -c sound.c >> log.txt
sdcc --use-stdout -mz80 -c soundfx.c >> log.txt
sdcc --use-stdout -mz80 -c setchannel.c >> log.txt
sdcc --use-stdout -mz80 -c getsound.c >> log.txt
sdcc --use-stdout -mz80 -c settoneperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setnoiseperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setenvelopeperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setvolume.c >> log.txt
sdcc --use-stdout -mz80 -c playenvelope.c >> log.txt
sdcc --use-stdout -mz80 -c locate.c >> log.txt
sdcc --use-stdout -mz80 -c cls.c >> log.txt
sdcc --use-stdout -mz80 -c print.c >> log.txt
sdcc --use-stdout -mz80 -c setspritepattern.c >> log.txt
sdcc --use-stdout -mz80 -c putsprite.c >> log.txt
sdcc --use-stdout -mz80 -c sprite8.c >> log.txt
sdcc --use-stdout -mz80 -c sprite16.c >> log.txt
sdcc --use-stdout -mz80 -c spriteon.c >> log.txt
sdcc --use-stdout -mz80 -c spriteoff.c >> log.txt
sdcc --use-stdout -mz80 -c spritesmall.c >> log.txt
sdcc --use-stdout -mz80 -c spritedouble.c >> log.txt
sdcc --use-stdout -mz80 -c spritereset.c >> log.txt
sdcc --use-stdout -mz80 -c spritecollision.c >> log.txt
sdcc --use-stdout -mz80 -c setcolors.c >> log.txt
sdcc --use-stdout -mz80 -c intswap.c >> log.txt
sdcc --use-stdout -mz80 -c inttofloat.c >> log.txt
sdcc --use-stdout -mz80 -c ispositive.c >> log.txt
sdcc --use-stdout -mz80 -c mmalloc.c >> log.txt
sdcc --use-stdout -mz80 -c vdp50hz.c >> log.txt
sdcc --use-stdout -mz80 -c vdp60hz.c >> log.txt
sdcc --use-stdout -mz80 -c readtpa.c >> log.txt
sdcc --use-stdout -mz80 -c setrealtimer.c >> log.txt
sdcc --use-stdout -mz80 -c realtimer.c >> log.txt
sdcc --use-stdout -mz80 -c mouseread.c >> log.txt
sdcc --use-stdout -mz80 -c covoxplay.c >> log.txt
sdcc --use-stdout -mz80 -c sc2circle.c >> log.txt
sdcc --use-stdout -mz80 -c sc2circlefilled.c >> log.txt
sdcc --use-stdout -mz80 -c vdplinesswitch.c >> log.txt
sdcc --use-stdout -mz80 -c rlewbtovram.c >> log.txt
sdcc --use-stdout -mz80 -c rlewbtoram.c >> log.txt
echo "... Compiling C functions"
for file in *.c ; do
echo $file;tput cuu1;tput el;
sdcc --use-stdout -mz80 -c $file >> log.txt
err=$?
if [ $err -gt 0 ];then
echo "Error when compiling $file"
exit 1
fi
done
#----------------------------------------------- Building the Library by fusioning all functions
echo " ... including functions to the library"
sdar -rc fusion.lib printf.rel
sdar -rc fusion.lib fcb_find.rel
sdar -rc fusion.lib fcb_open.rel
sdar -rc fusion.lib fcb_read.rel
sdar -rc fusion.lib inport.rel
sdar -rc fusion.lib outport.rel
sdar -rc fusion.lib outports.rel
sdar -rc fusion.lib putchar_msxdos.rel
sdar -rc fusion.lib getchar_msxdos.rel
sdar -rc fusion.lib screen.rel
sdar -rc fusion.lib vdpstatus.rel
sdar -rc fusion.lib vdpstatusni.rel
sdar -rc fusion.lib vdpwrite.rel
sdar -rc fusion.lib vdpwriteni.rel
sdar -rc fusion.lib exit.rel
sdar -rc fusion.lib doscls.rel
sdar -rc fusion.lib intdosbios.rel
sdar -rc fusion.lib settime.rel
sdar -rc fusion.lib setdate.rel
sdar -rc fusion.lib gettime.rel
sdar -rc fusion.lib getdate.rel
sdar -rc fusion.lib suspend.rel
sdar -rc fusion.lib vpeek.rel
sdar -rc fusion.lib vpeekfirst.rel
sdar -rc fusion.lib vpoke.rel
sdar -rc fusion.lib bchput.rel
sdar -rc fusion.lib num2dec16.rel
sdar -rc fusion.lib printfnumber.rel
sdar -rc fusion.lib printnumber.rel
sdar -rc fusion.lib getkeymatrix.rel
sdar -rc fusion.lib readmsxtype.rel
sdar -rc fusion.lib initpsg.rel
sdar -rc fusion.lib killkeybuffer.rel
sdar -rc fusion.lib fillvram.rel
sdar -rc fusion.lib changecap.rel
sdar -rc fusion.lib beep.rel
sdar -rc fusion.lib showdisplay.rel
sdar -rc fusion.lib hidedisplay.rel
sdar -rc fusion.lib functionkeys.rel
sdar -rc fusion.lib width.rel
sdar -rc fusion.lib setscrollv.rel
sdar -rc fusion.lib setscrollh.rel
sdar -rc fusion.lib psgwrite.rel
sdar -rc fusion.lib psgread.rel
sdar -rc fusion.lib setactivepage.rel
sdar -rc fusion.lib setdisplaypage.rel
sdar -rc fusion.lib keysound.rel
sdar -rc fusion.lib circle.rel
sdar -rc fusion.lib circlefilled.rel
sdar -rc fusion.lib joystickread.rel
sdar -rc fusion.lib triggerread.rel
sdar -rc fusion.lib getcpu.rel
sdar -rc fusion.lib changecpu.rel
sdar -rc fusion.lib pcmplay.rel
sdar -rc fusion.lib silencepsg.rel
sdar -rc fusion.lib sound.rel
sdar -rc fusion.lib soundfx.rel
sdar -rc fusion.lib setchannel.rel
sdar -rc fusion.lib getsound.rel
sdar -rc fusion.lib settoneperiod.rel
sdar -rc fusion.lib setnoiseperiod.rel
sdar -rc fusion.lib setenvelopeperiod.rel
sdar -rc fusion.lib setvolume.rel
sdar -rc fusion.lib playenvelope.rel
sdar -rc fusion.lib memchr.rel
sdar -rc fusion.lib memfill.rel
sdar -rc fusion.lib memcopy.rel
sdar -rc fusion.lib memcopyreverse.rel
sdar -rc fusion.lib memcompare.rel
sdar -rc fusion.lib waitkey.rel
sdar -rc fusion.lib keyboardread.rel
sdar -rc fusion.lib locate.rel
sdar -rc fusion.lib cls.rel
sdar -rc fusion.lib inputchar.rel
sdar -rc fusion.lib printchar.rel
sdar -rc fusion.lib inputstring.rel
sdar -rc fusion.lib getche.rel
sdar -rc fusion.lib inkey.rel
sdar -rc fusion.lib print.rel
sdar -rc fusion.lib setbordercolor.rel
sdar -rc fusion.lib puttext.rel
sdar -rc fusion.lib setpalette.rel
sdar -rc fusion.lib setspritepattern.rel
sdar -rc fusion.lib putsprite.rel
sdar -rc fusion.lib sprite8.rel
sdar -rc fusion.lib sprite16.rel
sdar -rc fusion.lib spriteon.rel
sdar -rc fusion.lib spriteoff.rel
sdar -rc fusion.lib spritesmall.rel
sdar -rc fusion.lib spritedouble.rel
sdar -rc fusion.lib spritereset.rel
sdar -rc fusion.lib spritemore.rel
sdar -rc fusion.lib spritecollision.rel
sdar -rc fusion.lib readwritescr.rel
sdar -rc fusion.lib scblock.rel
sdar -rc fusion.lib vdp_graph1.rel
sdar -rc fusion.lib vdp_graph2.rel
sdar -rc fusion.lib ctype.rel
sdar -rc fusion.lib io.rel
sdar -rc fusion.lib rammapper.rel
sdar -rc fusion.lib pt3replayer.rel
sdar -rc fusion.lib setcolors.rel
sdar -rc fusion.lib strcopy.rel
sdar -rc fusion.lib nstrcopy.rel
sdar -rc fusion.lib strlen.rel
sdar -rc fusion.lib strconcat.rel
sdar -rc fusion.lib nstrconcat.rel
sdar -rc fusion.lib strcompare.rel
sdar -rc fusion.lib nstrcompare.rel
sdar -rc fusion.lib strchr.rel
sdar -rc fusion.lib strsearch.rel
sdar -rc fusion.lib strposchr.rel
sdar -rc fusion.lib chartolower.rel
sdar -rc fusion.lib chartoupper.rel
sdar -rc fusion.lib strposstr.rel
sdar -rc fusion.lib strlefttrim.rel
sdar -rc fusion.lib strrighttrim.rel
sdar -rc fusion.lib printdec.rel
sdar -rc fusion.lib intswap.rel
sdar -rc fusion.lib inttofloat.rel
sdar -rc fusion.lib ispositive.rel
sdar -rc fusion.lib mmalloc.rel
sdar -rc fusion.lib VDP50Hz.rel
sdar -rc fusion.lib VDP60Hz.rel
sdar -rc fusion.lib readsp.rel
sdar -rc fusion.lib readtpa.rel
sdar -rc fusion.lib setrealtimer.rel
sdar -rc fusion.lib realtimer.rel
sdar -rc fusion.lib mouseread.rel
sdar -rc fusion.lib covoxplay.rel
sdar -rc fusion.lib sc2circle.rel
sdar -rc fusion.lib sc2circlefilled.rel
sdar -rc fusion.lib vdplinesswitch.rel
sdar -rc fusion.lib rlewbtovram.rel
sdar -rc fusion.lib rlewbtoram.rel
sdar -rc fusion.lib setdisktraddress.rel
sdar -rc fusion.lib getdisktraddress.rel
sdar -rc fusion.lib sectorread.rel
sdar -rc fusion.lib sectorwrite.rel
sdar -rc fusion.lib getdiskparam.rel
sdar -rc fusion.lib vram.rel
sdar -rc fusion.lib interrupt.rel
echo "... including functions to the library"
for file in *.rel ; do
echo $file;tput cuu1;tput el;
sdar -rc fusion.lib $file
err=$?
if [ $err -gt 0 ];then
echo "Error $err when including $file file"
exit 1
fi
done
#----------------------------------------------- Cleaning folder, y removing temp files
echo " ... cleaning folder"
echo "... cleaning folder"
rm *.rel
rm *.asm
rm *.lst
rm *.sym
#----------------------------------------------- Copying the fusion.lib file to another place
cp fusion.lib ../../lib/
echo " Done... Have a good day sir"
exit 0

File diff suppressed because it is too large Load Diff

View File

@@ -37,8 +37,6 @@ __asm
__endasm;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -25,19 +25,19 @@
// Change Capital Led of the keyboard On/off
void ChangeCap(char n) __naked
{
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0132 ; Bios routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop IY
pop IX
ret
__endasm;
n;
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0132 ; Bios routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop iy
pop ix
ret
__endasm;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -19,25 +19,24 @@
*/
/* ChangeCPU */
/* For MSX Turbo-R Only. Change CPU mode */
void ChangeCPU (char n)
{
// Enter n= 0: Z80 mode
// 1: R800 Rom Mode
// 2: R800 DRAM Mode
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0180 ; Bios CPU GET routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop IY
pop IX
ret
__endasm;
}
void ChangeCPU (char n) __naked
{
n;
// Enter n= 0: Z80 mode
// 1: R800 Rom Mode
// 2: R800 DRAM Mode
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0180 ; Bios CPU GET routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop iy
pop ix
ret
__endasm;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 02-04 - 2019 |
| V1.2 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -63,7 +63,7 @@ void CovoxPlay(char page, unsigned int start_adress, unsigned int length, char s
{
// Prepare VDP for reading data from Start_adress, in current screen mode and defined vram page
DisableInterupt();
DisableInterrupt();
if( Peek( 0xFCAF ) >= 7 ) {
VDPwriteNi( 14, (start_adress >> 14) | (page << 2) );
}
@@ -76,5 +76,5 @@ void CovoxPlay(char page, unsigned int start_adress, unsigned int length, char s
// Send data to covox port #91 (Printer port)
Covox(length, speed);
EnableInterupt();
}
EnableInterrupt();
}

View File

@@ -0,0 +1,412 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.2 - August 2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| Definitions used by G9KLIB |
;| By Sylvain G. |
;\___________________________________________________________/
; .ifndef BDOS_INC
; .define BDOS_INC
; System entry points
BDOS .equ 0x0005 ; BDOS entry address
MSX_DOS_SYS_ADR .equ 0x0006 ; Address of msxdos2.sys
; Bdos functions (DOS2)
_TERM0 .equ 0x00 ; Program terminate
_CONIN .equ 0x01 ; Console input
_CONOUT .equ 0x02 ; Console output
_AUXIN .equ 0x03 ; Auxiliary input
_AUXOUT .equ 0x04 ; Auxiliary output
_LSTOUT .equ 0x05 ; Printer output
_DIRIO .equ 0x06 ; Direct console I/O
_DIRIN .equ 0x07 ; Direct console input
_INNOE .equ 0x08 ; Console input without echo
_STROUT .equ 0x09 ; String output
_BUFIN .equ 0x0A ; Buffered line input
_CONST .equ 0x0B ; Console status
_CPMVER .equ 0x0C ; Return version number
_DSKRST .equ 0x0D ; Disk reset
_SELDSK .equ 0x0E ; Select disk
_LOGIN .equ 0x18 ; Get login vector
_CURDRV .equ 0x19 ; Get current drive
_SETDTA .equ 0x1A ; Set dsisk transfer adress
_ALLOC .equ 0x1B ; Get alloc information
_GDATE .equ 0x2A ; Get date
_SDATE .equ 0x2B ; Set date
_GTIME .equ 0x2C ; Get time
_STIME .equ 0x2D ; Set time
_VERIFY .equ 0x2E ; Set/reset verify flag
_RDABS .equ 0x2F ; Absolute sector read
_WRABS .equ 0x30 ; Absolute sector write
_DPARM .equ 0x31 ; Get disk parameters
_FFIRST .equ 0x40 ; Find first entry
_FNEXT .equ 0x41 ; Find next entry
_FNEW .equ 0x42 ; Find equ entry
_OPEN .equ 0x43 ; Open file handle
_CREATE .equ 0x44 ; Create file handle
_CLOSE .equ 0x45 ; Close file handle
_ENSURE .equ 0x46 ; Ensure file handle
_DUP .equ 0x47 ; Duplicate file handle
_READ .equ 0x48 ; Read from file handle
_WRITE .equ 0x49 ; Write to file handle
_SEEK .equ 0x4A ; Move file handle pointer
_IOCTL .equ 0x4B ; I/O control for devices
_HTEST .equ 0x4C ; Test file handle
_DELETE .equ 0x4D ; Delete file or subdirectory
_RENAME .equ 0x4E ; Rename file or subdirectory
_MOVE .equ 0x4F ; Move file or subdirectory
_ATTR .equ 0x50 ; Get/set file attributes
_FTIME .equ 0x51 ; Get/set file date and time
_HDELETE .equ 0x52 ; Delete file handle
_HRENAME .equ 0x53 ; Rename file handle
_HMOVE .equ 0x54 ; Move file handle
_HATTR .equ 0x55 ; Get/set file handle attributes
_HFTIME .equ 0x56 ; Get/set file handle date and time
_GETDTA .equ 0x57 ; Get disk transfer address
_GETVFY .equ 0x58 ; Get verify flag setting
_GETCD .equ 0x59 ; Get current directory
_CHDIR .equ 0x5A ; Change current directory
_PARSE .equ 0x5B ; Parse pathname
_PFILE .equ 0x5C ; Parse filename
_CHKCHR .equ 0x5D ; Check character
_WPATH .equ 0x5E ; Get whole path string
_FLUSH .equ 0x5F ; Flush disk buffers
_FORK .equ 0x60 ; Fork a child process
_JOIN .equ 0x61 ; Rejoin parent process
_TERM .equ 0x62 ; Terminate with error code
_DEFAB .equ 0x63 ; Define abort exit routine
_DEFER .equ 0x64 ; Define disk error handler routine
_ERROR .equ 0x65 ; Get previous error code
_EXPLAIN .equ 0x66 ; Explain error code
_FORMAT .equ 0x67 ; Format a disk
_RAMD .equ 0x68 ; Create or destroy RAM disk
_BUFFER .equ 0x69 ; Allocate sector buffers
_ASSGIN .equ 0x6A ; Logical drive assignment
_GENV .equ 0x6B ; Get environment item
_SENV .equ 0x6C ; Set environment item
_FENV .equ 0x6D ; Find environment item
_DSKCHK .equ 0x6E ; Get/set disk check status
_DOSVER .equ 0x6F ; Get MSX DOS version number
_REDIR .equ 0x70 ; Get/set redirection status
; Errors
;ERROR
.NCOMP .equ 0x0FF ; Incompatible disk
.WRERR .equ 0x0FE ; Write error
.DISK .equ 0x0FD ; Disk error
.NRDY .equ 0x0FC ; Not ready
.VERFY .equ 0x0FB ; Verify error
.DATA .equ 0x0FA ; Data error
.RNF .equ 0x0F9 ; Sector not found
.WPROT .equ 0x0F8 ; Write protected disk
.UFORM .equ 0x0F7 ; Unformatted disk
.NDOS .equ 0x0F6 ; Not a DOS disk
.WDISK .equ 0x0F5 ; Wrong disk
.WFILE .equ 0x0F4 ; Wrong disk for file
.SEEK .equ 0x0F3 ; Seek error
.IFAT .equ 0x0F2 ; Bad file allocation table
.NOUPB .equ 0x0F1 ; --
.IFORM .equ 0x0F0 ; Cannot format this drive
.INTER .equ 0x0DF ; Internal error
.NORAM .equ 0x0DE ; Not enough memory
.IBDOS .equ 0x0DC ; Invalid MSX-DOS call
.IDRV .equ 0x0DB ; Invalid drive
.IFNM .equ 0x0DA ; Invalid filename
.IPATH .equ 0x0D9 ; Invalid pathname
.PLONG .equ 0x0D8 ; Pathname too long
.NOFIL .equ 0x0D7 ; File not found
.NODIR .equ 0x0D6 ; Directory not found
.DRFUL .equ 0x0D5 ; Root directory full
.DKFUL .equ 0x0D4 ; Disk full
.DUPF .equ 0x0D3 ; Duplicate filename
.DIRE .equ 0x0D2 ; Invalid directory move
.FILRO .equ 0x0D1 ; Read only file
.DIRNE .equ 0x0D0 ; Directory not empty
.IATTR .equ 0x0CF ; Invalid attributes
.DOT .equ 0x0CE ; Invalid . or .. operation
.SYSX .equ 0x0CD ; System file exists
.DIRX .equ 0x0CC ; Directory exists
.FILEX .equ 0x0CB ; File exists
.FOPEN .equ 0x0CA ; File already in use
.OV64K .equ 0x0C9 ; Cannot transfer above 64K
.FILE .equ 0x0C8 ; File allocation error
.EOF .equ 0x0C7 ; End of file
.ACCV .equ 0x0C6 ; File access violation
.IPROC .equ 0x0C5 ; Invalid process id
.NHAND .equ 0x0C4 ; No spare file handles
.IHAND .equ 0x0C3 ; Invalid file handle
.NOPEN .equ 0x0C2 ; File handle not open
.IDEV .equ 0x0C1 ; Invalid device operation
.IENV .equ 0x0C0 ; Invalid environment string
.ELONG .equ 0x0BF ; Environment string too long
.IDATE .equ 0x0BE ; Invalid date
.ITIME .equ 0x0BD ; Invalid time
.RAMDX .equ 0x0BC ; RAM disk (drive H ) already exists
.NRAMD .equ 0x0BB ; RAM disk does not exist
.HDEAD .equ 0x0BA ; File handle has been deleted
.EOL .equ 0x0B9 ; Internal error. Should never occur
.ISBFN .equ 0x0B8 ; Invalid sub-function number
.STOP .equ 0x09F ; Ctrl-STOP pressed
.CTRLC .equ 0x09E ; Ctrl-C pressed
.ABORT .equ 0x09D ; Disk operation aborted
.OUTERR .equ 0x09C ; Error on standard output
.INERR .equ 0x09B ; Error on standard input
.BADCOM .equ 0x08F ; Wrong version of COMMAND
.BADCM .equ 0x08E ; Unrecognized command
.BUFUL .equ 0x08D ; Command too long
.OKCMD .equ 0x08C ; --
.IPARM .equ 0x08B ; Invalid parameter
.INP .equ 0x08A ; Too many parameters
.NOPAR .equ 0x089 ; Missing parameter
.IOPT .equ 0x088 ; Invalid option
.BADNO .equ 0x087 ; Invalid number
.NOHELP .equ 0x086 ; File for HELP not found
.BADVER .equ 0x085 ; Wrong version of MSX-DOS
.NOCAT .equ 0x084 ; Cannot concatenate destination file
.BADEST .equ 0x083 ; Cannot create destination file
.COPY .equ 0x082 ; File cannot be copied onto itself
.OVDEST .equ 0x081 ; Cannot overwrite previous destination file
; Allocate segment parameters
USER_SEGMENT .equ 0 ; Register A
SYSTEM_SEGMENT .equ 1 ; " "
PRIMARY_MAPPER .equ 0 ; Register B
; Open/create file flags (_OPEN,_CREATE)
OPEN_NO_WRITE .equ 1
OPEN_NO_READ .equ 2
OPEN_INHERITABLE .equ 4
; Seek flags (_SEEK)
SEEK_REL_BEGINING .equ 0 ; Relative to the beginning of the file
SEEK_REL_CURRENT .equ 1 ; Relative to the current position
SEEK_REL_END .equ 2 ; Relative to the end of the file.
; Parse flags(_PARSE)
;b0 - set if any characters parsed other than drive name
;b1 - set if any directory path specified
;b2 - set if drive name specified
;b3 - set if main filename specified in last item
;b4 - set if filename extension specified in last item
;b5 - set if last item is ambiguous
;b6 - set if last item is "." or ".."
;b7 - set if last item is ".."
; Create flags
CREATE_NEW .equ 128
; File attributes
FILE_READ_ONLY .equ 1 ;
FILE_HIDDEN .equ 2 ;
FILE_SYSTEM .equ 4 ;
FILE_VOLUME_NAME .equ 8 ;
FILE_DIRECTORY .equ 16 ;
FILE_ARCHIVE .equ 32 ;
FILE_RESERVED .equ 64 ;
FILE_DEVICE .equ 128 ;
; Disk error handler routine parameters in register C
ERROR_WRITING .equ 1 ; Set if writing
ERROR_NO_IGNORE .equ 2 ; Set if ignore not recommended
ERROR_AUTO_ABORT .equ 4 ; Set if auto-abort suggested
ERROR_VALID_SECTOR .equ 8 ; Set if sector number is valid
; Disk error handler routine return codes
CALL_SYSTEM_ERROR .equ 0 ; Call system error routine
ERROR_ABORT .equ 1 ; Abort
ERROR_RETRY .equ 2 ; Retry
ERROR_IGNORE .equ 3 ; Ignore
; Character flags for _CHKCHR
SUPPRESS_UPPER_CASING .equ 0 ; Set to suppress upper casing
FIRST_BYTE_WIDE_CHAR .equ 1 ; Set if first byte of 16-bit character
SECOND_BYTE_WIDE_CHAR .equ 2 ; Set if first byte of 16-bit character
VOLUME_NAME .equ 3 ; Set if second byte of 16-bit character
NOT_A_VALID_CHAR .equ 4 ; Not a valid file/volume name character
; Params _RAMD
DESTROY_RAMDISK .equ 0
GET_RAMDISK_SIZE .equ 0xFF
CREATE_RAMDISK .equ 1 ; CREATE_RAMDISK+n = 1+n
; Misc
CR .equ 0x0D ; Carridge Return
LF .equ 0x0A ; Line Feed
LE .equ 0x24 ; Line end
UPPER_CASE_MASK .equ 0xDF
CMD_LENGTH .equ 0x80
CMD_LINE .equ 0x82
COM_START_ADDR .equ 0x0100
BOOT_DRIVE .equ 0xF2FD
; STRUCT FIB
FIB.ff: .BYTE 0 ; 0 - Always 0FFh
FIB.fileName: .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0 ; Filename as an ASCIIZ string
FIB.fileAttrib: .BYTE 0 ; File attributes byte
FIB.lastModTime: .WORD 0 ; Time of last modification
FIB.lastModDate: .WORD 0 ; Date of last modification
FIB.startCluster: .WORD 0 ; Start Cluster
FIB.fileSize: .BYTE 0,0,0,0 ; Files size
FIB.logicalDrive: .BYTE 0 ; Logical drive
FIB.internalInfo: .BYTE 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Internal information, must not be modified
; ENDS
; STRUCT DISK_PAR
DISK_PAR.physicalDrive: .BYTE 1 ; 0 - Physical drive number (1=A: etc)
DISK_PAR.sectorSize: .WORD 0 ; 1,2 - Sector size (always 512 currently)
DISK_PAR.sectorsCluster: .BYTE 0 ; 3 - Sectors per cluster (non-zero power of 2)
DISK_PAR.reservedSectors: .WORD 0 ; 4,5 - Number of reserved sectors (usually 1)
DISK_PAR.nrOfFats: .BYTE 0 ; 6 - Number of copies of the FAT (usually 2)
DISK_PAR.nrRootEntries: .WORD 0 ; 7,8 - Number of root directory entries
DISK_PAR.logicalSectors: .WORD 0 ; 9,10 - Total number of logical sectors
DISK_PAR.mediaDescriptor: .BYTE 0 ; 11 - Media descriptor byte
DISK_PAR.nrSectorsFat: .BYTE 0 ; 12 - Number of sectors per FAT
DISK_PAR.firstRootSector: .WORD 0 ; 13..14 - First root directory sector number
DISK_PAR.firstDataSector: .WORD 0 ; 15..16 - First data sector number
DISK_PAR.maxClusterNr: .WORD 0 ; 17..18 - Maximum cluster number
DISK_PAR.dirtyDisk: .BYTE 0 ; 19 - Dirty disk flag
DISK_PAR.volumeID: .BYTE 0,0,0,0 ; 20..23 - Volume id. (-1 => no volume id.)
DISK_PAR.extLogicalSect: .BYTE 0,0,0 ; 24..26 - Extended total number of logical sectors (FAT16)
DISK_PAR.reserved: .BYTE 0,0,0,0,0 ; 27..31 - Reserved (currently always zero)
; ENDS
DPR_PTR_DRIVE_A .equ 0xf355
DPR_PTR_DRIVE_B .equ 0xf357
DPR_PTR_DRIVE_C .equ 0xf359
DPR_PTR_DRIVE_D .equ 0xf35b
DPR_PTR_DRIVE_E .equ 0xf35d
DPR_PTR_DRIVE_F .equ 0xf35f
DPR_PTR_DRIVE_G .equ 0xf361
DPR_PTR_DRIVE_H .equ 0xf363
;STRUCT DPR
DPR.driveNumber: .BYTE 0 ; Drive nummer
DPR.mediaId: .BYTE 0 ; Media ID byte
DPR.bytesPerSector: .WORD 0 ; number of bytes per sector
DPR.dirMask: .BYTE 0 ; directory maske
DPR.dirShift: .BYTE 0 ; directory shift
DPR.clusterMask: .BYTE 0 ; cluster mask
DPR.clusterShift: .BYTE 0 ; cluster shift
DPR.firstFatSector: .WORD 0 ; first FAT sector
DPR.nrFats: .BYTE 0 ; Number of FATs
DPR.nrDirEntries: .BYTE 0 ; aantal directory entries
DPR.firstDataSector: .WORD 0 ; eerste data sector
DPR.nrClusters: .WORD 0 ; Number of clusters + 1
DPR.sectorsFat: .BYTE 0 ; Number of sectors per FAT
DPR.firstDirSector: .WORD 0 ; eerste directory sector
DPR.fatAddress: .WORD 0 ; FAT-address
;ENDS
DRV_CTRL_1 .equ 0xFB21 ; number of drives connected to the 1st interface
SLOT_DRV_CNTRL_1 .equ 0xFB22 ; slotcode of the 1st interface
DRV_CTRL_2 .equ 0xFB23 ; number of drives connected to the 2nd interface
SLOT_DRV_CNTRL_2 .equ 0xFB24 ; slotcode of the 2nd interface
DRV_CTRL_3 .equ 0xFB25 ; number of drives connected to the 3rd interface
SLOT_DRV_CNTRL_3 .equ 0xFB26 ; slotcode of the 3rd interface
DRV_CTRL_4 .equ 0xFB27 ; number of drives connected to the 4th interface
SLOT_DRV_CNTRL_4 .equ 0xFB28 ; slotcode of the 4th interface
SLTWORK_BASE .equ 0xFD09
; STRUCT DISK_WORK_AREA
DISK_WORK_AREA.diskStopCount: .BYTE 0 ; Diskstop counter
DISK_WORK_AREA.readyFlagA: .BYTE 0 ; Ready-flag drive A: (=counter after diskstop)
DISK_WORK_AREA.readyFlagB: .BYTE 0 ; Ready-flag drive B: (=counter after diskstop)
DISK_WORK_AREA.activePhysDrive: .BYTE 0 ; Active physical drive
DISK_WORK_AREA.lastTrackVirDrA: .BYTE 0 ; Last track position for virtual drive A:
DISK_WORK_AREA.lastTrackVirDrB: .BYTE 0 ; Last track position for virtual drive B:
DISK_WORK_AREA.activeLogDrive: .BYTE 0 ; Active logical drive
DISK_WORK_AREA.nrPhysDrives: .BYTE 0 ; number of connected physical drives
; ENDS
; STRUCT MAPPER_TABLE
MAPPER_TABLE.slotAddress: .BYTE 0 ; Slot address of the mapper slot.
MAPPER_TABLE.nrSegments: .BYTE 0 ; Total number of 16k RAM segments. 1...255 (8...255 for the primary)
MAPPER_TABLE.freeSegments: .BYTE 0 ; Number of free 16k RAM segments.
MAPPER_TABLE.sysAllocated: .BYTE 0 ; Number of 16k RAM segments allocated to the system (at least 6 for the primay)
MAPPER_TABLE.userAllocated: .BYTE 0 ; Number of 16k RAM segments allocated to the user
; ENDS
; Entries for other mapper slots. If there is none, MAPPER_TABLE+8 will be zero.
; STRUCT MAPPER_FUNCTIONS
MAPPER_FUNCTIONS.AllocateSeg: .BYTE 0,0,0 ; Allocate a 16k segment.
MAPPER_FUNCTIONS.FreeSeg: .BYTE 0,0,0 ; Free a 16k segment.
MAPPER_FUNCTIONS.ReadSeg: .BYTE 0,0,0 ; Read byte from address A HL to A.
MAPPER_FUNCTIONS.WriteSeg: .BYTE 0,0,0 ; Write byte from E to address A HL.
MAPPER_FUNCTIONS.CallSeg: .BYTE 0,0,0 ; Inter-segment call. Address in IYh IX
MAPPER_FUNCTIONS.CallsSeg: .BYTE 0,0,0 ; Inter-segment call. Address in line after the call instruction.
MAPPER_FUNCTIONS.PutSeg: .BYTE 0,0,0 ; Put segment into page (HL).
MAPPER_FUNCTIONS.GetSeg: .BYTE 0,0,0 ; Get current segment for page (HL)
MAPPER_FUNCTIONS.PutSeg0: .BYTE 0,0,0 ; Put segment into page 0.
MAPPER_FUNCTIONS.GetSeg0: .BYTE 0,0,0 ; Get current segment for page 0.
MAPPER_FUNCTIONS.PutSeg1: .BYTE 0,0,0 ; Put segment into page 1.
MAPPER_FUNCTIONS.GetSeg1: .BYTE 0,0,0 ; Get current segment for page 1.
MAPPER_FUNCTIONS.PutSeg2: .BYTE 0,0,0 ; Put segment into page 2.
MAPPER_FUNCTIONS.GetSeg2: .BYTE 0,0,0 ; Get current segment for page 2.
MAPPER_FUNCTIONS.PutSeg3: .BYTE 0,0,0 ; Put segment into page 3.
MAPPER_FUNCTIONS.GetSeg3: .BYTE 0,0,0 ; Get current segment for page 3.
; ENDS
; STRUCT MAPPER
nrSegments: .BYTE 0
priMapperSlot: .BYTE 0
freeSegments: .BYTE 0
mapperSupport: .WORD 0 ; mapper support routine address
AllocateSegment: .BYTE 0,0,0 ; Allocate a 16k segment.
FreeSegment: .BYTE 0,0,0 ; Free a 16k segment.
ReadSegmentByte: .BYTE 0,0,0 ; Read byte from address A HL to A.
WriteSegmentByte: .BYTE 0,0,0 ; Write byte from E to address A HL.
InterSegCallReg: .BYTE 0,0,0 ; Inter-segment call. Address in IYh IX
InterSegCall: .BYTE 0,0,0 ; Inter-segment call. Address in line after the call instruction.
PutSegmentHL: .BYTE 0,0,0 ; Put segment into page (HL).
GetSegmentHL: .BYTE 0,0,0 ; Get current segment for page (HL)
PutSegment0: .BYTE 0,0,0 ; Put segment into page 0.
GetSegment0: .BYTE 0,0,0 ; Get current segment for page 0.
PutSegment1: .BYTE 0,0,0 ; Put segment into page 1.
GetSegment1: .BYTE 0,0,0 ; Get current segment for page 1.
PutSegment2: .BYTE 0,0,0 ; Put segment into page 2.
GetSegment2: .BYTE 0,0,0 ; Get current segment for page 2.
PutSegment3: .BYTE 0,0,0 ; Not supported since page-3 must never be changed. Acts like a "NOP" if called.
GetSegment3: .BYTE 0,0,0 ; Get current segment for page 3.
; ENDS
.MACRO BdosCall function
LD C,function
CALL BDOS
.ENDM
.MACRO CallSegment segment,address
LD IY,(segment-#1)
LD IX,address
CALL mapper.InterSegCallReg
.ENDM
; .endif

View File

@@ -0,0 +1,288 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.2 - August 2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| G9klib is Fusion-C Library for GFX9000 Graphic Card |
;| |
;| This G9KLIB is a port of the ASM G9KLIB by Team Bomba |
;| https://www.teambomba.net/gfx9klib.html |
;| By Sylvain G. |
;\___________________________________________________________/
;
;
; This G9KLIB is currently in Beta Version. No manual Available at this time.
;
;----------------------------------------------------------------------------;
; Gfx9000 general functions ;
;----------------------------------------------------------------------------;
;----------------------------------------------------------------------------;
; V9990 register and port defines ;
;----------------------------------------------------------------------------;
; Port defines
G9K_VRAM .equ 0x60 ; R/W
G9K_PALETTE .equ 0x61 ; R/W
G9K_CMD_DATA .equ 0x62 ; R/W
G9K_REG_DATA .equ 0x63 ; R/W
G9K_REG_SELECT .equ 0x64 ; W
G9K_STATUS .equ 0x65 ; R
G9K_INT_FLAG .equ 0x66 ; R/W
G9K_SYS_CTRL .equ 0x67 ; W
G9K_OUTPUT_CTRL .equ 0x6F ; R/W
; Register defines
G9K_WRITE_ADDR .equ 0 ; W
G9K_READ_ADDR .equ 3 ; W
G9K_SCREEN_MODE0 .equ 6 ; R/W
G9K_SCREEN_MODE1 .equ 7 ; R/W
G9K_CTRL .equ 8 ; R/W
G9K_INT_ENABLE .equ 9 ; R/W
G9K_INT_V_LINE_LO .equ 10 ; R/W
G9K_INT_V_LINE_HI .equ 11 ; R/W
G9K_INT_H_LINE .equ 12 ; R/W
G9K_PALETTE_CTRL .equ 13 ; W
G9K_PALETTE_PTR .equ 14 ; W
G9K_BACK_DROP_COLOR .equ 15 ; R/W
G9K_DISPLAY_ADJUST .equ 16 ; R/W
G9K_SCROLL_LOW_Y .equ 17 ; R/W
G9K_SCROLL_HIGH_Y .equ 18 ; R/W
G9K_SCROLL_LOW_X .equ 19 ; R/W
G9K_SCROLL_HIGH_X .equ 20 ; R/W
G9K_SCROLL_LOW_Y_B .equ 21 ; R/W
G9K_SCROLL_HIGH_Y_B .equ 22 ; R/W
G9K_SCROLL_LOW_X_B .equ 23 ; R/W
G9K_SCROLL_HIGH_X_B .equ 24 ; R/W
G9K_PAT_GEN_TABLE .equ 25 ; R/W
G9K_LCD_CTRL .equ 26 ; R/W
G9K_PRIORITY_CTRL .equ 27 ; R/W
G9K_SPR_PAL_CTRL .equ 28 ; W
G9K_SC_X .equ 32 ; W
G9K_SC_Y .equ 34 ; W
G9K_DS_X .equ 36 ; W
G9K_DS_Y .equ 38 ; W
G9K_NX .equ 40 ; W
G9K_NY .equ 42 ; W
G9K_ARG .equ 44 ; W
G9K_LOP .equ 45 ; W Logical Operation WC (Write Color) is obtained through logical operation with SC (Source Color) and DC (Destination Color)
; b0 L00 : WC value for the bit with SC=0 and DC=0
; b1 L01 : WC value for the bit with SC=0 and DC=1
; b2 L10 : WC value for the bit with SC=1 and DC=0
; b3 L11 : WC value for the bit with SC=1 and DC=1
; b4 TP : When this bit is "1", the data with SC as all "0" (by pixel for the X/Y-coordinates and by byte for the linear address) is not transferred.
G9K_WRITE_MASK .equ 46 ; W
G9K_FC .equ 48 ; W
G9K_BC .equ 50 ; W
G9K_OPCODE .equ 52 ; W
; Register Select options
G9K_DIS_INC_READ .equ 64
G9K_DIS_INC_WRITE .equ 128
; Bit defines G9K_SCREEN_MODE0 (register 6)
G9K_SCR0_STANDBY .equ 192 ; Stand by mode
G9K_SCR0_BITMAP .equ 128 ; Select Bit map mode
G9K_SCR0_P2 .equ 64 ; Select P2 mode
G9K_SCR0_P1 .equ 0 ; Select P1 mode
G9K_SCR0_DTCLK .equ 32 ; Master Dot clock not divided
G9K_SCR0_DTCLK2 .equ 16 ; Master Dot clock divided by 2
G9K_SCR0_DTCLK4 .equ 0 ; Master Dot clock divided by 4
G9K_SCR0_XIM2048 .equ 12 ; Image size = 2048
G9K_SCR0_XIM1024 .equ 8 ; Image size = 1024
G9K_SCR0_XIM512 .equ 4 ; Image size = 512
G9K_SCR0_XIM256 .equ 0 ; Image size = 256
G9K_SCR0_16BIT .equ 3 ; 16 bits/dot
G9K_SCR0_8BIT .equ 2 ; 8 bits/dot
G9K_SCR0_4BIT .equ 1 ; 4 bits/dot
G9K_SCR0_2BIT .equ 0 ; 2 bits/dot
; Bit defines G9K_SCREEN_MODE1 (register 7)
G9K_SCR1_C25M .equ 64 ; Select 640*480 mode
G9K_SCR1_SM1 .equ 32 ; Selection of 263 lines during non interlace , else 262
G9K_SCR1_SM .equ 16 ; Selection of horizontal frequency 1H=fsc/227.5
G9K_SCR1_PAL .equ 8 ; Select PAL, else NTSC
G9K_SCR1_EO .equ 4 ; Select of vertical resoltion of twice the non-interlace resolution
G9K_SCR1_IL .equ 2 ; Select Interlace
G9K_SCR1_HSCN .equ 1 ; Select High scan mode
; Bit defines G9K_CTRL (Register 8)
G9K_CTRL_DISP .equ 128 ; Display VRAM
G9K_CTRL_DIS_SPD .equ 64 ; Disable display sprite (cursor)
G9K_CTRL_YSE .equ 32 ; /YS Enable
G9K_CTRL_VWTE .equ 16 ; VRAM Serial data bus control during digitization
G9K_CTRL_VWM .equ 8 ; VRAM write control during digitization
G9K_CTRL_DMAE .equ 4 ; Enable DMAQ output
G9K_CTRL_VRAM512 .equ 2 ; VRAM=512KB
G9K_CTRL_VRAM256 .equ 1 ; VRAM=256KB
G9K_CTRL_VRAM128 .equ 0 ; VRAM=128KB
; Bit Defines G9K_PALETTE_CTRL (Register 13)
G9K_PAL_CTRL_YUV .equ 192 ; YUV mode
G9K_PAL_CTRL_YJK .equ 128 ; YJK mode
G9K_PAL_CTRL_256 .equ 64 ; 256 color mode
G9K_PAL_CTRL_PAL .equ 0 ; Pallete mode
G9K_PAL_CTRL_YAE .equ 32 ; Enable YUV/YJK RGB mixing mode
; Bit defines G9K_SYS_CTRL
G9K_SYS_CTRL_SRS .equ 2 ; Power on reset state
G9K_SYS_CTRL_MCKIN .equ 1 ; Select MCKIN terminal
G9K_SYS_CTRL_XTAL .equ 0 ; Select XTAL
; Blitter Commands G9K_OPCODE (Register 52)
G9K_OPCODE_STOP .equ 0x00 ; Command being excuted is stopped
G9K_OPCODE_LMMC .equ 0x10 ; Data is transferred from CPU to VRAM rectangle area
G9K_OPCODE_LMMV .equ 0x20 ; VRAM rectangle area is painted out
G9K_OPCODE_LMCM .equ 0x30 ; VRAM rectangle area is transferred to CPU
G9K_OPCODE_LMMM .equ 0x40 ; Rectangle area os transferred from VRAM to VRAM
G9K_OPCODE_CMMC .equ 0x50 ; CPU character data is color-developed and transferred to VRAM rectangle area
G9K_OPCODE_CMMK .equ 0x60 ; Kanji ROM data is is color-developed and transferred to VRAM rectangle area
G9K_OPCODE_CMMM .equ 0x70 ; VRAM character data is color-developed and transferred to VRAM rectangle area
G9K_OPCODE_BMXL .equ 0x80 ; Data on VRAM linear address is transferred to VRAM rectangle area
G9K_OPCODE_BMLX .equ 0x90 ; VRAM rectangle area is transferred to VRAM linear address
G9K_OPCODE_BMLL .equ 0xA0 ; Data on VRAM linear address is transferred to VRAM linear address
G9K_OPCODE_LINE .equ 0xB0 ; Straight line is drawer on X-Y co-ordinates
G9K_OPCODE_SRCH .equ 0xC0 ; Border color co-ordinates on X-Y are detected
G9K_OPCODE_POINT .equ 0xD0 ; Color code on specified point on X-Y is read out
G9K_OPCODE_PSET .equ 0xE0 ; Drawing is executed at drawing point on X-Y co-ordinates
G9K_OPCODE_ADVN .equ 0xF0 ; Drawing point on X-Y co-ordinates is shifted
; Bit defines G9K_ARG
G9K_ARG_MAJ .equ 1
G9K_ARG_NEG .equ 2
G9K_ARG_DIX .equ 4
G9K_ARG_DIY .equ 8
; Bit defines G9K_STATUS
G9K_STATUS_TR .equ 128
G9K_STATUS_VR .equ 64
G9K_STATUS_HR .equ 32
G9K_STATUS_BD .equ 16
G9K_STATUS_MSC .equ 4
G9K_STATUS_EO .equ 2
G9K_STATUS_CE .equ 1
VFF_OBJECT:
VFF_OBJECT.fileHandle .equ 0
VFF_OBJECT.name .equ 2
VFF_OBJECT.width .equ 18
VFF_OBJECT.height .equ 19
VFF_OBJECT.pitch .equ 20
VFF_OBJECT.dataSize .equ 21
VFF_OBJECT.ptrOffsetTable .equ 23
VFF_OBJECT.vramOffset .equ 25
VFF_OBJECT.ramFont .equ 27
G9B_OBJECT:
G9B_OBJECT.fileHandle .equ 0 ; 2 ; Dos2 file handle of the openend G9B file
G9B_OBJECT.bitDepth .equ 2 ; 1 ; 2,4,8 or 16 bit
G9B_OBJECT.colorType .equ 3 ; 1 ; 0=64 color palette mode,64=256 color fixed ,128=YJK and 192=YUV mode
G9B_OBJECT.nrColors .equ 4 ; 1 ; Number of colors in palette mode
G9B_OBJECT.width .equ 5 ; 2 ; Width
G9B_OBJECT.height .equ 7 ; 2 ; Height
G9B_OBJECT.compression .equ 9 ; 1 ; 0 = no compression, other value = compression used
G9B_OBJECT.dataSize .equ 10 ; 3 ; 24 bit data size
G9B_COMPRESSION_BITBUST .equ 1
;----------------------------------------------------------------------------;
; ;G9k Error codes ;
;----------------------------------------------------------------------------;
; Error codes
_NOVFF .equ 1 ; Input file is not a VFF file
_NOG9B .equ 2 ; Input file is not a G9B file
; RAM copy and print mode
TO_VRAM .equ 0 ;
TO_RAM .equ 1 ;
TO_XY .equ 1 ;
.macro G9kCmdWait ?localLabel
; Wait for command execution completion
; Modifies A
localLabel:
IN A,(G9K_STATUS)
RRA
JR C,localLabel
.endm
.macro G9kWriteReg register,data
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,#data
OUT (G9K_REG_DATA),A
.endm
.macro G9kWriteRegB register
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,B
OUT (G9K_REG_DATA),A
.endm
.macro G9kWriteRegC register
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,C
OUT (G9K_REG_DATA),A
.endm
.macro G9kWriteRegD register
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,D
OUT (G9K_REG_DATA),A
.endm
.macro G9kWriteRegE register
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,E
OUT (G9K_REG_DATA),A
.endm
.macro G9kWriteRegL register
; Write gfx9000 register
; modifies: A
LD A,#register
OUT (G9K_REG_SELECT),A
LD A,L
OUT (G9K_REG_DATA),A
.endm
.macro G9kReadReg register
; Read Gfx9000 register
; Result in A
LD A,#register
OUT (G9K_REG_SELECT),A
IN A,(G9K_REG_DATA)
.endm
.macro G9kWaitComReady ?lwait
; Wait for Command data ready
lwait:
IN A,(#G9K_STATUS)
RLA
JR NC,lwait ;$-3
.endm

2761
fusion-c/source/lib/g9klib.s Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.2 - August 2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| Macro definition used by G9KLIB |
;| By Sylvain G. |
;\___________________________________________________________/
;
; .ifndef MACROS_INC
; .define MACROS_INC
;add A to HL
.macro ADD_HL_A
add a,l
ld l,a
jr nc,jpahl
inc h
jpahl:
.endm
; .endif
; macro to get a bit from the bitstream
; carry if bit is set, nocarry if bit is clear
; must be entered with second registerset switched in!
.macro GET_BIT_FROM_BITSTREAM ?.done
add a,a ; shift out new bit
jp nz,.done ; if remaining value isn't zere, we're done
ld a,(hl) ; get 8 bits from bitstream
inc hl ; increase source data address
rla ; (bit 0 will be set!!!!)
.done:
.endm
.macro LD_A_IXL
.db 0xDD,0x7D ; LD A,IXL
.endm
.macro LD_A_IXH
.db 0xDD,0x7C ; LD A,IXH
.endm
.macro LD_A_IYL
.db 0xFD,0x7D ; LD A,IYL
.endm
.macro LD_A_IYH
.db 0xFD,0x7C ; LD A,IXH
.endm
.macro LD_E_IYL
.db 0xFD,0x5D ; LD E,IYL
.endm

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -20,27 +20,24 @@
/* GetCPU */
/* For MSX Turbo-R Only. Return CPU mode */
char GetCPU (void)
{
// Return 0: Z80 mode
// 1: R800 Rom Mode
// 2: R800 DRAM Mode
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0183 ; Bios CPU GET routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop IY
pop IX
ret
__endasm;
}
char GetCPU (void) __naked
{
// Return 0: Z80 mode
// 1: R800 Rom Mode
// 2: R800 DRAM Mode
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x0183 ; Bios CPU GET routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop iy
pop ix
ret
__endasm;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -53,7 +53,7 @@ bit 7 6 5 4 3 2 1 0
9 NUM4 NUM3 NUM2 NUM1 NUM0 NUM/ NUM+ NUM*
10 NUM. NUM, NUM- NUM9 NUM8 NUM7 NUM6 NUM5
============================================================================= */
char GetKeyMatrix(char line)
char GetKeyMatrix(char line) __naked
{
line;
__asm

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -51,20 +51,21 @@
Input : [char] register number (0 to 13)
Output : [char] value
============================================================================= */
char GetSound(char reg){
char GetSound(char reg) __naked
{
reg;
__asm
push IX
ld IX,#0
add IX,SP
push ix
ld ix,#0
add ix,sp
ld A,4(IX)
out (#AY0index),A
in A,(#AY0read)
ld a,4(ix)
out (#AY0index),a
in a,(#AY0read)
ld L,A
ld l,a
pop IX
pop ix
__endasm;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1b. July 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C S O U R C E C O D E |
| |
| Itoa |
\___________________________________________________________/
*/
// .
// Integer to Char converter
// Eric Boez 2019
//
#include "../../header/msx_fusion.h"
char* Itoa(int num, char* str, int base)
{
int i = 0;
char isNegative = 0;
/* Handle 0 explicitely, otherwise empty string is printed for 0 */
if (num == 0)
{
str[i++] = '0';
str[i] = '\0';
return str;
}
// In standard itoa(), negative numbers are handled only with
// base 10. Otherwise numbers are considered unsigned.
if (num < 0 && base == 10)
{
isNegative = 1;
num = -num;
}
// Process individual digits
while (num != 0)
{
int rem = num % base;
str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0';
num = num/base;
}
// If number is negative, append '-'
if (isNegative)
str[i++] = '-';
str[i] = '\0'; // Append string terminator
// Reverse the string
StrReverse(str);
return str;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -27,20 +27,20 @@
unsigned char JoystickRead(char joyNumber) __naked
{
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x00d5 ; Bios Joystick Read routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop IY
pop IX
ret
__endasm;
joyNumber;
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x00d5 ; Bios Joystick Read routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop iy
pop ix
ret
__endasm;
}

View File

@@ -1,118 +1,15 @@
------------------------------------ FUSION-C
Lun 27 mai 2019 16:49:31 CEST
Ven 30 aoû 2019 18:12:15 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
../../header/msx_fusion.h:261: syntax error: token -> ';' ; column 52
printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier
------------------------------------ FUSION-C
Lun 27 mai 2019 16:52:00 CEST
Ven 30 aoû 2019 19:49:09 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier
------------------------------------ FUSION-C
Mar 28 mai 2019 17:27:25 CEST
Lun 2 sep 2019 17:10:01 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
------------------------------------ FUSION-C
Ven 31 mai 2019 11:03:37 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
------------------------------------ FUSION-C
Lun 17 jui 2019 05:52:51 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
------------------------------------ FUSION-C
Lun 17 jui 2019 06:10:55 CEST
------------------------------------
printf.c:88: warning 85: in function do_char unreferenced function argument : 'buf'
printf.c:88: warning 85: in function do_char unreferenced function argument : 'c'
getkeymatrix.c:74: warning 59: function 'GetKeyMatrix' must return value
changecap.c:42: warning 85: in function ChangeCap unreferenced function argument : 'n'
joystickread.c:45: warning 85: in function JoystickRead unreferenced function argument : 'joyNumber'
triggerread.c:43: warning 85: in function TriggerRead unreferenced function argument : 'joyNumber'
getcpu.c:43: warning 59: function 'GetCPU' must return value
changecpu.c:41: warning 85: in function ChangeCPU unreferenced function argument : 'n'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'start'
pcmplay.c:47: warning 85: in function PCMPlay unreferenced function argument : 'lenght'
getsound.c:68: warning 59: function 'GetSound' must return value
printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier

View File

@@ -7,7 +7,7 @@
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.0 - 09-10-11 2018 |
;| V1.2 - 08 2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1 - 02-04 2019 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -24,8 +24,8 @@
// Return the x and y offset of mouse in a 16 bits value.
// Return 0xFFFF if no mouse detected
// Mouse port codes are
// Port 1 : 0x9310
// Port 2 : 0xEC20
// Port 1 : 0x1310
// Port 2 : 0x6C20
//
unsigned int MouseRead(unsigned int MousePort) __naked
@@ -34,11 +34,9 @@ MousePort;
__asm
; Routine to read the mouse by direct accesses (works on MSX1/2/2+/turbo R)
;
; Input: DE = 09310h for mouse in port 1 (D = 10010011b, E = 00010000b)
; DE = 0EC20h for mouse in port 2 (D = 11101100b, E = 00100000b)
; Input: DE = 01310h for mouse in port 1 (D = 00010011b, E = 00010000b)
; DE = 06C20h for mouse in port 2 (D = 01101100b, E = 00100000b)
; Output: H = X-offset, L = Y-offset (H = L = 255 if no mouse)
push ix
ld ix,#0
@@ -47,47 +45,55 @@ __asm
ld d,5(ix)
GTMOUS:
di ; DI useless if the routine is used during an interrupt
ld b,#30 ; Long delay for first read
call GTOFS2 ; Read bits 7-4 of the x-offset
and #0xF
and #0x0F
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the x-offset
and #0xF
and #0x0F
or c
ld h,a ; Store combined x-offset
call GTOFST ; Read bits 7-4 of the y-offset
and #0xF
and #0x0F
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the y-offset
and #0xF
and #0x0F
or c
ld l,a ; Store combined y-offset
ei ; EI useless if the routine is used during an interrupt
ld b,#40
call WAITMS
pop ix
ret
GTOFST: ld b,#10
GTOFS2: ld a,#15 ; Read PSG register 15 for mouse
di ; DI useless if the routine is used during an interrupt
out (#0xA0),a
ld a,d
out (#0xA1),a
xor e
ld d,a
in a,(#0xA1) ; preserve LED code/Kana state
and #0x80
or d ; mouse1 x0010011b / mouse2 x1101100b
; ld a,d
out (#0xA1),a ; first pin8=1, at second pass pin8=0 and so on
xor e ; reverse pin 8 state
ld d,a ;
call WAITMS ; Extra delay because the mouse is slow
call WAITMS ; Wait before read : 100<>150 us for first read
; 50<>150 us for next reads
ld a,#14
out (#0xA0),a
ei ; EI useless if the routine is used during an interrupt
in a,(#0xA2)
ret
WAITMS:
@@ -107,5 +113,4 @@ __asm
ret
__endasm;
}

View File

@@ -0,0 +1,112 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1 - 02-04 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C & A S M S O U R C E C O D E |
| |
| |
\___________________________________________________________/
*/
// Done with the help of GDX
//
// Mouse control function
//
// Return the x and y offset of mouse in a 16 bits value.
// Return 0xFFFF if no mouse detected
// Mouse port codes are
// Port 1 : 0x9310
// Port 2 : 0xEC20
//
unsigned int MouseRead(unsigned int MousePort) __naked
{
MousePort;
__asm
; Routine to read the mouse by direct accesses (works on MSX1/2/2+/turbo R)
;
; Input: DE = 09310h for mouse in port 1 (D = 10010011b, E = 00010000b)
; DE = 0EC20h for mouse in port 2 (D = 11101100b, E = 00100000b)
; Output: H = X-offset, L = Y-offset (H = L = 255 if no mouse)
push ix
ld ix,#0
add ix,sp
ld e,4(ix)
ld d,5(ix)
pop ix
GTMOUS:
ld b,#30 ; Long delay for first read
call GTOFS2 ; Read bits 7-4 of the x-offset
and #0xF
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the x-offset
and #0xF
or c
ld h,a ; Store combined x-offset
call GTOFST ; Read bits 7-4 of the y-offset
and #0xF
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the y-offset
and #0xF
or c
ld l,a ; Store combined y-offset
ret
GTOFST: ld b,#10
GTOFS2: ld a,#15 ; Read PSG register 15 for mouse
di ; DI useless if the routine is used during an interrupt
out (#0xA0),a
ld a,d
out (#0xA1),a
xor e
ld d,a
call WAITMS ; Extra delay because the mouse is slow
ld a,#14
out (#0xA0),a
ei ; EI useless if the routine is used during an interrupt
in a,(#0xA2)
ret
WAITMS:
ld a,b
WTTR:
djnz WTTR
.db #0xED,#0x55 ; Back if Z80 (RETN on Z80, NOP on R800)
rlca
rlca
;add a,b
ld b,a
WTTR2:
djnz WTTR2
ld b,a
WTTR3:
djnz WTTR3
ret
__endasm;
}

View File

@@ -0,0 +1,140 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C & A S M S O U R C E C O D E |
| |
| |
\___________________________________________________________/
*/
//
// Mouse control and button test function - return values to Structure
//
// MousePort must be 1 or 2
#include "../../header/msx_fusion.h"
void MouseReadTo(unsigned char MousePort, MOUSE_DATA *md) __naked
{
MousePort;
md;
__asm
; Routine to read the mouse by direct accesses (works on MSX1/2/2+/turbo R)
;
; Input: MousePort = 1 or 2
; md (MOUSE_DATA) including dx, dy, left button (1=OFF 0=ON), right button (1=OFF 0=ON)
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
ld l,5(ix)
ld h,6(ix)
ld de,#0x1310 ; DE = 01310h for mouse in port 1 (D = 00010011b, E = 00010000b)
and #02
jr z,GTMOUS
ld de,#0x6C20 ; DE = 06C20h for mouse in port 2 (D = 01101100b, E = 00100000b)
GTMOUS:
di ; DI useless if the routine is used during an interrupt
ld b,#30 ; Long delay for first read
call GTOFS2 ; Read bits 7-4 of the x-offset
and #0x0F
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the x-offset
and #0x0F
or c
ld (hl),a
inc hl
call GTOFST ; Read bits 7-4 of the y-offset
and #0x0F
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the y-offset
; can read mouse button bit4=left button / bit5=right button
ld b,a
and #0x0F
or c
ld (hl),a
ld a,b
and #0x10
rlca
rlca
rlca
rlca
inc hl
ld (hl),a
ld a,b
and #0x20
rlca
rlca
rlca
rlca
rlca
inc hl
ld (hl),a
ei ; EI useless if the routine is used during an interrupt
ld b,#40
call WAITMS
pop ix
ret
GTOFST: ld b,#10
GTOFS2: ld a,#15 ; Read PSG register 15 for mouse
out (#0xA0),a
in a,(#0xA1) ; preserve LED code/Kana state
and #0x80
or d ; mouse1 x0010011b / mouse2 x1101100b
out (#0xA1),a ; first pin8=1, at second pass pin8=0 and so on
xor e ; reverse pin 8 state
ld d,a ;
call WAITMS ; Wait before read : 100<>150 us for first read
; 50<>150 us for next reads
ld a,#14
out (#0xA0),a
in a,(#0xA2)
ret
WAITMS:
ld a,b
WTTR:
djnz WTTR
.db #0xED,#0x55 ; Back if Z80 (RETN on Z80, NOP on R800)
rlca
rlca
;add a,b
ld b,a
WTTR2:
djnz WTTR2
ld b,a
WTTR3:
djnz WTTR3
ret
__endasm;
}

View File

@@ -0,0 +1,330 @@
CLS
@echo off
echo " "
echo " F U S I O N - C V 1 . 2 "
echo " T h e U l t i m a t e SDCC L i b r a r y f o r M S X "
echo " Eric Boez & Fernando Garcia 2018-2019 : Made for coders !"
echo "_________________________________________________________________"
echo " "
echo " "
echo " "
echo "------------------------------------ FUSION-C" > log.txt
echo %date% %time% > log.txt
echo "------------------------------------" > log.txt
@echo "Now Building FUSION-C Library..."
@del .\fusion.lib
@echo "... Compiling ASM Functions"
sdasz80 -o fcb_find.s > log.txt
sdasz80 -o fcb_open.s > log.txt
sdasz80 -o fcb_read.s > log.txt
sdasz80 -o inport.s > log.txt
sdasz80 -o outport.s > log.txt
sdasz80 -o outports.s > log.txt
sdasz80 -o putchar_msxdos.s > log.txt
sdasz80 -o getchar_msxdos.s > log.txt
sdasz80 -o screen.s > log.txt
sdasz80 -o vdpstatus.s > log.txt
sdasz80 -o vdpstatusni.s > log.txt
sdasz80 -o vdpwrite.s > log.txt
sdasz80 -o vdpwriteni.s > log.txt
sdasz80 -o exit.s > log.txt
sdasz80 -o doscls.s > log.txt
sdasz80 -o intdosbios.s > log.txt
sdasz80 -o settime.s > log.txt
sdasz80 -o setdate.s > log.txt
sdasz80 -o gettime.s > log.txt
sdasz80 -o getdate.s > log.txt
sdasz80 -o suspend.s > log.txt
sdasz80 -o memchr.s > log.txt
sdasz80 -o memfill.s > log.txt
sdasz80 -o memcopy.s > log.txt
sdasz80 -o memcopyreverse.s > log.txt
sdasz80 -o memcompare.s > log.txt
sdasz80 -o waitkey.s > log.txt
sdasz80 -o keyboardread.s > log.txt
sdasz80 -o printdec.s > log.txt
sdasz80 -o inputchar.s > log.txt
sdasz80 -o printchar.s > log.txt
sdasz80 -o inputstring.s > log.txt
sdasz80 -o getche.s > log.txt
sdasz80 -o inkey.s > log.txt
sdasz80 -o setbordercolor.s > log.txt
sdasz80 -o puttext.s > log.txt
sdasz80 -o setpalette.s > log.txt
sdasz80 -o spritemore.s > log.txt
sdasz80 -o readwritescr.s > log.txt
sdasz80 -o scblock.s > log.txt
sdasz80 -o vdp_graph2.s > log.txt
sdasz80 -o vdp_graph1.s > log.txt
sdasz80 -o ctype.s > log.txt
sdasz80 -o io.s > log.txt
sdasz80 -o rammapper.s > log.txt
sdasz80 -o pt3replayer.s > log.txt
sdasz80 -o strcopy.s > log.txt
sdasz80 -o nstrcopy.s > log.txt
sdasz80 -o strlen.s > log.txt
sdasz80 -o strconcat.s > log.txt
sdasz80 -o nstrconcat.s > log.txt
sdasz80 -o strcompare.s > log.txt
sdasz80 -o nstrcompare.s > log.txt
sdasz80 -o strchr.s > log.txt
sdasz80 -o strsearch.s > log.txt
sdasz80 -o strposchr.s > log.txt
sdasz80 -o chartolower.s > log.txt
sdasz80 -o chartoupper.s > log.txt
sdasz80 -o strposstr.s > log.txt
sdasz80 -o strlefttrim.s > log.txt
sdasz80 -o strrighttrim.s > log.txt
sdasz80 -o setdisktradress.s > log.txt
sdasz80 -o getdisktradress.s > log.txt
sdasz80 -o sectorread.s > log.txt
sdasz80 -o sectorwrite.s > log.txt
sdasz80 -o getdiskparam.s > log.txt
sdasz80 -o readsp.s > log.txt
sdasz80 -o vram.s > log.txt
sdasz80 -o interrupt.s > log.txt
sdasz80 -o printhex.s > log.txt
echo " ... Compiling C functions"
sdcc --use-stdout -mz80 -c vpeek.c > log.txt
sdcc --use-stdout -mz80 -c vpeekfirst.c > log.txt
sdcc --use-stdout -mz80 -c vpoke.c > log.txt
sdcc --use-stdout -mz80 -c bchput.c > log.txt
sdcc --use-stdout -mz80 -c num2dec16.c > log.txt
sdcc --use-stdout -mz80 -c printfnumber.c > log.txt
sdcc --use-stdout -mz80 -c printnumber.c > log.txt
sdcc --use-stdout -mz80 -c getkeymatrix.c > log.txt
sdcc --use-stdout -mz80 -c readmsxtype.c > log.txt
sdcc --use-stdout -mz80 -c initpsg.c > log.txt
sdcc --use-stdout -mz80 -c killkeybuffer.c > log.txt
sdcc --use-stdout -mz80 -c fillvram.c > log.txt
sdcc --use-stdout -mz80 -c changecap.c > log.txt
sdcc --use-stdout -mz80 -c beep.c > log.txt
sdcc --use-stdout -mz80 -c showdisplay.c > log.txt
sdcc --use-stdout -mz80 -c hidedisplay.c > log.txt
sdcc --use-stdout -mz80 -c functionkeys.c > log.txt
sdcc --use-stdout -mz80 -c width.c > log.txt
sdcc --use-stdout -mz80 -c setscrollv.c > log.txt
sdcc --use-stdout -mz80 -c setscrollh.c > log.txt
sdcc --use-stdout -mz80 -c psgwrite.c > log.txt
sdcc --use-stdout -mz80 -c psgread.c > log.txt
sdcc --use-stdout -mz80 -c setactivepage.c > log.txt
sdcc --use-stdout -mz80 -c setdisplaypage.c > log.txt
sdcc --use-stdout -mz80 -c keysound.c > log.txt
sdcc --use-stdout -mz80 -c circle.c > log.txt
sdcc --use-stdout -mz80 -c circlefilled.c > log.txt
sdcc --use-stdout -mz80 -c joystickread.c > log.txt
sdcc --use-stdout -mz80 -c triggerread.c > log.txt
sdcc --use-stdout -mz80 -c getcpu.c > log.txt
sdcc --use-stdout -mz80 -c changecpu.c > log.txt
sdcc --use-stdout -mz80 -c pcmplay.c > log.txt
sdcc --use-stdout -mz80 -c silencepsg.c > log.txt
sdcc --use-stdout -mz80 -c sound.c > log.txt
sdcc --use-stdout -mz80 -c soundfx.c > log.txt
sdcc --use-stdout -mz80 -c setchannel.c > log.txt
sdcc --use-stdout -mz80 -c getsound.c > log.txt
sdcc --use-stdout -mz80 -c settoneperiod.c > log.txt
sdcc --use-stdout -mz80 -c setnoiseperiod.c > log.txt
sdcc --use-stdout -mz80 -c setenvelopeperiod.c > log.txt
sdcc --use-stdout -mz80 -c setvolume.c > log.txt
sdcc --use-stdout -mz80 -c playenvelope.c > log.txt
sdcc --use-stdout -mz80 -c locate.c > log.txt
sdcc --use-stdout -mz80 -c cls.c > log.txt
sdcc --use-stdout -mz80 -c print.c > log.txt
sdcc --use-stdout -mz80 -c setspritepattern.c > log.txt
sdcc --use-stdout -mz80 -c putsprite.c > log.txt
sdcc --use-stdout -mz80 -c sprite8.c > log.txt
sdcc --use-stdout -mz80 -c sprite16.c > log.txt
sdcc --use-stdout -mz80 -c spriteon.c > log.txt
sdcc --use-stdout -mz80 -c spriteoff.c > log.txt
sdcc --use-stdout -mz80 -c spritesmall.c > log.txt
sdcc --use-stdout -mz80 -c spritedouble.c > log.txt
sdcc --use-stdout -mz80 -c spritereset.c > log.txt
sdcc --use-stdout -mz80 -c spritecollision.c > log.txt
sdcc --use-stdout -mz80 -c setcolors.c > log.txt
sdcc --use-stdout -mz80 -c intswap.c > log.txt
sdcc --use-stdout -mz80 -c inttofloat.c > log.txt
sdcc --use-stdout -mz80 -c ispositive.c > log.txt
sdcc --use-stdout -mz80 -c mmalloc.c > log.txt
sdcc --use-stdout -mz80 -c vdp50hz.c > log.txt
sdcc --use-stdout -mz80 -c vdp60hz.c > log.txt
sdcc --use-stdout -mz80 -c readtpa.c > log.txt
sdcc --use-stdout -mz80 -c setrealtimer.c > log.txt
sdcc --use-stdout -mz80 -c realtimer.c > log.txt
sdcc --use-stdout -mz80 -c mouseread.c > log.txt
sdcc --use-stdout -mz80 -c mousereadto.c > log.txt
sdcc --use-stdout -mz80 -c covoxplay.c > log.txt
sdcc --use-stdout -mz80 -c sc2circle.c > log.txt
sdcc --use-stdout -mz80 -c sc2circlefilled.c > log.txt
sdcc --use-stdout -mz80 -c vdplinesswitch.c > log.txt
sdcc --use-stdout -mz80 -c rlewbtovram.c > log.txt
sdcc --use-stdout -mz80 -c rlewbtoram.c > log.txt
sdcc --use-stdout -mz80 -c strreverse.c > log.txt
sdcc --use-stdout -mz80 -c itoa.c > log.txt
sdcc --use-stdout -mz80 -c vdp_graph2plus.c > log.txt
echo "... adding functions to the lib"
sdar -rc fusion.lib printf.rel
sdar -rc fusion.lib fcb_find.rel
sdar -rc fusion.lib fcb_open.rel
sdar -rc fusion.lib fcb_read.rel
sdar -rc fusion.lib inport.rel
sdar -rc fusion.lib outport.rel
sdar -rc fusion.lib outports.rel
sdar -rc fusion.lib putchar_msxdos.rel
sdar -rc fusion.lib getchar_msxdos.rel
sdar -rc fusion.lib screen.rel
sdar -rc fusion.lib vdpstatus.rel
sdar -rc fusion.lib vdpstatusni.rel
sdar -rc fusion.lib vdpwrite.rel
sdar -rc fusion.lib vdpwriteni.rel
sdar -rc fusion.lib exit.rel
sdar -rc fusion.lib doscls.rel
sdar -rc fusion.lib intdosbios.rel
sdar -rc fusion.lib settime.rel
sdar -rc fusion.lib setdate.rel
sdar -rc fusion.lib gettime.rel
sdar -rc fusion.lib getdate.rel
sdar -rc fusion.lib suspend.rel
sdar -rc fusion.lib vpeek.rel
sdar -rc fusion.lib vpeekfirst.rel
sdar -rc fusion.lib vpoke.rel
sdar -rc fusion.lib bchput.rel
sdar -rc fusion.lib num2dec16.rel
sdar -rc fusion.lib printfnumber.rel
sdar -rc fusion.lib printnumber.rel
sdar -rc fusion.lib getkeymatrix.rel
sdar -rc fusion.lib readmsxtype.rel
sdar -rc fusion.lib initpsg.rel
sdar -rc fusion.lib killkeybuffer.rel
sdar -rc fusion.lib fillvram.rel
sdar -rc fusion.lib changecap.rel
sdar -rc fusion.lib beep.rel
sdar -rc fusion.lib showdisplay.rel
sdar -rc fusion.lib hidedisplay.rel
sdar -rc fusion.lib functionkeys.rel
sdar -rc fusion.lib width.rel
sdar -rc fusion.lib setscrollv.rel
sdar -rc fusion.lib setscrollh.rel
sdar -rc fusion.lib psgwrite.rel
sdar -rc fusion.lib psgread.rel
sdar -rc fusion.lib setactivepage.rel
sdar -rc fusion.lib setdisplaypage.rel
sdar -rc fusion.lib keysound.rel
sdar -rc fusion.lib circle.rel
sdar -rc fusion.lib circlefilled.rel
sdar -rc fusion.lib joystickread.rel
sdar -rc fusion.lib triggerread.rel
sdar -rc fusion.lib getcpu.rel
sdar -rc fusion.lib changecpu.rel
sdar -rc fusion.lib pcmplay.rel
sdar -rc fusion.lib silencepsg.rel
sdar -rc fusion.lib sound.rel
sdar -rc fusion.lib soundfx.rel
sdar -rc fusion.lib setchannel.rel
sdar -rc fusion.lib getsound.rel
sdar -rc fusion.lib settoneperiod.rel
sdar -rc fusion.lib setnoiseperiod.rel
sdar -rc fusion.lib setenvelopeperiod.rel
sdar -rc fusion.lib setvolume.rel
sdar -rc fusion.lib playenvelope.rel
sdar -rc fusion.lib memchr.rel
sdar -rc fusion.lib memfill.rel
sdar -rc fusion.lib memcopy.rel
sdar -rc fusion.lib memcopyreverse.rel
sdar -rc fusion.lib memcompare.rel
sdar -rc fusion.lib waitkey.rel
sdar -rc fusion.lib keyboardread.rel
sdar -rc fusion.lib locate.rel
sdar -rc fusion.lib cls.rel
sdar -rc fusion.lib inputchar.rel
sdar -rc fusion.lib printchar.rel
sdar -rc fusion.lib inputstring.rel
sdar -rc fusion.lib getche.rel
sdar -rc fusion.lib inkey.rel
sdar -rc fusion.lib print.rel
sdar -rc fusion.lib setbordercolor.rel
sdar -rc fusion.lib puttext.rel
sdar -rc fusion.lib setpalette.rel
sdar -rc fusion.lib setspritepattern.rel
sdar -rc fusion.lib putsprite.rel
sdar -rc fusion.lib sprite8.rel
sdar -rc fusion.lib sprite16.rel
sdar -rc fusion.lib spriteon.rel
sdar -rc fusion.lib spriteoff.rel
sdar -rc fusion.lib spritesmall.rel
sdar -rc fusion.lib spritedouble.rel
sdar -rc fusion.lib spritereset.rel
sdar -rc fusion.lib spritemore.rel
sdar -rc fusion.lib spritecollision.rel
sdar -rc fusion.lib readwritescr.rel
sdar -rc fusion.lib scblock.rel
sdar -rc fusion.lib vdp_graph1.rel
sdar -rc fusion.lib vdp_graph2.rel
sdar -rc fusion.lib ctype.rel
sdar -rc fusion.lib io.rel
sdar -rc fusion.lib rammapper.rel
sdar -rc fusion.lib pt3replayer.rel
sdar -rc fusion.lib setcolors.rel
sdar -rc fusion.lib strcopy.rel
sdar -rc fusion.lib nstrcopy.rel
sdar -rc fusion.lib strlen.rel
sdar -rc fusion.lib strconcat.rel
sdar -rc fusion.lib nstrconcat.rel
sdar -rc fusion.lib strcompare.rel
sdar -rc fusion.lib nstrcompare.rel
sdar -rc fusion.lib strchr.rel
sdar -rc fusion.lib strsearch.rel
sdar -rc fusion.lib strposchr.rel
sdar -rc fusion.lib chartolower.rel
sdar -rc fusion.lib chartoupper.rel
sdar -rc fusion.lib strposstr.rel
sdar -rc fusion.lib strlefttrim.rel
sdar -rc fusion.lib strrighttrim.rel
sdar -rc fusion.lib printdec.rel
sdar -rc fusion.lib intswap.rel
sdar -rc fusion.lib inttofloat.rel
sdar -rc fusion.lib ispositive.rel
sdar -rc fusion.lib mmalloc.rel
sdar -rc fusion.lib VDP50Hz.rel
sdar -rc fusion.lib VDP60Hz.rel
sdar -rc fusion.lib readsp.rel
sdar -rc fusion.lib readtpa.rel
sdar -rc fusion.lib setrealtimer.rel
sdar -rc fusion.lib realtimer.rel
sdar -rc fusion.lib mouseread.rel
sdar -rc fusion.lib mousereadto.rel
sdar -rc fusion.lib covoxplay.rel
sdar -rc fusion.lib sc2circle.rel
sdar -rc fusion.lib sc2circlefilled.rel
sdar -rc fusion.lib vdplinesswitch.rel
sdar -rc fusion.lib rlewbtovram.rel
sdar -rc fusion.lib rlewbtoram.rel
sdar -rc fusion.lib setdisktradress.rel
sdar -rc fusion.lib getdisktradress.rel
sdar -rc fusion.lib sectorread.rel
sdar -rc fusion.lib sectorwrite.rel
sdar -rc fusion.lib getdiskparam.rel
sdar -rc fusion.lib vram.rel
sdar -rc fusion.lib interrupt.rel
sdar -rc fusion.lib strreverse.rel
sdar -rc fusion.lib itoa.rel
sdar -rc fusion.lib vdp_graph2plus.rel
sdar -rc fusion.lib printhex.rel
echo "... cleaning folder"
del .\*.rel
del .\*.asm
del .\*.lst
del .\*.sym
copy fusion.lib ..\..\lib\
echo " ... Have a good day sir"

View File

@@ -0,0 +1,348 @@
#!/bin/sh
clear
echo " "
echo " F U S I O N - C V 1 . 2"
echo " T h e U l t i m a t e SDCC L i b r a r y f o r M S X"
echo " Eric Boez & Fernando Garcia 2018-2019 : Made for coders !"
echo " (Library builder script)"
echo "_________________________________________________________________"
echo " "
echo " "
date
echo " "
echo "------------------------------------ FUSION-C" >> log.txt
date >> log.txt
echo "------------------------------------" >> log.txt
echo "Now Building FUSION-C Library..."
rm fusion.lib
#-----------------------------------------------Building ASM .s functions
echo " ... Compiling ASM Functions"
sdasz80 -o fcb_find.s >> log.txt
sdasz80 -o fcb_open.s >> log.txt
sdasz80 -o fcb_read.s >> log.txt
sdasz80 -o inport.s >> log.txt
sdasz80 -o outport.s >> log.txt
sdasz80 -o outports.s >> log.txt
sdasz80 -o putchar_msxdos.s >> log.txt
sdasz80 -o getchar_msxdos.s >> log.txt
sdasz80 -o screen.s >> log.txt
sdasz80 -o vdpstatus.s >> log.txt
sdasz80 -o vdpstatusni.s >> log.txt
sdasz80 -o vdpwrite.s >> log.txt
sdasz80 -o vdpwriteni.s >> log.txt
sdasz80 -o exit.s >> log.txt
sdasz80 -o doscls.s >> log.txt
sdasz80 -o intdosbios.s >> log.txt
sdasz80 -o settime.s >> log.txt
sdasz80 -o setdate.s >> log.txt
sdasz80 -o gettime.s >> log.txt
sdasz80 -o getdate.s >> log.txt
sdasz80 -o suspend.s >> log.txt
sdasz80 -o memchr.s >> log.txt
sdasz80 -o memfill.s >> log.txt
sdasz80 -o memcopy.s >> log.txt
sdasz80 -o memcopyreverse.s >> log.txt
sdasz80 -o memcompare.s >> log.txt
sdasz80 -o waitkey.s >> log.txt
sdasz80 -o keyboardread.s >> log.txt
sdasz80 -o printdec.s >> log.txt
sdasz80 -o inputchar.s >> log.txt
sdasz80 -o printchar.s >> log.txt
sdasz80 -o inputstring.s >> log.txt
sdasz80 -o getche.s >> log.txt
sdasz80 -o inkey.s >> log.txt
sdasz80 -o setbordercolor.s >> log.txt
sdasz80 -o puttext.s >> log.txt
sdasz80 -o setpalette.s >> log.txt
sdasz80 -o spritemore.s >> log.txt
sdasz80 -o readwritescr.s >> log.txt
sdasz80 -o scblock.s >> log.txt
sdasz80 -o vdp_graph2.s >> log.txt
sdasz80 -o vdp_graph1.s >> log.txt
sdasz80 -o ctype.s >> log.txt
sdasz80 -o io.s >> log.txt
sdasz80 -o rammapper.s >> log.txt
sdasz80 -o pt3replayer.s >> log.txt
sdasz80 -o strcopy.s >> log.txt
sdasz80 -o nstrcopy.s >> log.txt
sdasz80 -o strlen.s >> log.txt
sdasz80 -o strconcat.s >> log.txt
sdasz80 -o nstrconcat.s >> log.txt
sdasz80 -o strcompare.s >> log.txt
sdasz80 -o nstrcompare.s >> log.txt
sdasz80 -o strchr.s >> log.txt
sdasz80 -o strsearch.s >> log.txt
sdasz80 -o strposchr.s >> log.txt
sdasz80 -o chartolower.s >> log.txt
sdasz80 -o chartoupper.s >> log.txt
sdasz80 -o strposstr.s >> log.txt
sdasz80 -o strlefttrim.s >> log.txt
sdasz80 -o strrighttrim.s >> log.txt
sdasz80 -o setdisktradress.s >> log.txt
sdasz80 -o getdisktradress.s >> log.txt
sdasz80 -o sectorread.s >> log.txt
sdasz80 -o sectorwrite.s >> log.txt
sdasz80 -o getdiskparam.s >> log.txt
sdasz80 -o readsp.s >> log.txt
sdasz80 -o vram.s >> log.txt
sdasz80 -o interrupt.s >> log.txt
sdasz80 -o printhex.s >> log.txt
#----------------------------------------------- Building C .c functions
echo " ... Compiling C functions"
sdcc --disable-warning 196 --use-stdout -mz80 -c printf.c >> log.txt
sdcc --use-stdout -mz80 -c vpeek.c >> log.txt
sdcc --use-stdout -mz80 -c vpeekfirst.c >> log.txt
sdcc --use-stdout -mz80 -c vpoke.c >> log.txt
sdcc --use-stdout -mz80 -c bchput.c >> log.txt
sdcc --use-stdout -mz80 -c num2dec16.c >> log.txt
sdcc --use-stdout -mz80 -c printfnumber.c >> log.txt
sdcc --use-stdout -mz80 -c printnumber.c >> log.txt
sdcc --use-stdout -mz80 -c getkeymatrix.c >> log.txt
sdcc --use-stdout -mz80 -c readmsxtype.c >> log.txt
sdcc --use-stdout -mz80 -c initpsg.c >> log.txt
sdcc --use-stdout -mz80 -c killkeybuffer.c >> log.txt
sdcc --use-stdout -mz80 -c fillvram.c >> log.txt
sdcc --use-stdout -mz80 -c changecap.c >> log.txt
sdcc --use-stdout -mz80 -c beep.c >> log.txt
sdcc --use-stdout -mz80 -c showdisplay.c >> log.txt
sdcc --use-stdout -mz80 -c hidedisplay.c >> log.txt
sdcc --use-stdout -mz80 -c functionkeys.c >> log.txt
sdcc --use-stdout -mz80 -c width.c >> log.txt
sdcc --use-stdout -mz80 -c setscrollv.c >> log.txt
sdcc --use-stdout -mz80 -c setscrollh.c >> log.txt
sdcc --use-stdout -mz80 -c psgwrite.c >> log.txt
sdcc --use-stdout -mz80 -c psgread.c >> log.txt
sdcc --use-stdout -mz80 -c setactivepage.c >> log.txt
sdcc --use-stdout -mz80 -c setdisplaypage.c >> log.txt
sdcc --use-stdout -mz80 -c keysound.c >> log.txt
sdcc --use-stdout -mz80 -c circle.c >> log.txt
sdcc --use-stdout -mz80 -c circlefilled.c >> log.txt
sdcc --use-stdout -mz80 -c joystickread.c >> log.txt
sdcc --use-stdout -mz80 -c triggerread.c >> log.txt
sdcc --use-stdout -mz80 -c getcpu.c >> log.txt
sdcc --use-stdout -mz80 -c changecpu.c >> log.txt
sdcc --use-stdout -mz80 -c pcmplay.c >> log.txt
sdcc --use-stdout -mz80 -c silencepsg.c >> log.txt
sdcc --use-stdout -mz80 -c sound.c >> log.txt
sdcc --use-stdout -mz80 -c soundfx.c >> log.txt
sdcc --use-stdout -mz80 -c setchannel.c >> log.txt
sdcc --use-stdout -mz80 -c getsound.c >> log.txt
sdcc --use-stdout -mz80 -c settoneperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setnoiseperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setenvelopeperiod.c >> log.txt
sdcc --use-stdout -mz80 -c setvolume.c >> log.txt
sdcc --use-stdout -mz80 -c playenvelope.c >> log.txt
sdcc --use-stdout -mz80 -c locate.c >> log.txt
sdcc --use-stdout -mz80 -c cls.c >> log.txt
sdcc --use-stdout -mz80 -c print.c >> log.txt
sdcc --use-stdout -mz80 -c setspritepattern.c >> log.txt
sdcc --use-stdout -mz80 -c putsprite.c >> log.txt
sdcc --use-stdout -mz80 -c sprite8.c >> log.txt
sdcc --use-stdout -mz80 -c sprite16.c >> log.txt
sdcc --use-stdout -mz80 -c spriteon.c >> log.txt
sdcc --use-stdout -mz80 -c spriteoff.c >> log.txt
sdcc --use-stdout -mz80 -c spritesmall.c >> log.txt
sdcc --use-stdout -mz80 -c spritedouble.c >> log.txt
sdcc --use-stdout -mz80 -c spritereset.c >> log.txt
sdcc --use-stdout -mz80 -c spritecollision.c >> log.txt
sdcc --use-stdout -mz80 -c setcolors.c >> log.txt
sdcc --use-stdout -mz80 -c intswap.c >> log.txt
sdcc --use-stdout -mz80 -c inttofloat.c >> log.txt
sdcc --use-stdout -mz80 -c ispositive.c >> log.txt
sdcc --use-stdout -mz80 -c mmalloc.c >> log.txt
sdcc --use-stdout -mz80 -c vdp50hz.c >> log.txt
sdcc --use-stdout -mz80 -c vdp60hz.c >> log.txt
sdcc --use-stdout -mz80 -c readtpa.c >> log.txt
sdcc --use-stdout -mz80 -c setrealtimer.c >> log.txt
sdcc --use-stdout -mz80 -c realtimer.c >> log.txt
sdcc --use-stdout -mz80 -c mouseread.c >> log.txt
sdcc --use-stdout -mz80 -c mousereadto.c >> log.txt
sdcc --use-stdout -mz80 -c covoxplay.c >> log.txt
sdcc --use-stdout -mz80 -c sc2circle.c >> log.txt
sdcc --use-stdout -mz80 -c sc2circlefilled.c >> log.txt
sdcc --use-stdout -mz80 -c vdplinesswitch.c >> log.txt
sdcc --use-stdout -mz80 -c rlewbtovram.c >> log.txt
sdcc --use-stdout -mz80 -c rlewbtoram.c >> log.txt
sdcc --use-stdout -mz80 -c strreverse.c >> log.txt
sdcc --use-stdout -mz80 -c itoa.c >> log.txt
sdcc --use-stdout -mz80 -c vdp_graph2plus.c >> log.txt
#----------------------------------------------- Building the Library by fusioning all functions
echo " ... including functions to the library"
sdar -rc fusion.lib printf.rel
sdar -rc fusion.lib fcb_find.rel
sdar -rc fusion.lib fcb_open.rel
sdar -rc fusion.lib fcb_read.rel
sdar -rc fusion.lib inport.rel
sdar -rc fusion.lib outport.rel
sdar -rc fusion.lib outports.rel
sdar -rc fusion.lib putchar_msxdos.rel
sdar -rc fusion.lib getchar_msxdos.rel
sdar -rc fusion.lib screen.rel
sdar -rc fusion.lib vdpstatus.rel
sdar -rc fusion.lib vdpstatusni.rel
sdar -rc fusion.lib vdpwrite.rel
sdar -rc fusion.lib vdpwriteni.rel
sdar -rc fusion.lib exit.rel
sdar -rc fusion.lib doscls.rel
sdar -rc fusion.lib intdosbios.rel
sdar -rc fusion.lib settime.rel
sdar -rc fusion.lib setdate.rel
sdar -rc fusion.lib gettime.rel
sdar -rc fusion.lib getdate.rel
sdar -rc fusion.lib suspend.rel
sdar -rc fusion.lib vpeek.rel
sdar -rc fusion.lib vpeekfirst.rel
sdar -rc fusion.lib vpoke.rel
sdar -rc fusion.lib bchput.rel
sdar -rc fusion.lib num2dec16.rel
sdar -rc fusion.lib printfnumber.rel
sdar -rc fusion.lib printnumber.rel
sdar -rc fusion.lib getkeymatrix.rel
sdar -rc fusion.lib readmsxtype.rel
sdar -rc fusion.lib initpsg.rel
sdar -rc fusion.lib killkeybuffer.rel
sdar -rc fusion.lib fillvram.rel
sdar -rc fusion.lib changecap.rel
sdar -rc fusion.lib beep.rel
sdar -rc fusion.lib showdisplay.rel
sdar -rc fusion.lib hidedisplay.rel
sdar -rc fusion.lib functionkeys.rel
sdar -rc fusion.lib width.rel
sdar -rc fusion.lib setscrollv.rel
sdar -rc fusion.lib setscrollh.rel
sdar -rc fusion.lib psgwrite.rel
sdar -rc fusion.lib psgread.rel
sdar -rc fusion.lib setactivepage.rel
sdar -rc fusion.lib setdisplaypage.rel
sdar -rc fusion.lib keysound.rel
sdar -rc fusion.lib circle.rel
sdar -rc fusion.lib circlefilled.rel
sdar -rc fusion.lib joystickread.rel
sdar -rc fusion.lib triggerread.rel
sdar -rc fusion.lib getcpu.rel
sdar -rc fusion.lib changecpu.rel
sdar -rc fusion.lib pcmplay.rel
sdar -rc fusion.lib silencepsg.rel
sdar -rc fusion.lib sound.rel
sdar -rc fusion.lib soundfx.rel
sdar -rc fusion.lib setchannel.rel
sdar -rc fusion.lib getsound.rel
sdar -rc fusion.lib settoneperiod.rel
sdar -rc fusion.lib setnoiseperiod.rel
sdar -rc fusion.lib setenvelopeperiod.rel
sdar -rc fusion.lib setvolume.rel
sdar -rc fusion.lib playenvelope.rel
sdar -rc fusion.lib memchr.rel
sdar -rc fusion.lib memfill.rel
sdar -rc fusion.lib memcopy.rel
sdar -rc fusion.lib memcopyreverse.rel
sdar -rc fusion.lib memcompare.rel
sdar -rc fusion.lib waitkey.rel
sdar -rc fusion.lib keyboardread.rel
sdar -rc fusion.lib locate.rel
sdar -rc fusion.lib cls.rel
sdar -rc fusion.lib inputchar.rel
sdar -rc fusion.lib printchar.rel
sdar -rc fusion.lib inputstring.rel
sdar -rc fusion.lib getche.rel
sdar -rc fusion.lib inkey.rel
sdar -rc fusion.lib print.rel
sdar -rc fusion.lib setbordercolor.rel
sdar -rc fusion.lib puttext.rel
sdar -rc fusion.lib setpalette.rel
sdar -rc fusion.lib setspritepattern.rel
sdar -rc fusion.lib putsprite.rel
sdar -rc fusion.lib sprite8.rel
sdar -rc fusion.lib sprite16.rel
sdar -rc fusion.lib spriteon.rel
sdar -rc fusion.lib spriteoff.rel
sdar -rc fusion.lib spritesmall.rel
sdar -rc fusion.lib spritedouble.rel
sdar -rc fusion.lib spritereset.rel
sdar -rc fusion.lib spritemore.rel
sdar -rc fusion.lib spritecollision.rel
sdar -rc fusion.lib readwritescr.rel
sdar -rc fusion.lib scblock.rel
sdar -rc fusion.lib vdp_graph1.rel
sdar -rc fusion.lib vdp_graph2.rel
sdar -rc fusion.lib ctype.rel
sdar -rc fusion.lib io.rel
sdar -rc fusion.lib rammapper.rel
sdar -rc fusion.lib pt3replayer.rel
sdar -rc fusion.lib setcolors.rel
sdar -rc fusion.lib strcopy.rel
sdar -rc fusion.lib nstrcopy.rel
sdar -rc fusion.lib strlen.rel
sdar -rc fusion.lib strconcat.rel
sdar -rc fusion.lib nstrconcat.rel
sdar -rc fusion.lib strcompare.rel
sdar -rc fusion.lib nstrcompare.rel
sdar -rc fusion.lib strchr.rel
sdar -rc fusion.lib strsearch.rel
sdar -rc fusion.lib strposchr.rel
sdar -rc fusion.lib chartolower.rel
sdar -rc fusion.lib chartoupper.rel
sdar -rc fusion.lib strposstr.rel
sdar -rc fusion.lib strlefttrim.rel
sdar -rc fusion.lib strrighttrim.rel
sdar -rc fusion.lib printdec.rel
sdar -rc fusion.lib intswap.rel
sdar -rc fusion.lib inttofloat.rel
sdar -rc fusion.lib ispositive.rel
sdar -rc fusion.lib mmalloc.rel
sdar -rc fusion.lib VDP50Hz.rel
sdar -rc fusion.lib VDP60Hz.rel
sdar -rc fusion.lib readsp.rel
sdar -rc fusion.lib readtpa.rel
sdar -rc fusion.lib setrealtimer.rel
sdar -rc fusion.lib realtimer.rel
sdar -rc fusion.lib mouseread.rel
sdar -rc fusion.lib mousereadto.rel
sdar -rc fusion.lib covoxplay.rel
sdar -rc fusion.lib sc2circle.rel
sdar -rc fusion.lib sc2circlefilled.rel
sdar -rc fusion.lib vdplinesswitch.rel
sdar -rc fusion.lib rlewbtovram.rel
sdar -rc fusion.lib rlewbtoram.rel
sdar -rc fusion.lib setdisktradress.rel
sdar -rc fusion.lib getdisktradress.rel
sdar -rc fusion.lib sectorread.rel
sdar -rc fusion.lib sectorwrite.rel
sdar -rc fusion.lib getdiskparam.rel
sdar -rc fusion.lib vram.rel
sdar -rc fusion.lib interrupt.rel
sdar -rc fusion.lib strreverse.rel
sdar -rc fusion.lib itoa.rel
sdar -rc fusion.lib vdp_graph2plus.rel
sdar -rc fusion.lib printhex.rel
#----------------------------------------------- Cleaning folder, y removing temp files
echo " ... cleaning folder"
rm *.rel
rm *.asm
rm *.lst
rm *.sym
#----------------------------------------------- Copying the fusion.lib file to another place
cp fusion.lib ../../lib/
echo " Done... Have a good day sir"

View File

@@ -0,0 +1,112 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1 - 02-04 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C & A S M S O U R C E C O D E |
| |
| |
\___________________________________________________________/
*/
// Done with the help of GDX
//
// Mouse control function
//
// Return the x and y offset of mouse in a 16 bits value.
// Return 0xFFFF if no mouse detected
// Mouse port codes are
// Port 1 : 0x9310
// Port 2 : 0xEC20
//
unsigned int MouseRead(unsigned int MousePort) __naked
{
MousePort;
__asm
; Routine to read the mouse by direct accesses (works on MSX1/2/2+/turbo R)
;
; Input: DE = 09310h for mouse in port 1 (D = 10010011b, E = 00010000b)
; DE = 0EC20h for mouse in port 2 (D = 11101100b, E = 00100000b)
; Output: H = X-offset, L = Y-offset (H = L = 255 if no mouse)
push ix
ld ix,#0
add ix,sp
ld e,4(ix)
ld d,5(ix)
pop ix
GTMOUS:
ld b,#30 ; Long delay for first read
call GTOFS2 ; Read bits 7-4 of the x-offset
and #0xF
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the x-offset
and #0xF
or c
ld h,a ; Store combined x-offset
call GTOFST ; Read bits 7-4 of the y-offset
and #0xF
rlca
rlca
rlca
rlca
ld c,a
call GTOFST ; Read bits 3-0 of the y-offset
and #0xF
or c
ld l,a ; Store combined y-offset
ret
GTOFST: ld b,#10
GTOFS2: ld a,#15 ; Read PSG register 15 for mouse
di ; DI useless if the routine is used during an interrupt
out (#0xA0),a
ld a,d
out (#0xA1),a
xor e
ld d,a
call WAITMS ; Extra delay because the mouse is slow
ld a,#14
out (#0xA0),a
ei ; EI useless if the routine is used during an interrupt
in a,(#0xA2)
ret
WAITMS:
ld a,b
WTTR:
djnz WTTR
.db #0xED,#0x55 ; Back if Z80 (RETN on Z80, NOP on R800)
rlca
rlca
;add a,b
ld b,a
WTTR2:
djnz WTTR2
ld b,a
WTTR3:
djnz WTTR3
ret
__endasm;
}

File diff suppressed because it is too large Load Diff

View File

@@ -21,8 +21,10 @@
/* For MSX Turbo-R Only. Play PCM from VRAM adress */
void PCMPlay(int start, int lenght) __naked
void PCMPlay(int start, int length) __naked
{
start;
length;
__asm
push ix
@@ -40,9 +42,9 @@ void PCMPlay(int start, int lenght) __naked
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop IY
pop IX
ret
pop iy
pop ix
ret
__endasm;
}
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -64,4 +64,4 @@ void Print(char* text)
PrintChar(character);
}
}
}
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -67,6 +67,8 @@ int sprintf(const char* buf, const char* fmt, ...)
static void do_char(const char* buf, char c) __naked
{
buf;
c;
__asm
ld hl,#4
@@ -194,4 +196,4 @@ static int format_string(const char* buf, const char *fmt, va_list ap)
if(bufPnt) *bufPnt = '\0';
return count;
}
}

View File

@@ -0,0 +1,146 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.0 - 09-10-11 2018 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| |
;\___________________________________________________________/
;
;
; PrintHex, PutCharHex, PrintString, CheckBreak
; by Eugeny Brychkov 2019
;
INTFLG .equ #0xfc9b
CHPUT .equ #0x00a2
CHGET .equ #0x009f
;------------------------------------------------------------------------
; GET_POINTER_TO_VAR: get pointer to the variable in the stack
;------------------------------------------------------------------------
; in: L=stack offset (forward)
; out: HL=pointer to the variable
; regs: AF
get_pointer_to_var:
ld h,#0 ; always forward addressing
add hl,sp ; now points to variable pointer in the stack
ld a,(hl)
inc hl
ld h,(hl)
ld l,a
ret
_PrintString::
ld l,#4
call get_pointer_to_var
puts_loop:
ld a,(hl)
or a
ret z
push hl
push ix ; preserve IX
rst #0x30
.db #0
.dw CHPUT
pop ix ; restore IX
pop hl
inc hl
jr puts_loop
ret
_PrintHex::
ld l,#4
call get_pointer_to_var
push hl
ld a,h
call prhex
pop hl
ld a,l
call prhex
ret
;*************************************************************************
; PUTCHAR_HEX: print hex representation of argument
;*************************************************************************
_PutCharHex::
ld l,#4
call get_pointer_to_var
ld a,l
prhex:
push af
rrca
rrca
rrca
rrca
call putnib
pop af
call putnib
ret
;*************************************************************************
; PUTNIB: print one nibble (0-F)
;*************************************************************************
; in: A (bits 3-0) = value to print
putnib:
and #0xf ; remove unsignificant bits
cp #0xa
jr c,less10 ; value is less than 10 (numerical)
add a,#0x7 ; adjust for uppercase letter A-F
less10:
push ix ; preserve IX
add a,#0x30
rst #0x30
.db #0
.dw CHPUT
pop ix ; restore IX
ret
;*************************************************************************
; CHECK_BREAK: Check for CTRL-STOP and suspend if STOP is pressed
;*************************************************************************
; in: nothing
; out: HL=0 if CTRL-STOP was not pressed, -1 otherwise
; note: enables interrupts
_CheckBreak::
ld hl,#INTFLG
di
ld a,(hl) ; sense STOP key pressed
ei
ld (hl),#0
cp #3 ; CTRL-STOP was pressed
jr z,crtl_stop_pressed
cp #4
jr nz,no_stop_condition
; we are here if STOP key was pressed, suspending
ld (hl),#0 ; reset stop press condition
sense_stop:
di
ld a,(hl)
ei
ld (hl),#0
cp #3
jr z,crtl_stop_pressed
or a
jr z,sense_stop
no_stop_condition:
ld hl,#0
ret ; return 0 if CTRL-STOP was not pressed
crtl_stop_pressed:
ld hl,#0xffff
ret ; return -1 if CTRL-STOP was pressed

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -36,11 +36,11 @@
void PutSprite( char sprite_no, char pattern_no, char x, char y, char ec_color ) {
DisableInterupt();
DisableInterrupt();
VpokeFirst( Peekw( ATRBAS ) + (unsigned int)(sprite_no << 2) );
VpokeNext( y );
VpokeNext( x );
VpokeNext( pattern_no );
VpokeNext( ec_color );
EnableInterupt();
EnableInterrupt();
}

View File

@@ -7,7 +7,7 @@
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.0 - 09-10-11 2018 |
;| V1.2 - 08 2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
@@ -46,31 +46,23 @@ _PutText::
add ix,sp
ld l,4(ix)
ld h,5(ix)
ld (GRPACX),hl
ld (GRPACX),hl ; X
ld l,6(ix)
ld h,7(ix)
ld (GRPACY),hl
ld (GRPACY),hl ; Y
ld a,10(ix)
ld (LOGOPR),a ; LogOp
ld l,8(ix)
ld h,9(ix)
push hl
ld l,10(ix)
ld h,#0
ld (LOGOPR),hl
pop hl
push iy
lb_ptlp:
ld a,(hl)
or a
jr z, lb_ptEx
;.db #0xF7 ; RST 30h
;.db #0x80
;.dw #0x008D ; GRPPRT displays character on graphics screen
ld a,(hl)
or a
jr z, lb_ptEx
ld iy, (0xFCC0) ; mainrom slotaddress (reference)
ld ix, #0x008D ; bios (api) address
ld iy,(0xFCC0) ; mainrom slotaddress (reference)
ld ix,#0x008D ; bios (api) address
call 0x001c ; interslotcall
ei
@@ -79,4 +71,4 @@ lb_ptlp:
lb_ptEx:
pop iy
pop ix
ret
ret

View File

@@ -25,7 +25,7 @@
*/
void RleToRam (unsigned int *RamSource, unsigned int *RamDest) __naked
void RleWBToRam (unsigned int *RamSource, unsigned int *RamDest) __naked
{
RamSource;
RamDest;

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1 - 02-04 - 2019 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -25,7 +25,7 @@
*/
#include "../../header/msx_fusion.h"
void RleVramDecompress(unsigned int *RamAddress) __naked
void RleVramDecompress(unsigned char *RamAddress) __naked
{
RamAddress;
@@ -36,34 +36,34 @@ __asm
_unRLEWBtoVRAM::
push ix
ld ix,#0
add ix,sp
ld ix,#0
add ix,sp
ld L,4(ix) ; Data RAM address
ld H,5(ix)
ld l,4(ix) ; Data RAM address
ld h,5(ix)
call unRLEWBVRAM
pop IX
pop ix
ret
unRLEWBVRAM::
ANALYZE:
ld A,(HL) ; get byte
ld a,(hl) ; get byte
cp #RLECONTROL
jr NZ,WriteByte ; if raw
jr nz,WriteByte ; if raw
inc HL ; get next byte
ld A,(HL)
or A
jr Z,WriteCONTROL ;if A=0 then write one $80 ($80 $0)
inc hl ; get next byte
ld a,(hl)
or a
jr z,WriteCONTROL ;if A=0 then write one $80 ($80 $0)
cp #0xFF ;if A=$FF ($80 $FF)
ret Z ;THEN exit
ret z ;THEN exit
;$80 nn dd
ld B,A
inc HL
ld A,(HL) ;get value
ld b,a
inc hl
ld a,(hl) ;get value
doRLE:
out (#0x98),A ;write in VRAM
@@ -71,15 +71,15 @@ doRLE:
nop
djnz doRLE
inc HL
inc hl
jr ANALYZE
WriteCONTROL:
ld A,#RLECONTROL ;write CONTROL value
ld a,#RLECONTROL ;write CONTROL value
WriteByte:
out (#0x98),A ;write in VRAM
inc HL
out (#0x98),a ;write in VRAM
inc hl
jr ANALYZE
__endasm;
@@ -88,7 +88,7 @@ __endasm;
void RleWBToVram(unsigned int *RamAddress, unsigned int VramAddress)
{
DisableInterupt();
DisableInterrupt();
if(Peek( 0xFCAF ) >= 7 ) {
VDPwriteNi( 14, (VramAddress >> 14) | (Peek( 0xFAF6 ) << 2) );
}
@@ -100,5 +100,5 @@ void RleWBToVram(unsigned int *RamAddress, unsigned int VramAddress)
OutPort( 0x99, ((unsigned char)(VramAddress >> 8) & 0x7F) | 0x40 );
RleVramDecompress(RamAddress);
EnableInterupt();
EnableInterrupt();
}

View File

@@ -19,6 +19,8 @@ _Screen::
add hl, sp
ld a, (hl) ;; mode
ld hl,#0xFCAF ;; Save current mode to FCAF
ld (hl),a
push ix
ld ix, #0x005f ;; chgmod on bios
ld iy, (0xfcc0) ;; iyh <= (0xfcc1) : EXPTBL(MAIN-ROM SLOT)

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -37,9 +37,9 @@
/* set sprite pattern */
/* --------------------------------------------------------- */
void SetSpritePattern( char pattern_no, char* p_pattern, char s_size ) {
DisableInterupt();
DisableInterrupt();
VpokeFirst( Peekw( PATBAS ) + (pattern_no << 3) );
OutPorts( 0x98, p_pattern, s_size );
EnableInterupt();
EnableInterrupt();
}

View File

@@ -0,0 +1,44 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1b. July 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C S O U R C E C O D E |
| |
| StrReverse |
\___________________________________________________________/
*/
// .
// Reverse a string
// eric Boez 2019
//
#include "../../header/msx_fusion.h"
char *StrReverse(char *str)
{
char tmp;
unsigned int i;
unsigned int j;
i = 0;
j = StrLen(str) - 1;
while (i < j)
{
tmp = str[i];
str[i] = str[j];
str[j] = tmp;
j--;
i++;
}
return (str);
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -26,19 +26,20 @@
unsigned char TriggerRead(char joyNumber) __naked
{
__asm
push ix
ld ix,#0
add ix,sp
ld A,4(ix)
push iy
ld ix,#0x00d8 ; Bios Trigger Read routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop IY
pop IX
ret
__endasm;
joyNumber;
__asm
push ix
ld ix,#0
add ix,sp
ld a,4(ix)
push iy
ld ix,#0x00d8 ; Bios Trigger Read routine
ld iy,(0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
ld l,a
pop iy
pop ix
ret
__endasm;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,189 @@
/*
___________________________________________________________
/ __ _ \
| / _| (_) |
| | |_ _ _ ___ _ ___ _ __ |
| | _| | | / __| |/ _ \| '_ \ |
| | | | |_| \__ \ | (_) | | | | |
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.1b - August - 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
| C & A S M S O U R C E C O D E |
| compilation : > sdcc -mz80 -c msx_misc.c |
| |
\___________________________________________________________/
*/
/* Line & BoxFill & BoxLine functions
|
| 2019 Eric Boez
|
*/
#include "../../header/vdp_graph2.h"
#define RPeek( address ) ( *( (volatile unsigned char*)(address) ) )
void SubLine( int X1, int Y1, int DX, int DY, int colour, char R45, char OP ) __naked
{
X1;Y1;DX;DY;colour;R45;OP;
__asm
push ix
ld ix,#0
add ix,sp
di
call VDPready
ld a,#36
out (#0x99),a
ld a,#128+#17
out (#0x99),a ;R#17 := 36
ld c,#0x9b
ld a,4(ix) ;
out (c),a ; R36 X1 low byte
ld a,5(ix) ;
out (c),a ; R37 X1 high byte
ld a,6(ix) ;
out (c),a ; R38 Y1 low byte
ld a,7(ix) ;
out (c),a ; R39 Y1 high byte
ld a,8(ix) ;
out (c),a ; R40 NX low byte
ld a,9(ix) ;
out (c),a ; R41 NX high byte
ld a,10(ix) ;
out (c),a ; R42 NY low byte
ld a,11(ix) ;
out (c),a ; R43 NY high byte
ld a,12(ix) ;
out (c),a ; R44 COL low byte
ld a,14(ix)
out (c),a ; R45 ARG
ld a,15(ix)
or ##0b01110000
out (c), a ; R46 do it
ei
pop ix
ret
VDPready:
ld a,#2
out (#0x99),a ;select status register 2
ld a,#128+#15
out (#0x99),a
in a,(#0x99)
and #1
jp nz, VDPready ; wait
xor a
out (#0x99),a
ld a,#128+#15
out (#0x99),a
ret
__endasm;
}
void Line( int x1, int y1, int x2, int y2, char color, char OP )
{
unsigned char R45;
int dx,dy;
unsigned int shortside,longside;
R45=0b00000000;
dx=x2-x1;
dy=y2-y1;
if (dx<0)
{
dx=dx*-1;
R45=R45 | 0b00000100;
}
//////////////////////////
if (dy<0)
{
dy=dy*-1;
R45=R45 | 0b00001000;
}
//////////////////////////
if (dy>dx)
{
longside=dy;
shortside=dx;
R45=R45 | 0b00000001;
}
else
{
longside=dx;
shortside=dy;
R45=R45 | 0b00000000;
}
SubLine(x1,y1,longside,shortside,color,R45,OP);
}
void BoxFill (int x1, int y1, int x2, int y2, char color, char op )
{
char scmode;
scmode=RPeek (0xFCAF);
if (op==0 && scmode > 7)
{
HMMV( x1, y1, x2-x1, y2-y1, color); // Using HMMV only with Scree8 and no OP
}
else
{
LMMV( x1, y1, x2-x1, y2-y1, color, op);
}
}
void BoxLine( int x1, int y1, int x2, int y2, char color, char OP )
{
if (OP==255)
{
BoxFill( x1, y1, x2, y2, color,0);
}
else
{
Line(x1,y1,x2,y1,color,OP);
Line(x1,y1,x1,y2,color,OP);
Line(x2,y2,x2,y1,color,OP);
Line(x2,y2,x1,y2,color,OP);
}
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -34,9 +34,9 @@
unsigned char Vpeek( unsigned int address ) {
unsigned char value;
DisableInterupt();
DisableInterrupt();
VpeekFirst( address );
value = InPort( 0x98 );
EnableInterupt();
EnableInterrupt();
return value;
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -49,8 +49,8 @@ void VpokeFirst( unsigned int address ) {
/* --------------------------------------------------------- */
void Vpoke( unsigned int address, unsigned char data ) {
DisableInterupt();
DisableInterrupt();
VpokeFirst( address );
OutPort( 0x98, data );
EnableInterupt();
EnableInterrupt();
}

View File

@@ -8,7 +8,7 @@
| |_| \__,_|___/_|\___/|_| |_| * |
| |
| The MSX C Library for SDCC |
| V1.0 - 09-10-11 2018 |
| V1.2 - 08 2019 |
| |
| Eric Boez & Fernando Garcia |
| |
@@ -25,20 +25,20 @@
// Width of screen in text mode
void Width(char n)
void Width(unsigned char n)
{
int m;
unsigned char m;
m=Peek(0xFCAF);
m=Peek(0xFCAF); // get actual screen mode
if (m==0)
{
Poke(0xF3AE,n);
Poke(0xF3AE,n); // set column number for SCREEN 0
Screen(0);
}
if (m==1)
{
Poke(0xF3AF,n);
Poke(0xF3AF,n); // set column number for SCREEN 1
Screen(1);
}
}