0x8BitDev / MAPeD-SPReD

NES/SMS/PCE/ZX/SMD development tools
https://pcengine.proboards.com/thread/1281/dev-tools-maped-spred-linux
MIT License
32 stars 1 forks source link

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

Closed Fabrizio-Caruso closed 3 years ago

Fabrizio-Caruso commented 3 years ago

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
0x8BitDev commented 3 years ago

Actually the MAPeD exports MAPs that consist of screen data of certain topology that you can customize using layouts. The minimal data to export is a layout with one assigned screen. NOT single tile (!)

Read the 'Quick Guide': 'The Steps to Quick Start' and 'A Few Steps to Create a Game Level'.

0x8BitDev commented 3 years ago

+Also you can get development build ( link in the Readme.md ) with an example project for the ZX version.

Fabrizio-Caruso commented 3 years ago

I will look at the docs but could you please tell me if I can draw a set of 8x8 tiles and see their "shapes" as Assembly directives otherwise I cannot use it for my purpose, which is just to know if it can export the tile "shape" data into a file with Assembly, e.g. db ... ... db ... or any other Assembly directive.

P.S.: My purpose is to support the import of tiles from Assembly and BASIC listings into my universal 8-bit development framework: https://github.com/Fabrizio-Caruso/CROSS-LIB

0x8BitDev commented 3 years ago

The MAPeD exports tiles as binary files for all supported platforms and then incbin's them in assembly listings. As for the ZX specific, the most useful tiles for use in games are tiles 2x2 or in terms of the editor - blocks. That's why the editor exports tiles 2x2. The only way to see 8x8 tiles as a set of 'db' in assembly listings is to write your own exporter using Python. The simple Python editor and API are available in the editor.

Fabrizio-Caruso commented 3 years ago

[I think you answered this] What I am trying to do is something trivial but I don't understand if and how your tool can do it. I just want to draw a bunch of monochromatic 8x8 tiles and see them as an Assembly file. I don't mind if more data (e.g. color data) is also part of the output.

Fabrizio-Caruso commented 3 years ago

I know 2x2 or 1x2 is more common but I have written a few games using also 8pixel x 8pixel tiles for all 8-bit computers and dozens of consoles (including the ZX Spectrum): https://github.com/Fabrizio-Caruso/CROSS-LIB/blob/master/docs/GAMES.md

0x8BitDev commented 3 years ago

That's why I made an API for custom data export.

Just in case, take a look at the '.\samples\zx\tilemap_render\multidir_scroll\data\tilemap.zxa'. This is an example of exported assembly listing. The source project file is '.\data\scroll_multidir_TEST.mapedzx'. Compiled binary here: '.\samples\zx\bin\multidir_scroll.sna'

Fabrizio-Caruso commented 3 years ago

Your tool is very powerful and it is meant for people who need to create binary asset files for a single or multiple specific target among many possible targets with tons of options. On the other hand, in my case, I need much less. I need to help people draw simple tiles with immediate and less smart tools for my abstract framework, which will automatically create Assembly and binary target-specific assets on the fly when mass-compiling/building for 200 different targets. Your tool is probably "too much" in a good sense.