+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Menu Compression.
Pages: 1 ... 7 8 [9] 10
Author Topic: Menu Compression.  (Read 4 times)
ded302
Guest
« Reply #120 on: April 30, 2008, 09:30:18 am »

Thanks for the advice.  Ill learn how to set breakpoints in neko tracer and also take a shot at the menu box.
ded302
Guest
« Reply #121 on: May 04, 2008, 01:12:41 pm »

Ive been trying to come up with a custom pointer system that uses 2 extra 16kb banks to store text.  The routine I coded will display text that has the normal pointer.  When I try to use a custom pointer the text does not display.  I did some tracing and debugging and found out that the routine is loading the correct value from the correct location with a custom pointer.

Here is a trace log
Code:
[03E181] $e181: 4C 28 E9    JMP $E928                   
[03E928] $e928: A5 6C       LDA $6C      @ $006C = $00
[03E92A] $e92a: C9 80       CMP #$80                     
[03E92C] $e92c: 90 08       BCC $E936                     
[03E936] $e936: A9 10       LDA #$10                     
[03E938] $e938: 8D 00 A0    STA $A000                     
[03E93B] $e93b: 4A          LSR                           
[03E93C] $e93c: 8D 00 A0    STA $A000                     
[03E93F] $e93f: 4A          LSR                           
[03E940] $e940: 8D 00 A0    STA $A000                   
[03E943] $e943: 4A          LSR                         
[03E944] $e944: 8D 00 A0    STA $A000                 
[03E947] $e947: 4A          LSR                         
[03E948] $e948: 8D 00 A0    STA $A000                     
[07E94B] $e94b: A5 6C       LDA $6C      @ $006C = $00   
[07E94D] $e94d: C9 3F       CMP #$3F                 
[07E94F] $e94f: 50 04       BVC $E955                 
[07E955] $e955: 18          CLC                         
[07E956] $e956: 69 80       ADC #$80                     
[07E958] $e958: 85 6C       STA $6C                     
[07E95A] $e95a: A9 00       LDA #$00                   
[07E95C] $e95c: 4C 69 E9    JMP $E969                   
[07E969] $e969: 4A          LSR                         
[07E96A] $e96a: 8D 00 E0    STA $E000                   
[07E96D] $e96d: 4A          LSR                           
[07E96E] $e96e: 8D 00 E0    STA $E000                   
[07E971] $e971: 4A          LSR                         
[07E972] $e972: 8D 00 E0    STA $E000                     
[07E975] $e975: 4A          LSR                           
[07E976] $e976: 8D 00 E0    STA $E000                     
[07E979] $e979: A0 00       LDY #$00                     
[07E97B] $e97b: B1 6B       LDA ($6B),Y  @ $8000 = $13   
[07E97D] $e97d: 48          PHA                         
[07E97E] $e97e: A9 00       LDA #$00                   
[07E980] $e980: 8D 00 A0    STA $A000                   
[03E983] $e983: 4A          LSR                         
[03E984] $e984: 8D 00 A0    STA $A000                   
[03E987] $e987: 4A          LSR                           
[03E988] $e988: 8D 00 A0    STA $A000                     
[03E98B] $e98b: 4A          LSR                         
[03E98C] $e98c: 8D 00 A0    STA $A000                   
[03E98F] $e98f: 4A          LSR                     
[03E990] $e990: 8D 00 A0    STA $A000               
[03E993] $e993: A9 0F       LDA #$0F                   
[03E995] $e995: 8D 00 E0    STA $E000                 
[03E998] $e998: 4A          LSR                           
[03E999] $e999: 8D 00 E0    STA $E000                     
[03E99C] $e99c: 4A          LSR                         
[03E99D] $e99d: 8D 00 E0    STA $E000                     
[03E9A0] $e9a0: 4A          LSR                   
[03E9A1] $e9a1: 8D 00 E0    STA $E000               
[03E9A4] $e9a4: 4A          LSR                         
[03E9A5] $e9a5: 8D 00 E0    STA $E000               
[03E9A8] $e9a8: 68          PLA                         
[03E9A9] $e9a9: 4C 85 E1    JMP $E185               

Here is what my routine looks like
Code:
:Check to see if pointer is a normal pointer.
LDA $6C
CMP #$80
;if not jump to custom pointer section
BCC pointer
;if it is a normal pointer load text byte
CLC
LDY #$00
LDA ($6B),Y
JMP $E185

pointer:
LDA #$10
STA $A000
LSR A
STA $A000
LSR A
STA $A000
LSR A
STA $A000
LSR A
STA $A000
LDA $6C

;this checks that range of the 2 banks
;0000-3FFF + 80
CMP #$3F
BVC bank0

;4000-7FFF = 40
CMP #$7F
BVC bank1

bank0:
CLC
ADC #$80
STA $6C
LDA #$00
JMP $E969

bank1:
CLC
ADC #$40
STA $6C
LDA #$01

STA $E000
LSR A
STA $E000
LSR A
STA $E000
LSR A
STA $E000
LSR A
STA $E000

LDY #$00
LDA ($6B),Y
PHA

LDA #$00
STA $A000
LSR A
STA $A000
LSR A
STA $A000
LSR A
STA $A000
LSR A
STA $A000

LDA #$0F
STA $E000
LSR A
STA $E000
LSR A
STA $E000
LSR A
STA $E000
LSR A
STA $E000
PLA
JMP $E185
KingMike
Guest
« Reply #122 on: May 04, 2008, 03:05:20 pm »

Sure you're swapping the right 16K page back in at the end (0x0F -> register $E000)?
Page 15 would be $3C000-3FFFF, resulting in this bank being in both $8000-BFFF and $C000-FFFF.

(or does this game use $C000 swappable mode? (which would be strange, due to the vector issue))
ded302
Guest
« Reply #123 on: May 04, 2008, 11:33:40 pm »

I did some tracing and debugging and modified the code some more and I am now able to read text from the original bank and the expanded bank.  Ill be converting this to make 2 expanded banks available.
« Last Edit: May 05, 2008, 06:22:30 pm by ded302 »
ded302
Guest
« Reply #124 on: July 06, 2008, 11:53:34 pm »

If I was to use the step frame function in neko tracer, would I be able to dump memory for each frame?
KingMike
Guest
« Reply #125 on: July 07, 2008, 06:49:44 am »

If the emulator stops after each frame, I would believe so.
You'd have to manually rename the dumped files each time, so they don't get overwritten.
ded302
Guest
« Reply #126 on: July 07, 2008, 11:10:18 am »

Thats all I need to know, thanks.
ded302
Guest
« Reply #127 on: August 11, 2008, 12:06:49 pm »

I did some reading on 8086 assembly for pc98 hacking and found out about the details of segments and how they are organized.  I did a memory dump while a textbox was displayed and was able to find the string in memory.  There is a special debug utility that is part of the neko tracer app that allows me to view segments.  I found out the text string was located in the string segment at 2426:64f6.  I searched for 64f6 and f664 and could not find it.  So that probaly means that 64f6 is not the pointer?
ded302
Guest
« Reply #128 on: September 29, 2008, 11:01:01 pm »

Ive been reading through the Neko Tracer documentation and I want to know how ad2ed is calculated in this step.

Select a target area in the BMP (234,265). This equals
265*640 + 234 = $2976A / 8 = $52ED. So that's $AD2ED RAM.

Btw this is for 8086 assembly.
KingMike
Guest
« Reply #129 on: September 30, 2008, 09:05:29 am »

Because VRAM starts at CPU address $A8000.

A8000 + 52ED = AD2ED.

(as I understand, PC98 uses 4-bit planar graphics, where each plane represents the entire screen.
So, you'd have to look at corresponding bits in the frame buffers at $A8000, B0000, B8000 and E0000 to find the color (screen is 640x400 pixels, divided by 8 pixels per byte, equals 32000 bytes))
Or at least what this game I started looking through was doing, writing to each of the planes.
« Last Edit: September 30, 2008, 09:17:47 am by KingMike »
ded302
Guest
« Reply #130 on: September 30, 2008, 11:10:29 am »

Thanks for the advice, Ill figure out how to set a breakpoint on those addresses.
ded302
Guest
« Reply #131 on: October 20, 2008, 08:23:06 pm »

Ive been using the unassemble function with neko tracer and ran into this loop when text is being printed onto the screen.

0070 cmp ds:[7c2eh],00h
0075 jz 0070h

So, how would this statement be printing text onto the screen?
Also, Ive been trying to set breakpoints with hook_log.txt and only get a blank line and TRACE STOPPED in my hook.txt file.  Ive read the readme and cant figure it out.
ded302
Guest
« Reply #132 on: November 01, 2008, 02:24:01 pm »

I recently found the code that loads a text byte in a Sega CD game called Illusion City.
Something like Move.b (A1)+,D0 was used to load the text byte.  Also I dumped the 512kb prg rom
with Gens tracer.  I opened up the prg rom in a hex editor and found out the address in A1 pointed to the text phrase, in the prg rom, that was displayed while I traced. If by chance the address in A1 is a pointer, how would I find it in the prg rom.
KingMike
Guest
« Reply #133 on: November 01, 2008, 09:12:17 pm »

Can't say much except find out how it got in A1.
Or look for the pointer in the CD data (68K handles data big-endian, so do not reverse the bytes before searching).
Haven't looked at the Sega CD memory map, but I would suspect the data is loaded from CD into RAM. So, it might be harder to find the data.
ded302
Guest
« Reply #134 on: November 01, 2008, 11:37:13 pm »

Thanks, Ill look into the 68k addressing modes and make another tracelog.
Pages: 1 ... 7 8 [9] 10  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC