Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: obj04 on April 07, 2020, 02:56:14 pm

Title: Pokémon Neptunium
Post by: obj04 on April 07, 2020, 02:56:14 pm
Hey calculator community!

A while ago, I made a Pokémon Yellow savefile editor.
I explored the world of Pokémon 1st Generation glitches until it became boring.
Somehow, I found an online article about ROM-Hacking which made me think about making my own game.
I decided to write my game for the Nintendo GameBoy Color :crazy: , because I happened to have gbc4nspire installed on my Nspire.
Are you shocked because I mentioned my Nspire? :o
Hold on, the best is yet to come.
I had to write my own Assembly compiler in Micropython!  :w00t:
And - it works just fine, although I just cobbled some more or less sensible classes together...
My game does not do very much yet. This could be caused by the fact that I only had some GameBoy (not GameBoy Color) docs to learn the GBC development.  :banghead:
But I already finished the overworld map, great thanks to Zeda.  :)
You can find my map draft in the attachments.


Stay cool everyone. See ya!
Title: Re: Pokémon Neptunium
Post by: Xeda112358 on April 07, 2020, 03:10:44 pm
"thanks to Zeda" ===> "Zeda said that the map and names it looked cool"

That is genuinely cool stuff, I'm quite impressed with that compiler and development right on the nspire, great work!
Title: Re: Pokémon Neptunium
Post by: Eeems on April 07, 2020, 03:14:32 pm
I would be interested to get some more information on the assembly compiler you wrote.
Title: Re: Pokémon Neptunium
Post by: obj04 on April 08, 2020, 12:32:38 am
"thanks to Zeda" ===> "Zeda said that the map and names it looked cool"

That is genuinely cool stuff, I'm quite impressed with that compiler and development right on the nspire, great work!

I wrote this because you had the idea to name some of the cities after electronic components   :)
Title: Re: Pokémon Neptunium
Post by: obj04 on April 08, 2020, 02:32:50 am
I would be interested to get some more information on the assembly compiler you wrote.

It works like this:

I hope this is what you wanted to know. :)
Title: Re: Pokémon Neptunium
Post by: Streetwalrus on April 08, 2020, 05:37:22 am
Nice project! This reminds me of the time when I tried to build a pokemon clone for the nspire with a few friends. It never went anywhere. :P Good luck, I hope you'll get further than we did.
Title: My ASM compiler
Post by: obj04 on April 08, 2020, 10:37:06 am
Nice project! This reminds me of the time when I tried to build a pokemon clone for the nspire with a few friends. It never went anywhere. :P Good luck, I hope you'll get further than we did.

Thanks, I have a good feeling about my project, because I currently don´t have very much other things to do.
But I´ll probably need some help when I have to invent some Pokémon names.
I´m not very creative in creating fictional names in English... x.x



For all people interested in my homebrew compiler:

If you want to test my compiler, make sure to have micropython and nTxt installed.

Then create the following files/directories:
Code: [Select]
/documents/
|- DevBoy/
   |- compileASM.py.tns (<- you can find this file in the attachments)
   |- project/
   |  |- main.asm.tns
   |
   |- global/
      |- opcodes.inc.tns
      |- inc/
         |- asm/
         |- bin/


The opcodes.inc file follows this structure (you´ll have to insert all opcode-mnemonic-assignments you want to use *.*):
Code: [Select]
00 = nop
76 = halt
7F = ld a,a
3A = ld a,(**)
3E = ld a,*
CB 07 = rlc a
* means a 1-Byte value or address
** means a 2-Byte value or address


You can use the following compiler commands in your source files:
Code: [Select]
; This is the file "main.asm".
; The ROM starts at pos $00, logically.
.db $FF   ; Write 1 byte to pos $00 ==> pos will be incremented by 1
          ; pos is now $01
.org $02  ; Jump to pos $02 (skip pos $01)
.db $EE   ; Write 1 byte to pos $02 ==> pos will be incremented by 1
When you compile this, your ROM file will contain the following 3 bytes: \xFF\x00\xEE


Jump labels etc. are marked by ::, e.g.:
Code: [Select]
infinite_loop::
jp infinite_loop


If you want to insert some immediate values, i.e. as command parameters, you have the following options:
Code: [Select]
ld a,%10010101 ; load binary 10010101 (=149) into register a
ld a,$95       ; load hex 95 (=149) into register a
ld a,#149      ; load decimal 149 into register a
If you use the .db command, you can insert an ASCII string too (e.g. .db "Hello World").

Edit (Eeems): Merged double post
Title: Re: Pokémon Neptunium
Post by: Eeems on April 08, 2020, 12:56:34 pm
Jump labels etc. are marked by ::, e.g.:
Code: [Select]
infinite_loop::
jp infinite_loop
What's the reason for going with :: instead of the standard :
Title: Re: Pokémon Neptunium
Post by: obj04 on April 08, 2020, 01:51:24 pm
Jump labels etc. are marked by ::, e.g.:
Code: [Select]
infinite_loop::
jp infinite_loop
What's the reason for going with :: instead of the standard :

There's no special reason. I just took it over from a code example.
Furthermore, I'll be able to add : for file-level jump labels.
Title: Re: Pokémon Neptunium
Post by: obj04 on April 13, 2020, 11:38:55 am
I made a grass tile.
It has 3 possible background colors, for a grass, mud, or snow terrain.
Actually, it should look like one of the grass tiles from Pokémon
generation 3 & 4, but now I think it kinda looks like a hemp leaf...
What do you think? Do you have some better ideas?



By the way, the image preview is upside down, for some reason.

Edit (Eeems): merged double post
Title: Re: Pokémon Neptunium
Post by: NonstickAtom785 on August 26, 2020, 09:54:53 am
This is interesting. I hope you keep on trying!