Code Monkey home page Code Monkey logo

fusion-c-v1.2's Introduction

Fusion-C-v1.2

Fusion-C 1.2 is a free C library with which you can program software and games for MSX computers under MSX-DOS with C language. You must use Fusion-C with SDCC 3.6.0 compiler (other versions have not been tested, but should work with more or less changes in the FUSION-C compilation script) Library is providing functions to work with every aspects of MSX computers (MSX1, MSX2, MSX2+, MSX TURBO-C) easily. The package is ready to use to make games and others tools.

The Fusion-C Library can be supplemented by the book "FUSION-C COMPLETE JOURNEY" which you can buy on Amazon : https://www.amazon.fr/FUSION-C-MSX-Library-complete-journey/dp/1730828612/ref=sr_1_1?__mk_fr_FR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&keywords=msx+Fusion-c

Have fun coding for MSX ! Eric Boez January/august 2019


History

—————————————————— 2019 - Sptember 13 —————————————————— FUSION-c 1.2 Changes :

  • added support functions for GFX9000/V990 and TCPIP for the Gr8NET. Both in beta version

  • New Library compilation Scripts

  • Fixed error or rewritten functions : RleWBToRam and RleWBToVram (msx_fusion.h) MouseRead (msx_fusion.h) LMMM ( !/ variables order changed) (vdp_graph2.h) Line (Now Works on Screen 7) (vdp_graph2.h) Point (Now Works on Screen 7) (vdp_graph2.h) Pset (Now Works on Screen 7) (vdp_graph2.h) CheckBreak (msx_fusion.h) PutCharHex (msx_fusion.h) PrintHex (msx_fusion.h)

  • added function to library and to manual/book : HMMM (Vram to Vram copy function) (vdp_graph2.h) LMMC (Ram to Vram copy function) (vdp_graph2.h) YMMM (Vram to Vram CopyY position) (vdp_graph2.h) HMMV (High speed rectangle fill) (vdp_graph2.h) LMMV (High speed rect. fill with OP) (vdp_graph2.h) MouseReadTo (Read mouse to structure) (msx_fusion.h) Itoa (Integer to Char cons.) (msx_fusion.h) StrReverse (Reverse a char string) (msx_fusion.h) BoxFill (vdp_graph2.h) BoxLine (vdp_graph2.h)

  • Removed functions : Rect (Same as BoxFill)

  • examples added or modified : loadScreen5Image.c ReadMouseTo.c MouseRead.c RlewbToVram.c sprites-msx2.c lineandbox.c vdptest5.c vdptest8.c

      GFX9000 examples Folder
      Gr8NET_TCPIP Example Folder
    

Updates on SublimeText Build System and Makefile Compilation script for MacOS users. Now the current file you are working on with SublimeText is detected and can be compile on the fly the build Sublime Text Build system. -Update your Build Script by copying
./Working Folder/Tools/_for Sublime Text/MacOs/sdcc-build.sublime-build To /Users//Library/Application\ Support/Sublime Text 3/Packages/User/ -update the Makefile provide with this Fusion-C version.

—————————————————— 2019 - June 17 —————————————————— FUSION-c 1.1a Changes :

  • Correction of a bug introduced in 1.1 version inside Print function

—————————————————— 2019 - May 28 —————————————————— FUSION-c 1.1 Changes :

  • Missing function definition added in msx_fusion.h : SetBorderColor

  • Errors in definitions fixed in msx_fusion.h : StrToLower renamed into CharToLower StrToUpper renamed into CharToLower keyboardRead renamed into KeyboardRead EnableInterupt renamed into EnableInterrupt DisableInterupt enamed into DisableInterrupt

  • Mistakes or Errors Fixed in Manual/Book : SetScrollH SetScrollV Sprite16 Sprite8 SetSC5Palette Vpoke other typo

  • Removed fonctions from previous version : WaitForKey (msx_fusion.h) idem as WaitKey KeyboardHit (msx_fusion.h) idem as Inkey Getcon (msx_fusion.h) idem as Getche

  • Errors in variable type fixed : Ltell second parameter is Long type variable Lseek second parameter is Long type variable

  • added instruction details in manual/book : printf

  • added long support to printf

  • Fixed or rewritten source code’s functions : getche.s vdp_graph2.s setdate.s inkey.s waitkey.s getche.s joystickRead.c triggeread.c killekeybuffer.c fillvram.c crt0_msxdos.s

  • added functions to library and to manual/book : MouseRead (msx_fusion.h) SetRealTimer (msx_fusion.h) RealTimer (msx_fusion.h) CovoxPlay (msx_fusion.h) SC2Circle (vdp_circle.h) SC2FilledCircle (vdp_circle.h) VDPLinesSwitch (msx_fusion.h) RleWBToVram (msx_fusion.h) RleWBToRam (msx_fusion.h) GetDiskParam (io.h) GetDiskTrAddress (io.h) SetDiskTrAddress (io.h) SectorRead (io.h) SectorWrite (io.h) CopyRamToVram (msx_fusion.h) CopyVramToRam (msx_fusion.h) PutText (msx_fusion.h) (Function Enhanced with Logical Operator) GetVramSize (msx_fusion.h) InitInterruptHandler (msx_fusion.h) EndInterruptHandler (msx_fusion.h) SetInterruptHandler (msx_fusion.h)

  • added code example : random-number.c hardware-scroll.c mouse.c timer.c 16x16_pixels_sprites.c arguments.c vsync_do.c vdp_blanking_test.c Circle_Msx1.c sc5Palette.c rlewbToVram.c riewb-test.c rlewbToRam.c readDiskParamandsectors.c printTextGraphic.c RamVramCopy.c interrupt.c

  • Compilation scripts Makefile & Compil.bat enhanced with conditional starting of openMSX

—————————————————— 2019 - January 08 ——————————————————

  • Fusion-C V1.0 Initial Release

fusion-c-v1.2's People

Contributors

ericb59 avatar

Stargazers

NataliaPC avatar Renan Guimarães avatar Benedito Angelo Molizane avatar Nivardo avatar Sérgio Barroso avatar Phoebe Zeitler avatar Stefano Baldo avatar Osvaldo Santana Neto avatar Roberto Magazoni avatar DaRKND avatar Markus Dieterle avatar X1pepe avatar molety avatar  avatar Vikentiy Chernyakov avatar Rafa López avatar Manoel Neto avatar Ricardo Ghisi Tobaldini avatar Erik Kohler avatar William Roy avatar Ruman Kim avatar  avatar Kazerlelutin avatar Sylvain Glaize avatar ToughkidDEV avatar Luciano Almeida avatar Pedro de Medeiros avatar Ari Adari avatar  avatar Cristiano Goncalves avatar Christopher Farrar avatar Jorge Janaite Neto avatar Antxiko Gorjon avatar Juhang Park avatar  avatar Edgar Gonzàlez i Pellicer avatar Denjhang Liu avatar André Baptista avatar Akihiro Shamoto avatar Nuno Mendes avatar Pedro Casaubon avatar Richard van Zon avatar Cláudio Pinheiro avatar  avatar preemeijer avatar Максим Сохацький avatar Miguel Colom avatar Raul Portales avatar Manuel Martinez Torres avatar Nicholas H. avatar Jose avatar Patrik avatar Pedro Lima avatar Wilson "Barney" Pilon avatar Sangwoo Shim avatar Marcos LM avatar Fabio Galuppo avatar Carlos Santisteban avatar Vicente Herrera avatar Saffron avatar  avatar  avatar Raymond avatar Sandy Pleyte avatar Iban Nieto avatar Jett avatar Haroldo de Oliveira Pinheiro avatar a0rante avatar André Simões avatar  avatar Laurens Holst avatar

Watchers

André Simões avatar James Cloos avatar Markus Dieterle avatar Marcos LM avatar Cláudio Pinheiro avatar Jorge Janaite Neto avatar a0rante avatar Wilson "Barney" Pilon avatar Christopher Farrar avatar Paulo V. Radtke avatar Raymond avatar ToughkidDEV avatar tooloud avatar  avatar Nuno Mendes avatar Cristiano Goncalves avatar  avatar  avatar

fusion-c-v1.2's Issues

More consistent naming of functions

Hi, great initiative and thanks for the effort! I bought the book and started reading. What I see is that the Fusion-C library could benefit from a more consistent naming convention for function names.

Most of them are camelcased and start with an uppercase character: FunctionName() but some start with a lowercase character and use underscores: function_name()

I would propose to unify it and make it consistent.

Also, what is the reason (other than style) to start function names with an uppercase? To keep it inline with other c-libraries and languages I would prefer to use a lowercase, like functionName() and not capitalize words like MSX and VDP: vdpFunction() and someMsxFunction(), but that’s just personal taste ;-)

Anyway thanks for sharing on github, am looking forward to contribute a bit.

Problem with InputString and the MSX-DOS2 extension

First of all, thank you for this library, it's an amazing work!

I think I might have found a bug in the InputString(....) function when the msxdos2 extension is not loaded.

To reproduce it, I compiled the file print-input.c from the examples directory, and executed the resulting COM file in the OpenMSX emulator with the following results:

  • If the 'msxdos2' extension was loaded, it works correctly as expected (both in MSX-DOS1 and MSX-DOS2).
  • If the 'msxdos2' extension was not loaded, after entering the string, it is not correctly shown and sometimes the machine hangs and/or reboots.

Please let me know if I can provide further information :-)
Thank you!

Rename "Working Folder" to "workspace"

Rename Working Folder to some other name without space characters. It's error prone for scripting. I like workspace which is common practice in several IDEs.

Error in the documentation

Hi. Thanks for such a fantastic package! Helps me A LOT. Keep it up.

Just wanted to point out that the docs says this:

Palette
typedef struct {
unsigned char color ; // color number 0..15
unsigned char R ; // 0..7 red brightness
unsigned char G ; // 0..7 green brightness
unsigned char B ; // 0..7 blue brightness
} ColRGB ;

and the source code says this:

/* 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
} ColRGB;

I get compilation errors on "color" :)

IntBios and IntDos (IntDosBios.s) boot the computer in ROM projects.

IntBios and IntDos (IntDosBios.s), as well as dependent routines (like ReadMSXtype) don't work in ROM projects. They rely self-modifying code (they (try to) change ibcladr) and, being unable to set the proper routine address, they end up jumping to 0x0000 and booting the computer.

crt0_msxdos_advanced.rel does not initialise static variables

Noticed today something strange. When I compile my code with the supplied .rel my static variables don't initialise. When I compile the rel with the .s file all is well. My guess is that the .rel in your include folder is old and based on the initial version of Konamiman.

My code to check things:

#include "stdio.h"
#include "stdint.h"
#include "string.h"

uint8_t query[255];

void dosomething ()
{
  static unsigned char endquery[] = {0,0,1,0,1};  
  memcpy(query, endquery, 5);
}

/*---------------------------------------------------------------------------*/
int main(char *argv[], int argc)
{
  // check arguments
  if (argc==0)
    printf ("No arguments\r\n");
  else
    printf ("Arguments\r\n");

  dosomething ();
  printf ("%d,%d,%d,%d,%d",query[0],query[1],query[2],query[3],query[4]);
  return 0;
}

With the wrong crt0 it displays 255,255,255,255,255. With the right one it displays: 0,0,1,0,1

I patched the original Konamiman version by doing this:

        ;.area   _GSINIT      WAS HERE MOVED DOWN TO gsinext
gsinit::
        ld	bc,#l__INITIALIZER
        ld	a,b
        or	a,c
        jp	z,gsinext
        ld	de,#s__INITIALIZED
        ld	hl,#s__INITIALIZER
        ldir
gsinext:
        .area   _GSINIT
        .area   _GSFINAL

Problem was that the application calls gsinit at start. When area _GSINIT is before that it will be skipped. I moved it to gsinext. The crt0_msxdos_advanced.s of FusionLib when compiled also gives a good result. Only it does not include code for INITIALIZER. Don't know if this is still necessary though.

Proper file places

Fusion-C uses non-standard directory structure. include directory should be reserved for header (.h) types only, so that the SDCC -I parameter makes sense. All .lib and .rel files should go to the lib directory.

Need a recent Hex2bin for Linux

make fails after this output:

..•̀ᴗ•́)و .. sdcc  											 is Processing ... !
Invalid input and output values
usage: hex2bin [options]
	--help, -h: Print this help
	--input, -i: The input file to use (containing the hexadecimal characters).
	--output, -o: The output file to use.
	--limit, -l: Character limit per line (the value of the "start" option is not included).
	--start, -s: Adding a start offset per line.
	--printable, -p: Extracts and converts all printable characters.
	--extract_only, -e: Only extracts words from "start" to "limit".
make: *** [Makefile:83: test.com] Fout 1**

Using:

  • OS: Linux 5.9.13-arch1-1
  • SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ez80_z80/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.0.0 #11528 (Linux) with printf, sprintf, vprintf, putchar, getchar removed
  • hex2bin: git://github.com/Keidan/hex2bin.git, master (commit a8de8c406ec4e4cdc08f646bd03f38377330854a)
  • Fusion-C: master (commit 184582a)

Can't make Pt3Player-MSX2-Demo example work

Hi,

First of all thank you so much for this wonderful library! kudos on the hard work.

I've been using it for writing a small RPG, and so far things work great. At least until I tried to play some music.

I've tried to compile the Pt3Player-MSX2-Demo example, but the music never plays. I've tried with a lot of other different examples and they work as expected, I'm also using the library with my game and it's working. So I was wondering if maybe the code of this example is old or different from the actual executable file? I've tried with the .com file that is already generated and that one works as expected.

Thanks!

Bug in hmmm x coordinate

When I copy a part of the screen with the hmmm command and put in on a certain target location the location is off by 1 pixel. When I move it to the right with 1 pixel, it moves with 2 pixels. So it looks like there is a bug in the X coordinate.

Exit(char N) does not exit

Hi. Thanks for such a fantastic package, once again.

I can't get the function Exit(char N) to exit, the program just returns to program and continues.

Also, the documentation (pdf) says that the call is "void exit(char N)" - with a lowercase e, while in the code/headerfile uppercase is used.

Just wanted to let you know, so things could be updated in a future release.

Interrupt Handler: interrupts not enabled before reti

If I understand well, at the end of a interrupt handler routine interrupts must be enabled again. I read it from several sources, this is one of them: http://map.grauw.nl/articles/interrupts.php

Current fusion c implementation does not call EI before RETI. From interrupt.s file:

; ---------------------------------------------------------
;	intr_handler
; ---------------------------------------------------------
intr_handler:
	push	af
	push	bc
	push	de
	push	hl
	push	ix
	push	iy
	exx
	ex		af,af'
	push	af
	push	bc
	push	de
	push	hl
	push	ix
	push	iy

user_intr_handler:
	call	dummy_handler

	xor		a
	or		l
	call	z, backup_keyint

	pop		iy
	pop		ix
	pop		hl
	pop		de
	pop		bc
	pop		af
	ex		af,af'
	exx
	pop		iy
	pop		ix
	pop		hl
	pop		de
	pop		bc
	pop		af
	reti

and, if I'm right, it should be:

; ---------------------------------------------------------
;	intr_handler
; ---------------------------------------------------------
intr_handler:
	push	af
	push	bc
	push	de
	push	hl
	push	ix
	push	iy
	exx
	ex		af,af'
	push	af
	push	bc
	push	de
	push	hl
	push	ix
	push	iy

user_intr_handler:
	call	dummy_handler

	xor		a
	or		l
	call	z, backup_keyint

	pop		iy
	pop		ix
	pop		hl
	pop		de
	pop		bc
	pop		af
	ex		af,af'
	exx
	pop		iy
	pop		ix
	pop		hl
	pop		de
	pop		bc
	pop		af
        ei
	reti

To reproduce the issue you can use the interrupt.c example file and comment the DisableInterrupt()/EnableInterrupt() calls from the main loop.

You will see that the interrupt handle is called only once, the first vsync, and will never be called again because interrupts are not enabled after the first interrupt handler call.

Exit() function doesn't work on MSXDOS1

When trying to exit a .COM program, the Exit(...) function was ignored on MSXDOS1 while it worked on other MSXDOS versions and derivatives. Here is an example:

#include "fusion-c/header/msx_fusion.h"

int main(void)
{
    Exit(0);
    Print("unreachable\r\n");
    return 0;
}

And the result:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.