----- Original Message -----
From: "Joe McKenzie" <
me@...>
To: <
gbadev@yahoogroups.com>
Sent: Monday, December 06, 2004 5:02 PM
Subject: Re: [gbadev] Re: Creating an e-reader program
>
>
> dracosilver_furcadia wrote:
>
>>
>>--- In
gbadev@yahoogroups.com, Joe McKenzie <me@j...> wrote:
>>
>>
>>>dracosilver_furcadia wrote:
>>>
>>>
>>>
>>>>How would i go about creating a program for the e-reader and
>>>>compiling/testing it? I can figure out how to create the dot-codes
>>>>from the files, but creating those files is what I can't figure out.
>>>>
>>>>Any help is appreciated.
>>>>
>>>>Thanks!
>>>>
>>>>Sincerely,
>>>>Jonathan Herr
>>>>
>>>>
>>>Somebody cracked the encryption/CRC on the dotcodes and wrote a program
>>>to convert the raw program and data into a bitmap. There's another
>>>program to print the bitmaps. (Remember to cut the margin the right
>>>size; use an official card as a sample.) You can't just print them from
>>>any program because the scaling messes up the dots' readability. I
>>>tried to print the Bombsweeper sample program on my Lexmark Z22, but I
>>>just kept getting read errors on both normal inkjet paper and Kodak
>>>photo paper. Later I might try using an older (really stubborn) inkjet
>>>or a really old 24-pin dot-matrix. The author's suggestion to correct
>>>this is to examine the printed output with a scanner or microscope and
>>>see if you can see any problems. Also try other DPI settings. (The
>>>output is never quite the same size as an official dotcode, but this
>>>doesn't seem to bother the eReader, but trying to scale it to the right
>>>size makes it completely unreadable.)
>>>The actual tools:
>>>
http://users.skynet.be/firefly/gba/e-reader/tools/index.htm
>>>Some info:
http://users.skynet.be/firefly/gba/e-reader/index.htm
>>>
>>>-Joe McKenzie
>>>
>>>
>>
>>So with those tools I should be able to create the raw programs and data?
>>
>
> The "Nintendo e-Reader Z80 Assembler and Linker v1.0" package
> (
http://users.skynet.be/firefly/gba/e-reader/tools/asxxxx_z80_ereader_10.zip)
> can be used to write programs for the e-Reader's Z80 emulation mode.
> (See the e-Reader Z80 API info at
>
http://users.skynet.be/firefly/gba/e-reader/api_z80.htm if you want to
> use graphics, sound or input.) The e-Reader also has a built-in NES
> emulator, which can run NES mapper type 0 games. Use a NES
> compiler/assembler to write these. The e-Reader can also run normal GBA
> code, which you would make using a GBA compiler. (Though I don't know
> where the entry point is....)
> Nintendo only uses NES mode (for ports of old NES games) and Z80 mode
> (for stuff like the Pokemon card mini-games). They only use GBA mode
> for loaders to transmit data to games (like the Animal Corssing cards).
> This is probably because GBA code takes up so much space, it would take
> too many cards to store any decent game.
> Once you write your program, you'll need the RAW to BMP program
> (
http://users.skynet.be/firefly/gba/download/raw-to-bmp-v11.zip) to
> convert the raw data into bitmaps and the dotcode print tool
> (
http://users.skynet.be/firefly/gba/e-reader/tools/dotcode-print-v10.zip)
> to print them. (1200 dpi on photo paper is recommended for best
> results, though I've yet to print a dotcode that doesn't create a read
> error.)
> Also look at the other programs (and samples) there. The flash maker
> looks particularly useful; it converts e-Reader programs into regular
> GBA ROMs, which would let you test and debug them with an emulator
> instead of printing out each revision only to watch it crash.
>
> -Joe McKenzie
I believe the Z80 entrypoint is 0x100.
For the gba code type, it is 0x2000000. At this location, the CRT0
needed, is nothing like the CRT0 used for compiling a multiboot game.
Basically, the code is something like this.
.TEXT
.ARM
_start:
LDR R0, =(_start_thumb+1)
BX R0
.THUMB
_start_thumb:
Push {LR} @ save the return address.
@ BSS clearing loop here
POP {R3}
MOV LR, R3
LDR R3, =main
BX R3
.ALIGN
.POOL
.END.
Basically, you have no header, no nintendo logo data, no header checksums.
This also means, when main returns, your back in the e-reader menu again.