Jump to content
  • Advertisement
Sign in to follow this  
Humberto Moura

My hello world rom (Genesis) runs on emulator, but in everdrive doesn't.

This topic is 571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello guys,
I made a hello world code based in Big evil corporation tutorial (https://bigevilcorporation.co.uk/2012/03/23/sega-megadrive-4-hello-world/), a great start tutorial.
I think I understood the code, I made several changes, it runs well in emulators like Gens and others. But when I try to run the code in the Mega Drive (Genesis) Hardware Throught "Everdrive" cartridge, it doesn't run. The screen stays black after the "licenced by Sega tm" words.

I compile my code in two forms:
asm68k /k /p /o ae- main.asm, final.bin >errors.txt, , hello.lst
asm68k /p main.asm,final.bin

The code compiles without error, but no runs on Megadrive 1 JP with everdrive. I tried with SNASM68k too. Same thing. Compiles well, ran on emulator, but everdrive doesn't.

After compile, I also used this two utilities to generate checksum:

gen-cksum.py final.bin
fixheadr.exe final.bin

I don't know what's going wrong, because I compile the Sonic 1 project hack at the same form and runs on mega drive with everdrive well.

I post all the source attached.
Thanks for any help, .
----------------------------------------------------------------------------------------------------
;main.asm
include 'init.asm'
include 'globals.asm'

__main:

move.w #0x8F02, vdp_control ; Configura o auto-incremento para 2 bytes
move.l #vdp_write_palettes, vdp_control ; configura a VDP para escrever na CRAM 0x0000C3

lea Paletas, a0 ; Carrega endereço da paleta para o registrador a0
move.l #0x07, d0 ; 32 bytes de dados (8 longwords, menos 1 para o contador) na paleta (2 pal = 0F)

.CorLoop:
move.l (a0)+, vdp_data ; Move os dados para a porta de dados da VDP, e incrementa o endereço de origem
dbra d0, .CorLoop

move.w #0x8706, vdp_control ; Configura a cor de fundo para paleta 0 cor 6 - amarelo

move.l #0x40200000, vdp_control ; Configura a VDP pra escrever no endereço da VRAM 0x0020
lea Caracteres, a0 ; Carrega endereço dos caracteres no a0
move.l #0x87, d0 ; (8 longwords * 8 letras = 64 longwords, menos 1 para contador) na fonte

@Loop:
move.l (a0)+, vdp_data ; Move dados para porta de dados da VDP, e incrementa endereço de origem
dbra d0, @Loop

move.l #vdp_write_plane_a, vdp_control ; Configura a VDP para escrever no endereço VRAM 0xC00000 (Plano A)

;plano A, paleta 0, sem girar, mais id do bloco (tile).
move.w #0x0008, vdp_data ; Pattern ID 09 - H
move.w #0x000F, vdp_data ; Pattern ID 07 - U
move.w #0x000B, vdp_data ; Pattern ID 0C - M
move.w #0x0002, vdp_data ; Pattern ID 0D - B
move.w #0x0005, vdp_data ; Pattern ID 00 - E
move.w #0x000D, vdp_data ; Pattern ID 17 - R
move.w #0x000E, vdp_data ; Pattern ID 01 - T
move.w #0x000C, vdp_data ; Pattern ID 10 - O
move.w #0x0000, vdp_data ; Pattern ID 00 -
move.w #0x000B, vdp_data ; Pattern ID 04 - M
move.w #0x000C, vdp_data ; Pattern ID 12 - O
move.w #0x000F, vdp_data ; Pattern ID 15 - U
move.w #0x000D, vdp_data ; Pattern ID 07 - R
move.w #0x0001, vdp_data ; Pattern ID 10 - A




include 'cores.asm'
include 'letras.asm'

__end ; Última linha. Fim do endereço da ROM.[attachment=34948:hello.zip]

Share this post


Link to post
Share on other sites
Advertisement

It's been a while since we got a question for a hobby "hello world"-style ROM.

 

 

Unfortunately, there aren't many people who are doing that these days. The assembly languages for each device tends to be quite specialized. Since you say it only affects Everdrive, it looks like the Everdrive folks have an active forum for their products. Have you asked over there?

Share this post


Link to post
Share on other sites

Hey there!

None of the earlier examples on my blog work on real hardware (I didn't get a development kit until later on in the project), I plan to revisit them and correct them all eventually - it's been 5 years since I wrote some of them and my code and knowledge are now a lot better!

Here's the improved Hello World example, tidied up and corrected for use on real hardware: https://pastebin.com/kJC99PA7

and here's the workshop I ran which should help explain every single step: https://docs.google.com/presentation/d/1xCFrrsfpcuXVQsfBk8OgGJrbQ4aAiENjPjEny3xu5zQ/edit?usp=sharing

Matt

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!