|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
WLA-DX structs question
Posted: Tue Aug 30, 2022 2:47 pm
|
I've been using WLA-DX for a while for programming in assembly, but whenever I use the following code (from the documentation)
.STRUCT position_t pos_x DW pos_y DW .ENDST .STRUCT enemy_t id DW INSTANCEOF position_t ; here we import fields from position_t health DW .ENDST .ENUM $A000 nemesis INSTANCEOF enemy_t .ENDE I get the following error message:
I'm wondering what I'm doing wrong, any thoughts? |
|
|
Posted: Tue Aug 30, 2022 3:09 pm |
Nothing wrong with that code so not sure why you should be seeing an error.
Is there anything above that snippet (e.g. another .struct) which could be causing the problem (see it's on line 58)? Otherwise, check what version you're running (just running wla-z80 with no arguments should print it near the top) |
|
|
Posted: Tue Aug 30, 2022 3:09 pm |
I suspect you either give a name to that member or use the dot ( . ) for an unnamed member - try
.STRUCT enemy_t
id DW . INSTANCEOF position_t ; here we import fields from position_t health DW .ENDST |
|
|
Posted: Tue Aug 30, 2022 3:19 pm |
The docs say this is allowed syntax - it makes a "nameless" instance. I just tried it (copied and pasted into an existing project) and it compiled fine, producing these symbols (if I also export them):
0000a000 nemesis
0000a000 nemesis.id 0000a002 nemesis.pos_x 0000a004 nemesis.pos_y 0000a006 nemesis.health Maybe you need a newer version of WLA DX? Mine says this: ----------------------------------------------------------------------
--- WLA Z80 Macro Assembler v10.3a --- ---------------------------------------------------------------------- Programmed by Ville Helin in 1998-2008 In GitHub since 2014: https://github.com/vhelin/wla-dx $VER: wla-z80 10.3a (24.6.2022) |
|
|
Posted: Tue Aug 30, 2022 5:24 pm |
Just updated to 10.3 but now nothing will compile at all... Gives me the following error:
This build.bat worked for me before this, though to be honest I'm not 100% comfortable with making bat files, so I've probably done something wrong. Here it is: @echo off cls ..\..\WLA-DX_Binaries\wla-z80 -o ..\Main\main.asm main.o echo [objects] > linkfile echo main.o >> linkfile ..\..\WLA-DX_Binaries\wlalink -drvs linkfile output.sms REM specific to my computer/github repository rem java -jar ..\..\..\Emulicious-with-Java\Emulicious.jar output.sms REM Make sure SYM file is in same directory with same name as output.sms move output.sym .. move output.sms .. REM Clean up del linkfile del main.o ::output.sms |
|
|
Posted: Tue Aug 30, 2022 5:35 pm |
You've got your input and output files the wrong way around.
Should be ..\..\WLA-DX_Binaries\wla-z80 -o main.o ..\Main\main.asm
|
|
|
Posted: Tue Aug 30, 2022 5:46 pm |
Tried that, but when I do that it still doesn't work, and it no longer shows the version information when I try to build |
|
|
Posted: Tue Aug 30, 2022 6:08 pm |
I don't think it should print out the version every time, but okay what's the error it's printing out now? | |
|
Posted: Tue Aug 30, 2022 6:57 pm |
$(WLAZ80) -o build/main.o main.asm
$(WLALINK) -d -S build/wla-linkfile build/output.sms edit: it won't print anything unless there's an error or you specify -v (or -v1 or -v2) |
|
|
Posted: Tue Aug 30, 2022 10:29 pm |
Ah okay! In that case the wla-z80.exe is working, it's the wlalink that I'm running into issues with now. Unfortunately there's no error code, it just prints:
This is what the bat file looks like now: @echo off rem cls ..\..\WLA-DX_Binaries\wla-z80 -o main.o ..\Main\main.asm echo [objects]>linkfile echo main.o>>linkfile ..\..\WLA-DX_Binaries\wlalink -drvs linkfile output.sms REM specific to my computer/github repository rem java -jar ..\..\..\Emulicious-with-Java\Emulicious.jar output.sms REM Make sure SYM file is in same directory with same name as output.sms rem move output.sym .. rem move output.sms .. REM Clean up rem del linkfile rem del main.o ::output.sms The linkfile and main.o are getting created, but output.sms is not |
|
|
Posted: Tue Aug 30, 2022 10:33 pm |
This was the issue! I needed to separate my -dvrs into -d -v -r -s Thank you all for your help, I got it back up and running! |
|