GithubHelp home page GithubHelp logo

0x8bitdev / maped-spred Goto Github PK

View Code? Open in Web Editor NEW
28.0 1.0 1.0 9.81 MB

NES/SMS/PCE/ZX/SMD development tools

Home Page: https://pcengine.proboards.com/thread/1281/dev-tools-maped-spred-linux

License: MIT License

C# 99.50% Python 0.50%
nes famicom 6502 sms sega-master-system z80 devtools zx speccy sega-mega-drive sega-genesis sgdk m68k zx-spectrum pc-engine turbografx-16 huc ca65 wla-dx retro

maped-spred's Introduction

Hi retro game developers!

Here you can find the NES/SMS/PCE/ZX/SMD development tools:

MAPeD-NES/SMS/PCE/ZX/SMD - Game maps editor

The MAPeD is a tool for building a game levels from scratch.

The main features are:

  • tiles drawing/composing tools
  • building a game map using 2x2 or/and 4x4 tiles
  • entities editor
  • tile patterns manager
  • data optimization tool
  • several game maps in one project
  • detachable UI
  • tile properties editing ( can be used as collisions data etc )
  • NES: palette per 1x1 tile support ( MMC5 )
  • import of tiles and game maps from images*
  • export to NES: CA65/NESasm / SMS: WLA-DX / PCE: CA65/PCEAS/HuC / ZX: SjASMPlus / SMD: vasm/SGDK with wide variety of options:
    • 2x2/4x4 tiles
    • column/row data order
    • RLE compression
    • modes: multidirectional / bidirectional scrolling, static screens switching
    • NES: attributes per 1x1/2x2 tile
    • tiles properties per 1x1/2x2 tile
    • level topology options
    • entities
    • etc...
  • export to the JSON format
  • export to the SjASMPlus (ZX-Spectrum)**
  • built-in Python script editor for writing custom data export scripts
  • easy data conversion***
  • etc...

* Smart import of images with checking of duplicate CHRs/blocks/tiles and flipped CHRs. Automatic palettes applying is supported for all platforms.

** Each MAPeD can export data to the SjASMPlus with additional options.

*** You can load any platform project into any MAPeD editor with automatic data conversion. So it's easy to adapt your graphics and data when creating a cross-platform project.

Examples of tiles and maps images: ./data/tiles-maps

Example projects: ./data

Quick Guide: ./doc/MAPeD/Quick_Guide.html

SPReD-NES/SMS/PCE - Sprites editor

The SPReD is a tool for converting prepared sprite images into a NES/SMS/PCE compatible format. Drawing mode is also available.

Some features are:

  • handy drawing mode
  • group operations on sprites
  • sprites data packing and optimization
  • NES/SMS: 8x16 mode support
  • images import/export
  • export to NES: CA65/NESasm/CC65 / SMS: WLA-DX/SDCC / PCE: CA65/PCEAS/HuC(PCX)
  • built-in Python script editor for writing custom data export scripts
  • NES <=> SMS data conversion*
  • etc...

* You can load a NES project into SMS editor and vice versa.

Example projects: ./data

Quick Guide: ./doc/SPReD/Quick_Guide.html

Python script editor

If you need to export specific data which are not supported by the tools, you can write your own script using a simple built-in Python script editor ( SPSeD ). Press Alt+X ( ALTernative eXport ) to open the editor.

Data export APIs were designed to work with a current application data state. So you can retrieve data, but you can't modify it. Application data will always remain unchanged.

Press Shift+F1 (in-app doc) or F1 (in-browser doc) to open the API documentation. Or you can find it here:

  • ./doc/MAPeD_Data_Export_Python_API.html
  • ./doc/SPReD_Data_Export_Python_API.html

Sample scripts of using the APIs:

  • ./scripts/MAPeD_project_stats.py
  • ./scripts/SPReD_project_stats.py

Note: It's not recommended to use the buit-in editor for script editing under Mono due to buggy implementation of RichTextBox. You can load your script into the editor and into any other editor where you can edit it. Then press Ctrl+R (reload script) and F5 (run script).

Compiling (Win/Linux)

The solution files you can find here:

  • ./src/MAPeD/
  • ./src/SPReD/

To compile the tools on Windows you can use the Microsoft Visual Studio.

To compile/run the tools on Linux you need to install Mono on your computer. The latest stable release can be found here: https://www.mono-project.com/download/stable/ To run the tools you may need to configure your environment to allow it to automatically run .exe files through Mono, or manually run the tools in terminal: mono <app.exe>.

After loading the solution you need to reinstall all NuGet packages using the following command:

Update-Package -reinstall

After that you can compile the project.

The tools use the following NuGet packages:

MAPeD:

  • OpenTK -Version 3.1.0
  • SkiaSharp.Views.WindowsForms -Version 2.88.1
  • SkiaSharp.NativeAssets.Linux.NoDependencies -Version 2.88.1

SPSeD:

  • IronPython -Version 2.7.9

Samples

MAPeD-NES

  • ./samples/nes/tilemap_render/bidir_scroll_MMC1_dyn_mirr/ - bidirectional scroller with dynamic mirroring and CHR bank switching
  • ./samples/nes/tilemap_render/bidir_scroll_MMC1_vert_mirr/ - bidirectional scroller with vertical mirroring
  • ./samples/nes/tilemap_render/multidir_scroll_MMC3_4scr_mirr/ - multidirectional scroller with 4-screen mirroring
  • ./samples/nes/tilemap_render/multidir_scroll_MMC3_horiz_mirr/ - the same as above, but with horizontal mirroring
  • ./samples/nes/tilemap_render/multidir_scroll_MMC3_vert_mirr/ - the same as above, but with vertical mirroring
  • ./samples/nes/tilemap_render/multidir_scroll_MMC3_vert_mirr_sbar/ - the same as above, but with MMC3 IRQ status bar
  • ./samples/nes/tilemap_render/static_screens_MMC5/ - static screens switching with MMC5 extended attributes support

MAPeD-SMS

  • ./samples/sms/tilemap_render/multidir_scroll/ - multidirectional scroller
  • ./samples/sms/tilemap_render/bidir_scroll/ - bidirectional scroller
  • ./samples/sms/tilemap_render/bidir_scroll_ADJ_SCR_MASKS/ - bidirectional scroller with a complex map topology
  • ./samples/sms/tilemap_render/bidir_stat_scr/ - the same as above, but with static screens switching
  • ./samples/sms/tilemap_render/bidir_stat_scr_ADJ_SCR_MASKS/ - the same as above, but with static screens switching
  • ./samples/sms/tilemap_render/stat_scr_VDP_data/ - static screens switching using VDP-ready screens data

MAPeD-PCE

  • ./samples/pce/tilemap_render/bidir_scroll_multimap/huc/ - bidirectional scroller
  • ./samples/pce/tilemap_render/bidir_stat_scr_multimap/huc/ - the same as above, but with static screens switching
  • ./samples/pce/tilemap_render/bidir_scroll_ADJ_SCR_MASKS_multimap/huc/ - bidirectional scroller with a complex map topology
  • ./samples/pce/tilemap_render/multidir_scroll_multimap/huc/ - multidirectional scroller
  • ./samples/pce/tilemap_render/multidir_stat_scr_multimap/huc/ - screens switching with double-buffering for multidirectional maps
  • ./samples/pce/tilemap_render/stat_scr_VDC_data_multimap/huc/ - static screens switching using VDC-ready data (raw BAT data)
  • ./samples/pce/tilemap_render/multidir_scroll_map_editor/huc/ - dynamic map: simple map editor
  • ./samples/pce/tilemap_render/multidir_scroll_maze_generator/huc/ - dynamic map: procedural generation of a random maze (3x3 screens)
  • ./samples/pce/game_prototype/huc/ - fully playable game prototype demo, run'n'jump platformer, 40 screens multidir scrollable map, 200+ entities +bonus level
  • All samples are written in HuC (C-like language) and support all export options

MAPeD-ZX

  • ./samples/zx/tilemap_render/multidir_scroll/ - multidirectional tilemap scroller with wide variety of settings (see 'settings.asm' for details); Keys: Q,A,O,P
  • ./samples/zx/tilemap_render/bidir_scroll/ - bidirectional scroller; Keys: Q,A,O,P
  • ./samples/zx/tilemap_render/bidir_stat_scr/ - static screens switching; Keys: Q,A,O,P

MAPeD-SMD

coming soon...

SPReD-NES

  • ./samples/nes/player_cntrl_NROM-128 - character controller: idle, running and jumping; 8x8/8x16 mode
  • ./samples/nes/player_cntrl_MMC3 - the same as previous, but using big meta-sprites with MMC3 1KB CHR bank switching ( +shooting and ducking animations )

SPReD-SMS

  • ./samples/sms/show_sprite - simple show sprite program
  • ./samples/sms/player_cntrl_dog - character controller: idle, running and jumping; 8x16 mode
  • ./samples/sms/player_cntrl_marco - the same as previous, but using big meta-sprites ( +shooting and ducking animations )
  • ./samples/sms/diff_bpp_test - test program for testing the same image with different exported BPP values

SPReD-PCE

  • ./samples/pce/sprite_render/show_sprites/asm/ - simple demo that shows test meta-sprites exported as asm data
  • ./samples/pce/sprite_render/show_sprites/huc/ - simple meta-sprites demo written in HuC
  • ./samples/pce/sprite_render/show_sprites/huc2/ - the same as previous, but with data exported as PCX images
  • ./samples/pce/sprite_render/animation_test/asm/ - simple animation demo with big meta-sprites in assembly
  • ./samples/pce/sprite_render/animation_test/huc/ - the same as previous, but written in HuC
  • ./samples/pce/sprite_render/animation_test/huc2/ - animation demo that shows 3 independent, dynamic meta-sprite sets with optional double-buffering
  • ./samples/pce/sprite_render/animation_test/huc3/ - meta-sprite instancing demo; each meta-sprite has its own unique behaviour, palette and share the same graphics data
  • ./samples/pce/sprite_render/player_cntrl/asm/ - simple character controller with a big meta-sprite character and dynamic sprite data: idle, move, kick; Controls: LEFT, RIGHT, UP
  • ./samples/pce/sprite_render/player_cntrl/huc/ - simple character controller written in HuC with a big meta-sprite character, dynamic sprite data and optional double-buffering; Controls: LEFT, RIGHT, UP

Used tools:

NES: CA65 assembler (v2.17 - GIT 7445550)

SMS: WLA-DX assembler v9.10

PCE: HuC - PC Engine C development toolkit (v4.00.4.gb95184f)

ZX Spectrum: SjASMPlus - Z80 Assembly Cross-Compiler (v1.18.3)

To compile the samples on Windows you can run 'compile.bat' which contains in all sample directories.

To compile them on Linux you can use 'makefile' which also contains in all sample directories.

  • make to compile binaries to the ./samples/<platform>/bin directory;
  • make run to run compiled sample with FCEUX/Mednafen/Fuse emulators;
  • make clean to remove compiled binaries;

Warning: The sample codes coming with the tools were made just for testing of exported data. You can use/modify them for free at your own risk without any warranties.


Third-party libraries

MAPeD:

SPReD:

SPSeD:

  • IronPython - Copyright (c) .NET Foundation and Contributors ( Apache License, Version 2.0 )
  • https://ironpython.net

The tools sources: https://github.com/0x8BitDev/MAPeD-SPReD

Compiled executables and compiled samples you can get in the latest release: https://github.com/0x8BitDev/MAPeD-SPReD/releases

The latest development build can be found here.


  • NES: Nintendo Entertainment System / Nintendo
  • SMS: Sega Master System / Sega Corp.
  • PCE: PC Engine/TurboGrafx-16 / NEC
  • ZX: ZX-Spectrum / Sinclair Research Ltd
  • SMD: Sega Mega Drive/Genesis / Sega Corp.

Are trademarks of their respective owners and I am not affiliated with these companies in any way. Therefore, you can use this software at your own risk and without warranty of any kind.


Developed by 0x8BitDev Copyright © 2017-present

Released under the MIT license. See LICENSE.txt

mail: 0x8bitdev[at]gmail.com

maped-spred's People

Contributors

0x8bitdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

maped-spred's Issues

[info] I am not able to figure out how to export in Assembly

I am trying to do something very simple.
I want to draw a single tile (8 pixels x 8 pixels) and export it as an Assembly file (with Assembly directives such as .byte or db or defb, etc).
It looks like the editor forces me to choose 2x2 tile blocks as the smallest editable object.

If I export I get something about the project and nothing about the edited tile:

;#######################################################
;
; Generated by MAPeD-ZX Copyright 2017-2021 0x8BitDev
;
;#######################################################

; export options:
;	- tiles 2x2/(rows)/monochrome
;	- properties per block
;	- mode: multidirectional scrolling
;	- layout: matrix (marks)
;	- entities (screen coordinates)


MAP_DATA_MAGIC = $E331

; data flags:
MAP_FLAG_TILES2X2                 = $01
MAP_FLAG_TILES4X4                 = $02
MAP_FLAG_RLE                      = $04
MAP_FLAG_DIR_COLUMNS              = $08
MAP_FLAG_DIR_ROWS                 = $10
MAP_FLAG_MODE_MULTIDIR_SCROLL     = $20
MAP_FLAG_MODE_BIDIR_SCROLL        = $40
MAP_FLAG_MODE_STATIC_SCREENS      = $80
MAP_FLAG_ENTITIES                 = $100
MAP_FLAG_ENTITY_SCREEN_COORDS     = $200
MAP_FLAG_ENTITY_MAP_COORS         = $400
MAP_FLAG_LAYOUT_ADJACENT_SCREENS  = $800
MAP_FLAG_LAYOUT_ADJACENT_SCR_INDS = $1000
MAP_FLAG_LAYOUT_MATRIX            = $2000
MAP_FLAG_MARKS                    = $4000
MAP_FLAG_PROP_ID_PER_BLOCK        = $8000
MAP_FLAG_PROP_ID_PER_CHR          = $10000
MAP_FLAG_COLOR_TILES              = $20000

; *** BASE ENTITIES ***


scr_2x2tiles_w	equ 16		; number of screen tiles 2x2 in width
scr_2x2tiles_h	equ 12		; number of screen tiles 2x2 in height

export tiles or blocks as 16*16 bmp

when use the export tiles bmp in Tiled ,it is so long,and not beautiful

image

so change export bmp as 16x16 bmp

image

//MainForm.cs export_tiles_blocks_data

// draw images into bitmap  16x16
// width : 16*_data_size
// height : Math.Ceiling(num_active_tiles/16)
var bmpWidth = 16 * _data_size;
var bmpHeight = (int)Math.Ceiling((float)num_active_tiles / 16) * _data_size;
Bitmap bmp = new Bitmap(bmpWidth, bmpHeight);
// Bitmap bmp = new Bitmap( _data_size * num_active_tiles, _data_size );//, PixelFormat.Format24bppRgb );

Graphics gfx = Graphics.FromImage( bmp );
gfx.InterpolationMode 	= InterpolationMode.NearestNeighbor;
gfx.PixelOffsetMode 	= PixelOffsetMode.HighQuality;

for( i = 0; i < num_active_tiles; i++ )
{
// gfx.DrawImage( _image_list.Images[ i ], i * _data_size, 0, _data_size, _data_size );
var x = i % 16;
var y = (int) Math.Floor((float)i / 16);

gfx.DrawImage(_image_list.Images[i], x * _data_size, y * _data_size, _data_size, _data_size);
}

Cannot compile example

Hi,

I'm trying to compile the "show_sprite" sms example, but I cannot do it. I have wla-dx in the system path.:

C:\Users\ANSJ\Documents\GitHub\MAPeD-SPReD\samples\sms\show_sprite>wla-z80 -I ..\common\ -I .\data\ -o ..\bin\show_sprite.o main.asm

WLA Z80 Macro Assembler v9.7b
Written by Ville Helin in 1998-2008 - In GitHub since 2014: https://github.com/vhelin/wla-dx
USAGE: wla-z80 -[iMqtvx]{lo} -I[INCDIR] [DEFINITIONS] [OUTPUT FILE]
Commands: Options:
l Library file i Add list file information
o Object file M Output makefile rules
q Quiet
t Test compile
v Verbose messages
x Extra compile time definitions
I Include directory

linking...

C:\Users\ANSJ\Documents\GitHub\MAPeD-SPReD\samples\sms\show_sprite>wlalink -i -r -v main.link ..\bin\show_sprite.sms

WLALINK GB-Z80/Z80/6502/65C02/6510/65816/HUC6280/SPC-700 WLA Macro Assembler Linker v5.8b
Written by Ville Helin in 2000-2008 - In GitHub since 2014: https://github.com/vhelin/wla-dx
USAGE: wlalink [-bdirsSv] -L[LIBDIR]
Options:
b Program file output
d Discard unreferenced sections
i Write list files
r ROM file output (default)
s Write also a NO$GMB symbol file
S Write also a WLA symbol file
v Verbose messages
L Library directory

Ok!
Could Not Find C:\Users\ANSJ\Documents\GitHub\MAPeD-SPReD\samples\sms\bin\show_sprite.o

C:\Users\ANSJ\Documents\GitHub\MAPeD-SPReD\samples\sms\bin>show_sprite.sms
'show_sprite.sms' is not recognized as an internal or external command,
operable program or batch file.


Chr import

when import 8kb mario.chr,only import the first 4kb. import all maybe better. and import auto add two bank

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.