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

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

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 » Thu Mar 08, 2018 9:21 am

Thanks! Yeah, I had read about those colors 14 and 15 of the 3rd palette - weird, but could be useful for some tricks.

I guess I'm at least 90% fine with the VDP inner workings. Where can I read now about the CPU? So far I only know what's written at the Motorola 68000 Wikipedia page, and of course I need to dig on. :lol:
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.


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 » Thu Mar 08, 2018 1:50 pm

Thank you - I'm reading them. A lot of addressing modes! Multiplications and divisions, 32 bit registers... why is that called a 16-bit processor? :?
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

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

Post by Chilly Willy » Thu Mar 08, 2018 2:46 pm

sverx wrote:
Thu Mar 08, 2018 1:50 pm
Thank you - I'm reading them. A lot of addressing modes! Multiplications and divisions, 32 bit registers... why is that called a 16-bit processor? :?
Because it uses a 16 bit ALU to do arithmetic/logic computations. Hence the reason that byte and word ops take the same time, but long ops take more cycles, even when done register to register.

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 » Thu Mar 08, 2018 2:50 pm

Actually I just realized it's a mistake on my side: the MegaDrive is a so-called "16-bit home video game console", but the Motorola 68000 is a 32bit CISC processor.
As for the ALU, that was my suspect too, but years ago I discovered that ALU word size has nothing to do with processor word size - the Zilog Z80 has a 4-bit ALU.
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

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

Post by Sik » Thu Mar 08, 2018 6:12 pm

Both the ALU and data bus are 16-bit on the 68000, and 32-bit operations always take longer (aside from stuff involving just moving between registers).

The bit number is meaningless as a precise definition... It really just refers to the word size at which the CPU is doing its best (and on 68000 doing 16-bit calculations is much better than 32-bit, much like how on Z80 most stuff is 8-bit and only a few slower operations are 16-bit).
Sik is pronounced as "seek", not as "sick".

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 » Thu Mar 08, 2018 9:21 pm

Sik wrote:
Thu Mar 08, 2018 6:12 pm
The bit number is meaningless as a precise definition... It really just refers to the word size at which the CPU is doing its best
True, but I would say that the length in bits of the accumulator register (or any data register for processors lacking a designated accumulator) would be a good way to define it. For instance:

Zilog Z80: A is 8 bits. Yes, you've got register pairs such as BC, DE, HL and some 16 bits operations, such as stack PUSH and POP
Intel 8086: AX is 16 bits, even if you can use AH and AL parts (8 bits each) and some opcodes use DX:AX register pair
ARM arm7tdmi: r0 (or any other general purpose register) is 32 bits - even if, for instance, thumb opcodes are 16 bits
MC68k: d0 (or any other data/address register) is 32 bits

just my opinion, of course. 8)
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

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

Post by Miquel » Fri Mar 09, 2018 4:44 am

If we are talking about marketing the strategy is clear: the biggest the number the most impression on the clients you are going to make, this way when they ponder if they should buy the hardware the benefit/cost ratio seems more favourable to the customer.
But in computers this is old stuff, don't affect much right now, probably due to too much use.

If we are talking about hardware design one number is not enough to describe it.

Perhaps you are mixing both semantic areas.
HELP. Spanish TVs are brain washing people to be hostile to me.

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 » Fri Mar 09, 2018 12:12 pm

sure, that was simply my opinion - the way I personally choose to categorize CPUs - surely not the revealed truth, I'm sorry if I ever given the impression that I'm here to teach, as I'm here to learn, not to teach (and beside that I think I haven't got anything particular to teach anyway :roll: )

Still reading all the CPU docs, it'll take a while.
When can I find small code snippets to see if I start to understand how it works?
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

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

Post by Chilly Willy » Fri Mar 09, 2018 4:14 pm

Easy68K has lots of example code, but here's a nice mini guide that uses Easy68K:

https://simpledevcode.wordpress.com/201 ... ogramming/

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

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

Post by Miquel » Sat Mar 10, 2018 4:37 am

sverx wrote:
Fri Mar 09, 2018 12:12 pm
sure, that was simply my opinion - the way I personally choose to categorize CPUs - surely not the revealed truth, I'm sorry if I ever given the impression that I'm here to teach, as I'm here to learn, not to teach (and beside that I think I haven't got anything particular to teach anyway :roll: )
More than you personal view, is what everyone write on Internet, but that knowledge comes from selling. When a "new generation" comes marketing people have to convince millions of people, not necessary with any knowledge of computers and alike, to buy a new apparatus, while most of them already have a machine from previous generation. So the most obvious technique is to say this new one is "times better" than the older. For a period 8bits, 16bits, 32bits, 64bits... fitted perfectly.

I think you are trying to make an agreement between popular knowledge and a detailed one. All I'm saying is don't do it, live with both.
Last edited by Miquel on Fri Mar 16, 2018 5:03 pm, edited 2 times in total.
HELP. Spanish TVs are brain washing people to be hostile to me.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

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

Post by Sik » Sat Mar 10, 2018 4:44 pm

Anyway, for many kinds of operations the 68000 can work with 32-bit values with only a small penalty (sometimes only on registers though), much less than if you had to use two 16-bit operations. You should stick to 16-bit values where you don't need more anyway (which is most things), but 32-bit is there when you need it.

Some of the complex or uncommon stuff like multiplication or BCD is where you don't get the luxury of 32-bit. In practice it's not stuff you'll be touching often.
Sik is pronounced as "seek", not as "sick".

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 » Thu Mar 15, 2018 2:57 pm

Now going deeper into the MegaDrive topic. Any code collection/library/devkit to program the thing in 68k asm? :)
Also, what's the assembler/editor/IDE of choice?
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

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

Post by cero » Thu Mar 15, 2018 6:21 pm

SGDK. You can call the same functions as in C, but write your own code in GNU as.

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 » Thu Mar 15, 2018 9:52 pm

Sorry, I actually meant to say I wanted to read asm code that does basic functions, such as writing to VDP register, setting VRAM address and so on...
sverx [zvɛrks]: Nintendo DS/GBA & SEGA Master System retrodeveloper, Disjointed Studio co-founder & coder, devkitSMS author.

Post Reply