Where do I start? I'm seeking technical documents.

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

User avatar
Sik
Very interested
Posts: 705
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by Sik » Thu Mar 15, 2018 10:09 pm

For assembly we usually just grab some 68000 assembler (as long as it's not GAS :​v) and a text editor. No need for linkers when you can just do lots of includes. Also no framework since if you're using asm you probably want to do everything as raw as possible (you'll probably end up making your own framework, possibly getting adapted as you work on different games).

No specific emulator at hand, in fact you probably want to grab several of them. There isn't a "best" emulator when it comes to making games, some are more accurate, or have better tools, or run faster on your crappy computer (:​P), etc.
Sik is pronounced as "seek", not as "sick".

User avatar
TmEE co.(TM)
Very interested
Posts: 2307
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by TmEE co.(TM) » Fri Mar 16, 2018 6:06 am

Just for code I have couple old things that can be looked at :
My first game on MD, very poor code : http://www.tmeeco.eu/SMD/GBMD11S.RAR
Pong game that doesn't use RAM at all : http://www.tmeeco.eu/BitShit/PONG!RAM.ASM

And for some less terrible stuff here's a disassembly of the TMSS ROM I made a while ago :
http://www.tmeeco.eu/SMD/TMSSCODE.ASM

All require SNASM68K to be assembled : http://www.tmeeco.eu/SMD/SNASM68K.EXE
There's also ASM68K which is mostly compatilbe and works on newer machines too : http://www.tmeeco.eu/SMD/ASM68K.EXE
I haven't yet found an assembler that can do all these do and aren't slow or buggy etc. so I'll be sticking to those until I write my own in not so far future.

BlastEm is slowly reaching the best emulator state for my liking... just needs a good UI which seems to be worked on already. But yes, you have tradeoffs between tools, speed and accuracy, there's no single emulator yet that combines all 3 (also a thing I'll do but not in that near future).
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

sverx
Interested
Posts: 19
Joined: Fri Feb 16, 2018 3:18 pm

Re: Where do I start? I'm seeking technical documents.

Post by sverx » Wed Apr 11, 2018 8:41 am

I still didn't start coding anything, but I was wondering how usually sprites are handled.
I mean, I've seen that the sprites are stored as a linked list instead that just a simple array - how usually this is used to any advantage?
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

User avatar
Sik
Very interested
Posts: 705
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by Sik » Wed Apr 11, 2018 11:40 am

It's not :​D

Seems like Sega added it thinking it could help e.g. with sorting and such, but in practice you're more likely to do all that manually before inserting the sprites in the list. I did use it once with that purpose, though that was more of an afterthought.

If you want to avoid the linked list mess just set the link value to always point to the next sprite in the list. You may want to set the link of the last sprite to 0 (terminating the list) instead of having to move off-screen all excess entries.
Sik is pronounced as "seek", not as "sick".

User avatar
Stef
Very interested
Posts: 2773
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by Stef » Wed Apr 11, 2018 3:43 pm

Well in fact the SGDK Sprite engine does use the link field to define sprite order and it does help a bit but just because the Sprite Engine by itself is a heavy beast (each sprite internally has a prev / next link anyway).

sverx
Interested
Posts: 19
Joined: Fri Feb 16, 2018 3:18 pm

Re: Where do I start? I'm seeking technical documents.

Post by sverx » Wed Apr 11, 2018 3:50 pm

Sik wrote:
Wed Apr 11, 2018 11:40 am
It's not :​D
That was my fear :?

Also, if I understand correctly what Stef just said, SGDK uses that simply because it was faster/easier than following the internal sprite list and dump them into the SAT in actual order? If so, it really isn't any smart use of those links...
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

User avatar
Stef
Very interested
Posts: 2773
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by Stef » Wed Apr 11, 2018 8:22 pm

No SGDK uses it as it can do partial update of SAT so at contrary that is a good way of using it but what i meant is that the sprite engine by itself is heavy in general (but that s the cost of its flexibility) and having a more customized engine designed on purpose can be faster just updating the whole SAT ;) Still if you're able to take advantage of it designing your sprite engine, then it can be useful (but definitely that is not *that* useful).

User avatar
Miquel
Very interested
Posts: 319
Joined: Sat Jul 30, 2016 12:33 am

Re: Where do I start? I'm seeking technical documents.

Post by Miquel » Fri Apr 13, 2018 12:10 pm

About that not so useful linked sprites:

If this is before 1989, you don't know which cpu will be used in conjunction perhaps makes more sense, since other cpu operate much more efficiently in strict array structures. Maybe NES, being the big bucks, had some influence.

But yes, even so is hard to see it's utility.

User avatar
Sik
Very interested
Posts: 705
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: Where do I start? I'm seeking technical documents.

Post by Sik » Fri Apr 13, 2018 9:11 pm

Neither NES nor Master System have linked lists. In both cases every sprite in the table is processed in order (there isn't even something to indicate how many sprites were there, you have to move off-screen all unused entries). The NES lets you specify which entry to start from (still processed all 64 entries due to wraparound), which was probably intended to help with flicker in case of sprite overflow but in practice wasn't that useful for that purpose.

They didn't ask for developer input back then so they just crammed in whatever feature they could that seemed nice, so I guess their thought was that linked lists were probably useful for something (don't get fooled, when they decided to ask for developer input, we got the clusterfuck that's the Saturn...)
Sik is pronounced as "seek", not as "sick".

User avatar
Miquel
Very interested
Posts: 319
Joined: Sat Jul 30, 2016 12:33 am

Re: Where do I start? I'm seeking technical documents.

Post by Miquel » Sat Apr 14, 2018 5:05 pm

I didn't say anything about NES having a sprite linked list, all I'm saying is NES cpu is extremely efficient working with arrays, but not that good moving memory around or working with pointers or lists... this linked list in hardware can help in this type of cpu's, a little. Of course this is just a speculation.

I think the usefulness is clear: you don't have to do all the work to z-sort the actors, part of it is done by hardware, so with a simple loop is enough to fill the hardware sprite array.

The shock is: it's not worth at all with a 68K or a Z80, since you can do this rearranging while doing other things.

sverx
Interested
Posts: 19
Joined: Fri Feb 16, 2018 3:18 pm

Re: Where do I start? I'm seeking technical documents.

Post by sverx » Wed Apr 18, 2018 11:17 am

Sik wrote:
Fri Apr 13, 2018 9:11 pm
Neither NES nor Master System have linked lists. In both cases every sprite in the table is processed in order (there isn't even something to indicate how many sprites were there, you have to move off-screen all unused entries).
Well, no, fortunately on the Master System there's an end-of-sprites marker (Y value 0xD0)
SMS VDP doc wrote:If the Y coordinate is set to $D0, then the sprite in question and all remaining sprites of the 64 available will not be drawn.
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest