Author Topic: Pokémon Neptunium  (Read 8871 times)

0 Members and 1 Guest are viewing this topic.

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Pokémon Neptunium
« 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!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Pokémon Neptunium
« Reply #1 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!

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Pokémon Neptunium
« Reply #2 on: April 07, 2020, 03:14:32 pm »
I would be interested to get some more information on the assembly compiler you wrote.
/e

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Pokémon Neptunium
« Reply #3 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   :)

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Pokémon Neptunium
« Reply #4 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:
  • Split the source file into an array of code lines and replace "#include <xyz>" by an array of code lines of "xyz"
  • Remove comments
  • Create a list which contains all jump-labels and aliases
  • Convert every line of code into it's opcode, followed by it's arguments, e.g. "nop" -> 0x00, and insert the results into a bytearray
  • Replace all aliases by their values
  • Write the bytearray's content into a file

I hope this is what you wanted to know. :)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: Pokémon Neptunium
« Reply #5 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.

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
My ASM compiler
« Reply #6 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:
  • #define alias value - replaces all occurences of alias with value in the compilation process.
  • #include <xyz> - includes the global library global/inc/asm/xyz.asm in your project.
  • #include "xyz" - includes the project-level library project/xyz.asm in your project.
  • .db $CB,$07 - inserts hex CB07 at the current position in the bytearray that is to be written into the ROM file. .db $CB,$07 would be equivalent to rlc a.
  • .org $015A - makes the compiler continue writing the compilation results into the rom file at position hex 15A. See the example below.
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
« Last Edit: April 08, 2020, 12:52:09 pm by Eeems »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6266
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Pokémon Neptunium
« Reply #7 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 :
/e

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Pokémon Neptunium
« Reply #8 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.

Offline obj04

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 9
  • Rating: +0/-0
    • View Profile
Re: Pokémon Neptunium
« Reply #9 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
« Last Edit: April 13, 2020, 01:43:20 pm by Eeems »

Offline NonstickAtom785

  • LV3 Member (Next: 100)
  • ***
  • Posts: 78
  • Rating: +4/-0
  • Just live life. Cal-cu-lat-or style!
    • View Profile
Re: Pokémon Neptunium
« Reply #10 on: August 26, 2020, 09:54:53 am »
This is interesting. I hope you keep on trying!
Grammer2 is Good!