MT MK2 troubleshooting (now cc65 in general and nesdev wiki)

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

MT MK2 troubleshooting (now cc65 in general and nesdev wiki)

Post by nesrocks »

From here:
https://github.com/mojontwins/MK2_NES

I can't get this to work. First of all, the batch file seems to be wrong? It tries to execute several things from "..\..\utils" but the correct path from the downloaded file is "..\utils".
I fixed this, but I can't understand what this batch line would do:
rem etc ...
How is it executing that line if rem is for comments? And what would "etc" do?
Even after fixing everything I can find and removing the rems it doesn't work. Maybe because my antivirus accused several of the executables to be infected. Yeah that could be a problem. So I guess I'd have to re-compile the BAS files myself? Does anyone have a working version of this?

edit: I have recompiled the BAS into EXE files, but it doesn't generate the palette.h right at the beginning of the batch file. So one of these lines isn't working correctly:
..\utils\mkts.exe mode=pals pals=..\gfx\palts.png out=work\palbg0.h label=palts0 silent
copy /b work\palfg0.h + work\palbg0.h + work\palbgend.h + work\pallightning.h assets\palettes.h > nul

edit2: yeah, palts.png doesn't exist.
Last edited by nesrocks on Mon May 07, 2018 6:37 am, edited 2 times in total.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
koitsu
Posts: 4201
Joined: Sun Sep 19, 2004 9:28 pm
Location: A world gone mad

Re: Mojon Twins Engine MK2 troubleshooting

Post by koitsu »

I'm not gonna sift through that project, considering the authors should really update README.md to contain proper instructions for building. Failure to do so (yet release it onto the Internet publicly) is a disservice, IMO. Yes I know people have lives/priorities but proper documentation is always needed, case in point.

I suggest strongly you open up a GitHub Issues with them and point all of this out; make it their problem: https://github.com/mojontwins/MK2_NES/issues

Anyway... REM is completely ignored in bat/cmd files, I can assure you. :: is another form of commenting that you might see, but is actually terrible and should never be used. The problem is not with the REM lines.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mojon Twins Engine MK2 troubleshooting

Post by nesrocks »

Yeah, I managed to find some palts.png files from other of their projects, but the .h files are full of bugs. Double defined labels, undefined labels, etc.

Code: Select all

assets/levelset.h(18): Error: Undefined symbol: `MAX_HOTSPOTS_0_TYPE_1'
assets/levelset.h(18): Error: Constant expression expected
assets/levelset.h(18): Error: Constant expression expected
engine/screens.h(56): Error: Undefined symbol: `zcp_title_rle'
engine/screens.h(56): Warning: Converting integer to pointer without a cast
engine/screens.h(74): Error: Undefined symbol: `zcp_ending_rle'
engine/screens.h(74): Warning: Converting integer to pointer without a cast
engine/hotspots.h(23): Error: Undefined symbol: `game_zcp'
engine/hud.h(48): Error: Undefined symbol: `zcp_hud_rle'
engine/hud.h(48): Warning: Converting integer to pointer without a cast
engine/player.h(136): Error: Undefined symbol: `flickering'
engine/player.h(497): Error: Undefined symbol: `game_zcp'
engine/enemmods/enem_linear.h(74): Error: Undefined symbol: `game_zcp'
engine/game.h(119): Error: Undefined symbol: `game_zcp'
engine/game.h(119): Fatal: Too many errors
edit: I have done as you said, opening an issue at the project. I have tried some other projects of theirs, but none compile.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Mojon Twins Engine MK2 troubleshooting

Post by na_th_an »

Sorry for the inconvenience. MK2 is a bit of a mess. That's why it hasn't been released properly as a standalone product. In fact, the engine is customized for each new game, with tons of new stuff added in each iteration. What's in the repo is just a copy of the latest customization. That's why it doesn't compile: it's incomplete.

MK2 is not ready yet for release, that's why there's no proper readme.md or any docs whatsoever. What's in the repo is outdated and definitely not ready to use. To get proper, working MK2 examples check this and this (this year's compo entry, latest MK2 version). Our you can wait until I finish what I am preparing to have a proper working, documented, and ready to use engine - I'm almost finished, just writing some docs at the moment. Please bear with us :)
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mojon Twins Engine MK2 troubleshooting

Post by nesrocks »

That's good to know! It would help though to have some disclaimer telling people that it isn't complete, because the ones likely to try it out are exactly the ones that need some working example to help them learn nes development, and it not working actually may throw them off in the complete opposite direction of figuring this thing isn't for them.

I tried the miedow project, and it almost compiles everything, but it throws an error that I've found with most of the other projects: it doesn't find the zeropage.inc. Then a lot of errors happen after that, which may be related to this.
Last edited by nesrocks on Fri May 04, 2018 6:58 am, edited 1 time in total.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Mojon Twins Engine MK2 troubleshooting

Post by na_th_an »

That surely has to do with the compiler version. I believe that versions prior to 2.15 needed such file in the same folder where the compile script is called. In my 2.13 projects I used to have a zeropage.inc file with this contents:

Code: Select all

;
; zeropage.inc
;
; (C) Copyright 2002 Ullrich von Bassewitz (uz@cc65.org)
;

; Assembler include file that imports the runtime zero page locations used
; by the compiler, ready for usage in asm code.


	.importzp   	sp, sreg, regsave
	.importzp   	ptr1, ptr2, ptr3, ptr4
	.importzp   	tmp1, tmp2, tmp3, tmp4
	.importzp   	regbank

; The total amount of zero page space used

zpspace = 26
But I believe your issue will be better solved by installing the latest 2.15 https://sourceforge.net/projects/cc65/f ... p/download

Anyways, I'd wait until we make a proper release of the engine we are preparing (called AGNES) - The code base and example games are already finished, I'm just writing some docs and designing a tutorial. Thanks for your interest :)
User avatar
Alp
Posts: 223
Joined: Mon Oct 06, 2014 12:37 am

Re: Mojon Twins Engine MK2 troubleshooting

Post by Alp »

na_th_an wrote:Anyways, I'd wait until we make a proper release of the engine we are preparing (called AGNES) - The code base and example games are already finished, I'm just writing some docs and designing a tutorial. Thanks for your interest :)
Nice! I've been working on an Assembly-based tutorial for the last week, at the request of a colleague.

It goes from "Hello World!", to a Space Shooter, all the way up to a tongue-in-cheek Mario clone! :P

I'm currently designing the webpage for it, to make the tutorial as professional as possible.
It will contain Assembly in spoiler boxes, in NESASM, ASM6, and CC65 syntax. I figured, why not cover them all?
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Mojon Twins Engine MK2 troubleshooting

Post by na_th_an »

That rocks! I'm sure we all have lots to learn from this :)
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mojon Twins Engine MK2 troubleshooting

Post by nesrocks »

I'm using version 2.16.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: Mojon Twins Engine MK2 troubleshooting

Post by na_th_an »

Strange. As far as I remember I am using 2.15 as out-of-the-box. Anyways, there's a zeropage.inc file in the the asminc subfolder. Maybe your package is not complete? This is the contents of such file:

Code: Select all

;
; zeropage.inc
;
; (C) Copyright 2002-2012, Ullrich von Bassewitz (uz@cc65.org)
;

; Assembler include file that imports the runtime zero page locations used
; by the compiler, ready for usage in asm code.


        .globalzp       sp, sreg, regsave
        .globalzp       ptr1, ptr2, ptr3, ptr4
        .globalzp       tmp1, tmp2, tmp3, tmp4
        .globalzp       regbank
  
; The size of the register bank
regbanksize     = 6

; The total amount of zero page space used
zpspace         = 26

; The amount of space that needs to be saved by an interrupt handler that
; calls C code (does not include the register bank, which is saved by the
; generated C code if required).
zpsavespace     = zpspace - regbanksize

Also, the CC65_HOME environment variable should be set, AFAIK, pointing to the base directory where your copy of cc65 resides.

Or just put the zeropage.inc alongside the compile.bat file in the /dev folder.
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: Mojon Twins Engine MK2 troubleshooting

Post by nesrocks »

Yeah, I figured what the problem is, and it's a problem I've mentioned in another thread in these forums:
There's currently no installer for cc65.

I think this is a huge problem for nes development in general. People who installed it when there was an installer are now in a select group where no new people can join :lol: </drama>
The way I've been using cc65 is I copy the executables to my projects and use them. But this whole path setting thing simply doesn't exist. This is a horrible solution, but I couldn't use it in any other way.

If you go to this nesdev wiki page https://wiki.nesdev.com/w/index.php/Installing_CC65
You will notice it is outdated. Those instructions don't work anymore because the cc65.org doesn't offer the installer option anymore, just a raw windows snapshot download.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: Mojon Twins Engine MK2 troubleshooting

Post by thefox »

nesrocks wrote:I think this is a huge problem for nes development in general. People who installed it when there was an installer are now in a select group where no new people can join :lol: </drama>
The way I've been using cc65 is I copy the executables to my projects and use them. But this whole path setting thing simply doesn't exist. This is a horrible solution, but I couldn't use it in any other way.
I've never used the installer. Extract cc65 wherever you like (e.g., C:\cc65), then add the binary directory (e.g., C:\cc65\bin) to the PATH environment variable. On recent versions of Windows you can press the Windows button and type in "environment variable", it should suggest you "Edit the system environment variables" to get you the GUI for changing it. You can verify that your change took effect by executing echo %PATH% in the command line. (Remember to reopen cmd.exe if you had it open before editing the variable.)

EDIT: Forgot that the cc65 binaries are in the "bin" directory.
Last edited by thefox on Mon May 07, 2018 8:21 pm, edited 1 time in total.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: MT MK2 troubleshooting (now cc65 in general and nesdev w

Post by nesrocks »

Ok, now I tried that. These were exactly my steps (using windows 8.1):
- System Properties
- Advanced
- Environment Variables...
- System Variables -> New...
- Variable name: PATH
- Variable value: C:\cc65

open cmd prompt, type echo %PATH%, nothing appeared.

So I tried instead of System Variables, adding it to the User Variables, at the end of the already present variables. Now the path appears on the cmd. But the command is not recognized when compiling the project.
Then I added C:\cc65\bin to the path, along with C:\cc65. Alas, the game compiled (miedow). I have to say, I don't think this is an ideal scenario for cc65 usage, it's too complicated to discover without proper guidance. I consider myself to be an advanced dos and windows user, and I had never set PATH on environment variables under windows (on DOS I did). I don't know what the solution is, but this is definitely scary to new developers. Can I update the wiki with these new instructions for windows users?
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: MT MK2 troubleshooting (now cc65 in general and nesdev w

Post by tepples »

Do you have an activated wiki account? If so, go ahead.

And are my instructions at all easy to understand?
User avatar
nesrocks
Posts: 563
Joined: Thu Aug 13, 2015 4:40 pm
Location: Rio de Janeiro - Brazil
Contact:

Re: MT MK2 troubleshooting (now cc65 in general and nesdev w

Post by nesrocks »

Thanks, tepples, those instructions seem very thorough! The reason I figure the wiki is so important is that if you google "install cc65" the wiki page on nesdev is the first hit. I'll get to it later.
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!
https://www.patreon.com/bitinkstudios <- Support me on Patreon!
Post Reply