Skip to content

Commit

Permalink
Merge pull request #4 from z88dk/master
Browse files Browse the repository at this point in the history
update to z88dk master
  • Loading branch information
feilipu committed Oct 16, 2017
2 parents f18092a + c7f11e7 commit 7cdf117
Show file tree
Hide file tree
Showing 327 changed files with 3,259 additions and 18,539 deletions.
9 changes: 9 additions & 0 deletions .gitmodules
@@ -0,0 +1,9 @@
[submodule "UNIXem"]
path = ext/UNIXem
url = https://github.com/z88dk/UNIXem.git
[submodule "ext/uthash"]
path = ext/uthash
url = https://github.com/z88dk/uthash.git
[submodule "ext/Oryx-Embedded-Common"]
path = ext/Oryx-Embedded-Common
url = https://github.com/z88dk/Common.git
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,10 @@ There are three ways to install z88dk.
1. Use the [Most Recent Official Release](https://github.com/z88dk/z88dk/tree/github/Readme#most-recent-official-release) currently v1.99B dated 10 Jan 2017. Follow these [installation instructions](https://www.z88dk.org/wiki/doku.php?id=temp:front#installation).
2. Get the [Nightly Build](http://nightly.z88dk.org/). Every night we build complete binary packages for windows and osx and generate source packages for everyone else. The same [installation instructions](https://www.z88dk.org/wiki/doku.php?id=temp:front#installation) apply. Using a nightly build means you can keep up with bugfixes and new features rather than having to wait an entire year for a release to occur.
3. Use Github. Using github will keep you up-to-date with the developers and will allow you to contribute to the project. We do not store the z80 libraries or the binaries in the github repository. Instead you will either have to build those things yourself or acquire them from the nightly build to have a working install.

The z88dk repository uses git submodules, these are not automatically downloaded by git by default so you will have to either adjust your clone line, or retrieve them manually. To clone with submodules use `git clone --recursive https://github.com/z88dk/z88dk.git`. To add the submodules to an already existing clone use `git submodule update --init --recursive`


1. **Installing the Z88DK Binaries**
* **Mac OSX** Download the nightly build for osx and copy the z88dk/bin directory to the same place in your z88dk tree. If you would like to try building the binaries yourself, follow the Other instructions below.
* **Windows** Download the nightly build for win32 and copy the z88dk/bin directory to the same place in your z88dk tree. You can also build the z88dk binaries yourself using the VS2015 solution found in z88dk/win32 however you should copy the nightly build initially so that various required dlls and some non-z88dk binaries are present.
Expand Down
1 change: 1 addition & 0 deletions ext/Oryx-Embedded-Common
Submodule Oryx-Embedded-Common added at 47a5ac
1 change: 1 addition & 0 deletions ext/UNIXem
Submodule UNIXem added at c5467f
1 change: 1 addition & 0 deletions ext/uthash
Submodule uthash added at 01e5a8
4 changes: 4 additions & 0 deletions include/_DEVELOPMENT/clang/arch.h
Expand Up @@ -19,6 +19,10 @@
#include <../../../libsrc/_DEVELOPMENT/target/sms/config_sms.h>
#endif

#ifdef __VGL
#include <../../../libsrc/_DEVELOPMENT/target/vgl/config_vgl.h>
#endif

#ifdef __EMBEDDED_Z80
#include <../../../libsrc/_DEVELOPMENT/target/z80/config_z80.h>
#endif
Expand Down
3 changes: 3 additions & 0 deletions include/_DEVELOPMENT/clang/arch/sms/SMSlib.h
Expand Up @@ -193,6 +193,9 @@ extern void _RST18_SMS_crt0_RST18(unsigned int addr) __preserves_regs(b,c,d,e,h,
extern void SMS_initSprites(void);


extern void SMS_addTwoAdjoiningSprites(unsigned char x,unsigned char y,unsigned char tile);


// returns -1 if no more sprites are available
extern signed char SMS_addSprite(unsigned char x,unsigned char y,unsigned char tile);

Expand Down
1 change: 1 addition & 0 deletions include/_DEVELOPMENT/proto/arch/sms/SMSlib.h
Expand Up @@ -161,6 +161,7 @@ extern void _RST18_SMS_crt0_RST18(unsigned int addr) __preserves_regs(b,c,d,e,h,
/** FUNCTIONS FOR SPRITE HANDLING */

__OPROTO(`b,c,d,e,h,l,iyl,iyh',`b,c,d,e,h,l,iyl,iyh',void,,SMS_initSprites,void)
__DPROTO(`iyl,iyh',`iyl,iyh',void,,SMS_addTwoAdjoiningSprites,unsigned char x,unsigned char y,unsigned char tile)
// returns -1 if no more sprites are available
__DPROTO(`iyl,iyh',`iyl,iyh',signed char,,SMS_addSprite,unsigned char x,unsigned char y,unsigned char tile)
__OPROTO(`b,c,iyl,iyh',`b,c,iyl,iyh',signed char,,SMS_reserveSprite,void)
Expand Down
4 changes: 4 additions & 0 deletions include/_DEVELOPMENT/sccz80/arch.h
Expand Up @@ -19,6 +19,10 @@
#include <../../../libsrc/_DEVELOPMENT/target/sms/config_sms.h>
#endif

#ifdef __VGL
#include <../../../libsrc/_DEVELOPMENT/target/vgl/config_vgl.h>
#endif

#ifdef __EMBEDDED_Z80
#include <../../../libsrc/_DEVELOPMENT/target/z80/config_z80.h>
#endif
Expand Down
5 changes: 5 additions & 0 deletions include/_DEVELOPMENT/sccz80/arch/sms/SMSlib.h
Expand Up @@ -201,6 +201,11 @@ extern void _RST18_SMS_crt0_RST18(unsigned int addr) __preserves_regs(b,c,d,e,h,
extern void __LIB__ SMS_initSprites(void) __smallc;


extern void __LIB__ SMS_addTwoAdjoiningSprites(unsigned char x,unsigned char y,unsigned char tile) __smallc;
extern void __LIB__ SMS_addTwoAdjoiningSprites_callee(unsigned char x,unsigned char y,unsigned char tile) __smallc __z88dk_callee;
#define SMS_addTwoAdjoiningSprites(a,b,c) SMS_addTwoAdjoiningSprites_callee(a,b,c)


// returns -1 if no more sprites are available
extern signed char __LIB__ SMS_addSprite(unsigned char x,unsigned char y,unsigned char tile) __smallc;
extern signed char __LIB__ SMS_addSprite_callee(unsigned char x,unsigned char y,unsigned char tile) __smallc __z88dk_callee;
Expand Down
4 changes: 4 additions & 0 deletions include/_DEVELOPMENT/sdcc/arch.h
Expand Up @@ -19,6 +19,10 @@
#include <../../../libsrc/_DEVELOPMENT/target/sms/config_sms.h>
#endif

#ifdef __VGL
#include <../../../libsrc/_DEVELOPMENT/target/vgl/config_vgl.h>
#endif

#ifdef __EMBEDDED_Z80
#include <../../../libsrc/_DEVELOPMENT/target/z80/config_z80.h>
#endif
Expand Down
5 changes: 5 additions & 0 deletions include/_DEVELOPMENT/sdcc/arch/sms/SMSlib.h
Expand Up @@ -211,6 +211,11 @@ extern void _RST18_SMS_crt0_RST18(unsigned int addr) __preserves_regs(b,c,d,e,h,

extern void SMS_initSprites(void) __preserves_regs(b,c,d,e,h,l,iyl,iyh);

extern void SMS_addTwoAdjoiningSprites(unsigned char x,unsigned char y,unsigned char tile) __preserves_regs(iyl,iyh);
extern void SMS_addTwoAdjoiningSprites_callee(unsigned char x,unsigned char y,unsigned char tile) __preserves_regs(iyl,iyh) __z88dk_callee;
#define SMS_addTwoAdjoiningSprites(a,b,c) SMS_addTwoAdjoiningSprites_callee(a,b,c)


// returns -1 if no more sprites are available
extern signed char SMS_addSprite(unsigned char x,unsigned char y,unsigned char tile) __preserves_regs(iyl,iyh);
extern signed char SMS_addSprite_callee(unsigned char x,unsigned char y,unsigned char tile) __preserves_regs(iyl,iyh) __z88dk_callee;
Expand Down
6 changes: 6 additions & 0 deletions include/cpc.h
Expand Up @@ -37,6 +37,12 @@ extern char __LIB__ *cpc_rsx_strcpy_callee(char *, char *) __smallc __z88dk_

#define cpc_rsx_strcpy(a,b) cpc_rsx_strcpy_callee(a,b)

// Set CPC color for a specified pen (set color in a palette element)
extern void __LIB__ cpc_set_palette(int pen, int color) __smallc ;
void __LIB__ cpc_set_palette_callee(int pen, int color) __smallc __z88dk_callee;

#define cpc_set_palette(a,b) cpc_set_palette_callee(a,b)

// Call RSX/Bar command
extern int __LIB__ cpc_rsx(char *cmd,...);

Expand Down
5 changes: 5 additions & 0 deletions include/psg.h
Expand Up @@ -33,6 +33,11 @@
#define psgT(hz) ((int) (hz/0.0596))
#endif

#ifdef __EINSTEIN__
// 2 Mhz clock (divided internally by 16)
#define psgT(hz) ((int)(125000.0 / (hz)))
#endif

#ifdef __MSX__
#include <msx.h>
// src clock: 17897725.5 divided internally by 16
Expand Down
4 changes: 4 additions & 0 deletions include/sound.h
Expand Up @@ -100,6 +100,10 @@ extern void __LIB__ bit_play(unsigned char melody[]);
#define BEEP_TSTATES 221750.0 /* 1.774 Mhz */
#endif

#ifdef VG5000
#define BEEP_TSTATES 500000.0 /* 4 Mhz */
#endif

/* Clock timing is not perfect, here we have a slightly different
routine, with the inner loop differing for one cycle,and
VZ300 has a CPU clock of 3,54 Mhz, VZ200 -> 3,58.. we stay in the middle */
Expand Down
3 changes: 2 additions & 1 deletion lib/config/msx.cfg
Expand Up @@ -16,5 +16,6 @@ SUBTYPE wav -Cz+msx -Cz--fmsx -Cz--audio -Cz--fast -startup=1
SUBTYPE rom -Cz+rom -Cz--romsize=0x8000 -Cz--rombase=0x4000 -startup=3
SUBTYPE msxdos -Cz+newext -Cz-e -Cz.com -startup=2

CLIB default -lmsx_clib -lndos
CLIB default -lmsx_clib
CLIB ansi -pragma-need=ansiterminal -lmsx_clib

5 changes: 4 additions & 1 deletion lib/config/mtx.cfg
Expand Up @@ -7,8 +7,11 @@ CRT0 DESTDIR/lib/mtx_crt0

# Any default options you want - these are options to zcc which are fed
# through to compiler, assembler etc as necessary
OPTIONS -v -O2 -iquote. -lmtx_clib -lndos -DZ80 -DMTX -D__MTX__ -M -Cc-standard-escape-chars -subtype=default
OPTIONS -v -O2 -iquote. -lndos -DZ80 -DMTX -D__MTX__ -M -Cc-standard-escape-chars -subtype=default -clib=default

SUBTYPE none
SUBTYPE default -Cz+mtx -Cz--audio
SUBTYPE rom -startup=2 -Cz+rom -Cz-s -Cz16384

CLIB default -lmtx_clib
CLIB ansi -pragma-need=ansiterminal -lmtx_clib
1 change: 1 addition & 0 deletions lib/config/svi.cfg
Expand Up @@ -14,4 +14,5 @@ SUBTYPE default -Cz+svi
SUBTYPE wav -Cz+svi -Cz--audio -Cz--fast

CLIB default -lsvi_clib -lndos
CLIB ansi -pragma-need=ansiterminal -lsvi_clib -lndos

6 changes: 3 additions & 3 deletions lib/cpm_crt0.asm
Expand Up @@ -18,7 +18,7 @@
; #pragma output noprotectmsdos - strip the MS-DOS protection header
; #pragma output noredir - do not insert the file redirection option while parsing the
; command line arguments (useless if "nostreams" is set)
; #pragma output nogfxglobals - No global variables for graphics (required for GFX on the TIKI-100 and Spectrum +3)
; #pragma output nogfxglobals - No global variables for graphics (required for GFX on TIKI-100, Einstein, and Spectrum +3)
;
; These can cut down the size of the resultant executable

Expand Down Expand Up @@ -160,6 +160,8 @@ l_dcal: jp (hl) ;Used for call by function ptr

; Memory banking for Spectrum +3
IF (startup=3)
PUBLIC pixelbyte
pixelbyte: defb 0 ; temp byte storage for VDP driver

p3_poke:
jp 0
Expand Down Expand Up @@ -244,11 +246,9 @@ _vdcDispMem: ; Label used by "c128cpm.lib" only
end: defb 0 ; null file name
IF !DEFINED_nogfxglobals
PUBLIC RG0SAV
PUBLIC pixelbyte
RG0SAV: defb 1*8 ; VDP graphics driver (Einstein)
; Also used to remember the border color for the ZX Spectrum +3
; in CP/M mode (Blue is default)
pixelbyte: defb 0 ; temp byte storage for VDP driver
ENDIF


Expand Down
3 changes: 0 additions & 3 deletions lib/mtx_crt0.asm
Expand Up @@ -107,9 +107,6 @@ msxbios:

SECTION bss_crt

PUBLIC pixelbyte
pixelbyte: defb 0

PUBLIC fputc_vdp_offs ;Current character pointer
PUBLIC aPLibMemory_bits;apLib support variable
Expand Down
4 changes: 2 additions & 2 deletions lib/svibasic.def
Expand Up @@ -3,7 +3,7 @@ lstoff
; MSX BASIC and SYSTEM VARIABLES definitions
;
; December 2007
; $Id: svibasic.def,v 1.10 2017-01-09 10:20:47 stefano Exp $
; $Id: svibasic.def $
;


Expand Down Expand Up @@ -145,7 +145,7 @@ defc PRMPRV = $F878 ; Pointer to previous parameter block
defc PRMLN2 = $F87A ; Size of parameter block
defc PARM2 = $F87C ; For parameter storage
defc PRMFLG = $F8E0 ; Flag to indicate whether PARM1 was searching
defc ARYTA2 = $F7F0 ; End point of search
defc ARYTA2 = $F8E1 ; End point of search
defc NOFUNS = $F8E3 ; 0 if no function active
defc TEMP9 = $F8E4 ; Location of temporary storage for garbage collection
defc FUNACT = $F8E6 ; Count of active functions
Expand Down
15 changes: 7 additions & 8 deletions lib/zx81_crt0.asm
Expand Up @@ -327,25 +327,24 @@ ENDIF
; Now some variables
;-----------
IF (startup>=3)
IF (startup>100)
; LAMBDA specific definitions (if any)
ELSE
PUBLIC text_rows
PUBLIC hr_rows
PUBLIC _hr_rows
text_rows:
hr_rows:
_hr_rows:
IF ((startup=5)|(startup=6)|(startup=7)|(startup=15)|(startup=16)|(startup=17)|(startup=25)|(startup=26)|(startup=27))
IF ((startup=5)|(startup=6)|(startup=7)|(startup=15)|(startup=16)|(startup=17)|(startup=25)|(startup=26)|(startup=27))
defw 8 ; Current number of text rows in graphics mode
ELSE
ELSE
defw 24 ; Current number of text rows in graphics mode
ENDIF
ENDIF
ENDIF







; defm "Small C+ ZX81" ;Unnecessary file signature
; defb 0
INCLUDE "crt0_runtime_selection.asm"
Expand All @@ -358,7 +357,7 @@ a1save: defb 0
ENDIF
hl1save: defw 0
;bc1save: defw 0
de1save: defw 0
;de1save: defw 0



2 changes: 1 addition & 1 deletion lib/zx81_hrg.def
Expand Up @@ -240,7 +240,7 @@ HRG_outloop:
ld a,h ; get HGR address MSB from HL
ld i,a ; load MSB into I register which is RFSH address MSB
ld a,l ; get HGR address LSB from HL
call (HRG_LineStart + $8000)
call HRG_LineStart+$8000
add hl,de ; add 32 to HL to point to next hline
dec b ; decrement line counter
jp nz,HRG_outloop ; test for last line
Expand Down
4 changes: 2 additions & 2 deletions lib/zx81_hrg_arx.def
Expand Up @@ -193,7 +193,7 @@ ENDIF


HRG_outloop1:
call (HRG_LineStart + $8000)
call HRG_LineStart+$8000
nop ; 159 t states so far (138 from 1st buffer) timing
dec c ;
jp z,HRG_outloop2
Expand All @@ -210,7 +210,7 @@ HRG_outloop2: ; this route is taken if 8 scanlines have been c
ld a,i

HRG_outloop3: ; start of the second inner loop
call (HRG_LineStart2 + $8000) ; fire the second "character row"
call HRG_LineStart2+$8000 ; fire the second "character row"
dec c ; 159 t states (138 from 2nd buffer)
jp z,HRG_outloop4
ld a,i ; this way if not 8 scanlines
Expand Down
1 change: 1 addition & 0 deletions libsrc/Makefile
Expand Up @@ -112,6 +112,7 @@ msxdeps:
zx81deps:
@$(RM) -f stdio/zx81/*.o
@$(RM) -f stdio/ansi/zx81/*.o
@$(RM) -f stdio/ansi/zx81/text/*.o
@$(RM) -f input/spectrum/*.o
@$(RM) -f input/zx81/*.o
@$(RM) -f games/zx81/*.o
Expand Down
17 changes: 15 additions & 2 deletions libsrc/_DEVELOPMENT/arch/sms/SMSlib/README.md
@@ -1,5 +1,13 @@
SMSlib library from [devkitSMS](https://github.com/sverx/devkitSMS)
synchronized May 15, 2017
synchronized October 12, 2017

still to add:

const unsigned char devkitSMS_font__tiles__1bpp[768];
void SMS_autoSetUpTextRenderer(void);
void SMS_load1bppTiles(void *src, unsigned int tilefrom, unsigned int size, unsigned char color0, unsigned char color1);
void SMS_configureTextRenderer(signed int ascii_to_tile_offset);
void putchar(char c);

SMSlib
======
Expand Down Expand Up @@ -57,6 +65,7 @@ void SMS_setTile (unsigned int tile);
/* sprite handling */
void SMS_initSprites (void); /* we're going to start declaring sprites, in front-to-back order */
signed char SMS_addSprite (unsigned char x, unsigned char y, unsigned char tile); /* declare a sprite - returns handle or -1 if no more sprites are available */
void SMS_addTwoAdjoiningSprites (unsigned char x, unsigned char y, unsigned char tile); /* doesn't return anything */
signed char SMS_reserveSprite (void);
void SMS_updateSpritePosition (signed char sprite, unsigned char x, unsigned char y);
void SMS_updateSpriteImage (signed char sprite, unsigned char image);
Expand All @@ -66,6 +75,10 @@ signed char SMS_addSpriteClipping (int x, int y, unsigned char tile); /* decla
void SMS_finalizeSprites (void); /* we're done declaring sprites */
void SMS_copySpritestoSAT (void); /* copy sprites to Sprites Attribute Table (do that during vBlank) */
/* text renderer */
void SMS_configureTextRenderer (signed int ascii_to_tile_offset); /* set the value you should add to ASCII value to get the tile number */
void SMS_autoSetUpTextRenderer (void); /* load a standard font character set into tiles 0-95, set BG palette to B/W and turn on the screen */
/* input handling */
unsigned int SMS_getKeysStatus (void); /* the current status of the keys */
unsigned int SMS_getKeysPressed (void); /* the keys that were up last frame and down now */
Expand All @@ -79,7 +92,7 @@ unsigned int SMS_getMDKeysHeld (void); /* the extended keys that were down la
unsigned int SMS_getMDKeysReleased (void); /* the extended keys that were down last frame and up now on a MD controller */
/* pause handling (SMS only) */
unsigned char SMS_queryPauseRequested (void); /* the pause key has been pressed since previous check */
_Bool SMS_queryPauseRequested (void); /* the pause key has been pressed since previous check */
void SMS_resetPauseRequest (void); /* reset/acknowledge pause requests */
/* line IRQ handling */
Expand Down
1 change: 1 addition & 0 deletions libsrc/_DEVELOPMENT/arch/sms/SMSlib/SMSlib_asm.lst
Expand Up @@ -6,6 +6,7 @@ arch/sms/SMSlib/z80/_SMS_crt0_RST08
arch/sms/SMSlib/z80/_SMS_crt0_RST18
arch/sms/SMSlib/z80/asm_SMSlib_addSprite
arch/sms/SMSlib/z80/asm_SMSlib_addSpriteClipping
arch/sms/SMSlib/z80/asm_SMSlib_addTwoAdjoiningSprites
arch/sms/SMSlib/z80/asm_SMSlib_copySpritestoSAT
arch/sms/SMSlib/z80/asm_SMSlib_detect_VDP_type
arch/sms/SMSlib/z80/asm_SMSlib_finalizeSprites
Expand Down
2 changes: 2 additions & 0 deletions libsrc/_DEVELOPMENT/arch/sms/SMSlib/SMSlib_sccz80.lst
Expand Up @@ -3,6 +3,8 @@ arch/sms/SMSlib/c/sccz80/SMS_addSprite
arch/sms/SMSlib/c/sccz80/SMS_addSprite_callee
arch/sms/SMSlib/c/sccz80/SMS_addSpriteClipping
arch/sms/SMSlib/c/sccz80/SMS_addSpriteClipping_callee
arch/sms/SMSlib/c/sccz80/SMS_addTwoAdjoiningSprites
arch/sms/SMSlib/c/sccz80/SMS_addTwoAdjoiningSprites_callee
arch/sms/SMSlib/c/sccz80/SMS_copySpritestoSAT
arch/sms/SMSlib/c/sccz80/SMS_finalizeSprites
arch/sms/SMSlib/c/sccz80/SMS_getHCount
Expand Down
2 changes: 2 additions & 0 deletions libsrc/_DEVELOPMENT/arch/sms/SMSlib/SMSlib_sdcc.lst
Expand Up @@ -3,6 +3,8 @@ arch/sms/SMSlib/c/sdcc/SMS_addSprite
arch/sms/SMSlib/c/sdcc/SMS_addSprite_callee
arch/sms/SMSlib/c/sdcc/SMS_addSpriteClipping
arch/sms/SMSlib/c/sdcc/SMS_addSpriteClipping_callee
arch/sms/SMSlib/c/sdcc/SMS_addTwoAdjoiningSprites
arch/sms/SMSlib/c/sdcc/SMS_addTwoAdjoiningSprites_callee
arch/sms/SMSlib/c/sdcc/SMS_copySpritestoSAT
arch/sms/SMSlib/c/sdcc/SMS_finalizeSprites
arch/sms/SMSlib/c/sdcc/SMS_getHCount
Expand Down
@@ -0,0 +1,25 @@
; void SMS_addTwoAdjoiningSprites(unsigned char x, unsigned char y, unsigned char tile)

SECTION code_clib
SECTION code_SMSlib

PUBLIC SMS_addTwoAdjoiningSprites

EXTERN asm_SMSlib_addTwoAdjoiningSprites

SMS_addTwoAdjoiningSprites:

pop af
pop hl
pop de
pop bc
push bc
push de
push hl
push af
ld b,l
ld d,e
jp asm_SMSlib_addTwoAdjoiningSprites

0 comments on commit 7cdf117

Please sign in to comment.