pouët.net

ZX Spectrum programming?

category: code [glöplog]
I always wondered how the speccy demos are made. Are they made in assembly? Because I'd like to give it a try.
added on the 2009-01-02 11:33:13 by deveah deveah
I'm no speccy expert, but yes, assembly is a given. :)
added on the 2009-01-02 12:14:40 by tomaes tomaes
The machine's Sinclair BASIC interpreter is stored in ROM
Ye i think most part is ASM, and i think the Z80 isnt that much of a bitch to learn to program :)
I'm guessing he likes to try something demoish, not "hello world". ;) Interpreted BASIC on 8-bit machines is hilariously slow.
added on the 2009-01-02 12:32:17 by tomaes tomaes
Incredible how stupid some people can be...
Of course every demo on 8bit machines are made in basic!
added on the 2009-01-02 12:32:40 by scoutski scoutski
Incredible how stupid some people can be...
Of course there's no other language that compiles to machine code and available on 8bit machines than assembly.
added on the 2009-01-02 12:55:55 by decipher decipher
Show me a non-sucky demo coded entirely in C on an 8-bit platform. And just because it's possible, doesn't mean it's the sane way to do.
added on the 2009-01-02 13:12:21 by tomaes tomaes
Incredible how stupid some people can be...
why would you code on this dinosaur?
I would avoid Sinclair BASIC due to its slowness, yes. What I'm looking for is something faster. And I'm not stupid if I want to code for a speccy, I just want to do something different than code for a PC, which is.. too simple.
added on the 2009-01-02 14:02:02 by deveah deveah
Incredible how stupid some people can be...
why would you code on this dinosaur? WHY NOT ?
hey, nowadays most used development tools for speccy on windows are:

1. unreal emulator
2. sj asm
3. vortex tracker
4. some graphic conversion tools

on a real machine (assuming you have 128k or more and tr-dos)

1. alasm
2. pro tracker 3
4. burial gfx editor

if you want to ask some questions, better go to zx.pk.ru, hope you will have ability to register here, even without russian language knowledge. or go to #speccy at ircnet.
added on the 2009-01-02 15:36:06 by elfh elfh
Quote:
What I'm looking for is something faster.


WOOOT!
Assembly? Naaaah...you must be kidding me!?

You needz is teh basic turbo extendah!
added on the 2009-01-02 15:37:53 by scoutski scoutski
There are some excellent Spectrum games written in C, but they almost always drop into pure assembly for anything graphically intensive. And since "anything graphically intensive" == "demo", the obvious conclusion applies :-)

People *have* written Speccy demos in compiled basic, uncompiled basic and even Pascal, and some of them even manage to not be a complete pile of donkey poo. But they're only nice in a "1990-style scroller plus dot effect" way... for real demo coding it's asm all the way.
added on the 2009-01-02 16:00:34 by gasman gasman
i'd assume using C for glue should work though?
added on the 2009-01-02 16:09:09 by Gargaj Gargaj
gasman: I guess it's similar to the c64: There are implementations for most languages (sans OOP), including c, pascal, cobol, fortran etc., and special basic extensions that provide some graphics routines, but at the end of the day, those are merely for educational or special niche purposes and not really usable for anything demo-ish.
gargaj: I guess so, but there is little to gain, I guess?
added on the 2009-01-02 16:19:29 by tomaes tomaes
could be some gain in readability and a little comfort in not purely seeing code such as

LD IY, #5C3A
RES 0, (IY+02)
RES 1, (IY+01)

LD HL, HEL!0
EH HL ELP
WH AT
EH? !
WTF!?
ARGGGGH!

Ifs thens are nice for overll code layout and you could mix some inline ASM for time critical stuff
added on the 2009-01-02 17:38:16 by button button
Quote:
i'd assume using C for glue should work though?

Quote:
I guess so, but there is little to gain, I guess?


Well, now you've really got me thinking. I suppose I'd put it like this: For most demos of the sort you get on oldschool platforms, it wouldn't be worth it - there's so little 'glue' involved compared to the amount of timing-critical stuff (it's not just about optimising inner loops, it's any loop...) that you'd be better off writing it all in asm. But for a heavily design-oriented demo where a substantial part of the work is in the direction and 'scripting' - something like Trans*Form perhaps - it could be a good choice.

I guess the answer is just the same as anything else on the scene: Someone should try it. It might just pay off. (or, if you prefer: "that's nice, go make a demo about it" :-) )
added on the 2009-01-02 22:16:50 by gasman gasman
@elfh: 1 2 4 !!!
it's all pure asm.

we tryed to do some demosystems, but it's impossible for demos such as machined or aeon, even in Windows :) (in my memory only Flying/DR has something like demosystem, but it was never released)

every democoder has his own set of engines to choose from, and there is some classic routine-sets (which also can be called engines) already published: chunky 4x4, maths, vector line layout, color chunky 8x8 packer, etc.

about tools:
for graphics creation - Excess Deluxe Paint 2.1 (ZX)
for graphics conversion i recommend BMP2SCR (PC) (some version works also for animation conversion)
and for the code TBK uses STORM assembler (ZX).
added on the 2009-01-03 05:36:40 by diver diver
@diver4d: Where are these published? I'm coding for a similarly low-resource platform and would like to compare...
added on the 2009-01-03 11:18:59 by trixter trixter
Heh, all I have is a speccy clone (48k) and a ZX-81 clone. And I have the Zeus assembler for the speccy. I've already read a book about programming on the z80, which had examples for the speccy, but it was based more on how the processor works than _how_ to code. Anyway, I'm not looking to make only demos, I'm looking to make little games which don't need too much graphic power, like roguelikes. So, is there something besides ASM and Sinclair BASIC that I can use to write little programs?
added on the 2009-01-03 12:28:28 by deveah deveah
As said, you'd then have to go with either compiled basic or a c/pascal implementation. But even roguelikes usually have tricky and complex calculations to make (read: you'd want some speed here), unless you go for something simple, like this f.e.
added on the 2009-01-03 13:01:50 by tomaes tomaes
trixter, basically in russian-language diskmags such as "demo or die", "spectrum expert" and "adventurer".

and there is also collection of zx sources
added on the 2009-01-03 14:08:53 by diver diver
for coding in c on the speccy there's z88dk. it's a pc based cross-compiler. i've never used it but i think you can dip into asm quite easily. probably good for prototyping and learning the speccy but, as others have said, on 8bit machines pretty much everything is time critical

for tools i'd second vortex tracker for music and recommend pasmo for a compiler - there are probably a dozen compilers that all have their pros and cons and everyone has a favourite so just pick one. i never found anything i liked for converting gfx so i just wrote my own little util to do this and it gets run from the makefile

ps: if you want to make demos then you'll probably want a 128 rather than a 48. the 128 gives you double buffering and a sound chip.. as well as obviously more memory ;)
added on the 2009-01-03 14:46:51 by evilpaul evilpaul

login