Updated fusion-c.

Added openmsx config file.
This commit is contained in:
Saffron
2021-08-22 20:41:38 +02:00
parent 93572abe6d
commit 88f69cd74f
25 changed files with 272 additions and 3903 deletions

2
.gitignore vendored
View File

@@ -261,3 +261,5 @@ __pycache__/
*.pyc *.pyc
openMSX/ openMSX/
Tools/ Tools/
/src/audio/At2Files.asm
/src/audio/audio.rel

Binary file not shown.

View File

@@ -0,0 +1,7 @@
machine Philips_NMS_8255
ext msxdos2
ext gfx9000
bind F12 cycle videosource
plug joyporta mouse
plug printerport simpl
diska dsk/

View File

@@ -1,92 +0,0 @@
//
// Fusion-C
// Mouse Control.
// 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 color[]={0x01,0x0B,0x0B,0x0B,0x0B,0x0B,0x0B,0x0A,
0x0A,0x06,0x06,0x06,0x0A,0x0B,0x06,0x01,
0x00,0x46,0x46,0x46,0x46,0x46,0x46,0x41,
0x41,0x41,0x41,0x41,0x41,0x46,0x41,0x00,
0x00,0x41,0x41,0x41,0x41,0x41,0x41,0x00,
0x00,0x00,0x00,0x00,0x00,0x41,0x00,0x00};
void main(void)
{
char mx,my,i;
unsigned int Mouse_offset;
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]); // 0x3800 is the memory adress of Sprite shapes for screen 1
}
for (i = 0; i < 48; ++i) // Read sprite patterns and set them in Video Ram
{
Vpoke(0x7400+i,pointer_pattern[i]); // 0x3800 is the memory adress of Sprite shapes for screen 1
}
mx=125;
my=110;
PutSprite (0,0,mx,my,0);
PutSprite (1,4,mx,my,0);
PutSprite (2,8,mx,my,0);
while (Inkey()!=27) // Escape to Quit
{
}
Screen(0);
Exit(0);
}

View File

@@ -1,35 +0,0 @@
//
// Fusion-C
// Pseudo Random Number
//
#include <stdlib.h>
#include <stdio.h>
#include "fusion-c/header/msx_fusion.h"
TIME tm;
char FT_RandomNumber (char a, char b)
{
char random;
random = rand()%(b-a)+a; // Random number between a and b-1
return(random);
}
void main(void)
{
char n,i;
GetTime(&tm);
srand(tm.sec);
for(i=0;i < 10; i++)
{
n=FT_RandomNumber(1,100);
printf("%d,",n);
}
Exit(0);
}

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,20 @@
XL2
H 6 areas 2 global symbols
S _main Ref0000
S .__.ABS. Def0000
A _CODE size 0 flags 0 addr 0
A _HEADER size 0 flags 8 addr 0
A _HEADER0 size 1A flags 8 addr 4000
A _DATA size 0 flags 0 addr 0
A _GSINIT size 0 flags 0 addr 0
A _GSFINAL size 0 flags 0 addr 0
T 00 40
R 00 00 02 00
T 00 40 41 42 10 40 00 00 00 00 00 00 00 00 00 00
R 00 00 02 00 00 04 02 00
T 0E 40 00 00
R 00 00 02 00
T 10 40
R 00 00 02 00
T 10 40 F3 ED 7B 4A FC FB CD 00 00 C7
R 00 00 02 00 02 09 00 00

View File

@@ -1,54 +1,63 @@
XL XL2
H 7 areas 7 global symbols H D areas 8 global symbols
S _main Ref0000 S _main Ref0000
S .__.ABS. Def0000 S .__.ABS. Def0000
S l__INITIALIZED Ref0000
S s__INITIALIZED Ref0000 S s__INITIALIZED Ref0000
S l__INITIALIZER Ref0000 S l__INITIALIZER Ref0000
S s__INITIALIZER Ref0000 S s__INITIALIZER Ref0000
A _CODE size 0 flags 0 addr 0 A _CODE size 0 flags 0 addr 0
A _HEADER size 0 flags 8 addr 0 A _HOME size 0 flags 0 addr 0
A _HEADER0 size 78 flags 8 addr 100 A _GSINIT size 10 flags 0 addr 0
A _GSFINAL size 1 flags 0 addr 0
A _INITIALIZER size 0 flags 0 addr 0
A _DATA size 2 flags 0 addr 0 A _DATA size 2 flags 0 addr 0
S _heap_top Def0000 S _heap_top Def0000
A _GSINIT size F flags 0 addr 0 A _INITIALIZED size 0 flags 0 addr 0
A _GSFINAL size 1 flags 0 addr 0 A _BSEG size 0 flags 0 addr 0
A _BSS size 0 flags 0 addr 0
A _HEAP size 0 flags 0 addr 0 A _HEAP size 0 flags 0 addr 0
S _HEAP_start Def0000 S _HEAP_start Def0000
A _STACK size 0 flags 0 addr 0
A _HEADER size 0 flags 8 addr 0
A _HEADER0 size 79 flags 8 addr 100
T 00 01 T 00 01
R 00 00 02 00 R 00 00 0C 00
T 00 01 CD 00 00 3A 80 00 B7 0E 00 28 4F 21 81 00 T 00 01 CD 00 00 40 3A 80 00 B7 0E 00 28 4F 21
R 00 00 02 00 00 03 04 00 R 00 00 0C 00 00 03 02 00
T 0E 01 ED 4B 80 00 06 00 09 36 00 21 32 01 11 T 0D 01 81 00 ED 4B 80 00 06 00 09 36 00 21 33 01
R 00 00 02 00 00 0C 02 00 R 00 00 0C 00 00 0E 0C 00
T 1B 01 00 C0 01 28 00 ED B0 21 81 00 0E 00 DD 21 T 1B 01 11 00 C0 01 28 00 ED B0 21 81 00 0E 00 DD
R 00 00 02 00 R 00 00 0C 00
T 29 01 00 01 11 5A 01 D5 C3 00 C0 7E B7 C8 FE 20 T 29 01 21 00 01 11 5B 01 D5 C3 00 C0 7E B7 C8 FE
R 00 00 02 00 00 05 02 00 R 00 00 0C 00 00 06 0C 00
T 37 01 20 03 23 18 F6 DD 75 00 DD 74 01 DD 23 DD T 37 01 20 20 03 23 18 F6 DD 75 00 DD 74 01 DD 23
R 00 00 02 00 R 00 00 0C 00
T 45 01 23 0C 79 FE 28 D0 7E B7 C8 FE 20 20 05 36 T 45 01 DD 23 0C 79 FE 28 D0 7E B7 C8 FE 20 20 05
R 00 00 02 00 R 00 00 0C 00
T 53 01 00 23 18 DB 23 18 F1 T 53 01 36 00 23 18 DB 23 18 F1
R 00 00 02 00 R 00 00 0C 00
T 5A 01 T 5B 01
R 00 00 02 00 R 00 00 0C 00
T 5A 01 21 00 01 06 00 C5 E5 D5 11 00 00 ED 53 T 5B 01 21 00 01 06 00 C5 E5 D5 11 00 00 ED 53
R 00 00 02 00 00 0B 06 00 R 00 00 0C 00 00 0B 09 00
T 67 01 00 00 D1 CD 00 00 0E 62 45 CD 05 00 0E 00 T 68 01 00 00 D1 CD 00 00 0E 62 45 CD 05 00 0E 00
R 00 00 02 00 00 02 03 00 02 06 00 00 R 00 00 0C 00 00 02 05 00 02 06 00 00
T 75 01 C3 05 00 T 76 01 C3 05 00
R 00 00 02 00 R 00 00 0C 00
T 00 00 T 00 00
R 00 00 03 00 R 00 00 05 00
T 00 00 00 00 T 00 00 00 00
R 00 00 03 00
T 00 00
R 00 00 04 00
T 00 00 01 00 00 78 B1 C8 11 00 00 21 00 00 ED B0
R 00 00 04 00 02 03 03 00 02 09 02 00 02 0C 04 00
T 0E 00 C9
R 00 00 04 00
T 00 00 C9
R 00 00 05 00 R 00 00 05 00
T 00 00 T 00 00
R 00 00 06 00 R 00 00 02 00
T 00 00 40 01 00 00 78 B1 28 08 11 00 00 21 00 00
R 00 00 02 00 02 04 04 00 02 0B 03 00 02 0E 05 00
T 0E 00 ED B0
R 00 00 02 00
T 10 00
R 00 00 02 00
T 00 00 C9
R 00 00 03 00
T 00 00
R 00 00 09 00

Binary file not shown.

View File

@@ -1,15 +0,0 @@
FUSION-C is free software; it comes without any warranty.
You can use, modify, share it under the terms of
Creative Commons CC BY_SA 4.0 license.
You are free to :
Share : Copy and redistribute the material in any medium or format
Adapt : remix, transform, and build upon the material for any purpose, even commercially.
The licensor cannot revoke these freedoms as long as you follow the license terms
You must give appropriate credit, provide a link to the license, and indicate if changes were made.
You may do so in any reasonable manner, but not in any way that suggest the licensor endorse you or your use.
You must provide : the name of the creator and attribution parties, the title of the material, a copyright notice a license notice,
a disclaimer notice and a link to the material.
If you remix, transform, or build upon the material you must distribute your contributions under the same license as the original.

View File

@@ -7,7 +7,7 @@
;| |_| \__,_|___/_|\___/|_| |_| * | ;| |_| \__,_|___/_|\___/|_| |_| * |
;| | ;| |
;| The MSX C Library for SDCC | ;| The MSX C Library for SDCC |
;| V1.0 - 09-10-11 2018 | ;| V1.3 - February 2020 |
;| | ;| |
;| Eric Boez & Fernando Garcia | ;| Eric Boez & Fernando Garcia |
;| | ;| |
@@ -16,21 +16,38 @@
;| | ;| |
;\___________________________________________________________/ ;\___________________________________________________________/
; ;
;--- crt0.s for MSX-DOS - by Konami Man, 11/2004 ;--- crt0.s for MSX-DOS - by Konami Man, 11/2004
; Advanced version: allows "int main(char** argv, int argc)",
; the returned value will be passed to _TERM on DOS 2,
; argv is always 0x100 (the startup code memory is recycled).
; Overhead: 112 bytes.
; ;
; Advanced version: allows "int main(char** argv, int argc)",
; the returned value will be passed to _TERM on DOS 2,
; argv is always 0x100 (the startup code memory is recycled).
; Overhead: 112 bytes.
;
; Compile programs with --code-loc 0x170 --data-loc X ; Compile programs with --code-loc 0x170 --data-loc X
; X=0 -> global vars will be placed immediately after code ; X=0 -> global vars will be placed immediately after code
; X!=0 -> global vars will be placed at address X ; X!=0 -> global vars will be placed at address X
; (make sure that X>0x100+code size) ; (make sure that X>0x100+code size)
.globl _main .globl _main
.globl l__INITIALIZED
.globl l__INITIALIZER
.globl s__INITIALIZED
.globl s__INITIALIZER
.area _HEADER (ABS) ;; Ordering of segments for the linker.
.area _HOME
.area _CODE
.area _GSINIT
.area _GSFINAL
.area _INITIALIZER
.area _DATA
.area _INITIALIZED
.area _BSEG
.area _BSS
.area _HEAP
.area _STACK
.area _HEADER (ABS)
.org 0x0100 ;MSX-DOS .COM programs start address .org 0x0100 ;MSX-DOS .COM programs start address
@@ -44,7 +61,7 @@ init: call gsinit
; and the command line itself at 0x81 (up to 127 characters). ; and the command line itself at 0x81 (up to 127 characters).
;* Check if there are any parameters at all ;* Check if there are any parameters at all
ld b,b
ld a,(#0x80) ld a,(#0x80)
or a or a
ld c,#0 ld c,#0
@@ -134,12 +151,12 @@ cont: ld hl,#0x100
push hl push hl
;--- Step 3: Call the "main" function ;--- Step 3: Call the "main" function
push de push de
ld de,#_HEAP_start ld de,#_HEAP_start
ld (_heap_top),de ld (_heap_top),de
pop de pop de
call _main call _main
;--- Step 4: Program termination. ;--- Step 4: Program termination.
; Termination code for DOS 2 was returned on L. ; Termination code for DOS 2 was returned on L.
@@ -153,23 +170,32 @@ cont: ld hl,#0x100
;--- Program code and data (global vars) start here ;--- Program code and data (global vars) start here
;* Place data after program code, and data init code after data ;* Place data after program code, and data init code after data
.area _CODE .area _CODE
.area _DATA .area _DATA
_heap_top:: _heap_top::
.dw 0 .dw 0
gsinit: .area _GSINIT .area _GSINIT
gsinit:
ld b,b
ld bc, #l__INITIALIZER
ld a, b
or a, c
jr Z, gsinit_next
ld de, #s__INITIALIZED
ld hl, #s__INITIALIZER
ldir
gsinit_next:
.area _GSFINAL
ret
.area _GSFINAL ;* These doesn't seem to be necessary... (?)
ret
;* These doesn't seem to be necessary... (?)
;.area _OVERLAY ;.area _OVERLAY
;.area _HOME ;.area _HOME
;.area _BSS ;.area _BSS
.area _HEAP .area _HEAP
_HEAP_start:: _HEAP_start::

View File

View File

@@ -1,9 +1,10 @@
@echo off @echo off
cls cls
echo. echo.
echo F U S I O N - C V 1 . 2 echo F U S I O N - C V 1 . 3
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 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 Eric Boez ^& Fernando Garcia 2018-2020 : Made for coders !
echo Library builder script for --> MSX-DOS <--
echo _________________________________________________________________ echo _________________________________________________________________
echo. echo.
echo. echo.
@@ -27,7 +28,7 @@ echo ... Compiling C functions
for %%x in (*.c) do ( for %%x in (*.c) do (
echo %%x echo %%x
sdcc --use-stdout -mz80 -c %%x >> log.txt sdcc --use-stdout -mz80 -c --opt-code-speed %%x >> log.txt
if errorlevel 1 goto :error if errorlevel 1 goto :error
) )
@@ -35,9 +36,7 @@ echo ... adding functions to the library
for %%x in (*.rel) do ( for %%x in (*.rel) do (
echo %%x echo %%x
type %%x | findstr /v "O -mz80" > %%x.tmp
del %%x
ren %%x.tmp %%x
sdar -rc fusion.lib %%x sdar -rc fusion.lib %%x
if errorlevel 1 goto :error if errorlevel 1 goto :error
) )

Binary file not shown.

View File

@@ -1,41 +0,0 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.1 - 03-2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| |
;\___________________________________________________________/
;
;
; GetDiskTrAddress
; Definitions for dealing with MSXDOS
;
; Eric Boez 2019
;
;
.area _CODE
;--- proc GetDiskTrAddress
;
; unsigned int GetDiskTrAddress(void);
;
_GetDiskTrAddress::
push ix
ld c,#0x57
call #5
ld h,d
ld l,e
pop ix
ret
;--- end of proc

View File

@@ -13,3 +13,25 @@ Lun 2 sep 2019 17:10:01 CEST
------------------------------------ ------------------------------------
printf.c:110: warning 196: pointer target lost const qualifier printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier printf.c:111: warning 196: pointer target lost const qualifier
------------------------------------ FUSION-C
22/08/2021 20:27:58,46
------------------------------------
covoxplay.c:66: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'di; '
printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier
rlewbtovram.c:91: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'di; '
------------------------------------ FUSION-C
22/08/2021 20:32:00,43
------------------------------------
covoxplay.c:66: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'di; '
printf.c:110: warning 196: pointer target lost const qualifier
printf.c:111: warning 196: pointer target lost const qualifier
rlewbtovram.c:91: info 218: z80instructionSize() failed to parse line node, assuming 999 bytes
'di; '

View File

@@ -42,11 +42,11 @@
#include <stdarg.h> #include <stdarg.h>
#ifdef SUPPORT_LONG #ifdef SUPPORT_LONG
extern void _ultoa(long val, char* buffer, char base); extern void __ultoa(long val, char* buffer, char base);
extern void _ltoa(long val, char* buffer, char base); extern void __ltoa(long val, char* buffer, char base);
#endif #endif
extern void _uitoa(int val, char* buffer, char base); extern void __uitoa(int val, char* buffer, char base);
extern void _itoa(int val, char* buffer, char base); extern void __itoa(int val, char* buffer, char base);
extern void putchar(char* c); extern void putchar(char* c);
static int format_string(const char* buf, const char *fmt, va_list ap); static int format_string(const char* buf, const char *fmt, va_list ap);
@@ -172,20 +172,20 @@ static int format_string(const char* buf, const char *fmt, va_list ap)
val = va_arg(ap, int); val = va_arg(ap, int);
if(isUnsigned && isLong) if(isUnsigned && isLong)
_ultoa(val, buffer, base); __ultoa(val, buffer, base);
else if(isUnsigned) else if(isUnsigned)
_uitoa(val, buffer, base); __uitoa(val, buffer, base);
else if(isLong) else if(isLong)
_ltoa(val, buffer, base); __ltoa(val, buffer, base);
else else
_itoa(val, buffer, base); __itoa(val, buffer, base);
#else #else
val = va_arg(ap, int); val = va_arg(ap, int);
if(isUnsigned) if(isUnsigned)
_uitoa(val, buffer, base); __uitoa(val, buffer, base);
else else
_itoa(val, buffer, base); __itoa(val, buffer, base);
#endif #endif
strPnt = buffer; strPnt = buffer;

View File

@@ -1,43 +0,0 @@
; ___________________________________________________________
;/ __ _ \
;| / _| (_) |
;| | |_ _ _ ___ _ ___ _ __ |
;| | _| | | / __| |/ _ \| '_ \ |
;| | | | |_| \__ \ | (_) | | | | |
;| |_| \__,_|___/_|\___/|_| |_| * |
;| |
;| The MSX C Library for SDCC |
;| V1.1 - 03-2019 |
;| |
;| Eric Boez & Fernando Garcia |
;| |
;| A S M S O U R C E C O D E |
;| |
;| |
;\___________________________________________________________/
;
;
; SetDiskTrAddress
; Definitions for dealing with MSXDOS
;
; Eric Boez 2019
;
;
.area _CODE
;--- proc SetDiskTrAddress
;
; void SetDiskTrAddress(int adress)
;
_SetDiskTrAddress::
push ix
ld ix,#0
add ix,sp
ld e,4(ix)
ld d,5(ix)
ld c,#0x1A
call #5
pop ix
ret
;--- end of proc

View File

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

View File

@@ -17,19 +17,33 @@
| | | |
\___________________________________________________________/ \___________________________________________________________/
*/ */
/* sprite16 /* spriteOff
| Activate Sprite data size 16x16 pixels | 2018 Eric Boez Updated November 2020
| 2006/11/25 t.hara
| 2018 Eric Boez
*/ */
#include "../../header/msx_fusion.h"
#define RG08SAV 0xFFE7 void SpriteOff(void) __naked
void SpriteOff(void)
{ {
unsigned char val; __asm
val=Peek(RG08SAV) | 0b00000010;
VDPwriteNi(0x08,val); /// Write to VDP Register 8 RG1SAV = 0xF3E0
Poke(RG08SAV,val); DPPAGE = 0xFAF5
ATRBAS = 0xF928
RG25SAV = 0xFFFA
RG2SAV = 0xF3E1
RG8SAV = 0xFFE7
RG9SAV = 0xFFE8
push ix
ld a,(RG8SAV)
or #0b00000010
ld (RG8SAV),a
ld b,a
ld c,#8
ld ix,#0x0047 ; Write VDP Bios
ld iy, (0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop ix
ret
__endasm;
} }

View File

@@ -17,19 +17,34 @@
| | | |
\___________________________________________________________/ \___________________________________________________________/
*/ */
/* sprite16 /* spriteOn
| Activate Sprite data size 16x16 pixels | 2018 Eric Boez Updated November 2020
| 2006/11/25 t.hara
| 2018 Eric Boez
*/ */
#include "../../header/msx_fusion.h"
#define RG08SAV 0xFFE7
void SpriteOn(void) void SpriteOn(void) __naked
{ {
unsigned char val; __asm
val=Peek(RG08SAV) & 0b11111101; RG1SAV = 0xF3E0
VDPwriteNi(0x08,val); /// Write to VDP Register 8 DPPAGE = 0xFAF5
Poke(RG08SAV,val); ATRBAS = 0xF928
RG25SAV = 0xFFFA
RG2SAV = 0xF3E1
RG8SAV = 0xFFE7
RG9SAV = 0xFFE8
push ix
ld a,(RG8SAV)
and #0b11111101
ld (RG8SAV),a
ld b,a
ld c,#8
ld ix,#0x0047 ; Write VDP Bios
ld iy, (0xFCC0) ; mainrom slotaddress
call 0x001c ; interslotcall
ei
pop ix
ret
__endasm;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
;| |_| \__,_|___/_|\___/|_| |_| * | ;| |_| \__,_|___/_|\___/|_| |_| * |
;| | ;| |
;| The MSX C Library for SDCC | ;| The MSX C Library for SDCC |
;| V1.1 - 05-2019 | ;| V1.1 - 05-2019 updated 11/09/20 |
;| | ;| |
;| Eric Boez & Fernando Garcia | ;| Eric Boez & Fernando Garcia |
;| | ;| |
@@ -33,6 +33,7 @@ EXBRSA = 0xFAF8
SCRMOD = 0xFCAF SCRMOD = 0xFCAF
ACPAGE = 0xFAF6 ACPAGE = 0xFAF6
MODE = 0xFAFC MODE = 0xFAFC
ATRBAS = 0xF928
;--------------------------- ;---------------------------
; Return the VRAM Size of the MSX Computer 16/64/128 KB ; Return the VRAM Size of the MSX Computer 16/64/128 KB
@@ -51,17 +52,15 @@ _GetVramSize::
ret ret
;--------------------------- ;---------------------------
; MODULE LDIRVM ; MODULE LDIRVM
; ;
; LDIRVM moves block from memory to the VRAM. ; LDIRVM moves block from memory to the VRAM.
; ;
; efinition : CopyRamToVram(void *SrcRamAddress, unsigned int DestVramAddress, unsigned int Length); ; Definition : CopyRamToVram(void *SrcRamAddress, unsigned int DestVramAddress, unsigned int Length);
; ;
_CopyRamToVram:: _CopyRamToVram::
push ix push ix
di
ld ix,#0 ld ix,#0
add ix,sp add ix,sp
ld E,4(ix) ; SRC RAM address ld E,4(ix) ; SRC RAM address
@@ -89,6 +88,7 @@ ldirvm_1:
jp nz,ldirvm_1 jp nz,ldirvm_1
dec a dec a
jp nz,ldirvm_1 jp nz,ldirvm_1
ei
pop ix pop ix
ret ret
@@ -102,7 +102,7 @@ ldirvm_1:
_CopyVramToRam:: _CopyVramToRam::
push ix push ix
di
ld ix,#0 ld ix,#0
add ix,sp add ix,sp
ld E,4(ix) ; SRC VRAM address ld E,4(ix) ; SRC VRAM address
@@ -130,6 +130,7 @@ ldirmv_1:
jp nz,ldirmv_1 jp nz,ldirmv_1
dec a dec a
jp nz,ldirmv_1 jp nz,ldirmv_1
ei
pop ix pop ix
ret ret
@@ -201,7 +202,49 @@ set_high:
setaddress_1: setaddress_1:
di di
out (c),l ; set the low address out (c),l ; set the low address
ld a,h ; prepare to set the middle address ld a,h ; prepare to set the middle address
and #0b00111111 and #0b00111111
pop de pop de
ret ret
;----------------------------
; MODULE PUTSPRITE
;
; PutSprite ( char sprite_no, char pattern_no, char x, char y, char ec_color );
;
;
_PutSprite::
push ix
ld ix,#0
add ix,sp
ld a,4(ix) ; sprite_no
rlca
rlca
ld hl,(ATRBAS)
; add HL to A
add a,l
ld l,a
adc a,h
sub l
ld h,a
di
call SETWRT
di
ld c,#0x98
ld a, 7 (ix) ; y
out (c),a
ld a, 6 (ix) ; x
out (c),a
ld a, 5 (ix) ; pattern_no
out (c),a
ld a, 8 (ix) ; ec_color
out (c),a
ei
pop ix
ret