English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 20 August 2022, 01:05   #1
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
WIP Mega Drive library

Started work on a Blitz Basic library for Mega Drive, source code and example "hello world" project (based on a BigEvilCorporation tutorial) is here.

Still early days, and it is very prone to breaking, but I'm hoping it'll eventually become mature enough to make a game with. It's largely based on the Super Skidmarks port to Mega Drive (including the way they inserted a pointer to a fake exec.library at $4 in order to have a fake version of allocmem at a place where Blitz Basic would expect it to be).

earok is offline  
Old 21 August 2022, 15:48   #2
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Sounds interesting - so the aim is Blitz Basic will compile to a Mega Drive executable?

How did the Skidmarks Mega Drive conversion work? Was it still based on it Blitz Basic roots?
Retro1234 is offline  
Old 23 August 2022, 13:09   #3
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Retro1234 View Post
Sounds interesting - so the aim is Blitz Basic will compile to a Mega Drive executable?

How did the Skidmarks Mega Drive conversion work? Was it still based on it Blitz Basic roots?
Blitz Basic still compiles an Amiga hunk executable, the "blitz2sega" executable included in the repo will rip out the hunks and fix the offsets accordingly, as well as patch the checksum and length of the ROM (assuming the executable was compiled with Blitz and configured in a certain way with the Sega header at the top, definitely won't work with any old Amiga hunk file).

I believe this is more or less how the Skidmarks conversion worked. I don't know their exact toolchain but I did copy how they used a fake exec with a fake allocmem function in order to essentially trick the Mega Drive port into thinking it was running on an Amiga (and thus, allocating memory the standard Amiga way through exec->allocmem)
earok is offline  
Old 24 August 2022, 10:36   #4
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Just curious do you think you could make MegaDrive Skidmarks run on the Amiga?
Retro1234 is offline  
Old 29 August 2022, 06:48   #5
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by Retro1234 View Post
Just curious do you think you could make MegaDrive Skidmarks run on the Amiga?
Ahhh.. probably not, I don't think I've got enough of the source. In any case, Skidmarks on both systems were optimised for the respective hardware (The detail in the Amiga tracks is a lot higher since you've got a lot more video memory, whereas the Sega version takes advantage of the Mega Drive graphics hardware to have bridges overlapping the tracks and cars), probably wouldn't be anything gained by backporting the Sega version to Amiga.
earok is offline  
Old 12 October 2022, 10:29   #6
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Did a minor update to the library - MD_FadePalette is a new command that's an analog to the FadePalette command in Blitz Basic proper. As such, the "hello world" demo has been updated with a fade in.

(note that the Mega Drive's tiny 512 base palette means it's far less smooth than doing the same on an OCS Amiga, let alone an AGA one!)
earok is offline  
Old 28 October 2022, 11:59   #7
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Did a couple of minor bug fixes (palette function should have been using word length, not long length moves), and updated the hello world sample to include loading of a full bitmap

earok is offline  
Old 31 October 2022, 08:42   #8
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
New update: Added a "Name Table" copy function that copies an arbitrary rectangle of tiles.

What was previously coded as:

Code:
;Load each row	
VDPDestination.l = $c000
NameTableSource.l = ?NameTable
for row = 0 to 31
	MD_CopyTo_VDP NameTableSource,40,VDPDestination,2
	VDPDestination + 64*2
	NameTableSource + 40*2
next
Is now

Code:
;Source Address,Dest Address,XSize,YSize,Source Modulo,Dest Modulo
MD_CopyTo_NameTable ?NameTable,$c000,40,32,40,64

Basically it's one line that you could use for copy an entire row, column, or rectangle of tiles.
earok is offline  
Old 11 December 2022, 03:06   #9
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Did a fairly major update to it, there's now a very very simple included "game" (with scrolling, sprites and a tilemap) that cross compiles to both Amiga and Mega Drive.

Video explanation:

[ Show youtube player ]
earok is offline  
Old 22 March 2023, 08:11   #10
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
[ Show youtube player ]

Been quietly updating this, fixing a few bugs and supporting more and more of the VDP's features.

There's now also audio support via the MDSDRV driver.
earok is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mega Drive questions antonvaltaz Retrogaming General Discussion 89 13 February 2022 11:44
SSFII - Mega Drive Stages viddi request.Other 13 05 September 2018 11:30
Mega Everdrive - An SD device for your SEGA Mega Drive [REVIEW] Neil79 Retrogaming General Discussion 15 22 December 2014 15:06
Well, so long dear Mega Drive MethodGit Retrogaming General Discussion 48 25 September 2003 16:35
Mega Drive Joypads steztheskinhead support.Hardware 6 23 July 2001 16:10

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 17:04.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07821 seconds with 15 queries