Notes:The Flintstones: King Rock Treasure Island
This page contains notes for the game The Flintstones: King Rock Treasure Island.
The following code was added to the original game in order to recreate the debug menu. Because the ROM was full, another ROM bank has been added at the end of the retail ROM. A custom bank jump routine has been inserted at 0:1244. The original code at 0:1239 was moved to 8:4000 and the routine below is at 8:4035. Absolute addresses are prefixed with $, labels are prefixed with @.
As a side note, Flintstones uses cooperative multi-threading with a maximum of three threads. That's why there's a call to yield every so often (with argument b := how many vblanks before thread resumes). The routines located in RB 3 are the original routines that weren't touched for this recreation patch.
;; Disable Cheat Entry ld hl,$FFCB res 7,[hl] ;; Turn screen off ld a, $03 ld [$FF00 + $9E], a ;; yield ld b, $01 rst $10 ;; Clear BG call $11C2 ;; Init xor a, a ld [$C211], a ld [$C4E4], a ld [$C4E5], a ;; Prepare Selector Sprite ld hl,$C000 ld a,$30 ldi [hl],a ld a,$20 ldi [hl],a ld a,$C7 ldi [hl],a xor a,a ld [hl],a ;; Call Menu Init 3:7F5A call $1244 dw $7F5A db $03 ;; Turn screen on; 8x8 sprites ld a, $83 ld [$FF00 + $9E], a @404D: ;; yield ld b, $01 rst $10 ;; Call Menu Cursor Move 3:7E06 call $1244 dw $7E06 db $03 ;; Call Menu Cursor Action 3:7E06 call $1244 dw $7E2E db $03 ;; Play Sound Change ld a,[$C4E5] ld b,a ld a,[$C4E4] cp a,b jr z,@2 ld [$C4E5],a call $20D @2: ;; Update Cursor Sprite ld hl,$C000 ld a,[$C211] inc a ld b,a ld a,$20 @3 add a,$10 dec b jr nz,@3 ld [hl],a ;; Check for Start Button ld a, [$FF00 + $A7] bit 3, a jr z, @404D ;; Menu Cursor over "EXIT"? ld a, [$C211] cp a, $05 jr nz, @4072 ;; Dirty hack to restart title screen pop de pop de pop hl pop af pop de ld de, $1558 push de @4072: ret