Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

The place for codemasters or beginners to talk about programming any language for the Spectrum.
User avatar
keith56
Berk
Posts: 48
Joined: Mon Nov 13, 2017 9:23 pm

Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by keith56 » Sat Jan 20, 2018 1:55 pm

It is with great honour I present to you my new Z80 tutorial series!
"Multiplatform Z80 ASM development videos... with vampires!"

I plan for these to take you from absolute beginner programmer, to Z80 game developer... I only learned ASM 18 months ago, and I'll teach you all the things I needed to learn, try to help you avoid the problems I had, and explain them in what I think is the easiest and fastest way for a beginner - I'll be using my own game as 'reference material' (hence the 'with vampires' comic title)

I'm teaching using the the CPC emulator WinApe , as it has a built in assembler and debugger that make it the easiest I've seen for a beginner to use and debug - but once I've taught the basics, I'll move on to ZX spectrum specific stuff... I've already done some technical videos on my youtube channel comparing the CPC/MSX and Spectrum

The website of this new tutorial is here:
http://www.chibiakumas.com/z80/

The lessons will have an accompanying video, which I intend you to watch as well as reading the website (though in theory you could do just either one)... The video for lesson 1 is here:



Lesson 1 is for the total beginner, I assume you've never even used winape before, and I'll show you how to enter, compile and debug your first Assembly program!

I plan to do more lessons, so I hope you enjoy it!

Post changed by admin to use new media tag.
2 x
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
「チビ悪魔」可笑しいゴシックSTG: http://www.chibiakuma.com
Chibi Akumas Episode 2:Confrontation for CPC ...Out Now!

Ralf
Manic Miner
Posts: 779
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by Ralf » Sat Jan 20, 2018 5:42 pm

Thanks!

I'd like to make a confession now ;) I always wanted to learn writing code for Amstrad CPC. Unofortunately out of all classic computers I can write code only for Zx Spectrum. I can't do it for Amstrad, can't do it for Sam Coupe, can't do it for MSX, not to mention machines with different CPUs than Z80 and completely different architecture.

I believe the easiest switch would be from Spectrum to CPC. With some experience at both platforms I could even maybe one day try to decompile and port some game from CPC to Spectrum ;) Or maybe not as it would turn too difficult. Anyway I'd like to try something new.

Unfortunately I never did it. I can see two obstacles - graphic modes of CPC which are quite badly documented (or at least Google failed me here) and different tools - emulators, debuggers, decompilers, art utilities, graphic rippers and so on.

So I'm really happy to see your tutorial. Don't hesitate to write about CPC. We know Zx Spectrum and I suppose there are people like me who would like to learn something new.
0 x

User avatar
R-Tape
Site Admin
Posts: 1473
Joined: Thu Nov 09, 2017 11:46 am

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by R-Tape » Sat Jan 20, 2018 6:01 pm

"You probably think 64 kilobytes doesn't sound much "

Actually I wasn't!

Thanks, I will be following these. A lot of people here will be familiar with the assembly and need to know the peculiarities of the CPC, I heard the screen layout is more wonky than the Speccy's.

I'd like to see my panic style platformer (Lost Tapes of Albion/EFMB) converted to as many platforms as possible (currently Speccy, SAM, Amiga, MSX, PC and someone's working on a C64 version), the CPC may be one I can manage myself eventually.
0 x

AndyC
Microbot
Posts: 161
Joined: Mon Nov 13, 2017 5:12 am

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by AndyC » Sat Jan 20, 2018 7:10 pm

Ralf wrote:
Sat Jan 20, 2018 5:42 pm
Unfortunately I never did it. I can see two obstacles - graphic modes of CPC which are quite badly documented (or at least Google failed me here) and different tools - emulators, debuggers, decompilers, art utilities, graphic rippers and so on.
The display on the CPC comes down to two chips, the CRTC which controls things like positioning on the screen, size of the displayed area and other timing issues and then the custom Gate Array, which encodes pixels based on the screen mode and handles palette selection (as well as doing ROM/RAM paging).

The CPC wiki has some pretty good documentation on how these work:

http://cpcwiki.eu/index.php/CRTC
http://cpcwiki.eu/index.php/Gate_Array
1 x

User avatar
Spud
Microbot
Posts: 146
Joined: Sun Nov 12, 2017 8:50 pm

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by Spud » Sat Jan 20, 2018 10:49 pm

R-Tape wrote:
Sat Jan 20, 2018 6:01 pm
I'd like to see my panic style platformer (Lost Tapes of Albion/EFMB) converted to as many platforms as possible (currently Speccy, SAM, Amiga, MSX, PC and someone's working on a C64 version), the CPC may be one I can manage myself eventually.
Jaco is going to stab me to death, but I am going to convert it to the Sega Master System in that case (I've been wanting an excuse to code for that system for years). It would be also be a cool title to see on the Game Boy.
1 x

Ralf
Manic Miner
Posts: 779
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by Ralf » Sun Jan 21, 2018 5:14 pm

The CPC wiki has some pretty good documentation on how these work:

http://cpcwiki.eu/index.php/CRTC
http://cpcwiki.eu/index.php/Gate_Array
Well, I suppose it is correct, I suppose it is thorough. But for learning it is terrible. When I opened these links I immediately wanted to run away ;) It's full of some long scary lists of names, numbers, ports, bits, palette indexes, suble differences in models and so on.

Good tutorial gives you knowledge in small doses and not throws everything at your face at once. You start from some simple things and at each step have practical examples which use only the stuff that you learnt so far.

So at this moment I'll just wait how Keith's tutorial develops. I hope at some moment he'll show how to draw a sprite/tile in assembler on CPC.
0 x

AndyC
Microbot
Posts: 161
Joined: Mon Nov 13, 2017 5:12 am

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by AndyC » Sun Jan 21, 2018 6:55 pm

Yes, it's more documentation than tutorial, Grimware's site was a bit better in that regard but it's disappeared for now at least. Hopefully Keith's videos will fill that niche a bit better. Generic sprite routines on the CPC are trickier to show than on the Speccy, because it depends a lot on how you arrange the screen ram and there are various tricks which work better in some circumstances than others.
0 x

User avatar
keith56
Berk
Posts: 48
Joined: Mon Nov 13, 2017 9:23 pm

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by keith56 » Mon Jan 22, 2018 9:31 am

Wow! so many replies... I wasn't expecting any interest in this, so I'm really touched by the enthusiasm!

The first few tutorials will just teaching the assembly language itself, once we're through the basics, I'll start teaching how my game works - and how to rip bits out of it and re-purpose them for your own work - and since all my modules are multiplatform, you'll be able to program CPC/MSX & ZX if you want!

my current game doesn't use a tile array, so that won't be in there, but I'll show you how my sprite routines work in case you want to write your own- and how to use my sprite editor to make the binary files they use in case you just want to rip my code - it's all open source so you're totally welcome use or modify my stuff!

There's a video describing the CPC and spectrum screens here:

The cpc screen is very similar to the spectrum, I got the CPC sprite code working on spectrum in about 2 hours (black and white only).. you just need to change the lookuptable, and command to calculate the screen line below the current one.

Oh, and I now have a Z80 cheatsheet on the tutorial website, it has CPC and Speccy goodness, so please grab it if you want!

The 64k comment was a joke aimed at the 'Xbox generation' - I'm pretty sure everyone here know 64k is plenty enough!

Post edited by admin to use new media tags.
0 x
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
「チビ悪魔」可笑しいゴシックSTG: http://www.chibiakuma.com
Chibi Akumas Episode 2:Confrontation for CPC ...Out Now!

AndyC
Microbot
Posts: 161
Joined: Mon Nov 13, 2017 5:12 am

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by AndyC » Mon Jan 22, 2018 8:04 pm

Pretty good intro to the screens video. I think maybe it might have been instructive to scroll the screen slightly on the CPC to show how things start to get weird and possibly fiddle with the CRTC screen size registers - it can be quite instructive to show that making a 64-byte (32 characters in Mode 1) wide screen gives you a similar advantage in next line calculations to the Speccy. Those are effects that can be quite easily demonstrated from BASIC too, whereas some of the more cunning CRTC effects require a fairly deep understanding of the hardware and probably a smattering or two of assembly.
0 x

User avatar
keith56
Berk
Posts: 48
Joined: Mon Nov 13, 2017 9:23 pm

Re: Beginner's ASM Tutorial: Multiplatform Z80 ASM development videos... with vampires!

Post by keith56 » Tue Jan 23, 2018 3:57 am

AndyC wrote:
Mon Jan 22, 2018 8:04 pm
I think maybe it might have been instructive to scroll the screen slightly on the CPC to show how things start to get weird and possibly fiddle with the CRTC screen size registers - it can be quite instructive to show that making a 64-byte (32 characters in Mode 1) wide screen gives you a similar advantage in next line calculations to the Speccy. Those are effects that can be quite easily demonstrated from BASIC too, whereas some of the more cunning CRTC effects require a fairly deep understanding of the hardware and probably a smattering or two of assembly.
CRTC functions on the CPC are very interesting, however my ChibiAkumas game only uses software scrolling and the default screen size, so it would have involved teaching things to 'beginners' that I do not use in either of my finished CPC games!... I do plan to reduce the CPC screensize as you describe in my future games so all the systems have a 256 pixel wide screen, but as my current game engine does not support it - and that's what my tutorial will focus on, I will not be covering it at this stage.

I'll be doing some very basic stuff with CPC screens again in this weeks tutorial, I will make sure I mention the scrolling issue to some extent so people know it's there, but again, I think hardware scroll is for a much later lesson!
0 x
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
「チビ悪魔」可笑しいゴシックSTG: http://www.chibiakuma.com
Chibi Akumas Episode 2:Confrontation for CPC ...Out Now!

Post Reply