Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - New user, would like to know about common tools used for sms programming

Reply to topic
Author Message
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
New user, would like to know about common tools used for sms programming
Post Posted: Sat Dec 31, 2016 4:44 am
I'm a developer that have interest in the sms and would like to experiment some code on this platform again. I did some programming in the past for other platform like the nes but I have been busy with family life and all projects have been on hold since then. Now I feel like coding again, something new, to change from the current routine. The sms was my first console so I want to try what I can do with it.

I'm pretty new to sms coding, may have tried a simple hello world a long time ago with wla-dx if my memory is good. Since that time (7-10 years ago), tools may have changed so I want to get up-to-date on the subject.

I tried looking at the development section of the site but the information seems old so the forum must be the most up-to-date section. Since I don't know what to search for, it is a little bit hard to find in the 80 pages of forum post.

I found:
- wla-dx is still updated, didn't know about that
- there is a devKitSMS if I want to code in C

What I would like to know is if there is other assembler used for sms coding since I remember the wla-dx syntax was unusual compared to other assembler. I may try C but still prefer assembler when available. I would like to know what other common tools people use these days for developing for the platform.

If there is a new page on the site with the current information that I may not have found I would be more than glad to read it if someone could point me to it.

Thank in advance for any information the subject, I really appreciate it.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14734
  • Location: London
Reply with quote
Post Posted: Sat Dec 31, 2016 10:16 am
Not really. How is WLA DX syntax so different?
  View user's profile Send private message Visit poster's website
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Sat Dec 31, 2016 7:33 pm
It's been a while so I don't remember what is was. I will give it a go and ask questions if I find back that unusual thing. Maybe it was only nes related and has no impact for sms.

What I would like to know is if there is any available sound driver for the sms? For example when doing nes programming you can use the famitracker driver for music only or some derivative like famitone with less functionality. Is there something similar for sms?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14734
  • Location: London
Reply with quote
Post Posted: Sat Dec 31, 2016 9:34 pm
PSGlib is a lightweight player for VGM derived data, and there are MML drivers too. The former is rather ROM intensive, the latter more CPU intensive.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Sun Jan 01, 2017 11:40 am
WLA-DX syntax differences are minor, IMHO. If something really bothers you, we can help you find a workaround :)
About PSGlib, here's a list of homebrew which uses it, to give you an idea of what is possible to do. You can create your own VGMs using Mod2PSG2 or DefleMask or VGMMusicMaker, basically, then you convert them and that's it.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Aug 2012
  • Posts: 322
  • Location: Porto, Portugal
Reply with quote
Post Posted: Sun Jan 01, 2017 3:53 pm
if you want to try something in (compiled) Basic language, perhaps you will enjoy doing something on Boriel’s ZX-Basic Compiler - http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_SMS - i were only using it for everything i were doing for SMS, SG1000, MSX, Casio PV1000, z80-based arcade machines, colecovision, etc. - @haroldoop made some experiences earlier than me and using another method (i used bash scripts, and @haroldoop used it combined with wla-dx) - i guess that all the sources shared there might be useful as documentation

about trackers, i’d suggest VortexTracker ( http://bulba.untergrund.net/vortex_e.htm ), which is quite simple (and runs fine on Wine), and it’s default file format is txt-based (quite rare and neat situation among trackers) - it was designed for ay-3-8910, but i think you can generate music data for sn76489 without further difficulty (but about drivers for that, i really have no idea, perhaps you might need to start something from scratch)
  View user's profile Send private message Visit poster's website
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Tue Jan 03, 2017 5:11 pm
I didn't have much time to check anything during the new year vacation in Japan so I should be able soon to start experiment a little bit.

@Maxim

I will check PSGlib/MML once I have a chance. For now if it can output sound I don't mind how much CPU intensive/data heavy it is since my first program will be for learning the platform. What is more important is if there is tracker that allow me to make some basic music to test it and a sound driver to use it.

@sverx

I checked the homebrew, especially Bruce lee (I remember from the c64 days), many of them I quite good. Will try to test all of them later. As for syntax, understood, I will ask questions once I start programming with it.

@nitrofurano

I'm more inclined to use assembler or C since those are the language I'm the most used it (did some basic in a long time ago though). As for tracker, I will check them too.

Thank you for the information, I really appreciate it.
  View user's profile Send private message
  • Joined: 09 Apr 2013
  • Posts: 106
  • Location: Sydney Australia
Reply with quote
Post Posted: Wed Jan 04, 2017 11:19 am
Hi banshaku,

I've written an eclipse IDE for programming in wla-dx.

You can find it here.

https://github.com/yuv422/z80editor

It has

  • syntax checking
  • syntax highlighting
  • cross references
  • jump to labels
  • outline view
  • built-in z80 reference documentation
  • cycle counter
  • instruction size counter


I use it for all my sms programming. :) I don't think I could go back to a plain text editor.
  View user's profile Send private message
  • Joined: 01 Jan 2014
  • Posts: 331
Reply with quote
Post Posted: Wed Jan 04, 2017 11:23 am
I second Efry's eclipse IDE. I use it for all SMS assembly, very good.
  View user's profile Send private message
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Sun Jan 08, 2017 6:59 pm
I got all my tools installed and can now compile code. I started to read Maxim tutorial in detail to get familiar with the platform.

Since I don't have any data to work with yet, the least I can do is start to understand the basics. I may have question later like for VDPInitData, I don't know if it is something you just do at the beginning only or must be done at other time. Maybe the tutorial talks about it.

@psidum, @efry

I tried the eclipse plug-in and it works. I may use it in the future, it just that I'm not a big fan of java since oracle bought sun and I try to avoid the products they own as much as possible. I may create some definition for the editors I use once I know more about wla-dx and z80. If I do so I will share it on the forum (did one for nes long time ago for notepad++).
  View user's profile Send private message
  • Joined: 01 Aug 2012
  • Posts: 322
  • Location: Porto, Portugal
Reply with quote
Post Posted: Sun Jan 08, 2017 10:26 pm
banshaku wrote

Since I don't have any data to work with yet, the least I can do is start to understand the basics. I may have question later like for VDPInitData, I don't know if it is something you just do at the beginning only or must be done at other time. Maybe the tutorial talks about it.


i think it is used for defining values to vdp registers, like for defining screen mode, vram adresses for tiles and sprites, sprites size, border colour, etc.? perhaps you might instead want to avoid it somehow, and set vdp registers values directly as experimentation? (i have no idea how possible is it)

Quote

Thank you for the information, I really appreciate it.


you”re welcome!
  View user's profile Send private message Visit poster's website
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Tue Jan 10, 2017 4:45 pm
I finished to read Maxim tutorial and it was easy to understand. I have now the basic knowledge and should be able to show simple stuff on the screen and started to read Charles Mc Donalds documents.

The only thing that surprised me a little bit is the fact that DEC doesn't set the zero flag once the value reach zero. I don't know if it something specific to the SMS or Z80.

Is there any other things like zero flag for DEC that I should be aware of? Except for that compiler is working, can debug with Emulicous, just need to get some tools for making data and learn common pattern used on SMS.
  View user's profile Send private message
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8648
  • Location: Paris, France
Reply with quote
Post Posted: Tue Jan 10, 2017 6:51 pm
AFAIK the DEC instrument affects the zero flag.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14734
  • Location: London
Reply with quote
Post Posted: Tue Jan 10, 2017 8:30 pm
8-bit DEC does, 16-bit DEC doesn't because it would need to chain the zero flags together from the parts.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Wed Jan 11, 2017 9:04 am
I suspect it's because that operation isn't performed by the ALU but by a separate 16-bit incrementer (adder?).

Incidentally, I just found something I really wasn't expecting: according to the z80 wikipedia page the z80 processor performs "fetch/execute overlap" (which actually sounds completely wrong to me TBH).

I mean, the page is saying that
Quote
Many instructions actually end during the M1 of the next instruction

and I've never read which instructions DO NOT and I've never read anything about speeding up code reordering instructions order.

Is there some more info on these topics somewhere?
  View user's profile Send private message Visit poster's website
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Wed Jan 11, 2017 4:40 pm
@Maxim

I'm new to z80 and I made the wrong assumption. In x86, doing dec on a 16 bit register like ax sets the zero flag. I assumed that bc was a 16 bit register, but it doesn't seems to be the case.

I checked some manual online and found which one affect the zero flag for dec. 8 bit registers and absolute addresses does but not combined registers.

So I think after seeing this interesting behavior I should stop assuming, read the zilog z80 manual and learn the difference for this processor compared the one I used before like x86 and 6502. Thank you again for clarifying.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Thu Jan 12, 2017 12:28 pm
banshaku wrote
In x86, doing dec on a 16 bit register like ax sets the zero flag. I assumed that bc was a 16 bit register, but it doesn't seems to be the case.


The 8086 is a 16-bit processor, the z80 is an 8-bit processor that has some (few) 16 bit extensions. But I admit I just made the wrong assumption too at the time - that any ADD/INC/DEC operation would set the flags accordingly.
  View user's profile Send private message Visit poster's website
  • Joined: 01 Jan 2014
  • Posts: 331
Reply with quote
Post Posted: Thu Jan 12, 2017 11:52 pm
This is a good site for opcodes http://clrhome.org/table/

Efry's IDE is also good. See attached images, look for 'Z80 Instruction View' window. Information includes flags. Yes eclipse sucks but the IDE uses it only as a shell so it works well. Yes java sucks but you need it for emulicious anyway.
z80_editor_1.png (172.37 KB)
z80_editor_1.png
z80_editor_2.png (159.66 KB)
z80_editor_2.png

  View user's profile Send private message
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Fri Jan 13, 2017 4:12 pm
@psidum

I never said that Efry's IDE is not good. On the contrary, I tried it and it seems nice (online help etc). I just didn't have the time to use it much yet (created a dummy project to see syntax and options) and I'm not sure if there is a proper way to create a project (my guess it just adding asm files but still). I will use it once I have something more concrete to work with. I installed the latest version of eclipse just for that.

As for Eclipse and java, I don't hate them, they are nice tools and used them for many years at work. What I don't like is the new owner, Oracle, that's it. I had no issue when it was under Sun.

It may seems like I'm not moving forward but it not easy when you have kids and living in Japan. I'm lucky when I can read docs for 30 minutes and sometime it's at 1h in the morning. I will eventually be able to work on something, hopefully.

I need to find some sample data, that would help me experiment with sprites and background. Will check on the net or this site, there must be some data available.
  View user's profile Send private message
  • Joined: 20 Feb 2008
  • Posts: 118
  • Location: Saintes, France
Reply with quote
Post Posted: Fri Jan 13, 2017 7:15 pm
banshaku wrote
I need to find some sample data, that would help me experiment with sprites and background. Will check on the net or this site, there must be some data available.

You can dump the whole VRAM with Meka (\DEBUG\Dump\VRAM) to a binary or an ASCII file (depending on \DEBUG\Dump\Configuration) ;)
  View user's profile Send private message
  • Joined: 01 Jan 2014
  • Posts: 331
Reply with quote
Post Posted: Fri Jan 13, 2017 10:22 pm
@banshaku

Sorry if my comments came off negative. The discussion pivoted to op code details, i was just showing how efry's ide tool gives you op code break downs in the IDE, i don't think many people know this.

And as for java people seam to have turned on it over the years so rather than trying to convince them otherwise i just agree with them and advocate for it's use anyway:p Those comments were made with a broad audience in mind.
  View user's profile Send private message
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Sat Jan 14, 2017 4:06 am
@vingazole

Oh, didn't know about this feature! I was searching inside emulicous and didn't find anything. I didn't have the reflex to check Meka for some reason. I have used Meka since the DOS days (version 0.30? don't remember in details) and for some reason I never really used much under windows. I think I never used at that time those debugging feature. Maybe they were there all along but did not remember.

That will be perfect for some test data. I will just fire up some game and extra the background/title data.

@psidum

It didn't felt negative, it felt more like that I may have indirectly said that his IDE may have not been good so I wanted to clarify my position on it, just in case. Any effort made to improve the live of a community is a good thing so I always support such effort.

As for opcode, I saw that page this week while searching more details about DEC and cycles per instruction and it was a nice one. Will keep a bookmark of it now.

Don't worry about your comment, they are very mild in nature compare to what I saw on other forum so I don't have any issue with them :) Everybody has a way of talking so there is no problem with that.

I have interest in IDE, code editors, maps etc since when I started to learn coding for retro console ~10 years ago as a hobby I wanted to make one that would support many platform so it would help me to experiment with all of them. It was going to have a map editor, code with highlight etc. Saw too big, the second kid came and time for hobby became nil :P I tried to target too many, over engineered it and it stayed incomplete because, well, couldn't work on it.

The map was going fine and for testing I started to make a sample of Mega man 9 for the nes, wanted to know how much could be reproducible . At the least the character was moving and some collision working.

I didn't code as a hobby because was too busy but I decided to motivate myself to try it again, even if it would be very little per week. So here I'm. It will take an eternity but the motivation is there. I chose the SMS because it was one of my targets, wanted to try something new and it was my first console.

Added a screenshot of my editor. It was made in c#. A shame I didn't continue it. Checked the code last year and I don't remember anything :P Would be easier to remake instead.
map editor.png (67.23 KB)
My map editor
map editor.png

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14734
  • Location: London
Reply with quote
Post Posted: Tue Feb 07, 2017 3:41 pm
sverx wrote
Incidentally, I just found something I really wasn't expecting: according to the z80 wikipedia page the z80 processor performs "fetch/execute overlap" (which actually sounds completely wrong to me TBH).

I mean, the page is saying that
Quote
Many instructions actually end during the M1 of the next instruction

and I've never read which instructions DO NOT and I've never read anything about speeding up code reordering instructions order.

Is there some more info on these topics somewhere?


Zaks page 77 onwards. It's a bit screwy, but basically since the first ~3 cycles of every opcode is the same (fetch the opcode, decode it a bit?) it means you can do some incredibly basic pipelining within the CPU by executing parts of the opcode a bit later using the stages of the CPU that aren't being used, and thus a lot of those 4-cycle opcodes avoid taking 5 cycles.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 3823
  • Location: Stockholm, Sweden
Reply with quote
Post Posted: Tue Feb 07, 2017 4:34 pm
I see. Well... thanks. My certainty falls to pieces with each day...
  View user's profile Send private message Visit poster's website
  • Joined: 07 Aug 2007
  • Posts: 220
  • Location: Yach, Germany
Reply with quote
Post Posted: Sun Feb 19, 2017 10:00 am
banshaku wrote
@Maxim

I'm new to z80 and I made the wrong assumption. In x86, doing dec on a 16 bit register like ax sets the zero flag. I assumed that bc was a 16 bit register, but it doesn't seems to be the case.

I checked some manual online and found which one affect the zero flag for dec. 8 bit registers and absolute addresses does but not combined registers.

So I think after seeing this interesting behavior I should stop assuming, read the zilog z80 manual and learn the difference for this processor compared the one I used before like x86 and 6502. Thank you again for clarifying.


This is common on 8/16 bit architectures. It makes processing variables bytewise easier, while using 16-bit registers as pointers into memory. E.g. adding 2 32-bit numbers at locations pointed to by bc and hl and write the result to the location pointed to by de. In that case you want to increment bc, hl, de after each 8-bit add or adc, but these 16-bit increments should not mess with the carry flag from the 8-bit add or adc.

Philipp
  View user's profile Send private message Visit poster's website
  • Joined: 31 Dec 2016
  • Posts: 24
  • Location: Japan
Reply with quote
Post Posted: Tue Feb 21, 2017 1:30 am
@PkK

Explained that way it makes perfect sense. It's been a while so my thinking in asm as been quite rusty these days. Thank you for the explanation!
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!