Calculator Community > ASM

Pokémon Neptunium

<< < (2/3) > >>

Streetwalrus:
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.

obj04:

--- Quote from: 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.

--- End quote ---

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: ---/documents/
|- DevBoy/
   |- compileASM.py.tns (<- you can find this file in the attachments)
   |- project/
   |  |- main.asm.tns
   |
   |- global/
      |- opcodes.inc.tns
      |- inc/
         |- asm/
         |- bin/

--- End code ---


The opcodes.inc file follows this structure (you´ll have to insert all opcode-mnemonic-assignments you want to use *.*):

--- Code: ---00 = nop
76 = halt
7F = ld a,a
3A = ld a,(**)
3E = ld a,*
CB 07 = rlc a

--- End code ---
* 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: ---; 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

--- End code ---
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: ---infinite_loop::
jp infinite_loop
--- End code ---


If you want to insert some immediate values, i.e. as command parameters, you have the following options:

--- Code: ---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

--- End code ---
If you use the .db command, you can insert an ASCII string too (e.g. .db "Hello World").

Edit (Eeems): Merged double post

Eeems:

--- Quote from: obj04 on April 08, 2020, 10:37:06 am ---Jump labels etc. are marked by ::, e.g.:

--- Code: ---infinite_loop::
jp infinite_loop
--- End code ---

--- End quote ---
What's the reason for going with :: instead of the standard :

obj04:

--- Quote from: Eeems on April 08, 2020, 12:56:34 pm ---
--- Quote from: obj04 on April 08, 2020, 10:37:06 am ---Jump labels etc. are marked by ::, e.g.:

--- Code: ---infinite_loop::
jp infinite_loop
--- End code ---

--- End quote ---
What's the reason for going with :: instead of the standard :

--- End quote ---

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.

obj04:
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

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version