Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2017-10-22 09:58:34

IkadzuchiPleist
New member
From: 日本
Registered: 2017-10-22
Posts: 2

GBDK: How can I overwrite builtin interrupt handler?

Hello.

I'm using GBDK (2.1.5) with assembly language.
When I build with "lcc -Wa-l -Wl-m -o output.gb source.s", it seems some interrupt handler is included. And it is very slow.
I want to replace it with some simple one.
Please teach me how to do it with GBDK, or with other software.

My source code contains:
.include "..\lib\global.s"
.area _CODE (REL,CON)
_main::

Thanks.

Offline

 

#2 2017-10-22 10:54:13

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 244

Re: GBDK: How can I overwrite builtin interrupt handler?

This is defined in the file crt0.s which is an assembly language file. Go to libc\gb in command prompt. Give something like the following command:
..\..\bin\lcc.exe -c -o ..\..\lib\gb\crt0.o crt0.s
-c means "compile only" because you are creating an object file and not a gb file.
-o means output.
This command will compile crt0.s and overwrite the file in the standard library. (So this would affect all projects.)

Do you have to use C? I would recommend to code assembly language. It's more difficult but gives you control over everything directly. You can use RGBDS (Redneck Gameboy Development System) or WLA DX for compiling asm code.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2017-10-22 11:26:04

IkadzuchiPleist
New member
From: 日本
Registered: 2017-10-22
Posts: 2

Re: GBDK: How can I overwrite builtin interrupt handler?

Thank you very much!
Overwrote crt0.o and it worked!

And, no, I don't have to use C.
I just didn't know what to use and googled to find GBDK.
I will try RGBDS and WLA DX.

Last edited by IkadzuchiPleist (2017-10-22 13:15:16)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson