-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running a ROM panics #1
Comments
Oh, output of
|
Actually if it's not too much of a bother, could you try 1.0.3? The line that's crashing is pretty low level so I'd just like to rule that out. If 1.0.3 still crashes I'll throw together a similar Arch VM tonight and test it more granularly. No games will run with that particular crash though. |
Yikes. Everything works fine on 1.0.3. Thanks for the nudge :-) This is really great work. I played through the first level of Mario. Nice job! |
Awesome, glad to hear it's working :) |
I think this is because of the recent change of making int 64 bits on amd64. |
Which int? The bitmap? I refactored this method this morning and ended up dropping one of them. |
buf := (*[512 * 480]int)(v.screen.Pixels)[:] When int is 64 bits this will give you a slice of 64 bit ints so it doesn't match the 32 bit SDL surface. I was able to get it to work by using int32 for the slice and then casting to int32 in the copy loop but it might be better to use int32 explicitly for all pixel work. |
Oh awesome, great find! So this fixes it? |
Yes, that plus the required int32 casts work as a quick fix (my version below) but on the long run in might be better to use int32 on the ppu side too. diff --git a/video.go b/video.go
index 61d5e78..f9486cd 100644
--- a/video.go
+++ b/video.go
@@ -31,7 +31,7 @@ func (v *Video) Init(t <-chan []int, d <-chan []int, n string) {
}
func (v *Video) Render() {
- buf := (*[512 * 480]int)(v.screen.Pixels)[:]
+ buf := (*[512 * 480]int32)(v.screen.Pixels)[:]
for {
select {
case val := <-v.tick:
@@ -42,10 +42,10 @@ func (v *Video) Render() {
y *= 2
x *= 2
- buf[(y*512)+x] = val[i]
- buf[((y+1)*512)+x] = val[i]
- buf[(y*512)+(x+1)] = val[i]
- buf[((y+1)*512)+(x+1)] = val[i]
+ buf[(y*512)+x] = int32(val[i])
+ buf[((y+1)*512)+x] = int32(val[i])
+ buf[(y*512)+(x+1)] = int32(val[i])
+ buf[((y+1)*512)+(x+1)] = int32(val[i])
}
v.screen.Flip() |
Awesome, just added this change. I'll test it on go tip soon and see about updating the PPU as well. -- Scott Ferguson On Saturday, October 6, 2012 at 3:03 PM, imarko wrote:
|
Here's the command and the panic. When I run it, I can see a window popup on my screen for at most a few milliseconds. Then it disappears.
I get the same error with any other ROM it seems. (I first tried Super Mario.)
I am on the latest commit from master to my knowledge: 06de8e525bfb4e26d8d09a0a3ccfd7d9b0bd54d1
I'm on Archlinux: Linux Ocelot 3.5.4-1-ARCH #1 SMP PREEMPT Sat Sep 15 08:12:04 CEST 2012 x86_64 GNU/Linux.
Here are my versions of the dependencies from the README:
Go-SDL:
Oh, and I'm on Go tip:
Let me know if you want to me to try it on 1.0.3.
The text was updated successfully, but these errors were encountered: