MagicKit assembler new unofficial version

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

zzo38
Posts: 1076
Joined: Mon Feb 07, 2011 12:46 pm

Re: MagicKit assembler new unofficial version

Post by zzo38 » Thu Jan 23, 2014 1:10 pm

It has been upgraded. New features includes:
  • Bank chaining, as a way to fake banks larger than 8K.
  • Additional registers in the postprocessor VM for accessing the ROM data in a way similar to how the PPU does.
  • The error message "Internal error [1]!" has been changed to "Symbol value changed between passes!"
  • A few new MACSET modes have been added.
Support for UNIF and FAMI have been dropped (they were never really supported anyways), although character mapping may be added in a later version.
[url=gopher://zzo38computer.org/].[/url]

User avatar
Hamtaro126
Posts: 776
Joined: Thu Jan 19, 2006 5:08 pm

Re: MagicKit assembler new unofficial version

Post by Hamtaro126 » Thu Jan 23, 2014 11:20 pm

You need nkf (Network Kanji Filter) to compile ppmckc properly on un*x system
I'm on a Win64 system, And a version for MinGW(32 or 64) doesn't exist!

Is this a full-on Requirement, or can support for NKF be removed?

EDIT: NKF is os-independent, Misread about it... Should rebuild with MinGW when ready!
AKA SmilyMZX/AtariHacker.

zzo38
Posts: 1076
Joined: Mon Feb 07, 2011 12:46 pm

Re: MagicKit assembler new unofficial version

Post by zzo38 » Sat Jan 25, 2014 4:38 pm

It has quickly been updated again; here is a list of some new features:
  • Command-line option to override output filename.
  • Some new ?letter expressions.
  • Map file output (contains map of used ROM space and all symbols in the assembler).
  • Pseudopage numbers (usable with map files and postprocessors).
  • Custom character sets.
  • Bank chaining now works with the DS command too.
[url=gopher://zzo38computer.org/].[/url]

Denine
Posts: 398
Joined: Wed Feb 17, 2010 5:42 pm

Re: MagicKit assembler new unofficial version

Post by Denine » Tue Apr 08, 2014 7:46 am

Hi,
I downloaded and compiled your version of nesasm and tried "bank chaining", but it doesn't work. Here's how I try to make it work:

Code: Select all

 .bank 0,"Music"
 .org $8000

;Here goes some code.

 .bank 1,"Music"
 .org $A000

;Empty bank, nothing here.
Code in bank 0 exceeds 8kb and I still get the sam error as in the old nesasm:

Code: Select all

Bank overflow!, offset > $1FFF!
I tried some other combinations with the name of the bank, but none works. How I'm suposed to make it correctly?

zzo38
Posts: 1076
Joined: Mon Feb 07, 2011 12:46 pm

Re: MagicKit assembler new unofficial version

Post by zzo38 » Tue Apr 08, 2014 9:53 am

Denine wrote:Hi,
I downloaded and compiled your version of nesasm and tried "bank chaining", but it doesn't work. Here's how I try to make it work:

Code: Select all

 .bank 0,"Music"
 .org $8000

;Here goes some code.

 .bank 1,"Music"
 .org $A000

;Empty bank, nothing here.
Code in bank 0 exceeds 8kb and I still get the sam error as in the old nesasm:

Code: Select all

Bank overflow!, offset > $1FFF!
I tried some other combinations with the name of the bank, but none works. How I'm suposed to make it correctly?
The bank has to be named before the overflow occurs, so do it like this:

Code: Select all

 .bank 1,"Music"

 .bank 0,"Music"
 .org $8000

;Here goes some code.
[url=gopher://zzo38computer.org/].[/url]

Denine
Posts: 398
Joined: Wed Feb 17, 2010 5:42 pm

Re: MagicKit assembler new unofficial version

Post by Denine » Tue Apr 08, 2014 11:27 am

Thanks and...sorry to be such a bother, but I have other problem now.
For some reason, your version do not recognize labels when pointers are made(?). Here's what I'm doing:

Code: Select all

 .bank 1,"Music"
 .bank 0,"Music"
 .org $8000

 .dw label

;enough code and data to cross 8kb mark

label:
 ;something
The error I'm getting is "Syntax error in expression".
The whole project assembles correctly with standard nesasm.

zzo38
Posts: 1076
Joined: Mon Feb 07, 2011 12:46 pm

Re: MagicKit assembler new unofficial version

Post by zzo38 » Tue Apr 08, 2014 11:40 am

Denine wrote:For some reason, your version do not recognize labels when pointers are made(?).
....
The error I'm getting is "Syntax error in expression".
The whole project assembles correctly with standard nesasm.
That's strange...it works on my computer!

What line number is the error? Check which expression is error, maybe that helps a bit.
[url=gopher://zzo38computer.org/].[/url]

Denine
Posts: 398
Joined: Wed Feb 17, 2010 5:42 pm

Re: MagicKit assembler new unofficial version

Post by Denine » Tue Apr 08, 2014 2:12 pm

Aaahh..I got it now.
Original NESASM seems to support more letters in one line.
The thing is, I usually sort my pointer by 16 per line, so I can count them more easily.
...so my line was:

Code: Select all

 .dw Label1,Label2,Label3(...)Label16
And NESASM accepted this. (This is probably bad habit of sorting pointers like that, right?) But your version supports less letters per line. So, I just changed my pointer lines to:

Code: Select all

 .dw Label1,Label2,Label3,Label4
 .dw Label5,Label6,Label7,Label8
 (etc)
Next, I'v got yet another error. I'm using shiru's Famitone 2.
The music file converted by text2data tool have line:
.dw .samples-4
I just deleted "-4" and finally, compiled the ROM. I just though it may be worth mentioning

But now, the ROM is not working! The part of insides of my Main file:

Code: Select all

 .bank 1,"name"
 .bank 0,"name"
 .org $8000
 .include "Music\Famiton2.asm" ;Music driver

Music.TBL:
 .dw Music

 .include "GFX/GFX_Load.txt" ;GFX

 .include "SYS/Scoring.txt" ;Score calculations
 .include "GFX/Palety.txt" ;Palette works
 .include "SYS/Buffer.PPU.txt" ;PPU Buffer code
 .include "SYS/KEYPAD.txt" ;Keypad handler
 .include "SYS/Grafika.txt" ;Various, turning on and off ppu, waiting for Vblank.
Reset code is at $F000, it clears RAM, then waits for Vblank few frames.

I traced the code with FCEUX and it seems that game crashes because jsr points to...somewhere in GFX data. jsr was supposed to point at waitVblank function but it does not. Using Hex editor(the one built in FCEUX), I found the waitVblank code at $B502, but jsr points at $9544...
The GFX_Load have several graphics files included, they cross Bank0 and Bank1 boundary.
Sorry, to be such a pain...it's probably my mistake somewhere...I can send you a source files via PM, if you want.

zzo38
Posts: 1076
Joined: Mon Feb 07, 2011 12:46 pm

Re: MagicKit assembler new unofficial version

Post by zzo38 » Fri Jul 10, 2015 10:09 pm

While I have posted a new version a few months ago I forgot to update this forum thread. Here is a partial list of changes:
  • A few new ports for use by the postprocessor/custom-output-routine (now it is possible to compile code while the postprocessor is running, if you are careful!)
  • Some new MACSET subcommands
  • A few bugs with writing NES 2.0 headers have been fixed
  • Some other bug fixes (I forget the details now)
I don't know whether or not this fixes Denine's problem. It may be a bug in my program, in Famitone 2, or in your program somehow. If there are any real bug reports with sufficient details, please report them here. (I myself have not had any problems with the current version.)

Note that it is possible to do "compile time debugging" using macros, such as the following:

Code: Select all

	macro compile_time_debug
	if ?X
	macset 1,4,\1
	fail \1
	endif
	endm
If you want the output in hexadecimal, please replace macset 1,4,\1 wth org \1 (in which case the fail message will be the expression and the address printed to the left is the value; with the MACSET it will print the current address to the left and the value in decimal format on the right).
[url=gopher://zzo38computer.org/].[/url]

Post Reply