News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Anime_World

Pages: [1] 2
1
I really appreciate it! But, unfortunely, i dont have a strong programming base, and read the whole thing seems like hell to me, hahaha. Is there any specific tutorial for the kind of thing that i want to do? Thanks a lot m8.

Unfortunately not!  :-[

3
Yes, just modify the dialogue routine using ARM assembly.  ;)

4
Newcomer's Board / Re: Help editing Pokémon Emerald Title Screen
« on: November 12, 2020, 12:49:50 pm »


5
Personal Projects / Re: STREET FIGHTER 2 DELUXE NES proyect
« on: November 07, 2020, 11:12:48 pm »
Anime_World
That is not possible the map shares palettes with Chun-Li :P

Change Chun-li blue to transparent color and use blue bg. Get it?  ::)
Also you can use color cycling e palette swapping to get more colors.

6
Personal Projects / Re: STREET FIGHTER 2 DELUXE NES proyect
« on: November 07, 2020, 12:28:36 pm »
verme
No, the modification that you propose is not possible, at least not in the way you have proposed it, the most feasible option would be to change the background color to blue, but as you can see the result would be quite poor:


Try swapping map border color by black and background by blue

7
ROM Hacking Discussion / Re: aladdin sega genesis - hacking notes
« on: November 07, 2020, 02:07:42 am »
The right place for this info is on Data Crystal ROM and RAM maps.
Sample: https://datacrystal.romhacking.net/wiki/Flashback:RAM_map

9
Personal Projects / Re: STREET FIGHTER 2 DELUXE NES proyect
« on: October 29, 2020, 01:52:27 pm »
Nice job  :thumbsup:

Suggestion: Make this background blue

10
ROM Hacking Discussion / Re: About that Beyond Oasis font
« on: October 26, 2020, 12:00:18 am »
First, you need to learn how to debug the decompression routines to understand how it works. After this, you are able to create the tools.
Other solution is dump the original font from VRAM, insert at free space and change routines to load uncompressed graphics instead compressed graphics.
Do not give up!

11
ROM Hacking Discussion / Re: About that Beyond Oasis font
« on: October 24, 2020, 02:40:10 am »
Yeah, you are right! Font graphics are compressed at 0x16943C 2bpp linear mode.
Data are decompressed into RAM, converted to 4bpp at 0x6F00 and copied via DMA to VRAM at 0xF4E0.


13
Programming / Re: street figther 2 nes proyecto trabado
« on: October 20, 2020, 02:41:28 pm »
Take a look on Street Fighter 2 CE for Sega Master System developed by Tectoy. Maybe it can be a nice resource base.


14
Programming / Re: 6 bit text encoding
« on: September 10, 2020, 03:21:17 pm »
Hint: abcde (atlas/cartographer) supports 6-bit encoding.

15
Programming / Re: 6 bit text encoding
« on: September 09, 2020, 04:25:14 pm »
If you're setting up a brand new text encoding from scratch and your primary concern is being able to fit a large amount of text into a small amount of space, then yes, using some encoding that's specifically designed to compress text will very likely give a better compression ratio than some encoding that's not designed to do that.

Pennywise's question, however, does not appear to be about choosing a particular compression algorithm (he may well also have that in mind, but that's not what he actually asked). Instead, I suspect (since we've been talking about it elsewhere) that he's looking at a particular game that uses 6-bit tokens and is trying to get a better understanding of how that's implemented.

With that in mind, here's a commented example of reading a stream of 6-bit tokens and converting them to 8-bit tokens from Dragon Quest IV (NES):
Code: [Select]
; read the next 6-bit token into A, updating script variables appropriately
; control flow target (from $DF76, $DF8F)
0x03DFA9|$0F:$DF99:A0 00    LDY #$00   
0x03DFAB|$0F:$DF9B:B1 49    LDA ($49),Y ; read current token byte 0
0x03DFAD|$0F:$DF9D:85 5F    STA $5F    ; store current token byte 0 in $5F
0x03DFAF|$0F:$DF9F:A5 5E    LDA $5E    ; read token counter
0x03DFB1|$0F:$DFA1:E6 5E    INC $5E    ; increment token counter
0x03DFB3|$0F:$DFA3:29 03    AND #$03    ; check low 2 bits of token counter: a sequence of 6-bit tokens can only be aligned in 4 possible ways relative to 8-bit boundaries
0x03DFB5|$0F:$DFA5:F0 10    BEQ $DFB7  ; handle 0bSSSSSSxx; we're going to need to re-read the current script byte for the next token, so don't update the script read address
0x03DFB7|$0F:$DFA7:20 D5 DF JSR $DFD5  ; update the script read address, taking into account reserved regions of RAM, the script crossing bank boundaries, etc.; leaves A unchanged
0x03DFBA|$0F:$DFAA:C9 02    CMP #$02   
0x03DFBC|$0F:$DFAC:90 0E    BCC $DFBC  ; 0 was handled earlier, so A < 2 => A == 1; handle 0bxxxxxxSS 0bSSSSxxxx
0x03DFBE|$0F:$DFAE:F0 18    BEQ $DFC8  ; A == 2; handle 0bxxxxSSSS 0bSSxxxxxx
0x03DFC0|$0F:$DFB0:A5 5F    LDA $5F    ; A == 3; handle 0bxxSSSSSS (the easy case); load current token byte 0
0x03DFC2|$0F:$DFB2:29 3F    AND #$3F    ; and chop off the bits we don't care about
0x03DFC4|$0F:$DFB4:60      RTS       


; code -> unknown
0x03DFC5|$0F:$DFB5:EA      ; NOP       
0x03DFC6|$0F:$DFB6:EA      ; NOP       

; unknown -> code
; handle 0bSSSSSSxx
; control flow target (from $DFA5)
0x03DFC7|$0F:$DFB7:A5 5F    LDA $5F    ; load current token byte 0
0x03DFC9|$0F:$DFB9:4A      LSR        ; shift from 0bSSSSSSxx to 0bxSSSSSSx
0x03DFCA|$0F:$DFBA:4A      LSR        ; shift from 0bxSSSSSSx to 0bxxSSSSSS
0x03DFCB|$0F:$DFBB:60      RTS       

; handle 0bxxxxxxSS 0bSSSSxxxx
; control flow target (from $DFAC)
0x03DFCC|$0F:$DFBC:B1 49    LDA ($49),Y ; $DFD5 updated $49-$4A to the next script byte, so this reads current token byte 1
0x03DFCE|$0F:$DFBE:46 5F    LSR $5F    ; shift from 0bxxxxxxSS 0bSSSSxxxx to 0bxxxxxxxS 0bSSSSSxxx
0x03DFD0|$0F:$DFC0:6A      ROR       
0x03DFD1|$0F:$DFC1:46 5F    LSR $5F    ; shift from 0bxxxxxxxS 0bSSSSSxxx to 0bxxxxxxxx 0bSSSSSSxx
0x03DFD3|$0F:$DFC3:6A      ROR       
0x03DFD4|$0F:$DFC4:4A      LSR        ; shift from 0bSSSSSSxx to 0bxSSSSSSx
0x03DFD5|$0F:$DFC5:4A      LSR        ; shift from 0bxSSSSSSx to 0bxxSSSSSS
0x03DFD6|$0F:$DFC6:60      RTS       


; code -> unknown
0x03DFD7|$0F:$DFC7:EA      ; NOP       

; unknown -> code
; handle 0bxxxxSSSS 0bSSxxxxxx
; control flow target (from $DFAE)
0x03DFD8|$0F:$DFC8:B1 49    LDA ($49),Y ; $DFD5 updated $49-$4A to the next script byte, so this reads current token byte 1
0x03DFDA|$0F:$DFCA:0A      ASL        ; shift from 0bxxxxSSSS 0bSSxxxxxx to 0bxxxSSSSS 0bSxxxxxxx
0x03DFDB|$0F:$DFCB:26 5F    ROL $5F   
0x03DFDD|$0F:$DFCD:0A      ASL        ; shift from 0bxxxSSSSS 0bSxxxxxxx to 0bxxSSSSSS 0bxxxxxxxx
0x03DFDE|$0F:$DFCE:26 5F    ROL $5F   
0x03DFE0|$0F:$DFD0:A5 5F    LDA $5F    ; load 0bxxSSSSSS
0x03DFE2|$0F:$DFD2:29 3F    AND #$3F    ; and chop off the bits we don't care about
0x03DFE4|$0F:$DFD4:60      RTS       
Basically that keeps track of the current script read address in $49-$4A and the number of tokens that have been read so far (from which we can deduce the alignment of the current token) in $5E, then reads the current script byte into $5F and (if necessary) also reads the next script byte, and then performs some bit shifts to get the 6 desired bits into the low 6 bits of A, setting the high 2 bits of A to 0.

After that, here's an example of using context (table switching) while converting from 6-bit tokens (or 8-bit tokens with the high 2 bits clear, depending on how you want to think of them) to characters (PPU tile IDs):
Code: [Select]
; control flow target (from $86D1)
; call to code in a different bank ($1F:$DF86)
0x0586CA|$16:$86BA:20 86 DF JSR $DF86  ; swap in needed banks then call $DF99 to read the next 6-bit token into A
0x0586CD|$16:$86BD:C9 3C    CMP #$3C    ; table switch tokens are #$3C - #$3F
0x0586CF|$16:$86BF:90 05    BCC $86C6  ; A < #$3C => normal table entry
0x0586D1|$16:$86C1:F0 06    BEQ $86C9  ; A == #$3C => switch between hiragana and katakana tables
0x0586D3|$16:$86C3:4C D4 86 JMP $86D4  ; A > #$3C => switch to dictionary table

; handle normal table entry
; control flow target (from $86BF)
0x0586D6|$16:$86C6:4C 4E 87 JMP $874E  ; target code is located too far away to use a branch, so JMP

; switch between hiragana and katakana tables
; control flow target (from $86C1)
0x0586D9|$16:$86C9:AD 66 05 LDA $0566  ; current table ID
0x0586DC|$16:$86CC:49 01    EOR #$01    ; switch between hiragana and katakana tables
0x0586DE|$16:$86CE:8D 66 05 STA $0566  ; current table ID
0x0586E1|$16:$86D1:4C BA 86 JMP $86BA  ; loop to read next token

; ...

; handle normal table entry
0x05875E|$16:$874E:85 5F    STA $5F    ; current 6-bit token 0b00SSSSSS
0x058760|$16:$8750:AD 66 05 LDA $0566  ; current table ID
0x058763|$16:$8753:0A      ASL        ; shift from 0bxxxxxxTT to 0bTTxxxxxx (yes, ROR x 3 would have been both faster and shorter)
0x058764|$16:$8754:0A      ASL       
0x058765|$16:$8755:0A      ASL       
0x058766|$16:$8756:0A      ASL       
0x058767|$16:$8757:0A      ASL       
0x058768|$16:$8758:0A      ASL       
0x058769|$16:$8759:18      CLC       
0x05876A|$16:$875A:65 5F    ADC $5F    ; combine table ID and 6-bit token to get 0bTTSSSSSS (yes, ORA $5F would have been both faster and shorter)
0x05876C|$16:$875C:AA      TAX        ; use combined value as an index into the hiragana/katakana mapping table
0x05876D|$16:$875D:BD 65 87 LDA $8765,X ; get the 8-bit value (usually a hiragana/katakana PPU tile ID)
0x058770|$16:$8760:C9 F0    CMP #$F0    ; check for control code #$F0 (wait for input)
0x058772|$16:$8762:F0 B7    BEQ $871B  ; if found, go handle #$F0
0x058774|$16:$8764:60      RTS        ; otherwise return the new 8-bit value
Basically that utilizes some extra storage in $0566 to remember the current table, updates it whenever a table switch token is read, and, in conjunction with the 6-bit token that was read earlier, uses it as an index into a lookup table to get an 8-bit value (usually a PPU tile ID, but could also be a control code) and then returns that for its caller to process (write to PPU or handle control code).

For another example, Dragon Warrior II (NES) uses a 5-bit encoding with a different implementation of table switching; you can check the commentary on https://datacrystal.romhacking.net/wiki/Dragon_Warrior_II::ROM_map/ASM_bank_02 starting at $02:$B393 for further details.
Yes, if you're going to make up your own encoding, you can definitely come up with something that has better space efficiency than using 6 bits to store 1 bit of information, but again, I don't think that's what the question was about ;).

Perfect explanation @abw.

16
Programming / Re: 6 bit text encoding
« on: September 05, 2020, 04:37:02 am »
Glad you came back! :woot!:

This is close to your table but your numbers dont add up right.


Can you finish filling your table from 0x00-0x3f (64 total)?

How did you get this from your table?



This is why I say data is missing and why I'm trying to get you to show me your
data after encoding certain text(chars). I'm just trying to show you what happens
when you do it this way.

OK.  8)

17
Programming / Re: 6 bit text encoding
« on: September 05, 2020, 02:52:15 am »
Did you post them? I dont see any.

September 05, 2020, 12:34:45 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I don't understand the trickery. :-\
All you did was flip the 6th bit on the j and the h to make them lower case.

Example in 6 bit 3 bytes:
JOHN =
001010, 001111, 001000, 001110

Example in 6 bit 3 bytes:
jOhN =
101010, 001111, 101000, 001110

September 05, 2020, 12:49:48 am - (Auto Merged - Double Posts are not allowed before 7 days.)
Lower case, upper case, numbers 0-9, and (!,.?'"space) will not fit in a 64 6-bit table.

Look:
Code: [Select]
text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
converted = []
for character in text:
  value = ord(character) &0x3F
  converted.append(value)
print(converted)

and the result:
Code: [Select]
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58

If u want to use numbers and other characters, combine them with one byte as bitmask every 8 bytes.
1 = 3bytes 6-bit encoded, counts as 1 byte decoded
0 = normal ascii value = decoded byte

18
Programming / Re: 6 bit text encoding
« on: September 05, 2020, 12:12:40 am »
It looks like you are removing data to make it smaller than what it acutely is.
Why not show the full data?

Lets see the tables.

OK.  :thumbsup:
Check tables...

19
Programming / Re: 6 bit text encoding
« on: September 04, 2020, 11:57:43 pm »
How does it go from 0x28, 0xF2, 0x0E to 0xA8, 0xFA, 0x0E?

Can you show me what the bits mean because it looks like data is missing?

Example in 8 bit, 4 bytes:
JOHN =
0x4a, 0x4f, 0x48, 0x4e
01001010, 01001111, 01001000, 01001110

Example in 6 bit 3 bytes:
JOHN =
001010, 001111, 001000, 001110

0x28, 0xF2, 0x0E
00101000, 11110010, 00001110


Code: [Select]
01101010 = j
01001111 = O
01101000 = h
01001110 = N

to 6-bits grouped:
Code: [Select]
   j     O       h     N
101010 001111 101000 001110 = A8FA0E

20
Programming / Re: 6 bit text encoding
« on: September 04, 2020, 11:46:13 pm »
What are the results if text = 'jOhN?

Code: [Select]
A8 FA 0E

Right?

Code: [Select]
>>> bin(ord('J'))
'0b1001010'
>>> bin(ord('j'))
'0b1101010'

Pages: [1] 2