From 74f1a8dd2826c2c9b1fc32ee0b29f1e0ce65d3a3 Mon Sep 17 00:00:00 2001 From: jeffman Date: Sun, 20 Jan 2019 00:50:58 -0500 Subject: [PATCH] Update notes --- notes/m2-notes.txt | 17 ++++++++++++++--- notes/m2-subBF858.txt | 8 ++++++-- src/c/vwf.c | 2 ++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/notes/m2-notes.txt b/notes/m2-notes.txt index 6f0da4e..37ce682 100644 --- a/notes/m2-notes.txt +++ b/notes/m2-notes.txt @@ -25,6 +25,11 @@ English names: 0x3000AA0: currently selected party member e.g. when in the Goods windows (-1 if nobody selected) 0x3000AA2: number of party members 0x3001300: number to be printed (e.g. withdrawn money amount) +0x300130C: window flags? + - 0x0800 is set when any of the A-menu sub-windows are open (Goods, PSI, etc.) + - 0x0001 is set when the A-menu is open + - 0x0002 is set when the cash window is open? or hp/pp maybe? + - 0x0007 is set when the main text window is open 0x3001D54: Ness items (16 bits each) 0x3001D70: Ness EXP 0x3001D80: Ness level @@ -58,7 +63,7 @@ English names: 0x3001DA9: Ness IQ 0x3001DB5: Ness equipment 0x3001F04: Current party -0x3001F0B: Party character count +0x3001F0B: Party character count (not sure how it's different from 3000AA2?) 0x3001F0C: Active party member flags 0x3001F6A: Ness PSI flags? 0x01: Teleport alpha @@ -120,6 +125,9 @@ Subroutines 80A2E00: door-related? r0 = source, r1 = dest 80A334C: store r0 to window memory 80B8AE0: draw PSI target/PP cost window with PSI index r0 +80BC670: check if currently selected character has item equipped + r0: item index + 1 + returns: 1 if equipped, 0 otherwise or if index==0 80BD7AC: copy window buffer (primary/secondary) r0 = 0: copy from primary (2028A58) to secondary (2030A40) r0 = 1: copy from secondary to primary @@ -197,7 +205,7 @@ Window structure: 0x00000001: enable 0x00000010: ? (checked when going right in goods character selection menu) 0x00000020: signals to redraw the window and borders (cleared by C87D0) - 0x0000FFDE: ? + 0x0000FFCE: ? 0xFFFF0000: we're stealing these for our hacks 0x0007: pixel X value 0xFFF8: unused @@ -221,7 +229,10 @@ Window structure: 0x32 - 0x33: frame counter? e.g. for goods windows, it counts up to 0x10 and then loops back to 0 0x34 - 0x35: cursor X 0x36 - 0x37: cursor Y - 0x38 - 0x3F: ? + 0x38 - 0x39: ? + 0x3A - 0x3B: ? + 0x3C - 0x3D: ? + 0x3E - 0x3F: ? 0x40 - 0x41: page number? 0x42 : cursor delta 0x43 : unused? diff --git a/notes/m2-subBF858.txt b/notes/m2-subBF858.txt index 6d58912..6e81e1a 100644 --- a/notes/m2-subBF858.txt +++ b/notes/m2-subBF858.txt @@ -135,7 +135,7 @@ // If right: 080BF936 (T) mov r8,r0 ;2 539 080BF938 (T) ldr r5,=3001D40h ;9 548 - 080BF93A (T) ldr r2,=3005264h ;9 557 + 080BF93A (T) ldr r2,=3005264h ;9 557 // active PC pointer 080BF93C (T) mov r6,0E6h ;2 559 080BF93E (T) lsl r6,r6,1h ;2 561 080BF940 (T) add r4,r5,r6 ;2 563 // 0x3001F0C (active party member flags) @@ -191,7 +191,7 @@ 080BF9A4 (T) strh r1,[r7,3Ah] ;8 754 // unknown 080BF9A6 (T) b 80BF9EAh ;8 762 -// Else if right: +// Else if left: 080BF9A8 (T) mov r2,0h ;2 764 080BF9AA (T) mov r8,r2 ;2 766 080BF9AC (T) ldr r5,=3001D40h ;9 775 @@ -539,6 +539,10 @@ 080BFC22 (T) cmp r0,0h ;2 1886 080BFC24 (T) beq 80BFC88h ;8 1894 +// if we pressed no arrows: go to C94 (clear window flag) +// if we pressed (not left-right): go to C88 (set window flag) +// else: continue to C26 + // Not sure what this is checking (branch seems to always evaluate to false?) 080BFC26 (T) ldr r0,=300130Ch ;9 1903 080BFC28 (T) ldr r0,[r0] ;13 1916 diff --git a/src/c/vwf.c b/src/c/vwf.c index a32ada3..0f2bb90 100644 --- a/src/c/vwf.c +++ b/src/c/vwf.c @@ -74,6 +74,8 @@ byte print_character_to_ram(byte chr, int *dest, int xOffset, int font, int fore return print_character_with_callback(chr, xOffset, 0, font, foreground, dest, &get_tile_number_grid, FALSE); } +// Prints a special tile. Pixels are copied to the VWF buffer. +// x, y in pixels void print_special_character(int tile, int x, int y) { // Special graphics must be tile-aligned