Page 1 of 1

GrimeZ80 assembly errors

Posted: Wed May 08, 2019 7:18 pm
by mrcook
Hi Keith,

This evening I was playing around with your GrimeZ80 source and while trying to assemble the binaries (using VASM), a couple of the systems were having issues. I first used the code from github, but then also tried the "UpdatedSource" code found in the archive from your download page.

BuildGMB and BuildGBC throw errors:

Code: Select all

$ vasmz80 GrimeZ80.asm -chklabels -nocase -Dvasm=1 -Fbin -o grime.bin -L grime.txt

error 2002 in line 42 of "../SrcGB/GB_V1_VDPMemory.asm": Opcode not supported by z80 (stop)
	included from line 1 of "read"
	called from line 12 of "../SrcALL/V1_VdpMemory.asm"
	included from line 1 of "read"
	called from line 1986 of "GrimeZ80.asm"
>	stop

error 2002 in line 76 of "../SrcGB/GB_V1_VDPMemory.asm": Opcode not supported by z80 (ldi)
	included from line 1 of "read"
	called from line 12 of "../SrcALL/V1_VdpMemory.asm"
	included from line 1 of "read"
	called from line 1986 of "GrimeZ80.asm"
>        ldi      (hl),a
The "ldi" also happens for lines 112, 114, and 116, but there's also the "***maximum number of errors reached!***" message.

Any ideas?

Re: GrimeZ80 assembly errors

Posted: Wed May 08, 2019 9:30 pm
by akuyou
I just redownladed the source, and it seems to compile OK my end.

You're missing a swith on the VASM command line, you need " -gbz80" to enable the extra 'non z80' commands of the Gameboy CPU,

I also can't see the 'BuildGBC' or 'DBuildGMB' symbol definitions, if you're defining them in the source code or something then that's fine (I assume you are, as otherwise the GB_V1_VDPMemory.asm shouldn't be included)

Here's the command I use

Code: Select all

\Utils\Vasm\vasmZ80_OldStyle_win32.exe %1  -chklabels -nocase -gbz80 -Dvasm=1 -DBuildGBC=1 -Fbin -o \RelGB\cart.gbc -L \RelGB\Listing.txt

Re: GrimeZ80 assembly errors

Posted: Wed May 08, 2019 9:43 pm
by mrcook
Okay, it works as you say after adding the "-gbz80". Thanks Keith!

As for the "BuildGBC", yes I was uncommenting that, as it says to do at the top of GrimeZ80.asm :)

Re: GrimeZ80 assembly errors

Posted: Wed May 08, 2019 9:58 pm
by akuyou
The
;Uncomment one of the lines below to select your compilation target
section of the ASM file was really for compiling with WinApe, which can't compile the GBZ80 commands anyway.

GrimeZ80, as it currently stands, won't actually compile on Winape, because of some syntax differences between VASM and WINAPE... For anyone interested It seems it can be fixed with some changes: (only tested on CPC)

1.PAUSE function needs to be renamed to DoPause (Winape uses Pause statement for something else it seems)

2.BRACKETS removed from formulas like "ld l,(ScreenHeight/2)+1"

3. One of the comment lines is too long for winape