Amiga-Development

Please login or register.

Login with username, password and session length
Advanced search  

News:

Created for developers of all Amiga camps

Author Topic: Writing a true color bitmap(.bmp) loader in assembly  (Read 3065 times)

0 Members and 1 Guest are viewing this topic.

fatman2021

  • Newbie
  • *
  • Posts: 3
    • View Profile
Writing a true color bitmap(.bmp) loader in assembly
« on: December 04, 2013, 12:51:44 AM »

I would like to create a simple true color bitmap loader in assembly. The bitmaps would be displayed using HAM8. No do not want to write the program in c/c++ or any other high level language as that would be cheating.  8)
Logged

Veda

  • Hero Member
  • *****
  • Gender: Male
  • Posts: 1008
  • Sleep is overrated
    • View Profile
Re: Writing a true color bitmap(.bmp) loader in assembly
« Reply #1 on: December 04, 2013, 11:58:15 AM »

What resolution?
And what level of complexity are you looking for?
Logged

fatman2021

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Writing a true color bitmap(.bmp) loader in assembly
« Reply #2 on: December 04, 2013, 04:43:45 PM »

What resolution?
And what level of complexity are you looking for?

I am looking at a resolution of 640x200. The program would setup a simple frame-buffer in which the user would read/write bitmap data to/from. The computer would then convert data found in the frame-buffer into HAM8 formant and then display it. The program will be running in AROS running over WinUAE.
« Last Edit: December 04, 2013, 04:45:53 PM by fatman2021 »
Logged

Veda

  • Hero Member
  • *****
  • Gender: Male
  • Posts: 1008
  • Sleep is overrated
    • View Profile
Re: Writing a true color bitmap(.bmp) loader in assembly
« Reply #3 on: December 04, 2013, 05:15:41 PM »

Why write it in ASM if it's run inside a Emulator which have to pass through a translation layer?
Logged

fatman2021

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Writing a true color bitmap(.bmp) loader in assembly
« Reply #4 on: December 04, 2013, 06:52:47 PM »

Why write it in ASM if it's run inside a Emulator which have to pass through a translation layer?

I am doing it for the challenge. If I wanted it be easy I would write it a high level language and do a function call.
Logged

Veda

  • Hero Member
  • *****
  • Gender: Male
  • Posts: 1008
  • Sleep is overrated
    • View Profile
Re: Writing a true color bitmap(.bmp) loader in assembly
« Reply #5 on: December 04, 2013, 09:07:30 PM »

 If you want a challenge try this.

Use HAM6 and color palette cycle.

Load from disk the image and keep the memory footprint minimal.

Variable resolution depending on the image source.

So these are the steps your program takes.
Starting with a file name parameter.
Initialization
Reading the file header.
Depending on what the file header said or switch statments made define the basis hardware settings.
Allocate a memory chunk for screen buffer, and copper list.
Inner program loop that translates the file to the desired format.
when the whole file is passed through that and the file size is known due to reading the header paint it on screen.
Wait for a input to stop program and deallocate resources used.
Logged