This page contains notes for the game Tinhead (SNES).
RAM Addresses#
7E002C password typed on password screen (6 letters)
7E004C level index
7E007A difficulty: 00=Normal, 01=Practice
7E009C password index counter (if reached $3C, typed password didn't match any valid password)
7E00A0 demo index (6 total)
7E00C6 cheat bits: 01=CAMELS 5 shots, 02=FLIMBO infinite lives
7E00CC pointer to text (24 bits)
7E016F lives
7E0171 health
7E0173 shots
Defeated#
$00/87EC A5 C6 LDA $C6 [$00:00C6] //cheat bits
$00/87EE 29 02 AND #$02 //FLIMBO cheat
$00/87F0 D0 13 BNE $13 [$8805] //branch to $8805 if FLIMBO cheat is ON
$00/87F2 AD 6F 01 LDA $016F [$00:016F]
$00/87F5 3A DEC A //lives -1
$00/87F6 8D 6F 01 STA $016F [$00:016F]
$00/87F9 10 0A BPL $0A [$8805] //branch to $8805 if lives remaining
$00/87FB 20 B9 E2 JSR $E2B9 [$00:E2B9] //print game over
$00/87FE A2 00 00 LDX #$0000 //disables cheats, and clears another unknown byte ($7E00C7)
$00/8801 86 C6 STX $C6 [$00:00C6]
$00/8803 80 28 BRA $28 [$882D]
$00/8805 20 7C AF JSR $AF7C [$00:AF7C]
Hit By Enemy#
$00/97E4 A5 C6 LDA $C6 [$00:00C6] //cheat bits
$00/97E6 29 01 AND #$01 //CAMELS cheat
$00/97E8 D0 09 BNE $09 [$97F3] //branch to $97F3 if CAMELS cheat is ON
$00/97EA AD 73 01 LDA $0173 [$00:0173]
$00/97ED 3A DEC A //shots -1
$00/97EE F0 03 BEQ $03 [$97F3] //branch to $97F3 if shots is 0 (ie, shots will remain at 1)
$00/97F0 8D 73 01 STA $0173 [$00:0173]
$00/97F3 AD 71 01 LDA $0171 [$00:0171]
$00/97F6 3A DEC A //health -1
$00/97F7 10 0A BPL $0A [$9803] //branch to $9803 if more than 1HP remaining
$00/97F9 8D 91 01 STA $0191 [$00:0191]
$00/97FC A9 01 LDA #$01
$00/97FE 20 3A 83 JSR $833A [$00:833A] //lost life TODO
$00/9801 A9 00 LDA #$00
$00/9803 8D 71 01 STA $0171 [$00:0171]
$00/9806 60 RTS
Stage Start#
$00/AE57 A5 C6 LDA $C6 [$00:00C6] //cheat bits
$00/AE59 29 01 AND #$01 //CAMELS cheat
$00/AE5B F0 06 BEQ $06 [$AE63] //branch to $AE63 if CAMELS cheat is OFF
$00/AE5D A2 05 00 LDX #$0005 //5 shots
$00/AE60 8E 73 01 STX $0173 [$00:0173]
$00/AE63 A5 C6 LDA $C6 [$00:00C6] //cheat bits
$00/AE65 29 02 AND #$02 //FLIMBO cheat
$00/AE67 F0 06 BEQ $06 [$AE6F] //branch to $AE6F if FLIMBO cheat is OFF
$00/AE69 A2 05 00 LDX #$0005 //5 lives
$00/AE6C 8E 6F 01 STX $016F [$00:016F]
$00/AE6F 60 RTS
Load Demo#
$00/E96F A5 A0 LDA $A0 [$00:00A0]
$00/E971 1A INC A //demo index +1
$00/E972 C9 06 00 CMP #$0006
$00/E975 D0 03 BNE $03 [$E97A]
...
$00/E97A 85 A0 STA $A0 [$00:00A0] //demo index
$00/E97C AA TAX
$00/E97D 0A ASL A
$00/E97E 0A ASL A
$00/E97F 0A ASL A
$00/E980 0A ASL A
$00/E981 0A ASL A
$00/E982 0A ASL A
$00/E983 85 A2 STA $A2 [$00:00A2]
$00/E985 E2 20 SEP #$20
$00/E987 BF 59 9D 9B LDA $9B9D59,x //levels used for the 6 demos are $00, 03, 04, 07, 09, 10
$00/E98B 85 4C STA $4C [$00:004C] //store level index
$00/E98D 60 RTS
Password System#
$00/EB80 E2 20 SEP #$20
$00/EB82 A0 56 00 LDY #$0056
$00/EB85 A2 C1 F4 LDX #$F4C1 //PASSWORD ACCEPTED text string pointer (lower 16 bits)
$00/EB88 86 CC STX $CC [$00:00CC]
$00/EB8A A2 81 00 LDX #$0081 //PASSWORD ACCEPTED text string pointer (bank)
$00/EB8D 86 CE STX $CE [$00:00CE]
$00/EB8F C9 3C CMP #$3C //check if reached the end of the password list
$00/EB91 D0 0D BNE $0D [$EBA0] //branch to $EBA0 if a valid password was entered
$00/EB93 A0 4C 00 LDY #$004C
$00/EB96 A2 D7 F4 LDX #$F4D7 //PASSWORD NOT ACCEPTED text string pointer (lower 16 bits)
$00/EB99 86 CC STX $CC [$00:00CC]
$00/EB9B A2 81 00 LDX #$0081 //PASSWORD NOT ACCEPTED text string pointer (bank)
$00/EB9E 86 CE STX $CE [$00:00CE]
$00/EBA0 A2 0A 03 LDX #$030A
$00/EBA3 98 TYA
$00/EBA4 20 C0 83 JSR $83C0 [$00:83C0]
$00/EBA7 20 DC F2 JSR $F2DC [$00:F2DC]
$00/EBAA A9 04 LDA #$04
$00/EBAC 85 06 STA $06 [$00:0006]
$00/EBAE 20 AD AF JSR $AFAD [$00:AFAD]
$00/EBB1 A5 9C LDA $9C [$00:009C] //index of typed password
$00/EBB3 C9 3C CMP #$3C //check if reached the end of the password list
$00/EBB5 F0 28 BEQ $28 [$EBDF] //branch to $EBDF (return to title screen) if invalid password was entered
$00/EBB7 C9 38 CMP #$38 //check if password is a level password or cheat password
$00/EBB9 B0 0E BCS $0E [$EBC9] //branch to $EBC9 if a cheat password was entered
level password
$00/EBBB 64 7A STZ $7A [$00:007A] //set Normal difficulty (default)
$00/EBBD 85 4C STA $4C [$00:004C] //set level index
$00/EBBF 38 SEC
$00/EBC0 E9 1C SBC #$1C
$00/EBC2 90 04 BCC $04 [$EBC8] //branch to $EBC8 if a Normal difficulty level password entered
$00/EBC4 85 4C STA $4C [$00:004C] //set level index
$00/EBC6 E6 7A INC $7A [$00:007A] //set Practice difficulty
$00/EBC8 60 RTS
cheat password
$00/EBC9 C9 38 CMP #$38 //CAMELS cheat
$00/EBCB D0 08 BNE $08 [$EBD5] //branch to $EBD5 if CAMELS password not entered
$00/EBCD 48 PHA
$00/EBCE A5 C6 LDA $C6 [$00:00C6]
$00/EBD0 09 01 ORA #$01 //set cheat bit $01
$00/EBD2 85 C6 STA $C6 [$00:00C6]
$00/EBD4 68 PLA
$00/EBD5 C9 39 CMP #$39 //FLIMBO cheat
$00/EBD7 D0 06 BNE $06 [$EBDF] //branch to $EBDF if FLIMBO password not entered
$00/EBD9 A5 C6 LDA $C6 [$00:00C6]
$00/EBDB 09 02 ORA #$02 //set cheat bit $02
$00/EBDD 85 C6 STA $C6 [$00:00C6]
return to title screen
$00/EBDF 82 1A FF BRL $FF1A [$EAFC]
Level Select#
$00/FA2C A5 03 LDA $03 [$00:0003] //controller press
$00/FA2E A0 00 00 LDY #$0000
$00/FA31 4A LSR A
$00/FA32 90 03 BCC $03 [$FA37] //branch to $FA37 if pressed D-pad right VERIFY
$00/FA34 A0 01 00 LDY #$0001 //level +1
$00/FA37 4A LSR A
$00/FA38 90 03 BCC $03 [$FA3D] //branch to $FA3D if pressed D-pad left VERIFY
$00/FA3A A0 FF FF LDY #$FFFF //level -1
$00/FA3D 84 7C STY $7C [$00:007C]
$00/FA3F A5 4C LDA $4C [$00:004C] //level index
$00/FA41 18 CLC
$00/FA42 65 7C ADC $7C [$00:007C]
$00/FA44 C9 1C CMP #$1C //beyond maximum level index
$00/FA46 D0 02 BNE $02 [$FA4A]
$00/FA48 A9 00 LDA #$00 //set level index to minimum $00
$00/FA4A C9 1C CMP #$1C //beyond maximum level index
$00/FA4C 90 02 BCC $02 [$FA50]
$00/FA4E A9 1B LDA #$1B //set level index to maximum $1B
$00/FA50 85 4C STA $4C [$00:004C]
$00/FA52 A5 4C LDA $4C [$00:004C]
$00/FA54 C2 20 REP #$20
$00/FA56 29 FF 00 AND #$00FF
$00/FA59 0A ASL A
$00/FA5A 0A ASL A
$00/FA5B 0A ASL A
$00/FA5C 18 CLC //accumulator now contains level index x 8 (level names are 6 bytes each, plus 2 padding bytes)
$00/FA5D 69 06 84 ADC #$8406 //pointer to level names (lower 16 bits)
$00/FA60 85 CC STA $CC [$00:00CC]
$00/FA62 A9 81 00 LDA #$0081 //pointer to level names (bank)
$00/FA65 85 CE STA $CE [$00:00CE]
$00/FA67 A2 54 03 LDX #$0354
$00/FA6A E2 20 SEP #$20
$00/FA6C A9 20 LDA #$20
$00/FA6E 85 B8 STA $B8 [$00:00B8]
$00/FA70 4C 15 F2 JMP $F215 [$00:F215] //print text