Simple question: what program or emulator will let me do a full memory dump, or preferably just a RAM dump, in a nice simple hex format such as this:
I want to be able to search it in notepad for repeated data.
This is because I am testing random number generating functions and I want to see how random the functions I'm testing actually are.
To make this thread a little more useful, here are some other threads I dug up on the topic of random numbers: here and here, and this one on generating an initial number based on player input.
The goal I'm working towards is writing a program that can generate a 32x32 maze like this at random:
But I want it to only be random the first time I generate it. The idea is, there are multiple floors to this maze, and players can move up and down floors. Obviously we don't have the RAM to save every floor, but I'd be satisfied with just being able to generate any floor a second time using seed values.
I don't want there to be only 256 possible mazes, though. I'd like to be able to seed twice, once using the floor number and again using the original generated seed from player input, so that there can be 256 unique mazes per floor.
So far it seems like this routine posted by blargg will let me do exactly what I want, by setting rand_h and rand_l to different seeds:
Code:
00 00 32 FA FA 45 6B 00 01 01 AF AF 6E 00 00 00
I want to be able to search it in notepad for repeated data.
This is because I am testing random number generating functions and I want to see how random the functions I'm testing actually are.
To make this thread a little more useful, here are some other threads I dug up on the topic of random numbers: here and here, and this one on generating an initial number based on player input.
The goal I'm working towards is writing a program that can generate a 32x32 maze like this at random:
But I want it to only be random the first time I generate it. The idea is, there are multiple floors to this maze, and players can move up and down floors. Obviously we don't have the RAM to save every floor, but I'd be satisfied with just being able to generate any floor a second time using seed values.
I don't want there to be only 256 possible mazes, though. I'd like to be able to seed twice, once using the floor number and again using the original generated seed from player input, so that there can be 256 unique mazes per floor.
So far it seems like this routine posted by blargg will let me do exactly what I want, by setting rand_h and rand_l to different seeds:
Code:
; Requires two bytes in memory that don't get modified by anything else.
; They don't need to be next to each other. Set them to reseed the generator.
rand_h = $00
rand_l = $01
; Generate pseudo-random 8-bit value and return in A.
; Preserved: X, Y
random:
; See "linear-congruential random number generator" for more.
; rand = (rand * 5 + 0x3611) & 0xffff;
; return (rand >> 8) & 0xff;
lda rand_h ; multiply by 5
sta temp
lda rand_l
asl a ; rand = rand * 4 + rand
rol temp
asl a
rol temp
clc
adc rand_l
pha
lda temp
adc rand_h
sta rand_h
pla ; rand = rand + 0x3611
clc
adc #$11
sta rand_l
lda rand_h
adc #$36
sta rand_h
rts ; return high 8 bits
; They don't need to be next to each other. Set them to reseed the generator.
rand_h = $00
rand_l = $01
; Generate pseudo-random 8-bit value and return in A.
; Preserved: X, Y
random:
; See "linear-congruential random number generator" for more.
; rand = (rand * 5 + 0x3611) & 0xffff;
; return (rand >> 8) & 0xff;
lda rand_h ; multiply by 5
sta temp
lda rand_l
asl a ; rand = rand * 4 + rand
rol temp
asl a
rol temp
clc
adc rand_l
pha
lda temp
adc rand_h
sta rand_h
pla ; rand = rand + 0x3611
clc
adc #$11
sta rand_l
lda rand_h
adc #$36
sta rand_h
rts ; return high 8 bits