File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ check version in documentation tab (move code)
2626logo
2727add flex.json to sonic 2 disassembly
2828counts for commands (wrap all in doAction, remove doAction from others)
29+ real command modes
2930search (filter)
3031have default as logo?
3132input type = color
@@ -34,5 +35,4 @@ lil-g/gemini
3435====
3536
3637object collapse state persistance
37- when saving asm, use the object name as the label name :D
3838create new file | newFactory={(path)=>{}}
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ export function bufferToDPLCs(buffer, format) {
2525 const dplcOffset = headerOffset + headerSize ;
2626 let sprites = [ ] ;
2727
28+ // prevent crashes from incorrectly read header
29+ if ( dplcQty > 0xFF ) return ;
30+
2831 for ( let i = 0 ; i < dplcQty ; i ++ ) {
2932 // convert each line to a binary string to easily extract properties
3033 const binStr = readBinary ( data , dplcOffset + ( dplcSize * i ) , dplcSize ) ;
Original file line number Diff line number Diff line change @@ -24,8 +24,11 @@ export function bufferToMappings(buffer, format) {
2424
2525 const mappingQty = readN ( data , headerOffset , headerSize ) ;
2626 const mappingOffset = headerOffset + headerSize ;
27+
2728 let sprites = [ ] ;
2829
30+ if ( mappingQty > 0xFF ) return ; // prevent crashes
31+
2932 for ( let i = 0 ; i < mappingQty ; i ++ ) {
3033 // convert each line to a binary string to easily extract properties
3134 const binStr = readBinary ( data , mappingOffset + ( mappingSize * i ) , mappingSize ) ;
Original file line number Diff line number Diff line change 11export function getHeaders ( data ) {
2- let a = 0x7FFF ; // ???
2+ // https://github.com/sonicretro/SonLVL/blob/master/SonLVLAPI/LevelData.cs#L1466-L1481
3+ let a = 0x7FFF ; // headers are twos complement
34 let headers = [ ] ;
4- for ( let i = 0 ; i < data . length && i != a ; i += 2 ) {
5- let header = readWord ( data , i ) ;
5+ for ( let i = 0 ; i < data . length && i < a ; i += 2 ) {
6+ let header = readWord ( data , i ) & 0x7FFF ;
67 headers . push ( header ) ;
78 if ( header < a && ! ( header == 0 ) ) {
89 a = header ;
You can’t perform that action at this time.
0 commit comments