Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2012-07-07 22:45:11

Lin
Member
Registered: 2011-06-27
Post 6/12

GameBoy Assembler Plus

Note: The current version is 1.1

Hey everyone. I decided I'd release this here because some people might find it useful. It's an assembler I just finished for the GameBoy and is pretty powerful. Here's a screenshot.

GFyt

Here's a full feature list from the read-me:

-Dynamic addressing (AKA label support, and the ability to call and jump to them)
-Code highlighting
-White space can be ignored, so instructions like "  ld  a     ,     5F" will assemble successfully. It should be noted that spaces and other characters act the same as commas, so don't feel like you need a comma just because it's proper
-Auto-indenting
-Error checking on-the-spot and highlighting
-Support for just assembling code right away without opening a ROM
-Read-only zones that prevent code from being written in certain areas
-Rewrite zones, which fill a specified area with 00s so you can safely rewrite a chunk of code
-Code previewing, which shows where your code will be written line-by-line
-Safe file IO (warnings when you would lose your code if it was unsaved)
-Code insertion - "This generates code compatible with any language that uses curcly-bracket array assigning in the case you might want to make software automatically insert your assembly into a ROM. This only generates the code containing the values, so you still have to write them to the proper addresses yourself."
-Disassembling
-Trace disassembling - the disassembler will start at a certain point and follow jumps, calls, and returns until the call stack is empty
-Bank-changing emulation - this is very weak and only emulates LD A,# and LD (####),A instructions, but when the accumulator is written to 2000-2FFF, the program will attempt to change the current bank if possible. Perhaps full emulation will come in the future

Update Log
==========
1.0 - Initial Release

1.1 - Fixed a bug that made instruction E9 appear as jp (hl) when it should just be jp hl. Also added instruction DE (sbc a,n)

Finally, here's the download:

Mediafire
My site

~Lin

Last edited by Lin (2012-07-16 00:24:01)

Offline

#2 2012-07-08 11:00:17

Miksy91
Member
Registered: 2010-10-16
Post 953/2,139

Re: GameBoy Assembler Plus

Like I already said in Romhacking before, this tool is really something else!
I especially like the trace disassembling feature which makes following the code a lot easier.

Good job!

Offline

#3 2012-07-08 12:39:15

Sawakita
Administrator
Registered: 2010-10-16
Post 280/361

Re: GameBoy Assembler Plus

Nice tool. A couple of questions:
- are you planning to release the source code?
- Looking at the screenshot it seems that it only supports numbers in base 16 format. Does/will it support other bases (like binary format, using a "0b" prefix)?

Lin wrote:

-Bank-changing emulation - this is very weak and only emulates LD A,# and LD (####),A instructions, but when the accumulator is written to 2000-2FFF, the program will attempt to change the current bank if possible. Perhaps full emulation will come in the future

MBC registers mapping depends on the type of MBC itself. For example MBC5 maps the low and high byte of the bank ID (which spans from 0x000 through 0x1FF) in the write attempts respectively at 0x2000-2FFF and 3000-0x3FFF. MBC2 maps 0x2000-0x21FF for the ROM bank switching.
In all truth I've always seen games switching ROM banks by writing either address 0x2000 or 0x2100 (which are multi-MBC compatible), so this shouldn't be a real issue.

Offline

#4 2012-07-08 23:04:13

Lin
Member
Registered: 2011-06-27
Post 8/12

Re: GameBoy Assembler Plus

Sawakita wrote:

Nice tool. A couple of questions:
- are you planning to release the source code?
- Looking at the screenshot it seems that it only supports numbers in base 16 format. Does/will it support other bases (like binary format, using a "0b" prefix)?

Lin wrote:

-Bank-changing emulation - this is very weak and only emulates LD A,# and LD (####),A instructions, but when the accumulator is written to 2000-2FFF, the program will attempt to change the current bank if possible. Perhaps full emulation will come in the future

MBC registers mapping depends on the type of MBC itself. For example MBC5 maps the low and high byte of the bank ID (which spans from 0x000 through 0x1FF) in the write attempts respectively at 0x2000-2FFF and 3000-0x3FFF. MBC2 maps 0x2000-0x21FF for the ROM bank switching.
In all truth I've always seen games switching ROM banks by writing either address 0x2000 or 0x2100 (which are multi-MBC compatible), so this shouldn't be a real issue.

Interesting. I thought it was only $2000-$2FFF, since the games I've debugged all use $2000 or $2222. At the other number bases, maybe, but I wouldn't count on it. As for the source code, I'm not happy with the GUI stuff so I'll just share the assembler, disassembler, and the code used to assemble code (which also shows how the labels work). This project is fairly old, and when I wrote the assembler, I didn't plan on taking the project this far, but I guess I did.

Assembler
Disassembler
Code used to do the assembling - Note: Very messy and it can easily be optimized at many parts, but all I cared about when I wrote it was functionality.

Last edited by Lin (2012-07-08 23:08:02)

Offline

#5 2012-11-12 21:51:51

KikiKaiKai
Member
Registered: 2012-03-04
Post 3/12

Re: GameBoy Assembler Plus

nothing's showing up when I open the rom. :/

Offline

#6 2012-11-15 07:25:16

Mateo
Member
From: PHO usually
Registered: 2009-11-25
Post 1,930/2,902

Re: GameBoy Assembler Plus

Miksy91 wrote:

Like I already said in Romhacking before, this tool is really something else!
I especially like the trace disassembling feature which makes following the code a lot easier.

Good job!

I agree with this. Keep at it, Lin.

Offline

#7 2012-11-16 16:21:49

KikiKaiKai
Member
Registered: 2012-03-04
Post 4/12

Re: GameBoy Assembler Plus

actually, I've got it figured out now. but there's hardly anything when I disassemble the whole rom... just some org with 0, and an org with 100.

Offline

#8 2012-12-31 01:18:31

emaj30
Member
From: Indigo Plateau
Registered: 2012-12-29
Post 13/462
Website

Re: GameBoy Assembler Plus

is this about ASM?well then im doomed!i think ASM needs a knowledge about C++ or VB6 and the like,which i dont have,is there an easy way to learn about programming?

Offline

#9 2012-12-31 04:06:03

theoblivinator
Member
From: Iowa
Registered: 2012-08-20
Post 56/96

Re: GameBoy Assembler Plus

Awesome!

Offline

#10 2013-01-27 20:26:39

jwibagi
Member
From: Route 29
Registered: 2011-05-13
Post 615/750

Re: GameBoy Assembler Plus

Chowdit2 wrote:

What's ASM?

Storm118 wrote:

Google it.

It's surprising how one post can be so appropriate when taken out of context.

* I also don't understand why I make myself go through these troubles when some people don't even bother to try.

Last edited by jwibagi (2013-01-27 20:31:46)


On a long break until my computer arrives.

Offline

#11 2013-01-27 20:31:30

598/692

Re: GameBoy Assembler Plus

jwibagi wrote:
Chowdit2 wrote:

What's ASM?

Storm118 wrote:

Google it.

It's surprising how one post can be so appropriate when taken out of context.

Given that the first three pages of my Google results for “ASM” do not describe assembly language, maybe not.

#12 2013-01-27 20:32:58

jwibagi
Member
From: Route 29
Registered: 2011-05-13
Post 616/750

Re: GameBoy Assembler Plus

IIMarckus wrote:

Given that the first three pages of my Google results for “ASM” do not describe assembly language, maybe not.

Adding the word "gameboy" helps, considering that Lin's tool is called "Gameboy Assembler Plus".


On a long break until my computer arrives.

Offline

#13 2013-01-29 00:50:09

emaj30
Member
From: Indigo Plateau
Registered: 2012-12-29
Post 170/462
Website

Re: GameBoy Assembler Plus

jwibagi wrote:
Chowdit2 wrote:

What's ASM?

Storm118 wrote:

Google it.

It's surprising how one post can be so appropriate when taken out of context.

* I also don't understand why I make myself go through these troubles when some people don't even bother to try.

i understood your thread very well,its very informative sir:),and dont worry about others if they dont bother to study it,atleast there are some who's trying hard to understand it.that wont spoil your effort though.

Last edited by emaj30 (2013-01-29 01:02:16)

Offline

#14 2013-01-29 04:22:49

jwibagi
Member
From: Route 29
Registered: 2011-05-13
Post 618/750

Re: GameBoy Assembler Plus

emaj30 wrote:

i understood your thread very well,its very informative sir:),and dont worry about others if they dont bother to study it,atleast there are some who's trying hard to understand it.that wont spoil your effort though.

I'm glad I could make a positive impact. You know, you don't have to call me (or most people here) sir.


On a long break until my computer arrives.

Offline

#15 2013-01-29 04:50:46

Mateo
Member
From: PHO usually
Registered: 2009-11-25
Post 2,224/2,902

Re: GameBoy Assembler Plus

I've always just interpreted emaj30's use of "sir Mateo" and "sir jwibagi" etc. as simply an honorific, the same as if he were saying Mateo-San or jwibagi-san, etc. and as such it never bothered me, even though it does feel out of place to be formal here. Not to mention that using "Sir" as a title before someone's name is technically only done when they receive that title from the Queen, and not many of us are even British.

Last edited by Mateo (2013-01-29 04:51:23)

Offline

#16 2013-01-29 10:13:01

emaj30
Member
From: Indigo Plateau
Registered: 2012-12-29
Post 173/462
Website

Re: GameBoy Assembler Plus

haha!sorry for that,im just used to it.maybe to show some respect and a good compliment too?anyways,im learning ASM on a slow and steady phase,so this assembler will be my future tool.thanks to all of you guys for tons of help!

Offline

Board footer

Powered by FluxBB