!oFzYaciDvwQCNUuheJ:matrix.org

gbdk

135 Members
2 Servers

Load older messages


SenderMessageTime
31 Jul 2021
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 22058 -> 562A -> ld [hl+],a << 8 | ld [hl],d 20:54:56
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 anyways 20:54:59
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 * 22058 -> 562A -> ld [hl],dl << 8 | d [hl+],a 20:55:18
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 * 22058 -> 562A -> ld [hl],d << 8 | d [hl+],a 20:55:22
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 * 22058 -> 562A -> ld [hl],d << 8 | ld a,[hl+] 20:55:36
@_discord_317029794598486018:t2bot.ioCasualPokePlayer#8731 * 22058 -> 562A -> ld d,[hl] << 8 | ld a,[hl+] 20:55:43
@_discord_369657328686989314:t2bot.ioDrush#1939
                DISABLE_RAM_MBC1;
                printf("\nYOUR MAXSCORE IS %u",maxscore);
20:57:35
@_discord_369657328686989314:t2bot.ioDrush#1939 I think I see at least one of the bugs :p 20:57:48
@_discord_369657328686989314:t2bot.ioDrush#1939 The other is that you're not doing ENABLE_RAM_MBC1 in init_sram() 20:58:24
@_discord_323417759507808257:t2bot.ioEvelin#1006 so it should've been after 20:59:06
@_discord_323417759507808257:t2bot.ioEvelin#1006 got it 20:59:09
@_discord_369657328686989314:t2bot.ioDrush#1939 Yes, since it's accessing SRAM—that's where this variable is located 21:05:19
@_discord_323417759507808257:t2bot.ioEvelin#1006
if((birdmove>=133 && birdmove<=144)&&isjump==1)
            {
                gamestate=3;
                    HIDE_BKG;
                    HIDE_SPRITES;
                    font_init();
                    mainfont=font_load(font);
                    font_set(mainfont);
                    ENABLE_RAM_MBC1;
                    printf("YOUR SCORE IS %u",(score/10));
                    if((score/10)>maxscore)maxscore=score/10;
                    printf("\nYOUR MAXSCORE IS %u",maxscore);
                    DISABLE_RAM_MBC1;
            }

The same snip now
21:05:28
@_discord_323417759507808257:t2bot.ioEvelin#1006
#include <gb/gb.h>
#include <string.h>
#include "memcmp.c"
uint16_t maxscore;
extern int memcmp(const void * buf1, const void * buf2, size_t count);
const char corruption_string[] = "SRAM corruption test string.";

char sram_corruption_string[sizeof(corruption_string)];

void init_sram() {
    // Check if the strings are equal.
    ENABLE_RAM_MBC1;
    if (!memcmp(corruption_string, sram_corruption_string, sizeof(corruption_string))) {
        // If they are not equal, copy the test sting to SRAM and intitiallize variables.
        memcpy(sram_corruption_string, corruption_string, sizeof(corruption_string));
        maxscore = 0;
        // etc...
    }
    DISABLE_RAM_MBC1;
}

save.c now
21:05:29
@_discord_323417759507808257:t2bot.ioEvelin#1006 And I get different results again 21:05:34
@_discord_323417759507808257:t2bot.ioEvelin#1006 NO MORE 5 DIGITS! 21:05:37
@_discord_323417759507808257:t2bot.ioEvelin#1006 I'm getting 1907 now 21:05:38
@_discord_369657328686989314:t2bot.ioDrush#1939 Send ROMs 21:05:47
@_discord_323417759507808257:t2bot.ioEvelin#1006Download main.gb21:06:01
@_discord_369657328686989314:t2bot.ioDrush#1939 Oh, you just inverted the condition 21:08:44
@_discord_369657328686989314:t2bot.ioDrush#1939 memcmp returns 0 if the buffers match 21:08:54
@_discord_369657328686989314:t2bot.ioDrush#1939 Otherwise, negative if the first different byte was smaller in the first buffer, and positive otherwise 21:09:18
@_discord_369657328686989314:t2bot.ioDrush#1939
     ENABLE_RAM_MBC1;
-    if (!memcmp(corruption_string, sram_corruption_string, sizeof(corruption_string))) {
+    if (memcmp(corruption_string, sram_corruption_string, sizeof(corruption_string))) {
         // If they are not equal, copy the test sting to SRAM and intitiallize variables.
21:09:53
@_discord_323417759507808257:t2bot.ioEvelin#1006 huh 21:10:12
@_discord_323417759507808257:t2bot.ioEvelin#1006 FINALLY 21:10:56
@_discord_323417759507808257:t2bot.ioEvelin#1006 THANK YOU SO MUCH 21:11:01
@_discord_369657328686989314:t2bot.ioDrush#1939 ^^ 21:11:16
@_discord_257618202014515211:t2bot.ioRafagars joined the room.23:40:28
1 Aug 2021
@_discord_115598075573174281:t2bot.iowermi joined the room.06:08:32
@_discord_197831071490899968:t2bot.ioKabcorp joined the room.13:58:13

There are no newer messages yet.


Back to Room List