NBA Jam Tournament Edition (SNES)/ROM map/JAM/END initials code

From Data Crystal
Jump to navigation Jump to search

This is a sub-page of NBA Jam Tournament Edition (SNES)/ROM map/JAM.

Note for template.png
Note:
This checks if the titlescreen code has been entered, then checks for the initials JAM or END, if correct: loads 28 or 27 (decimal) teams defeated, then sets the carry flag.


Commented JAM/END initials input check

===============================================
check for title screen code entered, end if not
===============================================
$8A/DB75 AD FF 16    LDA $16FF  [$00:16FF]   A:00C0 X:0000
$8A/DB78 F0 48       BEQ $48    [$DBC2]      A:0001 X:0000

$8A/DB7A DA          PHX                     A:0001 X:0000
$8A/DB7B BD 5E 15    LDA $155E,x[$00:155E]   A:0001 X:0000
$8A/DB7E AA          TAX                     A:00C0 X:0000
$8A/DB7F E2 20       SEP #$20                A:00C0 X:00C0 set 8 bit A

-------------------------------------------
compare first initial to E, branch if equal
-------------------------------------------
$8A/DB81 BD 00 1A    LDA $1A00,x[$00:1AC0]   A:00C0 X:00C0
$8A/DB84 C9 04       CMP #$04                A:0009 X:00C0
$8A/DB86 F0 16       BEQ $16    [$DB9E]      A:0009 X:00C0

--------------------------
compare first initial to J
--------------------------
$8A/DB88 C9 09       CMP #$09                A:0009 X:00C0
$8A/DB8A D0 36       BNE $36    [$DBC2]      A:0009 X:00C0

-------------------------
compare next initial to A
-------------------------
$8A/DB8C BD 01 1A    LDA $1A01,x[$00:1AC1]   A:0009 X:00C0
$8A/DB8F C9 00       CMP #$00                A:0000 X:00C0
$8A/DB91 D0 2F       BNE $2F    [$DBC2]      A:0000 X:00C0

-------------------------
compare next initial to M
-------------------------
$8A/DB93 BD 02 1A    LDA $1A02,x[$00:1AC2]   A:0000 X:00C0
$8A/DB96 C9 0C       CMP #$0C                A:000C X:00C0
$8A/DB98 D0 28       BNE $28    [$DBC2]      A:000C X:00C0

-------------------------------------
load amount of teams defeated for JAM
-------------------------------------
$8A/DB9A A9 1B       LDA #$1B                A:000C X:00C0
$8A/DB9C 80 10       BRA $10    [$DBAE]      A:001B X:00C0

===================
first initial was E
===================
-------------------------
compare next initial to N
-------------------------
$8A/DB9E BD 01 1A    LDA $1A01,x[$00:1AC1]   A:0004 X:00C0
$8A/DBA1 C9 0D       CMP #$0D                A:000D X:00C0
$8A/DBA3 D0 1D       BNE $1D    [$DBC2]      A:000D X:00C0

-------------------------
compare next initial to D
-------------------------
$8A/DBA5 BD 02 1A    LDA $1A02,x[$00:1AC2]   A:000D X:00C0
$8A/DBA8 C9 03       CMP #$03                A:0003 X:00C0
$8A/DBAA D0 16       BNE $16    [$DBC2]      A:0003 X:00C0

-------------------------------------
load amount of teams defeated for END
-------------------------------------
$8A/DBAC A9 1A       LDA #$1A                A:0003 X:00C0

$8A/DBAE C2 20       REP #$20                A:001B X:00C0 set 16 bit A
$8A/DBB0 29 1F 00    AND #$001F              A:001B X:00C0

$8A/DBB3 9D 00 1C    STA $1C00,x[$00:1CC0]   A:001B X:00C0

$8A/DBB6 E2 20       SEP #$20                A:001B X:00C0 set 8 bit A

$8A/DBB8 9D 00 1B    STA $1B00,x[$00:1BC0]   A:001B X:00C0

$8A/DBBB 3A          DEC A                   A:001B X:00C0
$8A/DBBC 9D 00 1D    STA $1D00,x[$00:1DC0]   A:001A X:00C0

---------------------------------------------
set carry, carry means initials were entered?
---------------------------------------------
$8A/DBBF 38          SEC                     A:001A X:00C0
$8A/DBC0 80 01       BRA $01    [$DBC3]      A:001A X:00C0

--------------------------------
wrong initials/quit, clear carry
--------------------------------
$8A/DBC2 18          CLC                     A:0000 X:00C0

$8A/DBC3 C2 20       REP #$20                A:001A X:00C0
$8A/DBC5 FA          PLX                     A:001A X:00C0
$8A/DBC6 60          RTS                     A:001A X:0000