GP2X 68000 Assembly (asm 68k)


mattyrb

Member
Joined
Mar 30, 2005
Messages
151
Hi,
This is completely off topic but I was wondering if anyone has experience in 68000 assembly (ASM 68k)....and if so could they answer a question relating the sega megadrive/genesis.

Currently talking to the people developing piersolar....(search on google) and they say they have a nightmare of a time trying to use both the megadrive and sega cd together...mainly due to the lack of memory (64k) would some optimised assembly to pass this information back and forward through the limited memory help at all?
 

ant512

Still Fresh
Joined
Oct 26, 2005
Messages
49
I'd be amazed if the developers were writing anything but pure 68k asm already. Coding videogames in high-level languages is a relatively recent phenomenon. Pretty much any commercial game will have been written in assembly prior to the advent of the 32-bit consoles (N64, PlayStation, Saturn) and you'd probably find a significant amount of asm produced for those.

EDIT:

Looks like the sound guy knows his stuff and is doing everything in asm, but the main coder is using a mixture of C and assembly. In that case, yes - you can always get a speed increase when working in asm, especially on this kind of hardware when the performance of the software is directly proportional to the number of weird tricks you know in asm.
 

hal9000

Member
Joined
Jan 6, 2007
Messages
219
Age
42
Location
France
Website
Visit site
ant512 said:
Pretty much any commercial game will have been written in assembly prior to the advent of the 32-bit consoles (N64, PlayStation, Saturn)
I don't know where you got this info but it sounds completely silly. A large majority of video games were written in C (or even higher level languages), with, sometimes, some small parts in assembly.

Doom, for example, is written in C, with just a very small part of the rendering code in asm.

I would be interested in a single example of commercial game completely written in assembly released after 80.
 
Last edited by a moderator:

gmiller1018

Member
Joined
Sep 21, 2006
Messages
336
Location
USA Florida
Website
Visit site
Although I would agree with you (hal9000) the 'hint" from his (ant512) reply is for console systems. I am unsure of what these were written in (but I would guess assembly) ... of course that is a blatant guess ...
 

mattyrb

Member
Joined
Mar 30, 2005
Messages
151
Its mixed C and ASM at the moment. I'm aware there are some major issues communicating between the 2 due to the lack of memory and wondered what kinds of solution could be made
 

ant512

Still Fresh
Joined
Oct 26, 2005
Messages
49
Doom ran really well on a P60 with 16MB of RAM. Difference? Roughly 99 MIPS and about 15.9MB of RAM. Of course you can program a PC game with C. But then, a P60 was perfectly capable of running Mega Drive games in an emulator. The difference in raw processing power between the two is like the difference between a GP2x and one of those old Nintendo Game & Watch LCD games.

Did you ever see the Mega Drive port of Duke Nukem 3D?

Mega Drive:

http://upload.wikimedia.org/wikipedia/en/0..._3D_Genesis.png

Versus PC:

http://upload.wikimedia.org/wikipedia/en/7...alt_Trooper.png

So where do I get this *crazy* idea from? I've got the original Genesis, 32x and SegaCD dev kits (just the software, unfortunately), along with the Sega tech docs. Also, I started programming on a Dragon 32. :p
 

kevcal

Coding " Abduction;Retrieval "
Joined
Jun 14, 2006
Messages
836
Age
54
Location
Southern England
Website
homepage.ntlworld.com
hal9000 said:
A large majority of video games were written in C (or even higher level languages), with, sometimes, some small parts in assembly.
I would be interested in a single example of commercial game completely written in assembly released after 80.
I think you'd be shocked - many of us were still writing in 68k assembler in the early 90s to get the best from the limited resources..
 
Last edited by a moderator:

woogal

Certified Guru
Joined
May 15, 2003
Messages
1,823
Age
44
Location
Newark, UK
Website
gp32.sector808.org
Many games back then would have been 100% asm, but far from all. Even back in the Dragon32 days, '100% asm!!!' was used as a big selling point which suggests that it must have been a fairly rare thing. I remember coming across quite a few commercial Dragon32 games that were actually 99% basic with just a small asm bootloader to do an autorun and attempt to hide the code.
 

camiga64

Still Fresh
Joined
Feb 14, 2006
Messages
116
Location
Germany
Website
Visit site
kevcal said:
hal9000 said:
A large majority of video games were written in C (or even higher level languages), with, sometimes, some small parts in assembly.
I would be interested in a single example of commercial game completely written in assembly released after 80.
I think you'd be shocked - many of us were still writing in 68k assembler in the early 90s to get the best from the limited resources..


You are damn right kevcal (and i mean commercial C64- an AMIGA-Games). :p
 
Last edited by a moderator:

hal9000

Member
Joined
Jan 6, 2007
Messages
219
Age
42
Location
France
Website
Visit site
camiga64 said:
You are damn right kevcal (and i mean commercial C64- an AMIGA-Games). :p
I don't know for C64, but I know that a very large majority of Amiga games were not written in assembly. Demos were written in assembly, but not games (there are probably some exceptions, but only a small minority).

The great things you could do with an amiga was done with a clever use of its graphical processors. You needed to do some low level programming for that, but not to write your complete game in assembly.
 
Last edited by a moderator:

kevcal

Coding " Abduction;Retrieval "
Joined
Jun 14, 2006
Messages
836
Age
54
Location
Southern England
Website
homepage.ntlworld.com
I disagree :) but then I only played and knew guys who wrote arcade style games.. back then compilers just weren't up to the job of writing efficient code and it would have been sacrilege to use them anyway..(!)
Everyone I knew was using devpac on the atari. We were often counting clock cycles and writing self-modifying code to squeeze the best out of the machine (the main challenge and fun bit). I dabbled with Hisoft C and the ilk - not good for high framerates - and I know how to write efficient C for a 68k... (oops, I'm not volunteering for anything).

Then again, of course, I guess something like football management sims or things that didn't need high framerates could have been written in GFA basic or whatever..

Anyway, this is a bit off-topic ;)
 

slaanesh

Certified Guru
Joined
Nov 9, 2005
Messages
1,994
Age
51
Location
Melbourne, Australia
Website
www.slaanesh.net
Frontier originally written for the Amiga/ST is one of those games. It's 99% 68K ASM which is an astounding feat considering the complexity of the game and why it actually worked so well!

I only ever played it on a 68030 @ 28Mhz on my A1200 but I did try it on my A500 on lowest detail settings. It was playable - just!
 

Exophase

Nothing good will ever come of Exophase.
Joined
Sep 21, 2006
Messages
10,308
Age
37
Location
Cleveland OH
hal9000 said:
ant512 said:
Pretty much any commercial game will have been written in assembly prior to the advent of the 32-bit consoles (N64, PlayStation, Saturn)
I don't know where you got this info but it sounds completely silly. A large majority of video games were written in C (or even higher level languages), with, sometimes, some small parts in assembly.

Doom, for example, is written in C, with just a very small part of the rendering code in asm.

I would be interested in a single example of commercial game completely written in assembly released after 80.


He's talking about console/handheld video games, not PC games. Most old platforms were either 65xx derivatives or z80. Neither were good targets for compilers, especially 65xx (especially 6502). This is because these CPUs have instruction sets with low to very low orthogonality. There's a fan made C compiler for Hu6280 (the CPU in the PC-Engine) but the output it produces is really terrible.

The exceptions are 68k (Genesis, Amiga) and x86 (PC); developing compilers for these platforms was much more realistic. There was a commercial C compiler for Genesis, but I would bet that most games still contained a large amount of assembly and some were probably completely assembly.

Keep in mind that consoles/handhelds were way behind computers in terms of CPU and RAM until the 32/64bit era. That's because they were aiming to be cheap, and also because they focused on specialized graphics/sound hardware instead. So it makes sense that the very cheap 6502/65816 and z80 based cores would be used for a pretty long time.
 
Last edited by a moderator:

ant512

Still Fresh
Joined
Oct 26, 2005
Messages
49
A couple of famous examples are Gloom and Super Skidmarks from the Amiga. At the time, people made a lot of fuss that the games were written in Blitz BASIC - arcade games written in BASIC? Surely not!

In fact, not. Blitz BASIC had a full inline 68K assembler. BASIC was used for initialising the hardware, and the rest of the code (99% of it) was plain old assembly. There's another example here:

http://aminet.net/search?query=alien+breed+3d

Full sourcecode to Alien Breed 3D 2. Game released in 1996; 100% 68K assembly.

You'd find that slower, more data-orientated Amiga games would have been written in C (Monkey Island, Civilization, etc). Anything else would be assembly.

Regarding the early home computers like the Dragon and Speccy, there were an awful lot of simplistic BASIC games in the early days. The were several reasons for that - BASIC was built-in, and it wasn't obvious how to get the machines to process machine code; more importantly, you had to write raw hex opcodes in those days, none of your fancy mnemonics or macros, so it was much harder to program anything. Machine code type-ins in magazines were just pages and pages of hex.

Once you got past the early days and games started to become more demanding - think Chase HQ, R-Type and Robocop, instead of Warlock of Firetop Mountain and basic text adventures - no-one said "100% machine code!" any more because everyone was doing it.
 

hal9000

Member
Joined
Jan 6, 2007
Messages
219
Age
42
Location
France
Website
Visit site
ant512 said:
A couple of famous examples are Gloom and Super Skidmarks from the Amiga. At the time, people made a lot of fuss that the games were written in Blitz BASIC - arcade games written in BASIC? Surely not!
It's funny how old stuff like that can raise controversy today :)

Super Skidmarks was definitely a real Blitz Basic game.

I remember it was clearly advertised as a game that you could do in Blitz BASIC (actually it was an advertisment for Blitz BASIC). I was myself Blitz BASIC programmer, I made some games technically comparable to it and I guarantee that programming Super Skidmarks in Blitz BASIC must have been really straightforward: one big virtual screen for the circuit, precomputed 3D for the cars and that's all (well, of course there were probably a lot of work behind the gameplay, but that's another story).

From my experience, I don't think you need assembly even for the most outstanding 2D games, like Alien Breed 2 for example. For what? This is only blitting and scrolling, and there are graphical processors which does it for you. And that was the case of most Amiga games, even arcade ones.

OK for the given examples: Frontier, Gloom, Alien Breed 3D, which were trying to push the Amiga on the PC games field, with a processor which could not match the ones of the PCs. But that's exceptions.

EDIT: Just for info, Blitz BASIC was a compiler. Just to say that it cannot be compared with other basic of that time.
 
Last edited by a moderator:

ant512

Still Fresh
Joined
Oct 26, 2005
Messages
49
hal9000 said:
EDIT: Just for info, Blitz BASIC was a compiler. Just to say that it cannot be compared with other basic of that time.
Noo, Blitz BASIC was a programming language. One of the tools included in the Blitz package was a compiler. There's no reason that someone couldn't have written an interpreter if they'd wanted to. Waste of time, though.

Compare it with the other big Amiga BASIC language, AMOS - out of the box, AMOS was an interpreted language. *However*, you could also buy an AMOS compiler, and most PD Amiga software written in AMOS after the compiler became available was compiled for release.
 
Last edited by a moderator:

hal9000

Member
Joined
Jan 6, 2007
Messages
219
Age
42
Location
France
Website
Visit site
ant512 said:
Noo, Blitz BASIC was a programming language. One of the tools included in the Blitz package was a compiler. There's no reason that someone couldn't have written an interpreter if they'd wanted to. Waste of time, though.
I think most people here know the difference between a language and a compiler. Or at least I do.

"Blitz BASIC is a compiler" is maybe an incorrect statement, but its meaning is not really ambiguous and quite obvious, I think.
 
Last edited by a moderator:
Top